/* =========================
   SUBGLOBAL PAGINATION
   Styles réutilisables pour les pages de listing avec pagination
========================= */

/* =========================
   CONTENT LISTING
========================= */

.content-listing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 20px;
    min-height: calc(100vh - 200px);
    margin-bottom: 10vh;
}

.listing-navbar {
    border: 1px solid var(--global-transparent-white-1);
    overflow: visible;
    min-height: 40px;
    border-radius: 999px;
    background-image: linear-gradient(179deg, var(--global-white-2), var(--global-white-1));
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* Conteneur des éléments */
.items-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 1000px;
}

/* Carte individuelle */
.item-card {
    background-color: rgba(255, 255, 255, 0.0);
    backdrop-filter: blur(16px);
    width: 75vw;
    max-width: 1000px;
    padding: 0;
    border: 1px solid var(--global-transparent-white-1);
    border-radius: 7px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover {
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.08);
}

/* Structure inline */
.item-card .inline {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* Type de fichier */
.item-card .type-fichier {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    background-color: rgba(245, 245, 247, 0.85);
    padding: 8px 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Ligne 1 : Titre + Date */
.item-card .card-line-1 {
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    justify-content: space-between;
    align-items: center;
}

.item-card .titre {
    color: white;
    animation: card-titre-glow 3s ease-in-out alternate infinite;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}
@keyframes card-titre-glow {
    0% {
        text-shadow: 0 0 8px rgb(255, 255, 255);
    }
    100% {
        text-shadow: 0 0 4px rgb(255, 255, 255);
    }
}

.item-card .date {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    white-space: nowrap;
    margin-left: 20px;
}

/* Ligne 2 : Description + Vignette */
.item-card .card-line-2 {
    background-color: rgba(255, 255, 255, 0.88);
    padding: 16px 20px;
    gap: 20px;
}

/* Quand pas de vignette, le texte prend toute la largeur */
.item-card .card-line-2.no-vignette {
    justify-content: center;
}

.item-card .card-line-2.no-vignette .description {
    max-width: 100%;
}

.item-card .description {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Galerie de description - flex wrap */
.item-card .description-gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 24px;
}

.item-card .gallery-item {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 100%;
}

.item-card .gallery-item-description {
    flex: 1 1 100%;
    min-width: 100%;
}

.item-card .gallery-item-action {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    margin-top: 8px;
}

.item-card .gallery-item h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.item-card .gallery-item p {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.8);
    margin: 0;
    line-height: 1.4;
}

.item-card .description p {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.7);
    margin: 0;
    line-height: 1.5;
}

.item-card .description h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    margin: 12px 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.item-card .description h3:first-of-type {
    margin-top: 8px;
}

