/* Galerie publique */
.gallery-section {
    padding: 80px 0;
}

.gallery-container {
    width: min(1200px, 90%);
    margin: 0 auto;
}

/* Disposition "mosaïque" en colonnes, mais contenue dans une hauteur fixe :
   au lieu de continuer vers le bas, les colonnes suivantes se créent vers
   la droite et deviennent accessibles par défilement horizontal (flèches
   ou glisser). Chaque photo garde ses proportions naturelles. */
.gallery-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0 24px;
}

.gallery-scroll-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: #222;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    transition: background 0.25s ease, transform 0.25s ease;
}

.gallery-scroll-btn:hover {
    background: #f5f5f5;
    transform: scale(1.08);
}

.gallery-scroll-btn:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.gallery-grid {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 640px;
    --col-width: 210px;
    --col-gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gallery-grid::-webkit-scrollbar {
    display: none;
}

.gallery-grid.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.gallery-section-title {
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    font-weight: 700;
    margin: 0 0 30px;
    text-align: center;
}

.gallery-section-title--videos {
    margin-top: 90px;
}

/* Vidéos : grille classique (pas de masonry) pour garder un ratio 16:9 cohérent */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.video-card {
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
}

.video-card-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-card-player iframe,
.video-card-player video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.video-card-meta {
    padding: 16px 18px;
    color: #fff;
    background: #111;
}

.video-card-meta h3 {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 6px;
}

.video-card-meta p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 991px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (max-width: 680px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-section-title--videos {
        margin-top: 60px;
    }
}

.gallery-card {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    opacity: 0;
    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease,
        opacity 0.3s ease;
}

.gallery-card.is-placed {
    opacity: 1;
}

.gallery-card:hover {
    transform: translateY(-6px);
}

.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.gallery-lightbox-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gallery-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    animation: galleryLightboxIn 0.3s ease;
}

@keyframes galleryLightboxIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    padding: 0;
}

.gallery-lightbox-close:hover {
    color: #e30613;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 40px;
    padding: 18px 22px;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10001;
    user-select: none;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox-prev {
    left: 20px;
}

.gallery-lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        font-size: 32px;
        padding: 14px 18px;
    }

    .gallery-lightbox-prev {
        left: 10px;
    }

    .gallery-lightbox-next {
        right: 10px;
    }

    .gallery-lightbox-close {
        font-size: 40px;
        top: 18px;
        right: 18px;
    }

    #gallery-lightbox-image {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .gallery-lightbox-prev,
    .gallery-lightbox-next {
        font-size: 26px;
        padding: 12px 14px;
    }

    .gallery-lightbox-prev {
        left: 8px;
    }

    .gallery-lightbox-next {
        right: 8px;
    }

    .gallery-lightbox-close {
        font-size: 32px;
        top: 14px;
        right: 14px;
    }

    #gallery-lightbox-image {
        max-height: 75vh;
    }
}

.gallery-image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s ease;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 50px 22px 22px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}

.gallery-card:hover .gallery-meta {
    opacity: 1;
    transform: translateY(0);
}

.gallery-meta h3 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0 0 6px;
}

.gallery-meta p {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.gallery-cover {
    width: 100%;
    margin-bottom: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.14);
}

.gallery-cover-image {
    width: 100%;
    min-height: 420px;
    background-size: cover;
    background-position: center;
}

.gallery-cover-meta {
    padding: 28px;
    background: rgba(7, 7, 10, 0.95);
    color: #fff;
}

.gallery-cover-meta h2 {
    margin: 0 0 12px;
    font-size: 2rem;
}

.gallery-cover-meta p {
    color: #d0d0d0;
    line-height: 1.8;
    margin: 0;
}

.gallery-page-hero {
    position: relative;
    min-height: 430px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #080808;
}

.gallery-hero-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
    width: min(900px, 90%);
    text-align: center;
    color: #fff;
}

.gallery-hero-content span {
    display: inline-block;
    color: #e30613;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    margin-bottom: 15px;
}

.gallery-hero-content h1 {
    margin: 0 0 20px;
    font-size: clamp(3rem, 6vw, 5.5rem);
    color: #fff;
}

.gallery-hero-content p {
    max-width: 700px;
    margin: 0 auto;
    color: rgba(255,255,255,0.85);
    font-size: 1.05rem;
    line-height: 1.8;
}

.page-hero {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.75) 100%), linear-gradient(180deg, rgba(10,10,10,0.95), rgba(20,20,20,0.95));
    text-align: center;
    padding: 60px 0 40px;
    position: relative;
}

@media (max-width: 991px) {
    .gallery-grid {
        height: 520px;
        --col-width: 180px;
        --col-gap: 12px;
    }

    .gallery-scroll-btn {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    /* Le carrousel doit occuper presque toute la largeur de l'écran sur
       mobile : on réduit le padding intérieur et l'espace autour des
       flèches, qui à leur taille desktop laissaient de grands espaces
       blancs de chaque côté au lieu de laisser la place aux photos. */
    .gallery-scroll-wrapper {
        gap: 8px;
        padding: 0 12px;
    }

    .gallery-scroll-btn {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .gallery-grid {
        height: 520px;
        --col-width: 165px;
        --col-gap: 10px;
    }

    .gallery-card {
        border-radius: 8px;
    }

    .gallery-meta {
        opacity: 1;
        transform: none;
        padding: 30px 12px 12px;
    }

    .gallery-meta h3 {
        font-size: 0.9rem;
    }

    .gallery-meta p {
        display: none;
    }

    .page-hero {
        padding: 40px 0;
    }
}

/* Ensure footer is visible on the public gallery page
   - this file is only loaded for the /galerie route so global body rules are safe here
   - make the page stretch to viewport and keep footer after main content */
html, body {
    height: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Le conteneur "plein écran" de la mosaïque utilise 100vw pour dépasser
       le conteneur central ; sur Windows, 100vw inclut la largeur de la
       scrollbar verticale et créait un léger débordement horizontal. */
    overflow-x: hidden;
}
main {
    flex: 1 0 auto;
}
.gallery-container {
    /* keep space at bottom so grid doesn't overlap footer */
    margin-bottom: 24px;
    padding-bottom: 24px;
}
.site-footer {
    position: relative;
    z-index: 10;
}
