/* =============================================================
   BLOC approach — manifeste pinned 800vh + FLIP image + 4 cartes
   Port fidèle de .approach (maquette 2026-06-10 / process.html, section 04).

   Mécanique pinned viewport (800vh de scroll, viewport sticky 100vh) :
     0.00 → 0.28 : Phase 1 lecture (titre wipe en cascade, image à gauche)
     0.28 → 0.36 : Sortie intro (texte décale gauche, fade, blur)
     0.28 → 0.42 : FLIP image (placeholder → 50vw plein viewport)
     0.32 → 0.45 : Volet bleu nuit remonte du bas
     0.36/0.55/0.72/0.88 → +0.07 : 4 cartes slide R→L (puis zone stable)
   JS : js/blocs/approach.js (desktop ≥1024px). Mobile <1024px : flux vertical.
   La conclusion .section-statement reste animée par scroll-engine.js.
   ============================================================= */

.approach {
  background: var(--c-blue);
  color: #fff;
  position: relative;
  padding-bottom: clamp(60px, 7vw, 100px);
}
/* Wrapper qui définit la hauteur totale de scroll (8 viewports) */
.approach__pin-wrapper {
  position: relative;
  height: 800vh;
}
/* Viewport sticky : reste collé top:0 pendant tout le scroll de la section. */
.approach__viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  background: var(--c-blue);
}
/* Container interne avec overflow:hidden pour clipper volet et cartes */
.approach__viewport-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* --- PHASE 1 : Manifeste fond bleu marine --- */
.approach__intro {
  position: absolute;
  inset: 0;
  padding: clamp(80px, 12vh, 140px) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 5;
  will-change: filter, opacity, transform;
}
.approach__intro .section-num {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-copper);
  margin-bottom: clamp(40px, 6vh, 80px);
}
/* Grille ratio 33/66 — image étroite à gauche, texte large à droite.
   Sort du .wrap parent (left/margin-left) pour dépasser ses 1440px. */
.approach__intro-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  justify-content: center;
  gap: clamp(24px, 2.5vw, 60px);
  align-items: center;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  width: 100vw;
  max-width: 100vw;
  padding: 0 max(clamp(40px, 5vw, 100px), calc((100vw - 1700px) / 2));
}
/* Placeholder image carrée 1:1, largeur fixe, collé à gauche dans sa colonne. */
.approach__intro-photo-placeholder {
  width: clamp(280px, 30vw, 440px);
  aspect-ratio: 1 / 1;
  justify-self: start;
}
/* Texte droite : animé au scroll via vars CSS (translateX + blur + alpha). */
.approach__intro-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  min-width: 0;
  max-width: 100%;
  gap: clamp(20px, 2.5vh, 32px);
  transform: translateX(calc(var(--intro-shift, 0) * 1px));
  opacity: var(--intro-alpha, 1);
  filter: blur(calc(var(--intro-blur, 0) * 1px));
  will-change: transform, opacity, filter;
}
.approach__intro-title {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
  text-align: left;
  width: 100%;
  max-width: 100%;
}
.approach__intro-title .mission-line {
  display: block;
  position: relative;
  overflow: hidden;
  /* height auto + retour à la ligne autorisé : sinon une phrase plus large que
     la colonne texte (ex. « en s'appuyant sur des principes opérationnels » sous
     ~1500px) est rognée à droite — la bande wipe ne couvre que width:100% de la
     colonne. Même correctif que les .mission-line de la home (governance). La
     bande couvre la ligne entière, y compris quand elle passe sur 2 niveaux. */
  height: auto;
  width: 100%;
  max-width: 100%;
  text-align: left;
}
.approach__intro-title .mission-line__phrase {
  display: block;
  position: relative;
  white-space: normal;
  opacity: 0;
  color: #fff;
  text-align: left;
}
.approach__intro-title .mission-line__wipe {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: var(--c-copper);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
  z-index: 2;
}
.approach__intro-title .mission-line__phrase em {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  color: var(--c-copper);
  letter-spacing: -0.01em;
}

/* --- IMAGE PARTAGÉE Phase 1↔2 — fil conducteur (position:fixed permanente) ---
   JS pilote top/left/width/height. z-index 90 (sous header z:100). */
