/* ============================================
   GALERIE — photos & vidéos
   Chargé après style.css. Contenu administré : /admin/galerie.php
   ============================================ */

:root {
    --gal-font-display: 'Space Grotesk', 'Poppins', system-ui, sans-serif;
    --gal-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --gal-ink: #0f172a;
    --gal-muted: #64748b;
    --gal-line: #eceef3;
    --gal-grad: linear-gradient(135deg, #6d28d9 0%, #db2777 100%);
    --gal-shadow: 0 1px 3px rgba(17, 12, 46, 0.06), 0 22px 48px -22px rgba(76, 29, 149, 0.32);
}

.gal-hero,
.gal-section { font-family: var(--gal-font-sans); }

/* ════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════ */
.gal-hero {
    position: relative;
    padding: 48px 0 52px;
    text-align: center;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(45, 0, 87, 0.94) 0%, rgba(75, 0, 130, 0.88) 45%, rgba(147, 112, 219, 0.78) 100%),
        url('https://media.istockphoto.com/id/1355800658/photo/business-conference.jpg?s=612x612&w=0&k=20&c=iTT8Odg7bW5wDug8DDFQ1GBp_ahzHJbzRCmp6g-BA-o=') center/cover no-repeat;
}

.gal-hero-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    animation: galFloat 7s ease-in-out infinite;
}
.gal-hero-shape:nth-child(1) { width: 220px; height: 220px; top: -90px;  left: -50px; }
.gal-hero-shape:nth-child(2) { width: 140px; height: 140px; top: 20px;   right: 70px; animation-delay: 2s; }
.gal-hero-shape:nth-child(3) { width: 90px;  height: 90px;  bottom: -20px; left: 24%; animation-delay: 4s; }

@keyframes galFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-18px) scale(1.04); }
}

.gal-hero-inner {
    position: relative;
    z-index: 2;
    color: #fff;
    animation: galHeroIn 0.8s ease both;
}

@keyframes galHeroIn {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gal-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.26);
    padding: 5px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
    margin-bottom: 13px;
}

.gal-hero h1 {
    font-family: var(--gal-font-display);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.gal-hero p {
    max-width: 620px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.88;
    font-weight: 300;
}

/* Compteurs sur une seule ligne pour limiter la hauteur */
.gal-hero-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.gal-hero-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    padding: 5px 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.gal-hero-stat strong {
    font-family: var(--gal-font-display);
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
}

.gal-hero-stat span {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.75;
}

/* ════════════════════════════════════════════
   FILTRES
   ════════════════════════════════════════════ */
.gal-section {
    padding: 56px 0 90px;
    background: #f8f8fc;
}

.gal-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-bottom: 40px;
}

.gal-filter-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.gal-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid var(--gal-line);
    color: var(--gal-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.22s ease;
}

.gal-filter:hover {
    border-color: #c4b5fd;
    color: #6d28d9;
    transform: translateY(-1px);
}

.gal-filter.active {
    background: var(--gal-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px -12px rgba(109, 40, 217, 0.7);
}

.gal-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--gal-line);
    color: var(--gal-muted);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gal-chip span {
    background: #f1f0f7;
    color: #6d28d9;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

.gal-chip:hover { border-color: #c4b5fd; color: #6d28d9; }

.gal-chip.active {
    background: #f3eeff;
    border-color: #6d28d9;
    color: #6d28d9;
}
.gal-chip.active span { background: #6d28d9; color: #fff; }

/* ════════════════════════════════════════════
   GRILLE
   ════════════════════════════════════════════ */
.gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 26px;
}

.gal-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--gal-line);
    box-shadow: 0 1px 3px rgba(17, 12, 46, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--gal-shadow);
}

/* Zone média cliquable (bouton pour la visionneuse, lien pour l'externe) */
.gal-card-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 0;
    border: 0;
    background: #1a1030;
    cursor: pointer;
    overflow: hidden;
}

.gal-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.gal-card:hover .gal-card-img { transform: scale(1.07); }

.gal-card-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    color: #fff;
    background: linear-gradient(135deg, var(--gal-plat, #6d28d9), #2d0057);
}

.gal-card-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 40%, rgba(20, 3, 40, 0.55) 100%);
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.gal-card:hover .gal-card-veil { opacity: 1; }

/* Bouton lecture / loupe */
.gal-card-play,
.gal-card-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.16);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gal-card-play { padding-left: 4px; }

