/* ==========================================
   Ma'Tour immersive editorial panels
   Version optimisée – 29 août 2026
   ========================================== */

/* ==========================================
   1. CONTENEUR PRINCIPAL
   ========================================== */
.immersive-journeys {
    position: relative;
    background: #17141a;
    color: #f7f1e8;
    overflow: visible;
    isolation: isolate;
}

/* ==========================================
   2. INTRODUCTION
   ========================================== */
.immersive-intro {
    position: relative;
    z-index: 10;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(5rem, 12vw, 10rem) 1.5rem clamp(3rem, 8vw, 6rem);
    text-align: center;
}

.immersive-intro .eyebrow {
    display: inline-block;
    color: #e3b56e;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.immersive-intro h2 {
    max-width: 700px;
    margin: 0.75rem auto 1.25rem;
    color: #fffaf1;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 0.98;
}

.immersive-intro p {
    max-width: 560px;
    margin: 0 auto;
    color: rgba(247, 241, 232, 0.72);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.7;
}

/* ==========================================
   3. STORY (PANELS)
   ========================================== */
.immersive-story {
    position: relative;
    z-index: 1;
    height: 160vh;
    margin: 0;
}

/* Empilement des stories */
.immersive-story:nth-of-type(2) { z-index: 2; }
.immersive-story:nth-of-type(3) { z-index: 3; }
.immersive-story:nth-of-type(4) { z-index: 4; }

/* Chevauchement */
.immersive-story + .immersive-story {
    margin-top: -100vh;
}

/* ==========================================
   4. MEDIA (IMAGE DE FOND)
   ========================================== */
.immersive-media {
    position: sticky;
    top: 0;
    height: 100vh;
    min-height: 620px;
    isolation: isolate;
    overflow: hidden;
    background-image: var(--premium-image), var(--fallback-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: translate3d(0, calc((1 - var(--story-reveal, 1)) * 100%), 0);
    will-change: transform;
    transition: transform 0.15s linear;
}

/* Overlay dégradé */
.immersive-media::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(8, 7, 10, 0.14) 15%, rgba(8, 7, 10, 0.12) 38%, rgba(8, 7, 10, 0.82) 100%);
    content: '';
    pointer-events: none;
}

.immersive-media::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle at 50% 35%, transparent 0%, rgba(8, 7, 10, 0.18) 100%);
    content: '';
    pointer-events: none;
}

/* ==========================================
   5. CAPTION (TEXTE SUR L'IMAGE)
   ========================================== */
.immersive-caption {
    position: absolute;
    right: clamp(1.25rem, 8vw, 9rem);
    bottom: clamp(2.5rem, 11vh, 8rem);
    left: clamp(1.25rem, 8vw, 9rem);
    z-index: 2;
    max-width: 680px;
    transform: translateY(18px);
    opacity: 0;
    transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.immersive-story.is-visible .immersive-caption {
    transform: translateY(0);
    opacity: 1;
}

.immersive-caption .eyebrow {
    display: inline-block;
    color: #e3b56e;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.immersive-caption h3 {
    max-width: 650px;
    margin: 0.6rem 0 1rem;
    color: #fffaf1;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.3rem, 6vw, 5.6rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 0.96;
}

.immersive-caption p {
    max-width: 520px;
    margin: 0 0 1.5rem;
    color: rgba(255, 250, 241, 0.84);
    font-size: clamp(1rem, 1.55vw, 1.2rem);
    line-height: 1.6;
}

/* ==========================================
   6. LIEN "DÉCOUVRIR"
   ========================================== */
.immersive-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 250, 241, 0.65);
    padding-bottom: 0.45rem;
    color: #fffaf1;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: gap 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.immersive-link:hover,
.immersive-link:focus-visible {
    gap: 1.05rem;
    border-color: #e3b56e;
    color: #e3b56e;
}

.immersive-link:focus-visible {
    outline: 2px solid #e3b56e;
    outline-offset: 4px;
}

.immersive-link svg,
.immersive-link span {
    transition: transform 0.3s ease;
}

.immersive-link:hover span {
    transform: translateX(4px);
}

/* ==========================================
   7. RESPONSIVE – MOBILE
   ========================================== */
