/* ══════════════════════════════════════════════════════════════
   QUATRE — EXPERTISE DETAIL PAGES (v2)
   Inspiration Collins : fond clair, images contenues,
   blocs colorés en cartes arrondies flottantes
   ═════════════════════════════════════════════════════════════ */

html, body { background: var(--bg); }

/* ═══════════════════════════════════════
   PAGE HEADER — label + titre au-dessus du visuel
   ═══════════════════════════════════════ */
.ed-page-header {
  padding: calc(var(--nav-h) + clamp(48px,5vw,80px)) var(--pad-x) clamp(28px,3vw,44px);
}

.ed-page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: center; /* tous sur la même ligne horizontale */
}

/* Colonne 1 : bouton Retour (cols 1–2) */
.ed-ph-back {
  grid-column: 1 / 3;
}

/* Neutralise le margin-bottom de .cs-back hérité de case-study.css
   (prévu pour la sidebar, pas pour ce header horizontal) */
.ed-ph-back .cs-back {
  margin-bottom: 0;
  align-self: auto; /* annule flex-start positionné dans case-study.css */
}

/* Colonne 2 : label "Expertise" (cols 3–5) */
.ed-ph-label {
  grid-column: 3 / 6;
}

/* Colonne 3 : titre seul (cols 6–13) — le sous-titre est en dehors du grid */
.ed-ph-title {
  grid-column: 6 / 13;
}

/* Sous-titre : aligné sous la colonne du titre (col 6 → fin) */
.ed-page-header-sub {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  padding-top: 10px;
}

.ed-page-header-sub .ed-page-sub {
  grid-column: 6 / 13;
}

.ed-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "GTFlexaMono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 14px;
  transition: color 0.2s ease, gap 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.ed-back-link:hover {
  color: var(--text-dark);
  gap: 10px;
}

.ed-page-label {
  font-family: "GTFlexaMono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  padding-bottom: 4px;
}

.ed-page-title {
  font-family: "Spectral", Georgia, serif;
  font-size: var(--headline-xl-size);
  line-height: var(--headline-xl-lh);
  font-weight: 400;
  color: var(--text-dark);
}

.ed-page-sub {
  margin-top: 10px;
  font-size: var(--text-base-size);
  line-height: var(--text-base-lh);
  color: var(--muted);
  max-width: 44ch;
}

/* ═══════════════════════════════════════
   HERO VISUEL — .cta contenu avec marges
   ═══════════════════════════════════════ */
.ed-hero-wrap {
  padding: 0 var(--pad-x) clamp(56px,5.5vw,96px);
}

/* Override cta pour être contenu, pas plein-écran */
.ed-hero-cta.cta {
  max-width: var(--max-width);
  margin: 0 auto;
  border-radius: var(--radius);
  min-height: 480px;
  overflow: hidden;
  /* clip-path garantit l'arrondi même sur les enfants position:absolute imbriqués */
  clip-path: inset(0 round var(--radius));
}

/* Overlay uniforme — remplace le dégradé par défaut */
.ed-hero-cta .carousel-overlay {
  background: rgba(0, 0, 0, 0.42);
}

/* Titre + eyebrow en bas à gauche, alignés avec le bouton CTA */
.ed-hero-cta .cta-bottom-inner {
  align-items: flex-end;
}

.ed-hero-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ed-hero-bottom-left h1 {
  font-family: "Spectral", Georgia, serif;
  font-size: var(--headline-xl-size);
  line-height: var(--headline-xl-lh);
  font-weight: 400;
  color: #ffffff;
}

.ed-hero-eyebrow {
  font-family: "GTFlexaMono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(255,255,255,0.6);
}

/* Masque le cta-center hérité si jamais présent sur ces pages */
.ed-hero-cta .cta-center {
  display: none;
}

/* ═══════════════════════════════════════
   INTRO — services + grande description
   ═══════════════════════════════════════ */
.ed-intro {
  padding: 0 var(--pad-x) clamp(56px,5.5vw,96px);
}

.ed-intro-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: start;
}

