/* Galerie ESCA - ouverture bleu degrade */
.gal-hero {
    position: relative;
    padding: 100px 24px 80px;
    text-align: center;
    color: #FFFFFF;
    overflow: hidden;
    background:
        radial-gradient(700px 380px at 85% 15%, rgba(243, 156, 18, 0.18), transparent 60%),
        radial-gradient(600px 400px at 10% 90%, rgba(47, 107, 206, 0.25), transparent 60%),
        linear-gradient(135deg, #0F2D5E 0%, #173F8A 55%, #0B2447 100%);
}

.gal-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-titres);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--orange-accent);
    margin-bottom: 20px;
}

.gal-hero h1 {
    font-family: var(--font-titres);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 900;
    color: #FFFFFF;
    margin-bottom: 18px;
}

.gal-hero h1 i {
    color: var(--orange-accent);
    margin-right: 14px;
    font-size: 0.85em;
}

.gal-hero h1 span {
    color: var(--orange-accent);
}

.gal-subtitle {
    font-family: var(--font-corps);
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Compteurs live */
.gal-chips {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.gal-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    backdrop-filter: blur(8px);
    font-family: var(--font-titres);
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFFFFF;
}

.gal-chip i {
    color: var(--orange-accent);
}

.gal-chip strong {
    color: #FFD700;
    font-size: 1rem;
}

/* Section albums */
.gal-section {
    padding: 70px 20px 90px;
    background: var(--blanc-casse);
}

.gal-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Barre de retour et titre album */
.gal-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.gal-toolbar[hidden] {
    display: none;
}

.gal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bleu-institutionnel);
    border: none;
    border-radius: 50px;
    font-family: var(--font-titres);
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gal-back:hover {
    background: var(--bleu-fonce);
    transform: translateY(-2px);
}

.gal-current {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-titres);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--noir);
}

.gal-current i {
    color: var(--orange-accent);
}

/* Grille des albums */
.gal-folders {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.gal-folders[hidden] {
    display: none;
}

.gal-folder {
    background: #FFFFFF;
    border: 1px solid #E4E7EC;
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.3s ease;
}

.gal-folder:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(23, 63, 138, 0.12);
    border-color: transparent;
}

.gal-folder-cover {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #173F8A, #0F2D5E);
    overflow: hidden;
}

.gal-folder-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gal-folder:hover .gal-folder-cover img {
    transform: scale(1.06);
}

.gal-folder-cover > i {
    font-size: 2.6rem;
    color: rgba(255, 255, 255, 0.85);
}

.gal-folder-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange-accent);
    color: #FFFFFF;
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-titres);
    font-size: 0.72rem;
    font-weight: 700;
    z-index: 2;
}

.gal-folder-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
}

.gal-folder-head i {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(243, 156, 18, 0.12);
    color: var(--orange-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.gal-folder-head h3 {
    font-family: var(--font-titres);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--noir);
}

/* Grille des medias d'un album */
.gal-medias {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.gal-medias[hidden] {
    display: none;
}

.gal-media {
    position: relative;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #0B1230;
    cursor: pointer;
}

.gal-media img,
.gal-media video {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gal-media-img:hover img {
    transform: scale(1.06);
}

/* Badge video en haut a gauche */
.gal-video-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(243, 156, 18, 0.95);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 2;
}

/* Bouton son pour les videos */
.gal-sound {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--bleu-fonce);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.gal-sound:hover {
    background: #FFFFFF;
    transform: scale(1.08);
}

/* Messages chargement et vide */
.gal-loading,
.gal-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--gris);
    font-style: italic;
    padding: 40px 0;
}

/* Visionneuse plein ecran */
.gal-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 34, 0.94);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.gal-lightbox[hidden] {
    display: none;
}

.gal-lightbox-media img,
.gal-lightbox-media video {
    max-width: 90vw;
    max-height: 82vh;
    border-radius: 10px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    display: block;
}

.gal-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gal-lightbox-close:hover {
    background: var(--orange-accent);
    transform: rotate(90deg);
}

.gal-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gal-lightbox-nav:hover {
    background: var(--orange-accent);
}

.gal-lightbox-prev {
    left: 24px;
}

.gal-lightbox-next {
    right: 24px;
}

.gal-lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-titres);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Responsive tablette */
@media (max-width: 1024px) {
    .gal-folders,
    .gal-medias {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive mobile */
@media (max-width: 640px) {
    .gal-hero {
        padding: 80px 20px 60px;
    }
    .gal-folders,
    .gal-medias {
        grid-template-columns: 1fr;
    }
    .gal-media img,
    .gal-media video {
        height: 300px;
    }
    .gal-lightbox-nav {
        width: 42px;
        height: 42px;
    }
    .gal-lightbox-prev {
        left: 10px;
    }
    .gal-lightbox-next {
        right: 10px;
    }
    .gal-chips {
        gap: 8px;
    }
    .gal-chip {
        padding: 8px 14px;
        font-size: 0.75rem;
    }
    .gal-chip strong {
        font-size: 0.9rem;
    }
}