/* ═══════════════════════════════════════════════════════════════════════
 * LZ Galerie Réalisations — Carrousel + Overlay + Lightbox
 * Couleurs : #152738 (marine) / #808186 (gris)
 * ═══════════════════════════════════════════════════════════════════════ */

.lz-gal {
    position: relative;
    width: 100%;
    padding: 80px 0;
    background: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.lz-gal *,
.lz-gal *::before,
.lz-gal *::after {
    box-sizing: border-box;
}

.lz-gal__inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ─── EN-TÊTE ─────────────────────────────────────────────────────────── */
.lz-gal__header {
    text-align: center;
    margin-bottom: 50px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.lz-gal__kicker {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #808186;
    margin-bottom: 18px;
}

.lz-gal__kicker::before,
.lz-gal__kicker::after {
    content: '';
    width: 34px;
    height: 1px;
    background: #808186;
    display: inline-block;
}

.lz-gal__title {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #152738;
    margin: 0 0 18px;
}

.lz-gal__title-accent {
    color: #808186;
    font-style: italic;
    font-weight: 700;
    position: relative;
}

.lz-gal__title-accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.05em;
    height: 2px;
    background: #808186;
    opacity: 0.4;
}

.lz-gal__subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: #506069;
    margin: 0;
}

/* ─── FILTRES ─────────────────────────────────────────────────────────── */
.lz-gal__filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 auto 44px;
    padding: 6px;
    background: rgba(247, 248, 249, 0.7);
    border-radius: 100px;
    width: fit-content;
    max-width: 100%;
    border: 1px solid rgba(21, 39, 56, 0.07);
}

.lz-gal__filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    background: transparent;
    color: #506069;
    border: 1px solid transparent;
    border-radius: 100px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
    line-height: 1;
}

.lz-gal__filter:hover:not(.is-active) {
    color: #152738;
    background: rgba(255, 255, 255, 0.9);
}

.lz-gal__filter.is-active {
    background: #152738;
    color: #ffffff;
    border-color: #152738;
    box-shadow: 0 4px 14px -4px rgba(21, 39, 56, 0.4);
    font-weight: 700;
}

/* ─── CARROUSEL ───────────────────────────────────────────────────────── */
.lz-gal__carousel {
    position: relative;
}

.lz-gal__viewport {
    overflow: hidden;
    padding: 10px 0;
    margin: -10px 0;
}

.lz-gal__track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ─── CARDS ─────────────────────────────────────────────────────────── */
.lz-gal__card {
    flex: 0 0 auto;
    width: 320px; /* recalculé en JS */
    height: 400px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f2f5;
    box-shadow: 0 4px 18px -6px rgba(21, 39, 56, 0.12);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.lz-gal__card.is-filtered-out {
    display: none;
}

.lz-gal__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px -12px rgba(21, 39, 56, 0.3);
}

.lz-gal__card-img-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #f0f2f5;
}

.lz-gal__card-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.6s ease;
}

.lz-gal__card:hover .lz-gal__card-image {
    transform: scale(1.06);
}

/* Badge catégorie en haut à gauche */
.lz-gal__card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #152738;
    border-radius: 100px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

/* Overlay au hover (titre + lieu + icône loupe) */
.lz-gal__card-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    padding: 26px 24px;
    background: linear-gradient(0deg, rgba(21, 39, 56, 0.97) 0%, rgba(21, 39, 56, 0.85) 35%, rgba(21, 39, 56, 0.35) 75%, transparent 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    text-align: left;
    opacity: 0;
    transition: opacity 0.4s ease;
    font-family: inherit;
}

.lz-gal__card:hover .lz-gal__card-overlay,
.lz-gal__card:focus-within .lz-gal__card-overlay {
    opacity: 1;
}

.lz-gal__card-zoom {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    color: #ffffff;
    transition: transform 0.3s ease, background 0.3s ease;
}

.lz-gal__card:hover .lz-gal__card-zoom {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.28);
}