/* 
   LIGNE 3 : ACTIONS (Contenus associés + Bouton)
*/
.item-card .card-line-3 {
    background-color: rgba(245, 245, 247, 0.85);
    backdrop-filter: blur(6px);
    padding: 12px 20px;
    gap: 20px;
    justify-content: space-between;
    align-items: flex-start;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.item-card .card-action-item {
    flex: 0 0 auto;
    width: 200px;
}

.item-card .card-action-item.contenus-associes {
    flex: 1;
    min-width: 200px;
    max-width: none;
}

.item-card .card-action-item.action-button {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    min-width: 200px;
}

.item-card .card-action-item h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.item-card .contenus-associes-liste {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.item-card .contenus-associes-liste a {
    font-size: 0.85rem;
    color: var(--button-global-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.item-card .contenus-associes-liste a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.item-card .contenus-associes-liste .no-content {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.35);
    font-style: italic;
}

.item-card .vignette {
    width: 150px;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card .vignette img {
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* =========================
   SLIDER VIGNETTES
========================= */

.item-card .vignette-slider {
    width: 180px;
    min-width: 180px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.item-card .slides-container {
    width: 100%;
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card .slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card .slide.active {
    opacity: 1;
}

.item-card .slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.item-card .slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--global-transparent-white-1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s ease;
    z-index: 2;
}

.item-card .slider-btn:hover {
    background-color: rgba(255, 255, 255, 1);
}

.item-card .slider-prev {
    left: -8px;
}

.item-card .slider-next {
    right: -8px;
}

.item-card .slider-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.item-card .slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.item-card .slider-dot.active {
    background-color: var(--button-global-color);
}

.item-card .slider-dot:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

/* Référence fichier */
.item-card .reference {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.5);
    background-color: rgba(245, 245, 247, 0.85);
    padding: 8px 20px;
    text-align: right;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* =========================
   PAGINATION
========================= */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-size: 1rem;
    font-weight: 500;
    user-select: none;
    margin-left: 20px;
}

.pagination-number {
    margin-top: 4px;
    margin-bottom: 4px;
    width: 4vw;
    max-width: 3.5rem;
    text-align: center;
    border-radius: 7px;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.7);
    background-color: var(--global-white-2);
    border: 2px solid rgba(255, 255, 255, 0);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination-number:hover {
    font-weight: 900;
    background-color: var(--global-white-1);
    border: 2px solid var(--global-transparent-white-1);
    box-shadow: 0 0 9px var(--global-transparent-white-1);
    color: rgba(0, 0, 0, 0.8);
    transition: font-weight 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.pagination-number.active {
    background-color: var(--button-global-color);
    color: white;
    font-weight: 900;
}
.pagination-number.active:hover {
    border: 2px solid transparent;
}

.pagination-separator {
    color: rgba(0, 0, 0, 0.4);
}

/* Message si aucun élément */
.no-items {
    text-align: center;
    color: rgba(0, 0, 0, 0.5);
    font-size: 1rem;
    padding: 40px;
}

/* =========================
   FILTRES
========================= */

.filtres-container {
    display: block;
    margin-right: 25px;
}

.filtre-select {
    padding: 8px 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}

.filtre-select:focus {
    border-color: var(--button-global-color);
}











/* =========================
   CUSTOM SELECT
========================= */
/* The container must be positioned relative: */
.custom-select {
  position: relative;
  font-family: 'Intertight-italic';
  font-size: 1rem;
  font-weight: 400;
}

.custom-select select {
  display: none; /*hide original SELECT element: */
}

.select-selected {
  background-color: transparent;
}

/* Style the arrow inside the select element: */
.select-selected:after {
  position: absolute;
  content: "";
  top: 14px;
  right: 10px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-color: rgb(0, 0, 0) transparent transparent transparent;
}

/* Point the arrow upwards when the select box is open (active): */
.select-selected.select-arrow-active:after {
  border-color: transparent transparent black transparent;
  top: 7px;
}

/* style the items (options), including the selected item: */
.select-items div,.select-selected {
  color: rgba(0, 0, 0, 0.9);
  padding: 3px 16px;
  border: 1px solid transparent;
  border-color: transparent transparent rgba(0, 0, 0, 0.05) transparent;
  cursor: pointer;
}

/* Style items (options): */
.select-items {
  position: absolute;
  background-color: var(--global-white-2);
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99;
  padding: 7px 0 20px 0;
  border: 1px solid var(--global-transparent-white-1);
  border-radius: 7px 7px 20px 20px;
}

/* Hide the items when the select box is closed: */
.select-hide {
  display: none;
}

.select-items div:hover, .same-as-selected {
  background-color: var(--global-white-1);
}


/* =========================
   MOBILE RESPONSIVE - 800px
========================= */
@media (max-width: 800px) {
    /* Content listing */
    .content-listing {
        padding: 20px 12px;
        gap: 16px;
    }
    
    /* Item cards - full width */
    .item-card {
        width: 100%;
        max-width: 100%;
    }
    
    /* Ligne 2 : Description + Vignette en colonne */
    .item-card .card-line-2 {
        flex-direction: column;
        gap: 16px;
    }
    
    /* Vignette slider pleine largeur sous la description */
    .item-card .vignette-slider {
        width: 100%;
        min-width: 100%;
        order: 2; /* Place après description */
    }
    
    .item-card .slides-container {
        height: 180px; /* Plus grand sur mobile */
    }
    
    .item-card .description {
        order: 1; /* Description en premier */
        width: 100%;
    }
    
    /* Vignette simple pleine largeur */
    .item-card .vignette {
        width: 100%;
        min-width: 100%;
        order: 2;
    }
    
    /* Ligne 3 : Actions en colonne */
    .item-card .card-line-3 {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .item-card .card-action-item {
        width: 100%;
        min-width: 100%;
    }
    
    .item-card .card-action-item.contenus-associes {
        width: 100%;
        min-width: 100%;
    }
    
    .item-card .card-action-item.action-button {
        width: 100%;
        min-width: 100%;
        justify-content: flex-end; /* Bouton aligné à droite */
        margin-top: 4px;
    }
    
    /* Titre et date */
    .item-card .card-line-1 {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .item-card .titre {
        font-size: 1rem;
    }
    
    .item-card .date {
        margin-left: 0;
        font-size: 0.8rem;
    }
    
    /* Pagination */
    .listing-navbar {
        border-radius: 12px;
        flex-direction: row;
        padding: 0;
        gap: 0;
        position: relative;
    }
    
    .pagination {
        margin-left: 0;
        gap: 6px;
    }
    
    .pagination-number {
        width: 36px;
        max-width: 36px;
        font-size: 0.9rem;
    }
    
    /* Pagination condensée - boutons Précédent/Suivant */
    .pagination-nav-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 7px;
        background-color: transparent;
        border: none;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        color: rgba(0, 0, 0, 0.7);
        transition: color 0.2s ease, opacity 0.2s ease;
        user-select: none;
    }
    
    .pagination-nav-btn:hover:not(.disabled) {
        color: rgba(0, 0, 0, 0.9);
    }
    
    .pagination-nav-btn.disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }
    
    .pagination-ellipsis {
        color: rgba(0, 0, 0, 0.4);
        font-size: 0.85rem;
        padding: 0 2px;
        user-select: none;
    }
    
    /* Filtres - sortis de la navbar sur mobile */
    .filtres-container {
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        margin-right: 0;
        width: auto;
        background: transparent;
        z-index: 5;
    }
    
    /* Espace pour le filtre sorti */
    .listing-navbar {
        margin-bottom: 50px;
    }
    
    .filtre-select {
        width: auto;
        min-width: 120px;
    }
}