.gal-card:hover .gal-card-play,
.gal-card:hover .gal-card-zoom,
.gal-card-media:focus-visible .gal-card-play,
.gal-card-media:focus-visible .gal-card-zoom {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gal-card.is-video .gal-card-play {
    opacity: 1;
    background: rgba(220, 38, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.5);
}

.gal-card.is-video:hover .gal-card-play {
    background: #dc2626;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Pastille plateforme */
.gal-card-source {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(15, 5, 32, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
}

.gal-card-source i { color: var(--gal-plat, #fff); font-size: 12px; }

/* Corps de carte */
.gal-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.gal-card-title {
    font-family: var(--gal-font-display);
    font-size: 16.5px;
    font-weight: 600;
    color: var(--gal-ink);
    letter-spacing: -0.01em;
    line-height: 1.35;
    margin: 0;
}

.gal-card-desc {
    font-size: 13.5px;
    color: var(--gal-muted);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gal-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--gal-line);
    font-size: 12px;
    color: #94a3b8;
}

.gal-card-meta i { margin-right: 5px; color: #c4b5fd; }
.gal-card-cat { font-weight: 600; color: #6d28d9; }
.gal-card-cat i { color: #c4b5fd; }

/* ── État vide ── */
.gal-empty {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--gal-line);
}

.gal-empty-icon {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    margin: 0 auto 22px;
    background: var(--gal-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
}

.gal-empty h2 {
    font-family: var(--gal-font-display);
    font-size: 21px;
    color: var(--gal-ink);
    margin-bottom: 8px;
}

.gal-empty p { color: var(--gal-muted); font-size: 14.5px; }
.gal-empty a { color: #6d28d9; font-weight: 600; }

/* ════════════════════════════════════════════
   VISIONNEUSE
   ════════════════════════════════════════════ */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(8, 2, 18, 0.96);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 24px 40px;
}

.gal-lightbox.open {
    display: flex;
    animation: galLbIn 0.25s ease both;
}

@keyframes galLbIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.gal-lb-stage {
    width: min(1100px, 100%);
    max-height: calc(100vh - 210px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gal-lb-stage img {
    max-width: 100%;
    max-height: calc(100vh - 210px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

.gal-lb-stage iframe {
    width: min(1100px, 100%);
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 210px);
    border: 0;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

.gal-lb-caption {
    text-align: center;
    color: #fff;
    margin-top: 22px;
    max-width: 720px;
}

.gal-lb-caption h2 {
    font-family: var(--gal-font-display);
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 6px;
}

.gal-lb-caption p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.72;
    margin: 0;
}

.gal-lb-close,
.gal-lb-nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gal-lb-close {
    top: 22px;
    right: 24px;
    width: 46px;
    height: 46px;
    font-size: 18px;
}

.gal-lb-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 17px;
}

.gal-lb-prev { left: 24px; }
.gal-lb-next { right: 24px; }

.gal-lb-close:hover,
.gal-lb-nav:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Verrouillage du défilement pendant l'ouverture */
body.gal-lb-open { overflow: hidden; }

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 992px) {
    .gal-hero { padding: 38px 0 42px; }
    .gal-hero h1 { font-size: 29px; }
    .gal-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
}

@media (max-width: 640px) {
    .gal-hero { padding: 30px 0 33px; }
    .gal-hero h1 { font-size: 24px; }
    .gal-hero p { font-size: 14px; }
    .gal-hero-stats { gap: 8px; margin-top: 16px; }
    .gal-hero-stat { padding: 4px 12px; }
    .gal-hero-stat strong { font-size: 17px; }
    .gal-section { padding: 40px 0 64px; }
    .gal-grid { grid-template-columns: 1fr; }
    .gal-filter { padding: 9px 18px; font-size: 13px; }

    .gal-lightbox { padding: 64px 12px 28px; }
    .gal-lb-nav { width: 40px; height: 40px; }
    .gal-lb-prev { left: 8px; }
    .gal-lb-next { right: 8px; }
}

/* ── Accessibilité ── */
@media (prefers-reduced-motion: reduce) {
    .gal-hero-shape,
    .gal-hero-inner { animation: none; }
    .gal-card,
    .gal-card-img { transition: none; }
    .gal-card:hover { transform: none; }
    .gal-card:hover .gal-card-img { transform: none; }
}