.lz-gal__card-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.lz-gal__card-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 500;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.lz-gal__card-location svg {
    flex-shrink: 0;
    opacity: 0.9;
}

/* ─── NAVIGATION FLÈCHES ─────────────────────────────────────────────── */
.lz-gal__nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.lz-gal__arrow {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #152738;
    color: #ffffff;
    border: 2px solid #152738;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.lz-gal__arrow:hover {
    background: #ffffff;
    color: #152738;
    border-color: #152738;
    transform: translateY(-2px);
}

.lz-gal__arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ─── DOTS ────────────────────────────────────────────────────────────── */
.lz-gal__dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.lz-gal__dot {
    width: 28px;
    height: 3px;
    background: rgba(21, 39, 56, 0.2);
    border: none;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
    transition: background 0.3s ease, width 0.3s ease;
}

.lz-gal__dot.is-active {
    background: #152738;
    width: 40px;
}

/* ─── Modificateurs : cacher dots/arrows si désactivés ─────────────────── */
/* Cache forcée quand les toggles Elementor sont sur OFF (anti-Bixol) */
.lz-gal--no-dots .lz-gal__dots,
.lz-gal--no-dots .lz-gal__dot,
.lz-gal--no-dots .swiper-pagination,
.lz-gal--no-dots .slick-dots,
.lz-gal--no-dots [class*="pagination"]:not(.lz-gal__filter) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.lz-gal--no-arrows .lz-gal__nav,
.lz-gal--no-arrows .lz-gal__arrow,
.lz-gal--no-arrows .swiper-button-prev,
.lz-gal--no-arrows .swiper-button-next,
.lz-gal--no-arrows .slick-prev,
.lz-gal--no-arrows .slick-next {
    display: none !important;
    visibility: hidden !important;
}