@media (max-width: 760px) {
    /* Désactiver l'effet de parallaxe sur mobile */
    .immersive-story {
        width: 100% !important;
        height: auto !important;
        min-height: 100svh !important;
        margin-top: 0 !important;
        position: relative !important;
    }

    .immersive-story + .immersive-story {
        margin-top: 0 !important;
    }

    .immersive-media {
        position: relative !important;
        top: auto !important;
        width: 100% !important;
        height: 100svh !important;
        min-height: 560px;
        transform: none !important;
        transition: none !important;
    }

    .immersive-caption {
        position: absolute !important;
        width: calc(100% - 2.5rem) !important;
        max-width: none !important;
        left: 1.25rem !important;
        right: 1.25rem !important;
        bottom: clamp(3rem, 10vh, 5rem) !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .immersive-caption h3 {
        font-size: clamp(2.15rem, 12vw, 4rem);
    }

    .immersive-caption p {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    }

    .immersive-intro {
        padding: clamp(4rem, 10vw, 6rem) 1.25rem clamp(2rem, 6vw, 4rem);
    }

    .immersive-intro h2 {
        font-size: clamp(2.2rem, 10vw, 3.8rem);
    }
}

/* ==========================================
   8. RESPONSIVE – TRÈS PETITS ÉCRANS
   ========================================== */
@media (max-width: 400px) {
    .immersive-caption {
        width: calc(100% - 1.5rem) !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        bottom: clamp(2.5rem, 8vh, 3.5rem) !important;
    }

    .immersive-caption h3 {
        font-size: clamp(1.8rem, 10vw, 2.8rem);
    }

    .immersive-caption p {
        font-size: 0.9rem;
    }

    .immersive-link {
        font-size: 0.75rem;
        gap: 0.5rem;
    }
}

/* ==========================================
   9. ACCESSIBILITÉ – RÉDUCTION D'ANIMATIONS
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .immersive-media {
        transform: none !important;
        will-change: auto !important;
        transition: none !important;
    }

    .immersive-caption {
        transform: none !important;
        opacity: 1 !important;
        transition: none !important;
    }

    .immersive-story.is-visible .immersive-caption {
        transform: none !important;
        opacity: 1 !important;
    }

    .immersive-link:hover,
    .immersive-link:focus-visible {
        gap: 0.75rem;
    }

    .immersive-link:hover span {
        transform: none;
    }
}

/* ==========================================
   10. ACCESSIBILITÉ – FOCUS VISIBLE
   ========================================== */
.immersive-link:focus-visible {
    outline: 2px solid #e3b56e;
    outline-offset: 4px;
}

/* ==========================================
   11. PERFORMANCE – OPTIMISATION IMAGES
   ========================================== */
@media (max-width: 760px) {
    .immersive-media {
        background-image: var(--mobile-image, var(--premium-image)), var(--fallback-image);
    }
}

/* ==========================================
   12. COMPATIBILITÉ NAVIGATEURS
   ========================================== */
@supports (height: 100svh) {
    .immersive-story {
        height: 160svh;
    }
    
    .immersive-media {
        height: 100svh;
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .immersive-media::before {
        background: linear-gradient(180deg, rgba(8, 7, 10, 0.25) 15%, rgba(8, 7, 10, 0.20) 38%, rgba(8, 7, 10, 0.85) 100%);
    }
}

/* ==========================================
   13. VARIANTES DE COULEUR (optionnel)
   ========================================== */
.immersive-story[data-theme="light"] .immersive-caption h3 {
    color: #1a161e;
}

.immersive-story[data-theme="light"] .immersive-caption p {
    color: rgba(26, 22, 30, 0.8);
}

.immersive-story[data-theme="light"] .immersive-link {
    color: #1a161e;
    border-color: rgba(26, 22, 30, 0.4);
}

.immersive-story[data-theme="light"] .immersive-link:hover {
    color: #c85d2e;
    border-color: #c85d2e;
}

/* ==========================================
   14. SCROLL INDICATOR (optionnel)
   ========================================== */
.immersive-scroll-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: bounceDown 2.4s ease-in-out infinite;
}

.immersive-scroll-hint .line {
    width: 1px;
    height: 28px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
}

@keyframes bounceDown {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
    50% { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .immersive-scroll-hint {
        animation: none;
        opacity: 0.3;
    }
}

/* ==========================================
   15. FIX : ÉVITER LE DÉBORDEMENT
   ========================================== */
.immersive-journeys,
.immersive-story,
.immersive-media {
    max-width: 100vw;
    overflow-x: hidden;
}