/**
 * hero-scroll.css — v3 (réplique fidèle du mécanisme Elementor)
 * /votre-theme/css/hero-scroll.css
 */

/* ── 1. Pleine largeur (casse la contrainte Gutenberg) ───────────────────── */
.hs-pin-spacer { max-width: 100% !important; }

.is-layout-constrained > .hs-pin-spacer,
.is-layout-flow > .hs-pin-spacer,
.entry-content > .hs-pin-spacer,
.wp-block-post-content > .hs-pin-spacer,
.wp-site-blocks > .hs-pin-spacer {
  max-width: 100vw !important;
  width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
}

/* ── 2. Pin-spacer : réserve l'espace de scroll ──────────────────────────
   Hauteur = 100vh (shell) + scroll additionnel, gérée en JS         */
.hs-pin-spacer {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* ── 3. Shell : passe en fixed pendant le pin (géré par GSAP) ────────────
   Au repos (avant pin) il est position:relative pour s'afficher
   normalement dans le flux. GSAP bascule en fixed au scroll.       */
.hs-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  background: #000;
  overflow: hidden;
  isolation: isolate;
  box-sizing: border-box;
}

/* Quand GSAP épingle (classe ajoutée en JS) */
.hs-shell.is-pinned {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}

/* ── 4. Wrapper interne ───────────────────────────────────────────────── */
.hs-wrapper { position: absolute; inset: 0; }

/* ── 5. Couche primaire (vidéo + H1) ──────────────────────────────────── */
.hs-primary { position: absolute; inset: 0; z-index: 2; }

.hs-media-wrap {
  position: absolute;
  inset: 0;
  padding: 0.75rem;
  border-radius: 0.75rem;
  overflow: hidden;
  will-change: transform;
  box-sizing: border-box;
  z-index: 1;
}

.hs-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hs-video--placeholder { background: linear-gradient(135deg,#111,#222); }

.hs-overlay-img {
  position: absolute;
  inset: 0 0 -1.5rem;
  width: 100%; height: calc(100% + 1.5rem);
  object-fit: cover;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.hs-primary-content {
  position: absolute; inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(2.5rem, 5vw, 5rem);
  gap: 1.25rem;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,.2) 45%, transparent);
  pointer-events: none;
}
.hs-primary-content > * { pointer-events: auto; }

/* ── 6. Couche secondaire — superposée, opacity 0 au départ ─────────────
   IMPORTANT : pas de visibility:hidden — Elementor utilise opacity
   + pointer-events pour ne jamais "sauter" lors du fade-in        */
.hs-secondary {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.hs-secondary-stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 0.4rem;
  padding: 0.4rem;
  box-sizing: border-box;
}

.hs-sec-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  object-fit: cover;
  border-radius: 0.6rem;
  /* État initial posé en JS (opacity 0, scale 0.85, translateY) */
}
.hs-sec-img--placeholder {
  background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 0.6rem;
}

.hs-sec-title-wrap {
  position: absolute;
  bottom: clamp(2.5rem, 5vw, 5rem);
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  z-index: 2;
  padding: 0 2rem;
}

/* ── 7. Typo ──────────────────────────────────────────────────────────── */
.hs-h1 {
  font-size: clamp(2.2rem, 4.5vw, 5rem);
  font-weight: 700; line-height: 1.06; letter-spacing: -0.03em;
  color: #fff; margin: 0;
}
.hs-h2 {
  font-size: clamp(1.4rem, 2.5vw, 2.8rem);
  font-weight: 600; line-height: 1.15; letter-spacing: -0.02em;
  color: #fff; margin: 0; text-align: center;
  text-shadow: 0 2px 16px rgba(0,0,0,.7);
}
.hs-subtitle {
  font-size: clamp(.95rem, 1.3vw, 1.15rem);
  color: rgba(255,255,255,.62);
  line-height: 1.6; max-width: 44ch; margin: 0;
}

.hs-cta {
  display: inline-flex; align-items: center;
  padding: .82em 1.9em;
  background: #fff; color: #000;
  font-size: 1rem; font-weight: 600;
  text-decoration: none; border-radius: 100px;
  width: fit-content;
  transition: transform .2s, box-shadow .2s;
}
.hs-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,255,255,.18); }

.hs-video-btn {
  position: absolute; bottom: 1.25rem; right: 1.25rem;
  z-index: 10; background: none; border: none;
  cursor: pointer; padding: 0; opacity: 0;
  transition: opacity .4s;
}
.hs-video-btn.is-visible { opacity: 1; }
.hs-video-btn svg { width: 3.5rem; height: 3.5rem; display: block; }

/* ── 8. Mobile : pas d'effet, layout empilé statique ─────────────────── */
@media (max-width: 1024px) {
  .hs-pin-spacer { height: auto !important; }
  .hs-shell { position: relative !important; height: auto !important; overflow: visible !important; }
  .hs-wrapper { position: relative; inset: auto; }
  .hs-primary { position: relative; height: 90vh; min-height: 480px; }
  .hs-secondary {
    position: relative; inset: auto;
    opacity: 1 !important; pointer-events: auto;
    height: 65vw; min-height: 300px;
  }
  .hs-secondary-stage { position: absolute; inset: 0; grid-template-rows: 1fr 1fr; }
  .hs-sec-title-wrap { position: relative; bottom: auto; padding: 1.5rem; background: #000; }
  .hs-h2 { text-align: left; }
  .hs-sec-img { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-secondary { opacity: 1 !important; }
  .hs-sec-img   { opacity: 1 !important; transform: none !important; }
}