.sorties-page {
    min-height: calc(100vh - 200px);
    padding: 0 0 5rem;
    background: #F6E2F6;
}

/* === Header === */
.page-header {
    background: linear-gradient(135deg, #F6E2F6 0%, #ebcbdb 100%);
    text-align: center;
    padding: 5rem 6% 4rem;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.page-header::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(249,214,109,0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 7vw, 4rem);
    font-weight: 700;
    color: #E46CC5;
    margin-bottom: 0.6rem;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}
.page-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.15rem;
    color: #8a4060;
    font-weight: 500;
    position: relative;
    z-index: 1;
}
.page-header-divider {
    width: 80px; height: 5px;
    background: linear-gradient(to right, var(--pink-soft), var(--gold-warm));
    border-radius: 3px;
    margin: 1.2rem auto 0;
    position: relative;
    z-index: 1;
}
.header-wave {
    display: block; width: 100%;
    overflow: hidden; line-height: 0; margin: -1px 0;
}
.header-wave svg { width: 100%; height: 60px; }

/* === Empty State === */
.empty-state { text-align: center; padding: 6rem 2rem; color: #b07090; }
.empty-icon {
    width: 80px; height: 80px; margin-bottom: 2rem;
    stroke: var(--pink-soft); stroke-width: 1.5; opacity: 0.4;
}
.empty-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem; font-weight: 600; color: var(--pink-deep); margin-bottom: 0.5rem;
}
.empty-text { font-size: 1.05rem; color: #b07090; }

/* === Grille === */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem; padding: 3rem 5%;
    max-width: 1400px; margin: 0 auto;
}

/* === Cartes === */
.gallery-card {
    background: white; border-radius: 24px; overflow: hidden;
    box-shadow: 0 8px 30px rgba(194,24,91,0.08);
    border: 1px solid rgba(240,98,146,0.1);
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.4s cubic-bezier(0.4,0,0.2,1),
                border-color 0.4s ease;
    cursor: pointer;
}
.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(194,24,91,0.16);
    border-color: rgba(240,98,146,0.3);
}

/* === Vignette === */
.card-image-wrapper {
    position: relative; height: 260px; overflow: hidden;
    background: linear-gradient(135deg, var(--pink-pale) 0%, #f8bbd9 100%);
}
.card-image {
    width: 100%; height: 100%; object-fit: cover;
    aspect-ratio: 16 / 9;   /* réserve l'espace avant chargement */
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
    /* Améliore le rendu sur GPU */
    will-change: transform;
}
.gallery-card:hover .card-image { transform: scale(1.08); }

/* Badge Vidéo */
.card-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* On donne une couleur de fond au cas où le dégradé du wrapper ne suffise pas */
    background-color: #f8bbd9; 
}

/* Conteneur pour l'icône Play */
.play-btn-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Laisse passer le clic vers la carte */
    z-index: 2;
}

/* Le cercle blanc du bouton */
.play-btn-circle {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

/* Le triangle (icône)[cite: 1] */
.play-btn-circle svg {
    width: 30px;
    height: 30px;
    fill: var(--pink-deep);
    margin-left: 4px;
}

/* Animation au survol de la carte[cite: 1] */
.gallery-card:hover .play-btn-circle {
    transform: scale(1.1);
    background: #fff;
}

/*  */
.card-video-badge {
    position: absolute; top: 12px; right: 12px;
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.8rem;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(8px);
    color: white; border-radius: 20px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0.03em;
    z-index: 2; pointer-events: none;
}
.card-video-badge svg { width: 14px; height: 14px; }

/* Icône play */
.card-play-icon {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 1;
}
.card-play-icon svg {
    width: 64px; height: 64px;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}
.gallery-card:hover .card-play-icon svg { transform: scale(1.12); }

/* Overlay survol */
.image-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(194,24,91,0.75) 0%, rgba(240,98,146,0.35) 50%, transparent 100%);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.35s ease; z-index: 3;
}
.gallery-card:hover .image-overlay { opacity: 1; }
.overlay-content {
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    color: white; transform: translateY(12px); transition: transform 0.35s ease;
}
.gallery-card:hover .overlay-content { transform: translateY(0); }
.overlay-icon { width: 48px; height: 48px; stroke-width: 1.5; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }
.overlay-text {
    font-family: 'Quicksand', sans-serif; font-size: 1.05rem;
    font-weight: 700; letter-spacing: 0.03em; text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* === Contenu carte === */
.card-content { padding: 1.6rem 1.6rem 1.4rem; }
.card-title {
    font-family: 'Playfair Display', serif; font-size: 1.25rem;
    font-weight: 700; color: var(--pink-deep); margin-bottom: 0.9rem; line-height: 1.3;
}
.card-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.meta-item {
    display: flex; align-items: center; gap: 0.45rem;
    color: #a06080; font-size: 0.92rem;
    font-family: 'Quicksand', sans-serif; font-weight: 500;
}
.meta-icon { width: 16px; height: 16px; stroke: var(--pink-soft); stroke-width: 2; flex-shrink: 0; }

/* === Miniatures === */
.thumbnails-preview { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.thumbnail-mini {
    width: 58px; height: 58px; border-radius: 12px; overflow: hidden;
    box-shadow: 0 3px 10px rgba(194,24,91,0.12);
    border: 2px solid rgba(240,98,146,0.15);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative; cursor: pointer;

    background: linear-gradient(135deg, #fce4ec, #f06292); /* Un fond rose dégradé */
    display: flex;
    align-items: center;
    justify-content: center;
}
.thumbnail-mini:hover {
    transform: scale(1.12); border-color: var(--pink-soft);
    box-shadow: 0 6px 16px rgba(194,24,91,0.22);
}
.thumbnail-mini img { width: 100%; height: 100%; object-fit: cover; }
.thumb-play {
    position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center; background: rgba(0,0,0,0.3);
}
.thumb-play svg { width: 22px; height: 22px; }
.thumbnail-more {
    width: 58px; height: 58px; border-radius: 12px;
    background: linear-gradient(135deg, var(--pink-soft), var(--pink-deep));
    display: flex; align-items: center; justify-content: center;
    color: white; font-family: 'Quicksand', sans-serif;
    font-weight: 700; font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(194,24,91,0.28);
}

/* ===== LIGHTBOX ===== */
#photo-lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(10, 0, 8, 0.97);
    display: none; align-items: center; justify-content: center;
    padding: 2rem;
}
#photo-lightbox.active {
    display: flex;
    animation: lbFadeIn 0.25s ease forwards;
}
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-content {
    max-width: 90vw; max-height: 85vh;
    display: flex; flex-direction: column; align-items: center;
    gap: 1.5rem; position: relative; z-index: 1;
}

/* Image lightbox */
#lightbox-main-img {
    max-width: 100%; max-height: 70vh; object-fit: contain;
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    border: 2px solid rgba(240,98,146,0.2); display: none;
    transition: opacity 0.2s ease;
}

