/* ============================================
   UNITBASSE — INDEX EXTRAS
   Extension de la charte Pro Max v2.0
   - Screenshots agrandis (hero + ampli)
   - Section galerie 4 captures XL
   - Composant zoomable (hover + invitation)
   - Lightbox plein écran
   - Footer 5 colonnes
   ============================================ */

/* ===========================================
   01. ZOOMABLE — base partagée
   =========================================== */
.zoomable {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: var(--radius-xl);
    transition: all var(--duration-slow) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.zoomable:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

.zoomable img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
    transition: transform var(--duration-slower) var(--ease-out);
}

.zoomable:hover img {
    transform: scale(1.04);
}

/* Hint qui apparaît au survol */
.zoomable__hint {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--black);
    background: var(--gradient-gold);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md), var(--shadow-glow-gold);
    opacity: 0;
    transform: translateY(8px);
    transition: all var(--duration-base) var(--ease-out);
    pointer-events: none;
    z-index: 3;
}

.zoomable:hover .zoomable__hint,
.zoomable:focus-visible .zoomable__hint {
    opacity: 1;
    transform: translateY(0);
}

/* Variante "bare" pour la section ampli (sans cadre additionnel) */
.zoomable--bare {
    border: 1px solid var(--gray-800);
    box-shadow:
        var(--shadow-xl),
        0 0 80px rgba(201, 162, 39, 0.12);
}

.zoomable--bare:hover {
    border-color: var(--gold-dark);
    transform: scale(1.02);
    box-shadow:
        var(--shadow-xl),
        0 0 100px rgba(201, 162, 39, 0.25);
}

/* ===========================================
   02. HERO — Visuel agrandi avec zoomable
   ===========================================
   IMPORTANT : pas de transform/perspective sur des
   parents de .lightbox pour ne pas casser position:fixed.
   On applique l'effet 3D uniquement via une transition
   de box-shadow et scale.
   =========================================== */
.hero__inner--xl {
    grid-template-columns: 0.85fr 1.15fr;
    gap: var(--space-12);
}

.hero__visual--xl {
    position: relative;
}

.hero__image--xl {
    box-shadow:
        var(--shadow-xl),
        0 0 80px rgba(201, 162, 39, 0.15);
    border: 1px solid var(--gray-800);
}

.hero__image--xl::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.04) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    z-index: 2;
}

.hero__image--xl:hover {
    border-color: var(--gold-dark);
    box-shadow:
        var(--shadow-xl),
        0 0 100px rgba(201, 162, 39, 0.3);
}

/* Effet 3D appliqué à l'IMAGE INTERNE uniquement,
   pas au parent. Évite les soucis de stacking. */
.hero__image--xl img {
    transition: transform var(--duration-slower) var(--ease-out);
}

.hero__image--xl:hover img {
    transform: scale(1.04);
}

/* ===========================================
   03. GALLERY — 4 screenshots zoomables
   =========================================== */
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-10);
    max-width: 1200px;
    margin: 0 auto;
}

.gallery__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.gallery__frame {
    background: var(--black);
    border: 1px solid var(--gray-800);
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 10;
}

.gallery__frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(201, 162, 39, 0.0) 0%,
        rgba(201, 162, 39, 0.1) 100%
    );
    opacity: 0;
    transition: opacity var(--duration-slow);
    pointer-events: none;
    z-index: 2;
}

.gallery__frame:hover {
    border-color: var(--gold-dark);
    box-shadow:
        var(--shadow-xl),
        0 0 60px rgba(201, 162, 39, 0.25);
}

.gallery__frame:hover::after {
    opacity: 1;
}

.gallery__caption {
    padding: 0 var(--space-2);
}

.gallery__caption h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--cream);
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.gallery__caption p {
    font-size: var(--text-sm);
    color: var(--cream-muted);
    line-height: 1.65;
}

/* ===========================================
   04. AMPS — Section avec image XL
   =========================================== */
.amps__inner--xl {
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-16);
    align-items: center;
}

.amps__visual--xl {
    position: relative;
}

.amps__visual--xl .zoomable--bare::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* ===========================================
   05. LIGHTBOX — Plein écran
   ===========================================
   IMPORTANT : la lightbox est déplacée en
   enfant direct de <body> par lightbox.js
   pour éviter les contextes de stacking parents.
   =========================================== */
.lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-base) var(--ease-out),
                visibility var(--duration-base);
    cursor: zoom-out;
    margin: 0;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox__content {
    position: relative;
    max-width: min(95vw, 1800px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    transform: scale(0.96);
    transition: transform var(--duration-base) var(--ease-out);
    cursor: default;
}

.lightbox.is-open .lightbox__content {
    transform: scale(1);
}

.lightbox__img {
    max-width: 100%;
    max-height: calc(90vh - 60px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-xl);
    box-shadow:
        var(--shadow-xl),
        0 0 100px rgba(201, 162, 39, 0.2);
    border: 1px solid var(--gray-800);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox__caption {
    font-size: var(--text-sm);
    color: var(--cream-muted);
    text-align: center;
    max-width: 720px;
    margin: 0;
    padding: 0 var(--space-4);
}

.lightbox__close {
    position: absolute !important;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(34, 34, 34, 0.8);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--gray-700);
    color: var(--cream);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.lightbox__close:hover {
    background: var(--gradient-gold);
    color: var(--black);
    border-color: transparent;
    transform: scale(1.1);
}

.lightbox__close:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Empêche le scroll du body quand la lightbox est ouverte */
body.lightbox-open {
    overflow: hidden;
}

/* ===========================================
   06. FOOTER — 5 colonnes (avec Presse)
   =========================================== */
.footer__inner {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
}

/* ===========================================
   07. RESPONSIVE
   =========================================== */
@media (max-width: 1200px) {
    .gallery {
        gap: var(--space-8);
    }
}

@media (max-width: 1024px) {
    .hero__inner--xl {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }

    .hero__image--xl {
        max-width: 720px;
        margin: 0 auto;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: var(--space-10);
        max-width: 720px;
    }

    .amps__inner--xl {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .amps__visual--xl {
        max-width: 720px;
        margin: 0 auto;
    }

    .footer__inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery__caption h3 {
        font-size: var(--text-lg);
    }

    .footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Lightbox mobile */
    .lightbox {
        padding: var(--space-4);
    }

    .lightbox__close {
        top: var(--space-4);
        right: var(--space-4);
        width: 40px;
        height: 40px;
    }

    /* Sur mobile pas de hover : on rend le hint toujours visible */
    .zoomable__hint {
        opacity: 0.85;
        transform: translateY(0);
        font-size: 10px;
        padding: var(--space-1) var(--space-3);
    }
}

@media (max-width: 480px) {
    .gallery__frame {
        border-radius: var(--radius-lg);
    }
}

/* Préférence utilisateur : moins de motion */
@media (prefers-reduced-motion: reduce) {
    .hero__image--xl,
    .gallery__frame,
    .zoomable,
    .zoomable img,
    .zoomable--bare,
    .lightbox,
    .lightbox__content {
        transition: none;
        transform: none !important;
    }

    .zoomable:hover img {
        transform: none;
    }
}