.lz-gal__empty {
    padding: 60px 30px;
    text-align: center;
    color: #506069;
    background: #f7f8f9;
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
 * LIGHTBOX
 * Note: la lightbox est déplacée dans <body> par le JS au moment de l'init,
 * pour échapper aux contraintes de stacking context des parents (Elementor 
 * containers, Bixol theme wrappers).
 * ═══════════════════════════════════════════════════════════════════════ */
.lz-gal__lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important; /* dynamic viewport height pour mobile */
    z-index: 2147483647 !important; /* z-index maximum 32-bit signed */
    background: rgba(10, 18, 28, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin: 0 !important;
    transform: none !important;
}

.lz-gal__lightbox.is-open {
    display: flex !important;
    opacity: 1;
}

/* ─── Quand la lightbox est ouverte, on neutralise le header sticky Bixol ─
 * Le thème Bixol utilise différents sélecteurs pour son sticky header.
 * On les cible tous pour être sûr de masquer le header pendant la lightbox.
 * ───────────────────────────────────────────────────────────────────────── */
body.lz-gal-lb-open {
    overflow: hidden !important;
    /* Empêche le scroll de la page derrière */
}

body.lz-gal-lb-open .sticky-header,
body.lz-gal-lb-open .site-header.is-sticky,
body.lz-gal-lb-open .header-sticky,
body.lz-gal-lb-open .is-sticky,
body.lz-gal-lb-open .stickyheader,
body.lz-gal-lb-open #masthead.is-sticky,
body.lz-gal-lb-open .main-header.is-sticky,
body.lz-gal-lb-open #wrapper-navbar.fixed,
body.lz-gal-lb-open .navbar.fixed-top,
body.lz-gal-lb-open .navbar-fixed-top {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Mobile menu Bixol qui peut prendre le dessus */
body.lz-gal-lb-open .mobile-nav,
body.lz-gal-lb-open .mobile-menu,
body.lz-gal-lb-open .mobile-header,
body.lz-gal-lb-open .mobile-nav-wrapper {
    display: none !important;
    z-index: -1 !important;
}

.lz-gal__lb-close,
.lz-gal__lb-prev,
.lz-gal__lb-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    padding: 0;
}

.lz-gal__lb-close:hover,
.lz-gal__lb-prev:hover,
.lz-gal__lb-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.lz-gal__lb-close {
    top: 24px;
    right: 24px;
}

.lz-gal__lb-prev {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.lz-gal__lb-prev:hover {
    transform: translateY(-50%) scale(1.05);
}

.lz-gal__lb-next {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.lz-gal__lb-next:hover {
    transform: translateY(-50%) scale(1.05);
}

.lz-gal__lb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    max-width: 1100px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.lz-gal__lb-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    background: #1a2533;
}

.lz-gal__lb-caption {
    text-align: center;
    color: #ffffff;
    max-width: 700px;
    padding: 0 20px;
}

.lz-gal__lb-badge {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-radius: 100px;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
}

.lz-gal__lb-badge:empty {
    display: none;
}

.lz-gal__lb-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.lz-gal__lb-location {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 10px;
}

.lz-gal__lb-location:empty {
    display: none;
}

.lz-gal__lb-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 14px;
}

.lz-gal__lb-desc:empty {
    display: none;
}

.lz-gal__lb-counter {
    display: inline-block;
    font-family: 'Manrope', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
}

body.lz-gal-lb-open {
    overflow: hidden;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .lz-gal {
        padding: 60px 0;
    }
    .lz-gal__inner {
        padding: 0 30px;
    }
    .lz-gal__header {
        margin-bottom: 40px;
    }
}

@media (max-width: 768px) {
    .lz-gal {
        padding: 50px 0;
    }
    .lz-gal__inner {
        padding: 0 20px;
    }
    .lz-gal__header {
        margin-bottom: 32px;
    }
    .lz-gal__kicker {
        font-size: 0.72rem;
    }
    .lz-gal__kicker::before,
    .lz-gal__kicker::after {
        width: 20px;
    }
    .lz-gal__filters {
        margin-bottom: 30px;
        gap: 6px;
    }
    .lz-gal__filter {
        padding: 8px 16px;
        font-size: 0.78rem;
    }
    .lz-gal__arrow {
        width: 42px;
        height: 42px;
    }
    .lz-gal__nav {
        margin-top: 28px;
    }

    /* Lightbox sur mobile : layout optimisé pour voir l'image en grand */
    .lz-gal__lightbox {
        padding: 10px 8px 70px; /* padding bottom plus grand pour les flèches */
    }
    .lz-gal__lb-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
    .lz-gal__lb-prev,
    .lz-gal__lb-next {
        width: 44px;
        height: 44px;
        bottom: 14px;
        top: auto;
        transform: none;
    }
    .lz-gal__lb-prev:hover,
    .lz-gal__lb-next:hover {
        transform: scale(1.05);
    }
    .lz-gal__lb-prev {
        left: 20%;
    }
    .lz-gal__lb-next {
        right: 20%;
    }
    .lz-gal__lb-content {
        gap: 12px;
        padding-top: 50px; /* libère espace pour bouton close en haut */
    }
    .lz-gal__lb-image {
        max-height: 60vh;
        max-height: 60dvh;
        width: auto;
    }
    .lz-gal__lb-title {
        font-size: 1.05rem;
    }
    .lz-gal__lb-caption {
        padding: 0 10px;
    }
    .lz-gal__lb-desc {
        font-size: 0.85rem;
    }
    .lz-gal__lb-counter {
        font-size: 0.8rem;
    }

    /* Overlay sur mobile : visible par défaut (pas de hover) pour montrer le titre */
    .lz-gal__card-overlay {
        opacity: 1;
        background: linear-gradient(0deg, rgba(21, 39, 56, 0.85) 0%, rgba(21, 39, 56, 0.3) 50%, transparent 70%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lz-gal__track,
    .lz-gal__card,
    .lz-gal__card-image,
    .lz-gal__card-overlay,
    .lz-gal__arrow,
    .lz-gal__dot,
    .lz-gal__filter,
    .lz-gal__lightbox {
        transition: none !important;
    }
}
