/* ============================================================================
 * Lightbox PhotoSwipe — bande de thumbnails + compteur (MED-03)
 * Extrait de `Views/partials/gallery.php` pour respecter R22 (CSS dans fichiers dédiés).
 * ============================================================================ */

.gallery-image-link { display: block; cursor: zoom-in; }

/* Bande de thumbnails + compteur en bas de la lightbox */
.pswp-thumbs-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 10px 16px 14px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1;
}
.pswp-thumbs-counter {
    text-align: center;
    color: #fff;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 8px;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}
.pswp-thumbs-strip {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    /* Swipe horizontal natif sur mobile — ne bloque pas les gestes verticaux de PhotoSwipe
       (pinch-to-close, vertical drag to close) */
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}
.pswp-thumbs-strip::-webkit-scrollbar { height: 4px; }
.pswp-thumbs-strip::-webkit-scrollbar-track { background: transparent; }
.pswp-thumbs-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Centrage élégant quand les thumbs tiennent dans la largeur :
   les marges auto sur le 1er et le dernier absorbent l'espace restant.
   Quand ça déborde, elles sont annulées par le contenu → scroll normal depuis le début. */
.pswp-thumb:first-child { margin-left: auto; }
.pswp-thumb:last-child  { margin-right: auto; }

.pswp-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.45;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    /* Laisse le scroll horizontal natif + clic rapide au tap, sans conflit avec PhotoSwipe */
    touch-action: manipulation;
}
.pswp-thumb:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}
.pswp-thumb.is-active {
    opacity: 1;
    border-color: #0BCFE0;
}
.pswp-thumb:focus-visible {
    outline: 2px solid #0BCFE0;
    outline-offset: 2px;
}
.pswp-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* Mobile : thumbs plus petits */
@media (max-width: 600px) {
    .pswp-thumb { width: 48px; height: 48px; }
    .pswp-thumbs-bar { padding: 8px 10px 10px; }
    .pswp-thumbs-counter { font-size: 10px; margin-bottom: 6px; }
}
