/* ═══════════════════════════════════════════════════════════
   LA TABLE MÉDITERRANÉENNE — galerie.css
   Page Galerie — grille masonry, filtres, lightbox
   Animation : zoom depuis le centre (distinct des autres pages)
   ═══════════════════════════════════════════════════════════ */

/* ── ANIMATION GALERIE ───────────────────────────────────── */
.gal-item {
    opacity: 0;
    transform: scale(.94);
    transition: opacity .55s cubic-bezier(.16, 1, .3, 1),
        transform .55s cubic-bezier(.16, 1, .3, 1);
}

.gal-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* ── HERO ────────────────────────────────────────────────── */
.gal-hero {
    position: relative;
    height: 55vh;
    min-height: 380px;
    max-height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gal-hero-media {
    position: absolute;
    inset: 0;
}

.gal-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    animation: galHeroZoom 12s ease forwards;
}

@keyframes galHeroZoom {
    from {
        transform: scale(1.05);
    }

    to {
        transform: scale(1);
    }
}

.gal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(10, 6, 2, .4) 0%,
            rgba(10, 6, 2, .25) 40%,
            rgba(10, 6, 2, .65) 100%);
}

.gal-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--header-h) 1.5rem 0;
}

.gal-hero-label {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--or-light);
    display: block;
    margin-bottom: .75rem;
    animation: galFadeUp .7s cubic-bezier(.16, 1, .3, 1) .3s both;
}

.gal-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 300;
    color: var(--blanc);
    line-height: 1.05;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .4);
    animation: galFadeUp .9s cubic-bezier(.16, 1, .3, 1) .45s both;
}

.gal-hero-title em {
    font-style: italic;
    color: var(--or-light);
}

.gal-hero-sub {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 400;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
    margin-top: 1rem;
    animation: galFadeUp .7s cubic-bezier(.16, 1, .3, 1) .65s both;
}

@keyframes galFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ── FILTRES ─────────────────────────────────────────────── */
.gal-filters {
    position: sticky;
    top: 70px;
    z-index: 100;
    background-color: var(--blanc);
    border-bottom: 1px solid var(--gris-light);
    box-shadow: 0 2px 16px rgba(44, 32, 22, .06);
}

.gal-filters-inner {
    display: flex;
    justify-content: center;
    gap: 0;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gal-filters-inner::-webkit-scrollbar {
    display: none;
}

.gal-filter-btn {
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gris-txt);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 1.15rem 1.4rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease);
}

.gal-filter-btn:hover {
    color: var(--brun);
}

.gal-filter-btn.active {
    color: var(--or-dark);
    border-bottom-color: var(--or);
}


/* ── GRILLE MASONRY ──────────────────────────────────────── */
.gal-grid-section {
    background-color: var(--creme);
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2rem);
}

.gal-grid {
    max-width: var(--max-width);
    margin-inline: auto;
    columns: 3;
    column-gap: .75rem;
}

/* ── Items ── */
.gal-item {
    break-inside: avoid;
    margin-bottom: .75rem;
    overflow: hidden;
    border-radius: var(--radius-sm);
    position: relative;
    cursor: pointer;
    background-color: var(--creme-deep);
}

.gal-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .65s var(--ease);
    object-fit: cover;
}

/* Formats spéciaux */
.gal-item.gal-tall img {
    aspect-ratio: 3/4;
}

.gal-item.gal-wide {
    column-span: 2;
}

.gal-item.gal-wide img {
    aspect-ratio: 16/9;
}

.gal-item:not(.gal-tall):not(.gal-wide) img {
    aspect-ratio: 4/3;
}

/* Hover */
.gal-item:hover img {
    transform: scale(1.06);
}

/* Overlay au survol */
.gal-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 5, .0);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 1rem;
    transition: background var(--dur-fast) var(--ease);
    pointer-events: none;
}

.gal-item:hover .gal-item-overlay {
    background: rgba(20, 12, 5, .45);
}

.gal-item-cat {
    font-family: var(--font-body);
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0);
    background-color: rgba(184, 151, 90, .9);
    padding: .25rem .6rem;
    border-radius: 2px;
    transition: color .2s ease;
}

.gal-item:hover .gal-item-cat {
    color: var(--blanc);
}

.gal-item-zoom {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0);
    font-weight: 300;
    transition: color .2s ease, transform .2s ease;
    line-height: 1;
}

.gal-item:hover .gal-item-zoom {
    color: var(--blanc);
    transform: scale(1.2);
}

/* Items masqués par le filtre */
.gal-item.gal-hidden {
    display: none;
}


/* ── LIGHTBOX ────────────────────────────────────────────── */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: rgba(6, 4, 2, .96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s var(--ease);
}

.gal-lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.gal-lb-inner {
    position: relative;
    max-width: min(90vw, 1100px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gal-lb-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
    transition: opacity .25s ease;
}

.gal-lb-img.loading {
    opacity: .4;
}

.gal-lb-caption {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    color: rgba(245, 239, 228, .5);
    letter-spacing: .08em;
    margin-top: 1rem;
    text-align: center;
}

/* Boutons navigation */
.gal-lb-close,
.gal-lb-prev,
.gal-lb-next {
    position: fixed;
    background: none;
    border: none;
    color: rgba(245, 239, 228, .7);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: .75rem;
    transition: color .2s ease, transform .2s ease;
    z-index: 10;
}

.gal-lb-close {
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.2rem;
}

.gal-lb-prev {
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    font-weight: 300;
}

.gal-lb-next {
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    font-weight: 300;
}

.gal-lb-close:hover {
    color: var(--blanc);
    transform: scale(1.1);
}

.gal-lb-prev:hover {
    color: var(--or-light);
    transform: translateY(-50%) scale(1.2);
}

.gal-lb-next:hover {
    color: var(--or-light);
    transform: translateY(-50%) scale(1.2);
}

.gal-lb-counter {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    letter-spacing: .15em;
    color: rgba(245, 239, 228, .4);
}


/* ── CTA ─────────────────────────────────────────────────── */
.gal-cta {
    background-color: var(--brun);
    padding-block: var(--space-lg);
    text-align: center;
}

.gal-cta-inner {
    max-width: 560px;
    margin-inline: auto;
}

.gal-cta .section-label {
    color: var(--or-light);
}

.gal-cta h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    color: var(--creme);
    margin-bottom: 1rem;
}

.gal-cta h2 em {
    color: var(--or-light);
}

.gal-cta p {
    font-size: var(--fs-md);
    color: rgba(245, 239, 228, .65);
    margin-bottom: 2rem;
    line-height: 1.75;
}


/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .gal-grid {
        columns: 2;
    }

    .gal-item.gal-wide {
        column-span: 2;
    }
}

@media (max-width: 768px) {
    .gal-hero {
        height: 45vh;
        min-height: 300px;
    }

    .gal-filter-btn {
        padding: .85rem .5rem;
        font-size: .52rem;
        letter-spacing: .06em;
    }

    /* Lightbox mobile */
    .gal-lb-prev {
        left: .5rem;
        font-size: 2.2rem;
    }

    .gal-lb-next {
        right: .5rem;
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .gal-grid {
        columns: 1;
    }

    .gal-item.gal-wide {
        column-span: 1;
    }

    .gal-grid-section {
        padding-inline: .5rem;
    }
}