/* Fiches dispositif et cas concrets — mise en page éditoriale (couleurs via tokens.css).
   Ruban d'en-tête, repères chiffrés en texte, texte sur une colonne, mécanisme centré et
   agrandi (chaque partie se met en évidence au survol), bénéfices / vigilance sur deux
   colonnes séparées par un filet, étapes enchaînées par des flèches. Aucun encadré. */

/* ---------- en-tête : chapeau et titre à gauche, accroche à droite ---------- */
.fiche-tete { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 12px 48px; align-items: end; margin: 0 0 28px; }
.fiche-tete h1 { margin: 0 !important; }
.fiche-tete .fiche-accroche { margin: 0 0 6px !important; max-width: none !important; }

/* ---------- ruban d'en-tête ---------- */
.fiche-ruban { display: flex; flex-wrap: wrap; border-top: 1px solid var(--text); border-bottom: 1px solid var(--line); margin: 0 0 40px; }
.ruban-item { flex: 1 1 180px; min-width: 0; padding: 16px 24px 16px 0; margin-right: 24px; border-right: 1px solid var(--line); }
.ruban-item:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.ruban-lbl { margin: 0 0 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.ruban-val { margin: 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; color: var(--text); }
.ruban-val svg { width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; }

/* ---------- repères chiffrés : du texte, pas des tuiles ---------- */
.fiche-kpis { display: flex; flex-wrap: wrap; row-gap: 32px; margin: 0 0 52px; }
/* 3 par ligne ; chaque ligne commence sans filet, alignée sur la première ; une ligne incomplète
   s'élargit, ses filets ne prolongent donc pas ceux du dessus (retour du 10/11/2026) */
.kpi { flex: 1 1 30%; min-width: 0; padding: 4px 24px; border-left: 1px solid var(--line); }
.kpi:nth-child(3n+1) { border-left: 0; padding-left: 0; }
/* exactement 4 repères : une seule ligne */
.kpi:first-child:nth-last-child(4), .kpi:first-child:nth-last-child(4) ~ .kpi { flex-basis: 20%; }
.kpi:first-child:nth-last-child(4) ~ .kpi:nth-child(4) { border-left: 1px solid var(--line); padding-left: 24px; }
.kpi-val { margin: 0 0 6px; font-size: var(--fs-2xl); font-weight: 600; line-height: 1.1; ; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-lbl { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }

/* ---------- texte courant sur une colonne ---------- */
.fiche-texte { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 48px; margin: 0 0 56px; }
.fiche-texte .ft-main > h2:first-child, .fiche-texte .ft-side > h3:first-child { margin-top: 0 !important; }
.fiche-texte .ft-side { border-left: 1px solid var(--line); padding-left: 48px; }
.fiche-texte .ft-side h3 { margin: 22px 0 10px !important; }
.fiche-texte .ft-side h3:first-child { margin-top: 0 !important; }
/* paragraphe d'introduction ou de perspectives d'un cas : une seule colonne (retour du 10/11/2026) */
.fiche-lead { max-width: 860px !important; }
/* perspectives : jusqu'au bord droit de la page, comme les étapes et le schéma (retour du 12/11/2026) */
.fiche-lead.fiche-perspectives { max-width: none !important; }

/* ---------- mécanisme : centré, agrandi, parties mises en évidence au survol ---------- */
.fiche-meca { max-width: 760px; margin: 0 auto 64px; padding-top: 32px; border-top: 1px solid var(--line); text-align: center; }
.fiche-meca > h2 { text-align: center; margin-bottom: 22px !important; }
.meca-part { border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 18px 22px; transition: border-color .18s, background-color .18s; }
.meca-part:hover, .meca-part:focus-within { border-color: var(--accent); background: var(--tint); }
.meca-fort { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.meca-fort:hover { background: var(--dark-2); border-color: var(--accent); }
.meca-titre { margin: 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
.meca-sous { margin: 4px 0 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--text-2); }
.meca-fort .meca-sous { color: var(--on-dark-2); }
.meca-fleche { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.3; }
.meca-fleche svg { width: 14px; height: 30px; flex: none; }
.meca-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.meca-row .meca-part { flex: 1 1 160px; min-width: 0; padding: 14px 16px; }
.meca-row .meca-titre { font-size: var(--fs-md); }
.meca-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.meca-warn .meca-sous { color: var(--warn-text); }
.meca-ok { background: var(--tint); border-color: var(--line-2); color: var(--primary); }
.meca-ok .meca-sous { color: var(--primary); }
.meca-note { margin: 16px 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); text-align: left; }

/* ---------- deux colonnes de texte séparées par un filet ---------- */
.fiche-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px 48px; margin: 0 0 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.fiche-2col .col { min-width: 0; }
.fiche-notes .col { font-size: var(--fs-sm); }
@media (min-width: 721px) { .fiche-2col .col + .col { border-left: 1px solid var(--line); padding-left: 48px; } }

/* ---------- étapes enchaînées : 3 par ligne (retour du 10/11/2026) ---------- */
.fiche-etapes { --eg: 64px; --er: 56px; list-style: none; margin: 0 0 56px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--eg); row-gap: var(--er); }
.etape { min-width: 0; position: relative; display: flex; flex-direction: column; gap: 8px; }
.etape-n { font-size: var(--fs-2xl); font-weight: 600; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.etape h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
.etape p { margin: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
/* étapes numérotées, sans flèche (13/11) ; exactement 4 étapes (fiches dispositifs) : une seule ligne */
.fiche-etapes:has(> .etape:nth-child(4):last-child) { --eg: 56px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .fiche-etapes { display: flex; flex-direction: column; gap: 20px; }
  .etape { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; padding: 0; }
  .etape-n { grid-row: 1 / span 3; }
  .etape h3, .etape p { grid-column: 2; }
}
@media (max-width: 720px) {
  .fiche-meca { padding-top: 24px; }
  .fiche-tete, .fiche-texte { grid-template-columns: minmax(0, 1fr); }
  .fiche-texte .ft-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .fiche-texte, .fiche-meca, .fiche-tete { padding-left: 0 !important; padding-right: 0 !important; }
  .fiche-kpis { flex-direction: column; row-gap: 0; }
  .fiche-kpis > .kpi { border-left: 0 !important; padding: 12px 0 !important; }
  .kpi + .kpi { border-top: 1px solid var(--line); }
  .ruban-item { flex-basis: 100%; border-right: 0; margin-right: 0; padding: 12px 0; }
  .ruban-item + .ruban-item { border-top: 1px solid var(--line); }
}

/* ---------- cas concrets : figure et encadré latéral sans boîte ---------- */
.fiche-figure { margin: 0 0 48px; text-align: center; }
.fiche-figure img { margin: 0 auto; }
.fiche-figure-row { display: flex; flex-wrap: wrap; gap: 28px 40px; align-items: center; justify-content: center; }
.fiche-aside { flex: 1 1 280px; min-width: 0; border-top: 1px solid var(--text); padding-top: 18px; }

/* schémas des cas concrets au format des fiches dispositifs (retour du 10/11/2026) */
.fiche-meca > h3 { margin: 0 0 22px; text-align: center; font-size: var(--fs-xl); font-weight: 600; color: var(--primary-2); }
.meca-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.meca-col-titre { margin: 0 0 12px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.meca-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.meca-detail .meca-part { padding: 10px 12px; }
.meca-detail .meca-titre { font-size: var(--fs-sm); }
.meca-detail .meca-sous { font-size: var(--fs-xs); }
@media (max-width: 720px) {
  .meca-cols { grid-template-columns: minmax(0, 1fr); }
  .meca-cols > div + div { border-top: 1px solid var(--line); padding-top: 20px; }
}
/* flèche à libellé : la flèche reste dans l'axe, le libellé se place à sa droite */
.meca-fleche { position: relative; min-height: 42px; }
.meca-fleche span { position: absolute; left: calc(50% + 14px); top: 50%; transform: translateY(-50%); max-width: calc(50% - 14px); text-align: left; }

/* carte de localisation dans « Caractéristiques du projet » */
.aside-corps { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-start; }
.aside-corps > div { flex: 1 1 170px; min-width: 0; }
.fiche-carte { flex: 0 0 150px; width: 150px; height: auto; }
.fiche-carte .fc-pays { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; stroke-linejoin: round; }
.fiche-carte .fc-site { fill: var(--primary); stroke: var(--surface); stroke-width: 1.5; }
