/* ============================================================
   REVERENTIA - Cartes empilees + Chapitres video (homepage)
   Carte Hero : video avec chapitres pilotes par scroll/swipe.
   Cartes suivantes : transitions GSAP.
   ============================================================ */

/* ===== CONTENEUR PRINCIPAL ===== */
.rev-stack {
    position: relative;
    z-index: 1; /* Stacking context sous le header (z-index:1030) */
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    touch-action: pan-y;
}

/* ===== CARTES ===== */
.rev-stack__card {
    position: absolute;
    touch-action: pan-y;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    will-change: transform;
}

/* Z-index croissant : chaque carte se pose par-dessus la precedente */
.rev-stack__card[data-card="0"] { z-index: 1; }
.rev-stack__card[data-card="1"] { z-index: 2; transform: translateY(100%); }
.rev-stack__card[data-card="2"] { z-index: 3; transform: translateY(100%); }
.rev-stack__card[data-card="3"] { z-index: 4; transform: translateY(100%); }
.rev-stack__card[data-card="4"] { z-index: 5; transform: translateY(100%); }
.rev-stack__card[data-card="5"] { z-index: 6; transform: translateY(100%); }
.rev-stack__card[data-card="6"] { z-index: 7; transform: translateY(100%); }

/* ===== CONTENU DES CARTES ===== */

/* Carte hero video */
.rev-stack__card--hero {
    background: var(--rev-black-deep);
}

/* Forcer l'affichage de l'overlay et du contenu hero dans le card-stack */
.rev-stack__card--hero .rev-hero__overlay {
    opacity: 1 !important;
}