.ed-intro-left {
  grid-column: 1 / 4; /* 3 colonnes */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ed-intro-label {
  font-family: "GTFlexaMono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 16px;
  display: block;
}

.ed-services-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ed-services-list li {
  padding: 11px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-lh);
  color: var(--text-dark);
}

.ed-services-list li:first-child {
  border-top: 1px solid rgba(0,0,0,0.07);
}

.ed-intro-description {
  grid-column: 6 / 12; /* démarre col 6, 6 colonnes de large */
  font-family: "Spectral", Georgia, serif;
  font-size: clamp(22px,1.65vw,30px);
  line-height: clamp(34px,2.4vw,44px);
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.01em;
}

/* ── Scroll reveal — color + opacity driven by JS ── */
.reveal-word {
  color: var(--muted);
  opacity: 0.15; /* initial state: faint grey */
  transition: color 0.18s ease, opacity 0.18s ease;
}

/* ═══════════════════════════════════════
   CARTES CONTENUES — red / dark / light
   chaque bloc = fond de page + carte flottante
   ═══════════════════════════════════════ */
.ed-card-section {
  padding: 0 var(--pad-x) clamp(32px,3vw,48px);
}

.ed-card {
  max-width: var(--max-width);
  margin: 0 auto;
  border-radius: var(--radius);
  /* overflow:hidden supprimé — il casse position:sticky sur .ed-card-left */
  padding: clamp(40px,3.5vw,64px) clamp(32px,3vw,56px);
}

.ed-card--brand {
  background: var(--brand);
  color: #ffffff;
}

.ed-card--dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.ed-card--light {
  background: #ffffff;
  color: var(--text-dark);
}

.ed-card-inner {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(40px,4vw,72px);
  align-items: start;
}

.ed-card-left {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ed-card-label {
  font-family: "GTFlexaMono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  opacity: 0.6;
}

.ed-card-title {
  font-family: "Spectral", Georgia, serif;
  font-size: var(--headline-lg-size);
  line-height: var(--headline-lg-lh);
  font-weight: 400;
}

.ed-card-sub {
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-lh);
  opacity: 0.6;
  max-width: 30ch;
}

/* ─── Liste features (carte rouge) ─── */
.ed-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ed-features-list li {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: var(--text-base-size);
  line-height: var(--text-base-lh);
  color: #ffffff;
}

.ed-features-list li:last-child {
  border-bottom: none;
}

.ed-features-num {
  font-family: "GTFlexaMono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.4;
  flex-shrink: 0;
  width: 20px;
  margin-top: 4px;
}

/* ─── FAQ accordion (carte sombre) ─── */
.ed-accordion-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ed-accordion-item {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ed-accordion-item:last-child {
  border-bottom: none;
}

.ed-accordion-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-light);
  text-align: left;
  padding: 20px 0;
  font-size: var(--text-base-size);
  line-height: var(--text-base-lh);
  font-family: "Inter", Arial, sans-serif;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  transition: opacity 0.2s;
}

.ed-accordion-btn:hover { opacity: 0.75; }

.ed-accordion-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), border-color 0.2s;
}

.ed-accordion-item.is-open .ed-accordion-icon {
  transform: rotate(45deg);
  border-color: rgba(255,255,255,0.45);
}

.ed-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}

.ed-accordion-item.is-open .ed-accordion-body {
  grid-template-rows: 1fr;
}

.ed-accordion-body-inner { overflow: hidden; }

.ed-accordion-text {
  padding-bottom: 22px;
  color: rgba(255,255,255,0.52);
  font-size: var(--text-sm-size);
  line-height: clamp(22px,1.5vw,26px);
}

/* ─── Challenges (carte blanche) ─── */
.ed-challenges-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ed-challenges-list li {
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-size: var(--text-base-size);
  line-height: var(--text-base-lh);
}

.ed-challenges-list li:last-child {
  border-bottom: none;
}

.ed-challenge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 9px;
  flex-shrink: 0;
}

.ed-challenge-text strong {
  display: block;
  font-weight: 500;
  margin-bottom: 3px;
}