/* Vidéo lightbox — optimisé */
#lightbox-main-video {
    max-width: min(90vw, 960px); max-height: 70vh; width: 100%;
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    border: 2px solid rgba(240,98,146,0.2);
    background: #000; display: none;
    transition: opacity 0.2s ease; outline: none;
}
#lightbox-main-video.active { display: block; }

/* Spinner de chargement vidéo */
.lb-spinner {
    display: none;
    width: 48px; height: 48px;
    border: 4px solid rgba(240,98,146,0.2);
    border-top-color: var(--pink-soft);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.lb-spinner.active { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.lightbox-info { text-align: center; color: white; max-width: 600px; }
.lightbox-caption {
    font-family: 'Playfair Display', serif; font-size: 1.25rem;
    font-weight: 600; margin-bottom: 0.4rem; line-height: 1.4; color: #fce4ec;
}
.lightbox-meta {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem; color: rgba(255,255,255,0.5);
}

/* Bouton fermer */
.lightbox-close {
    position: absolute; top: 1.5rem; right: 1.5rem;
    width: 48px; height: 48px; padding: 0;
    background: rgba(240,98,146,0.15); border: 1px solid rgba(240,98,146,0.3);
    border-radius: 50%; color: white; cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px); z-index: 10;
}
.lightbox-close:hover {
    background: var(--pink-soft); border-color: var(--pink-soft); transform: rotate(90deg);
}
.lightbox-close svg { width: 22px; height: 22px; pointer-events: none; }

/* Boutons nav */
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 56px; height: 56px; padding: 0;
    background: rgba(240,98,146,0.12); border: 1px solid rgba(240,98,146,0.25);
    border-radius: 50%; color: white; cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(10px); z-index: 10;
}
.lightbox-nav:hover {
    background: var(--pink-soft); border-color: var(--pink-soft);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(240,98,146,0.4);
}
.lightbox-nav svg { width: 26px; height: 26px; pointer-events: none; }
.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }
.lightbox-nav.hidden { display: none; }

/* === Responsive === */
@media (max-width: 768px) {
    .page-header { padding: 3.5rem 5% 3rem; }
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem; padding: 2rem 4%;
    }
    .card-image-wrapper { height: 220px; }
    .lightbox-prev { left: 0.75rem; }
    .lightbox-next { right: 0.75rem; }
    .lightbox-nav { width: 44px; height: 44px; }
    .lightbox-nav svg { width: 20px; height: 20px; }
    .lightbox-close { top: 0.75rem; right: 0.75rem; width: 40px; height: 40px; }
    /* #lightbox-main-img { display: block; } */
    /* #lightbox-main-video.active { display: block; max-height: 60vh; } */
    #lightbox-main-video.active { max-height: 60vh; }


}
@media (max-width: 480px) {
    .gallery-container { grid-template-columns: 1fr; padding: 1.5rem 1rem; }
    .lightbox-prev { left: 0.4rem; }
    .lightbox-next { right: 0.4rem; }
    .lightbox-nav { width: 38px; height: 38px; }
    /* #lightbox-main-img { display: block; } */
    /* #lightbox-main-video.active { display: block; max-height: 55vh; border-radius: 10px; } */
    #lightbox-main-video.active { max-height: 55vh; border-radius: 10px; }
    .lightbox-caption { font-size: 1.05rem; }
}