.rev-stack__card--hero .rev-hero__content {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.rev-stack__card--hero .rev-hero__logo,
.rev-stack__card--hero .rev-hero__title,
.rev-stack__card--hero .rev-hero__subtitle {
    opacity: 1 !important;
    animation: none !important;
}

/* Carte texte introduction */
.rev-stack__card--intro {
    background: var(--rev-black-deep);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rev-stack__card--intro .rev-stack__card-inner {
    max-width: 700px;
    padding: 2rem;
    text-align: center;
}

.rev-stack__card--intro .rev-stack__card-inner .rev-subtitle {
    margin-bottom: 1.5rem;
}

.rev-stack__card--intro .rev-stack__card-inner p {
    color: var(--rev-text-secondary);
    font-size: 1rem;
    line-height: 1.9;
}

/* Cartes collection (bannieres) */
.rev-stack__card--collection {
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.rev-stack__card--collection::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.rev-stack__card--collection .rev-stack__card-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

/* Couleurs specifiques par collection (image-set AVIF -> WebP -> JPG fallback) */
.rev-stack__card--rouge {
    background-image: url('../images/backgrounds/bg-collection-rouge.jpg');
    background-image: image-set(
        url('../images/backgrounds/bg-collection-rouge.avif') type('image/avif'),
        url('../images/backgrounds/bg-collection-rouge.webp') type('image/webp'),
        url('../images/backgrounds/bg-collection-rouge.jpg')  type('image/jpeg')
    );
}

.rev-stack__card--bleu {
    background-image: url('../images/backgrounds/bg-collection-bleu.jpg');
    background-image: image-set(
        url('../images/backgrounds/bg-collection-bleu.avif') type('image/avif'),
        url('../images/backgrounds/bg-collection-bleu.webp') type('image/webp'),
        url('../images/backgrounds/bg-collection-bleu.jpg')  type('image/jpeg')
    );
}

.rev-stack__card--vert {
    background-image: url('../images/backgrounds/bg-collection-vert.jpg');
    background-image: image-set(
        url('../images/backgrounds/bg-collection-vert.avif') type('image/avif'),
        url('../images/backgrounds/bg-collection-vert.webp') type('image/webp'),
        url('../images/backgrounds/bg-collection-vert.jpg')  type('image/jpeg')
    );
}

/* Nom de collection sur la banniere */
.rev-stack__collection-name {
    font-family: var(--rev-font-heading);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 600;
    font-variation-settings: 'opsz' 9; /* Bodoni Moda 9pt */
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.rev-stack__card--rouge .rev-stack__collection-name {
    color: #c20019;
    text-shadow: 0 4px 5px rgba(0, 0, 0, 1);
}

.rev-stack__card--bleu .rev-stack__collection-name {
    color: #283583;
    text-shadow: 0 4px 5px rgba(0, 0, 0, 1);
}

.rev-stack__card--vert .rev-stack__collection-name {
    color: #006b55;
    text-shadow: 0 4px 5px rgba(0, 0, 0, 1);
}

.rev-stack__collection-subtitle {
    font-family: var(--rev-font-heading);
    font-style: italic;
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    color: var(--rev-gold);
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.rev-stack__collection-cta {
    display: inline-block;
    font-family: var(--rev-font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--rev-gold);
    border: 1px solid var(--rev-gold);
    padding: 0.875rem 2.5rem;
    text-decoration: none;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.rev-stack__collection-cta:hover {
    background-color: var(--rev-gold);
    color: var(--rev-black-deep);
}

/* ===== FLECHES DE NAVIGATION ===== */
.rev-stack__nav {
    position: fixed;
    right: 1.5rem;
    bottom: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Visible quand le card-stack est actif */
.rev-stack.active .rev-stack__nav {
    opacity: 1;
    pointer-events: auto;
}

.rev-stack__arrow {
    background: none;
    border: 1px solid rgba(234, 200, 128, 0.15);
    color: var(--rev-gold);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.3;
    transition: opacity 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.rev-stack__arrow:hover {
    opacity: 1;
    border-color: var(--rev-gold);
    background: rgba(234, 200, 128, 0.08);
}

.rev-stack__arrow:disabled {
    opacity: 0.1;
    cursor: default;
    pointer-events: none;
}

/* ===== INDICATEURS DE POSITION ===== */
.rev-stack__dots {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.rev-stack.active .rev-stack__dots {
    opacity: 1;
    pointer-events: auto;
}

.rev-stack__dot {
    width: 8px;
    height: 8px;
    border: 1px solid rgba(234, 200, 128, 0.3);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.rev-stack__dot.active {
    background: var(--rev-gold);
    border-color: var(--rev-gold);
    transform: scale(1.3);
}

.rev-stack__dot:hover {
    border-color: var(--rev-gold);
}

/* ===== ANIMATIONS INTERNES AUX CARTES ===== */
.rev-stack__card .rev-stack__fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.rev-stack__card.is-visible .rev-stack__fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Delais echelonnes */
.rev-stack__card.is-visible .rev-stack__fade-in:nth-child(2) {
    transition-delay: 0.15s;
}
.rev-stack__card.is-visible .rev-stack__fade-in:nth-child(3) {
    transition-delay: 0.3s;
}
.rev-stack__card.is-visible .rev-stack__fade-in:nth-child(4) {
    transition-delay: 0.45s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .rev-stack__nav {
        right: 1rem;
        bottom: 1.5rem;
    }

    .rev-stack__dots {
        right: 1rem;
    }

    .rev-stack__arrow {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .rev-stack__card--intro .rev-stack__card-inner {
        padding: 1.5rem;
    }

    .rev-stack__collection-name {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
}

/* ===== CHAPITRES VIDEO (overlays sur carte Hero) ===== */

/* Contenu hero masque quand un chapitre avec texte est actif */
.rev-hero__content--chapter-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.6s ease;
}

/* Masquer l'indicateur de scroll quand on avance dans les chapitres */
.rev-hero__scroll-indicator.rev-chapter-hidden {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Overlay de chapitre */
.rev-chapter {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    z-index: 10;
    padding: 0 var(--rev-space-lg, 2rem);
}

.rev-chapter.active {
    opacity: 1;
}

/* Alignement gauche / droite */
.rev-chapter--right {
    justify-content: flex-end;
}

.rev-chapter--left {
    justify-content: flex-start;
}

/* Contenu du chapitre */
.rev-chapter__content {
    width: 50%;
    padding: clamp(1.5rem, 3vw, 3.5rem);
}

.rev-chapter--right .rev-chapter__content {
    text-align: left;
}

.rev-chapter--left .rev-chapter__content {
    text-align: right;
}

.rev-chapter__title {
    font-family: var(--rev-font-heading);
    font-size: clamp(1.4rem, 4vw + 0.5rem, 4rem);
    font-weight: 600;
    font-variation-settings: 'opsz' 9; /* Bodoni Moda 9pt */
    letter-spacing: clamp(0.04em, 0.08vw, 0.12em);
    line-height: 1.2;
    color: var(--rev-text-primary);
    margin-bottom: clamp(0.5rem, 1.5vw, 1.2rem);
    transform: translateY(20px);
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
    opacity: 0;
}

.rev-chapter.active .rev-chapter__title {
    transform: translateY(0);
    opacity: 1;
}

.rev-chapter__subtitle {
    font-family: var(--rev-font-heading);
    font-style: italic;
    font-size: clamp(0.85rem, 1.8vw + 0.3rem, 1.5rem);
    font-weight: 400;
    letter-spacing: clamp(0.03em, 0.06vw, 0.1em);
    line-height: 1.5;
    color: var(--rev-gold);
    transform: translateY(15px);
    transition: transform 1s 0.2s ease-out, opacity 1s 0.2s ease-out;
    opacity: 0;
}

.rev-chapter.active .rev-chapter__subtitle {
    transform: translateY(0);
    opacity: 1;
}

/* Contenu HTML personnalise */
.rev-chapter__custom {
    margin-top: clamp(0.75rem, 1.5vw, 1.5rem);
    font-size: clamp(0.8rem, 1.2vw + 0.3rem, 1.1rem);
    line-height: 1.7;
    transform: translateY(15px);
    transition: transform 1s 0.3s ease-out, opacity 1s 0.3s ease-out;
    opacity: 0;
}

.rev-chapter.active .rev-chapter__custom {
    transform: translateY(0);
    opacity: 1;
}

/* ===== BARRE DE PROGRESSION CHAPITRES ===== */
.rev-chapter-progress {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.rev-chapter-progress.visible {
    opacity: 1;
    pointer-events: auto;
}

.rev-chapter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(234, 200, 128, 0.25);
    cursor: pointer;
    transition: background 0.4s ease, transform 0.4s ease;
    -webkit-tap-highlight-color: transparent;
}

.rev-chapter-dot.active {
    background: var(--rev-gold);
    transform: scale(1.3);
}

.rev-chapter-dot.passed {
    background: rgba(234, 200, 128, 0.55);
}

.rev-chapter-dot:hover {
    background: rgba(234, 200, 128, 0.6);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .rev-chapter__content {
        width: 85%;
        padding: var(--rev-space-md, 1.5rem);
    }

    .rev-chapter--right,
    .rev-chapter--left {
        justify-content: center;
    }

    .rev-chapter--right .rev-chapter__content,
    .rev-chapter--left .rev-chapter__content {
        text-align: center;
    }

    .rev-chapter-progress {
        bottom: 1.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .rev-chapter__content {
        width: 60%;
    }
}

/* ===== PREFERENCE MOUVEMENT REDUIT ===== */
@media (prefers-reduced-motion: reduce) {
    .rev-stack__card {
        will-change: auto;
    }

    .rev-stack__card .rev-stack__fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .rev-chapter,
    .rev-chapter__title,
    .rev-chapter__subtitle,
    .rev-chapter__custom {
        transition: none;
    }

    .rev-chapter.active .rev-chapter__title,
    .rev-chapter.active .rev-chapter__subtitle,
    .rev-chapter.active .rev-chapter__custom {
        transform: none;
        opacity: 1;
    }
}

/* ============================================
   CARTE 6 — EVENT ESXENCE 2026
   Layout split 45/55 inspire des fiches produit
   ============================================ */
.rev-stack__card--event {
    background: var(--rev-dark, #0A0A0A);
    overflow: hidden;
}
.rev-stack__event-split {
    display: grid;
    grid-template-columns: 45% 55%;
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

/* --- Colonne media (gauche) --- */
.rev-stack__event-media {
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(234, 200, 128, 0.18);
}
.rev-stack__event-picture,
.rev-stack__event-picture img {
    display: block;
    width: 100%;
    height: 100%;
}
.rev-stack__event-picture img {
    object-fit: cover;
    object-position: center;
}
.rev-stack__event-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 10, 10, 0.25) 0%, rgba(10, 10, 10, 0.55) 65%, rgba(10, 10, 10, 0.85) 100%);
    pointer-events: none;
}
/* Logo Esxence officiel en bas a gauche du media */
.rev-stack__event-logo {
    position: absolute;
    left: clamp(1.5rem, 3vw, 2.5rem);
    bottom: clamp(1.5rem, 3vh, 2.5rem);
    width: clamp(100px, 14vw, 160px);
    height: auto;
    opacity: 0.95;
    display: block;
}
.rev-stack__event-logo img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* --- Colonne editoriale (droite) --- */
.rev-stack__event-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2.5rem, 6vw, 5.5rem) clamp(2rem, 5vw, 5rem);
    max-width: 720px;
    color: var(--rev-text-secondary, #a4a4a4);
}
.rev-stack__event-label {
    color: var(--rev-gold);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
    font-family: var(--rev-font-body);
}
.rev-stack__event-title {
    font-family: var(--rev-font-display);
    color: var(--rev-cream, #f5f0eb);
    font-size: clamp(2.4rem, 4.5vw, 3.6rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
    line-height: 1.1;
}
.rev-stack__event-subtitle {
    font-family: var(--rev-font-display);
    font-style: italic;
    color: var(--rev-gold);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    letter-spacing: 0.04em;
    margin: 0 0 2rem;
    position: relative;
    padding-bottom: 1.25rem;
}
.rev-stack__event-subtitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 56px;
    height: 1px;
    background: var(--rev-gold);
    opacity: 0.6;
}
.rev-stack__event-info {
    margin: 0 0 1.75rem;
    font-family: var(--rev-font-body);
    font-size: 1rem;
    line-height: 1.7;
}
.rev-stack__event-info p { margin: 0; }
.rev-stack__event-location {
    color: var(--rev-cream, #f5f0eb);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.rev-stack__event-dates {
    color: var(--rev-gold);
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    margin-top: 0.4rem !important;
}
.rev-stack__event-address {
    color: #8a8a8a;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    margin-top: 0.4rem !important;
}
.rev-stack__event-quote {
    font-family: var(--rev-font-display);
    font-style: italic;
    color: var(--rev-cream, #f5f0eb);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.65;
    margin: 0 0 2.25rem;
    opacity: 0.92;
    max-width: 460px;
}

/* CTA + note */
.rev-stack__event-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.rev-stack__event-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.rev-stack__event-cta i {
    font-size: 0.95em;
}
.rev-stack__event-brochure-note {
    font-family: var(--rev-font-body);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7a7a7a;
}

/* Lien externe esxence.com */
.rev-stack__event-external {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--rev-gold);
    font-family: var(--rev-font-body);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-bottom: 1px solid rgba(234, 200, 128, 0.25);
    padding-bottom: 0.2rem;
    align-self: flex-start;
    transition: color var(--rev-transition), border-color var(--rev-transition);
}
.rev-stack__event-external:hover {
    color: var(--rev-gold-bright, var(--rev-gold));
    border-bottom-color: var(--rev-gold);
}
.rev-stack__event-external i {
    font-size: 0.85em;
}

/* Bloc stand (a reveler plus tard) */
.rev-stack__event-stand {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(234, 200, 128, 0.15);
}
.rev-stack__event-stand-label {
    color: var(--rev-gold);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin: 0 0 0.6rem;
}
.rev-stack__event-stand-number {
    font-family: var(--rev-font-display);
    color: var(--rev-cream, #f5f0eb);
    font-size: 1.4rem;
    letter-spacing: 0.06em;
    margin: 0;
}
.rev-stack__event-stand-zone {
    color: #8a8a8a;
    font-size: 0.85rem;
    margin: 0.3rem 0 0;
}

/* Cascade fade-in supplementaire (nth-child 5/6/7) */
.rev-stack__card--event.is-visible .rev-stack__event-content > .rev-stack__fade-in:nth-child(5) {
    transition-delay: 0.6s;
}
.rev-stack__card--event.is-visible .rev-stack__event-content > .rev-stack__fade-in:nth-child(6) {
    transition-delay: 0.75s;
}
.rev-stack__card--event.is-visible .rev-stack__event-content > .rev-stack__fade-in:nth-child(7) {
    transition-delay: 0.9s;
}

/* --- Responsive : empilement vertical (image au-dessus du contenu) --- */
@media (max-width: 991.98px) {
    .rev-stack__event-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .rev-stack__event-media {
        border-right: none;
        border-bottom: 1px solid rgba(234, 200, 128, 0.18);
        aspect-ratio: 16 / 9;
        max-height: 45vh;
    }
    .rev-stack__event-logo {
        width: clamp(80px, 18vw, 120px);
        left: 1.25rem;
        bottom: 1.25rem;
    }
    .rev-stack__event-content {
        padding: clamp(2rem, 6vw, 3rem) clamp(1.5rem, 5vw, 2.5rem);
        max-width: 100%;
    }
}
@media (max-width: 575.98px) {
    .rev-stack__event-media {
        aspect-ratio: 4 / 3;
        max-height: 40vh;
    }
    .rev-stack__event-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }
    .rev-stack__event-subtitle {
        font-size: 0.95rem;
    }
    .rev-stack__event-info {
        font-size: 0.95rem;
    }
}