.approach__intro-photo {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  z-index: 90;
  border-radius: 0 0 clamp(140px, 22vw, 380px) 0;
  will-change: transform, top, left, width, height;
  pointer-events: none;
}
/* 4 layers superposés. Volet qui remonte du bas (clip-path inset top 100→0).
   Scale combiné : --phase-zoom (JS, 1.25→1) × scale d'entrée (1.08→1 sur .is-active). */
.approach__intro-photo-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  clip-path: inset(100% 0 0 0);
  transform: scale(calc(var(--phase-zoom, 1.25) * 1.08));
  transition: clip-path 0.9s cubic-bezier(0.24, 0.43, 0.15, 0.97),
              transform 1.4s cubic-bezier(0.24, 0.43, 0.15, 0.97);
  will-change: clip-path, transform;
}
.approach__intro-photo-layer.is-active {
  clip-path: inset(0 0 0 0);
  transform: scale(var(--phase-zoom, 1));
}
/* Layer 0 toujours visible par défaut (image de base) */
.approach__intro-photo-layer[data-card-idx="0"] {
  clip-path: inset(0 0 0 0);
  transform: scale(var(--phase-zoom, 1));
}
.approach__intro-photo-layer[data-card-idx="0"] { z-index: 1; }
.approach__intro-photo-layer[data-card-idx="1"] { z-index: 2; }
.approach__intro-photo-layer[data-card-idx="2"] { z-index: 3; }
.approach__intro-photo-layer[data-card-idx="3"] { z-index: 4; }

/* --- VOLET BLEU NUIT qui remonte par-dessus la Phase 1 --- */
.approach__veil {
  position: absolute;
  inset: 0;
  background: var(--c-blue);
  z-index: 20;
  transform: translateY(100%);
  pointer-events: none;
  will-change: transform;
}

/* --- PHASE 2 : 4 cartes empilées à droite (50% du viewport) --- */
.approach__cards {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  z-index: 25;
}
.approach__card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateX(100%);   /* cachée à droite, JS pilote le slide R→L */
  will-change: transform;
}
.approach__card-content {
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.24, 0.43, 0.15, 0.97);
}
.approach__card.is-content-visible .approach__card-content {
  opacity: 1;
}
.approach__card[data-card-idx="0"] { z-index: 1; }
.approach__card[data-card-idx="1"] { z-index: 2; }
.approach__card[data-card-idx="2"] { z-index: 3; }
.approach__card[data-card-idx="3"] { z-index: 4; }

.approach__card-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 5vw, 90px) clamp(30px, 4vw, 70px);
  gap: clamp(16px, 2.5vh, 32px);
  height: 100%;
  z-index: 2;
}
/* Numéros d'étape masqués (HTML préservé pour réversibilité). */
.approach__card-num {
  display: none;
}
.approach__card-label {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.approach__card-title {
  margin: 0 0 clamp(16px, 2.5vh, 32px) 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.4rem, 4.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: #fff;
}
.approach__card-desc {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.1rem, 1.5vw, 1.6rem);
  line-height: 1.4;
  color: #fff;
  max-width: 36ch;
  margin: 0;
}
.approach__card-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.approach__card-bullets li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(12px, 1.6vh, 20px) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: clamp(0.95rem, 1.05vw, 1.1rem);
  color: #fff;
  cursor: pointer;
  transition: color 0.4s cubic-bezier(0.24, 0.43, 0.15, 0.97);
}
.approach__card-bullets li:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.approach__card-bullets li:hover { color: var(--c-copper); }
.approach__card-bullets svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.4s, transform 0.4s cubic-bezier(0.24, 0.43, 0.15, 0.97);
}
.approach__card-bullets li:hover svg {
  color: var(--c-copper);
  transform: translate(2px, -2px);
}

/* --- Menu "Notre approche :" en bas-gauche, fixed. Affichage piloté par
   .is-visible (opacity + pointer-events). --- */