.ed-challenge-text span {
  color: var(--muted);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-lh);
}

/* ═══════════════════════════════════════
   KPI SLIDER — contenu dans max-width
   ═══════════════════════════════════════ */
.ed-kpi {
  padding: 0 var(--pad-x) clamp(32px,3vw,48px);
}

.ed-kpi-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.ed-kpi-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.ed-kpi-label {
  font-family: "GTFlexaMono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.ed-kpi-title {
  font-family: "Spectral", Georgia, serif;
  font-size: var(--headline-lg-size);
  line-height: var(--headline-lg-lh);
  font-weight: 400;
  color: var(--text-dark);
}

.ed-kpi-track-wrap {
  position: relative;
  margin: 0 calc(-1 * var(--pad-x));
}

.ed-kpi-track-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: linear-gradient(to left, var(--bg), transparent);
  z-index: 2;
  pointer-events: none;
}

.ed-kpi-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  /* Aligne les deux bords avec le max-width des autres blocs */
  padding-top: 0;
  padding-bottom: 8px;
  padding-left:  max(var(--pad-x), calc((100vw - var(--max-width)) / 2));
  padding-right: max(var(--pad-x), calc((100vw - var(--max-width)) / 2));
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}

.ed-kpi-track::-webkit-scrollbar { display: none; }
.ed-kpi-track.is-dragging { cursor: grabbing; scroll-behavior: auto; }

.ed-kpi-track .cs-outcome-card {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   SECTIONS ARTICLES & REBOND
   Exactement comme la home page
   ═══════════════════════════════════════ */
.ed-home-section {
  padding: var(--section-pad-y) var(--pad-x);
}

.ed-home-section .container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.ed-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 34px;
}

.ed-section-head-left { max-width: 50%; }

.ed-eyebrow {
  font-family: "GTFlexaMono", monospace;
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-lh);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.ed-section-title {
  font-family: "Spectral", Georgia, serif;
  font-size: var(--headline-lg-size);
  line-height: var(--headline-lg-lh);
  font-weight: 400;
  color: var(--text-dark);
}

/* Grille actus — identique à la home (définie dans home.css, répliquée ici) */
.actus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Grille 3 colonnes pour le rebond (vs 4 sur la home) */
.ed-expert-3cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Grille cas liés ── */
.ed-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ed-related-grid .cs-card {
  aspect-ratio: 4 / 3;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .ed-page-header-inner {
    grid-template-columns: 1fr 1fr;
    row-gap: 16px;
  }
  /* Sur tablette : Retour seul en haut sur toute la largeur,
     puis label + titre côte à côte */
  .ed-ph-back    { grid-column: 1 / -1; }
  .ed-ph-label   { grid-column: 1 / 2; }
  .ed-ph-title   { grid-column: 2 / 3; }

  .ed-page-header-sub {
    grid-template-columns: 1fr 1fr;
  }
  .ed-page-header-sub .ed-page-sub {
    grid-column: 2 / 3;
  }

  .ed-intro-inner,
  .ed-card-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ed-intro-left,
  .ed-intro-description {
    grid-column: 1 / -1;
  }

  .ed-card-left { position: static; }

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

  .ed-expert-3cols {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 640px) {
  .ed-hero-cta.cta { min-height: 360px; }

  .ed-kpi-track .cs-outcome-card { width: 300px; }

  /* Mobile : tout empilé en colonne */
  .ed-page-header-inner {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }
  .ed-ph-back,
  .ed-ph-label,
  .ed-ph-title { grid-column: 1 / -1; }

  .ed-page-header-sub {
    grid-template-columns: 1fr;
  }
  .ed-page-header-sub .ed-page-sub {
    grid-column: 1 / -1;
  }

  .actus-grid {
    grid-template-columns: 1fr;
  }

  .ed-expert-3cols {
    grid-template-columns: 1fr;
  }

  .ed-related-grid {
    grid-template-columns: 1fr;
  }

  .ed-section-head-left { max-width: 100%; }
}
