/* ============================================================
   Lightbox galerie de photos — chargé uniquement si la visite
   a des photos (§10.1 : visite sans photo = zéro impact)
   Tous les sélecteurs sont des IDs (spécificité 1,0,0)
   pour résister aux feuilles PSV CDN (max 0,1,1).
   ============================================================ */

#gallery-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.93);
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#gallery-overlay.is-open {
    display: flex;
}

/* ---- Bouton fermer (croix — haut droite) ---- */
#btn-gallery-close {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.15s;
}
#btn-gallery-close:hover,
#btn-gallery-close:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}

/* ---- Zone image + légende ---- */
#gallery-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(90vw, 1200px);
}

#gallery-img {
    display: block;
    max-width: 100%;
    max-height: 75svh;
    object-fit: contain;
    border-radius: 4px;
}

#gallery-caption {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    text-align: center;
    max-width: 600px;
    line-height: 1.5;
    min-height: 1.2em;
    padding: 0 60px; /* dégagement des flèches nav */
}

/* ---- Boutons navigation ← → ---- */
#btn-gallery-prev,
#btn-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    min-width: 44px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.10);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    padding: 0 8px;
}
#btn-gallery-prev {
    left: 0;
    border-radius: 0 6px 6px 0;
}
#btn-gallery-next {
    right: 0;
    border-radius: 6px 0 0 6px;
}
#btn-gallery-prev:hover,
#btn-gallery-next:hover,
#btn-gallery-prev:focus-visible,
#btn-gallery-next:focus-visible {
    background: rgba(255, 255, 255, 0.24);
    outline: none;
}

/* ---- Compteur (1 / 5) ---- */
#gallery-counter {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
}