.approach__menu {
  position: fixed;
  bottom: clamp(20px, 3vh, 40px);
  left: clamp(20px, 3vw, 40px);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--ff-body);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.24, 0.43, 0.15, 0.97);
}
.approach__menu.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.approach__menu-label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 6px;
}
.approach__menu-item {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.25);
  transition: color 0.4s cubic-bezier(0.24, 0.43, 0.15, 0.97);
}
.approach__menu-item.is-active { color: #fff; }
.approach__menu-item:hover { color: rgba(255, 255, 255, 0.7); }

/* Variante "menu sur photo claire" : inverse les couleurs pour rester lisible. */
.approach__menu.is-on-light .approach__menu-label {
  color: rgba(10, 22, 38, 0.5);
}
.approach__menu.is-on-light .approach__menu-item {
  color: rgba(10, 22, 38, 0.45);
}
.approach__menu.is-on-light .approach__menu-item.is-active {
  color: var(--c-blue);
}
.approach__menu.is-on-light .approach__menu-item:hover {
  color: rgba(10, 22, 38, 0.8);
}

/* --- CTA fixed bas-droite — rendu visuel via .btn .btn--ghost-light .btn-shape --- */
.approach__cta {
  position: fixed;
  bottom: clamp(20px, 3vh, 40px);
  right: clamp(20px, 3vw, 40px);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.24, 0.43, 0.15, 0.97);
}
.approach__cta.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.approach__cta.is-on-light {
  border-color: rgba(10, 22, 38, 0.3);
  color: var(--c-blue);
}
.approach__cta.is-on-light:hover {
  border-color: var(--c-copper);
  color: var(--c-copper);
}

/* --- Mobile + tablette (≤1024px) : désactive sticky/FLIP, stack vertical --- */
@media (max-width: 1024px) {

  /* 1. Supprimer l'espace fantôme 800vh */
  .approach__pin-wrapper { height: auto; }

  /* 2. Dé-stickyfier le viewport */
  .approach__viewport {
    position: relative;
    height: auto;
    background: transparent;
  }

  /* 3. viewport-inner : flux colonne */
  .approach__viewport-inner {
    position: relative;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  /* 4. IMAGE STICKY — bandeau collé en haut, fenêtre d'un strip horizontal */
  .approach__intro-photo {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 36vh !important;
    display: block !important;
    overflow: hidden !important;
    border-radius: 0 0 clamp(40px, 12vw, 80px) 0 !important;
    z-index: 20 !important;
    will-change: auto !important;
    pointer-events: none !important;
  }
  .approach__cards { position: relative; z-index: 1; }
  .approach__card { z-index: 1; }

  /* 5. Chaque image = un calque pleine largeur, translaté par JS (i-activeIdx)*100% */
  .approach__intro-photo-layer {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    clip-path: none !important;
    transition: transform 0.5s cubic-bezier(0.65, 0.05, 0, 1) !important;
    object-fit: cover !important;
    display: block !important;
    opacity: 1 !important;
  }
  .approach__intro-photo-layer[data-card-idx="0"],
  .approach__intro-photo-layer[data-card-idx="1"],
  .approach__intro-photo-layer[data-card-idx="2"],
  .approach__intro-photo-layer[data-card-idx="3"] {
    z-index: auto !important;
    clip-path: none !important;
  }

  /* 6. Section intro Phase 1 : masquée en mobile */
  .approach__intro {
    display: none !important;
  }

  /* 7. Volet bleu nuit : masqué */
  .approach__veil { display: none; }

  /* 8. Conteneur des cartes : flux vertical */
  .approach__cards {
    position: relative;
    left: auto;
    width: 100%;
    height: auto;
  }

  /* 9. Chaque carte : flux vertical, sans superposition */
  .approach__card {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    transform: none !important;
    opacity: 1 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .approach__card:first-child { border-top: none; }

  .approach__card.is-approach-active .approach__card-content {
    opacity: 1 !important;
  }
  .approach__card:not(.is-approach-active) .approach__card-content {
    opacity: 0.55 !important;
  }

  /* 10. Contenu card : toujours visible */
  .approach__card-content {
    opacity: 1 !important;
    height: auto !important;
    padding: clamp(32px, 6vw, 56px) var(--gutter, clamp(20px, 5vw, 48px));
    transition: opacity 0.35s ease !important;
  }

  /* 11. Titre card : retour à la ligne autorisé */
  .approach__card-title {
    font-size: clamp(1.6rem, 6vw, 2.6rem);
    white-space: normal;
    margin-bottom: clamp(12px, 2vw, 20px);
  }

  /* 12. Menu et CTA : masqués en mobile */
  .approach__menu, .approach__cta { display: none; }
}
