/* Section #process : comparatif « Aujourd’hui / Avec un système » et chaîne de processus. */

/* Texte réservé aux lecteurs d’écran (deux-points des étiquettes, région d’annonce). */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Section sur Paper : texte Encre, focus Iris (le Lumière par défaut ne se voit pas sur fond clair). */
.process { position: relative; background: var(--paper); color: var(--ink); }
.process :focus-visible { outline-color: var(--iris); }
:where(.process) :where(h3, h4, dl, dd) { margin: 0; }

.process-heading { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; column-gap: clamp(32px, 6vw, 96px); }
.process h2 { font-family: Figtree, Arial, sans-serif; font-weight: 400; font-size: clamp(44px, 4.6vw, 76px); letter-spacing: -.05em; line-height: 1.07; max-width: none; text-wrap: balance; }
.process-heading > p { max-width: 46ch; font-size: 18px; line-height: 1.6; color: var(--body); }

/* Comparatif : le problème reste en Encre plein, la réponse passe sur la surface lavande. */
.bottleneck { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); margin-top: clamp(64px, 7vw, 112px); }
.bottleneck-intro h3 { font: 400 clamp(28px, 2.6vw, 40px)/1.1 Figtree, Arial, sans-serif; letter-spacing: -.035em; text-wrap: balance; }
.bottleneck-intro > p { margin-top: 18px; max-width: 44ch; font-size: 17px; line-height: 1.6; color: var(--body); }
.bottleneck-intro > .bottleneck-risks { margin-top: 28px; padding-left: 14px; border-left: 2px solid var(--sand); font-size: 15px; }
.bottleneck-risks span { display: block; margin-bottom: 2px; font-weight: 600; color: var(--ink); }
.bottleneck-head, .bottleneck-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1.15fr); align-items: center; column-gap: 12px; }
.bottleneck-head { padding-bottom: 12px; border-bottom: 1px solid #21193226; font-size: 13px; font-weight: 600; color: var(--depth); }
.bottleneck-head span:last-child { grid-column: 3; padding-left: 16px; }
.bottleneck-list { margin: 0; padding: 0; list-style: none; }
.bottleneck-row { padding: 14px 0; border-bottom: 1px solid #21193226; }
.bottleneck-today { font-size: 16px; line-height: 1.55; color: var(--ink); }
.bottleneck-arrow { display: grid; place-items: center; color: var(--iris); }
.bottleneck-arrow .icon { width: 20px; height: 20px; }
.bottleneck-system { padding: 14px 16px 2px; border-radius: 12px; background: #ebe6f1; }
.bottleneck-system p { font-size: 16px; line-height: 1.55; color: var(--ink); }
.bottleneck-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--depth); text-decoration: underline; text-decoration-color: #392b5966; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.bottleneck-link:focus-visible { outline-offset: 2px; text-decoration-color: currentColor; }
/* Les étiquettes sont lues partout, mais affichées seulement quand l’en-tête de colonnes disparaît. */
@media (min-width: 768px) { .bottleneck-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }

/* Chaîne : grand panneau lavande, panneaux Paper, filets de 1 px. */
.process-chain { margin-top: clamp(64px, 7vw, 112px); padding: clamp(20px, 3vw, 40px); border: 1px solid #7059cb24; border-radius: 24px; background: #ebe6f1; }
.process-chain-top { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.process-chain-top h3 { font: 400 clamp(26px, 2.4vw, 36px)/1.12 Figtree, Arial, sans-serif; letter-spacing: -.03em; }
.process-chain-top div > p { margin-top: 10px; max-width: 58ch; font-size: 15px; line-height: 1.6; color: var(--body); }
.process-badge { flex: none; padding: 5px 10px; border: 1px solid #21193226; border-radius: 8px; font-size: 12px; line-height: 1.5; color: var(--body); }
.process-legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.45; color: var(--body); }
.process-legend li { display: flex; align-items: center; gap: 8px; }
.process-legend strong { font-weight: 600; color: var(--ink); }
.process-legend .icon, .process-column dt .icon { width: 18px; height: 18px; color: var(--depth); }

/* Onglets, bureau : huit stations sur un rail rempli jusqu’à l’étape courante. */
.process-tabs { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin: 30px 0 20px; }
.process-tabs[hidden], .process-stepper[hidden] { display: none; }
.process-rail { position: absolute; top: 23px; left: 6.25%; right: 6.25%; height: 1px; background: #21193226; pointer-events: none; }
/* Le dégradé reste fixé sur toute la chaîne : seule sa part visible avance. */
.process-rail-progress { position: absolute; inset: -.5px 0; background: linear-gradient(90deg, var(--iris), var(--sand)); clip-path: inset(0 calc(100% - var(--process-progress, 0) * 100%) 0 0); }
.process-tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; min-height: 88px; padding: 8px 6px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--body); font-size: 14px; font-weight: 600; line-height: 1.3; text-align: center; overflow-wrap: break-word; }
.process-tab:focus-visible { outline-offset: 3px; }
.process-tab-number { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid #21193233; border-radius: 50%; background: #ebe6f1; font: 12px/1 'JetBrains Mono', monospace; color: var(--depth); }
.process-tab.is-before .process-tab-number { border-color: #7059cb99; }
.process-tab[aria-selected="true"] { color: var(--ink); }
.process-tab[aria-selected="true"] .process-tab-number { scale: 1.08; border-color: var(--deep); background: var(--deep); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .process-tab:not([aria-selected="true"]):hover { background: #f4f3ee99; color: var(--ink); }
  .bottleneck-link:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
}

/* Panneaux : sans JS, à la suite ; avec JS, empilés dans une seule cellule sous un cadre fixe (hauteur stable). */
.process-panels { display: grid; gap: 16px; margin-top: 28px; }
.process-panel { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 2.15fr); gap: clamp(24px, 3vw, 48px); align-content: start; min-width: 0; padding: clamp(20px, 2.6vw, 36px); border: 1px solid #21193214; border-radius: 12px; background: var(--paper); box-shadow: inset 0 1px 0 #fff9, 0 10px 30px #392b5912; }
.process-panels.is-stacked { gap: 0; margin-top: 0; border: 1px solid #21193214; border-radius: 12px; background: var(--paper); box-shadow: inset 0 1px 0 #fff9, 0 10px 30px #392b5912; }
.process-panels.is-stacked > .process-panel { grid-area: 1 / 1; border-color: transparent; background: none; box-shadow: none; }
.process-panels.is-stacked > .process-panel[data-state="inactive"] { visibility: hidden; }
.process-panel:focus-visible { outline: 2px solid var(--iris); outline-offset: 3px; }
.process-panel-index { font: 12px/1.5 'JetBrains Mono', monospace; color: var(--depth); }
.process-panel-title { margin: 10px 0 16px; font: 400 clamp(28px, 2.6vw, 40px)/1.08 Figtree, Arial, sans-serif; letter-spacing: -.035em; }
.process-friction { max-width: 38ch; font-size: 15px; line-height: 1.6; color: var(--body); }
.process-friction-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--ink); }
.process-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.process-column { min-width: 0; padding-left: 16px; border-left: 1px solid #21193220; }
.process-column[data-kind="decision"] { padding-left: 15px; border-left: 2px solid var(--sand); }
.process-column dt { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--depth); }
.process-column dd { padding: 12px 0; border-top: 1px solid #21193214; font-size: 15px; line-height: 1.55; color: var(--ink); overflow-wrap: break-word; }
.process-tag { display: inline-block; margin: 0 6px 4px 0; padding: 1px 7px; border: 1px solid #7059cb40; border-radius: 6px; background: #d6cef066; font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--depth); vertical-align: 1px; }

/* Pas à pas : sous le cadre fixe, le bouton « suivante » ne bouge pas d’une étape à l’autre. */
.process-stepper { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 16px; }
.process-nav { display: inline-flex; align-items: center; gap: 12px; justify-self: start; max-width: 100%; min-height: 52px; padding: 8px 16px; border: 1px solid #21193226; border-radius: 12px; background: #f4f3eeb3; color: var(--ink); text-align: left; }
.process-nav-next { justify-self: end; text-align: right; }
.process-nav-text { min-width: 0; }
.process-nav-hint { display: block; font-size: 12px; line-height: 1.4; color: var(--body); }
.process-nav-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; }
.process-nav .icon { width: 20px; height: 20px; }
.process-nav:disabled { cursor: default; }
.process-nav.is-unavailable { visibility: hidden; }
.process-stepper-count { font: 12px/1 'JetBrains Mono', monospace; color: var(--depth); }
@media (hover: hover) and (pointer: fine) { .process-nav:hover { background: var(--paper); border-color: #7059cb59; } }

.process-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; margin-top: clamp(40px, 4vw, 56px); }
.process-bottom p { max-width: 62ch; font-size: 15px; line-height: 1.6; color: var(--body); }
.process-bottom strong { font-weight: 600; color: var(--ink); }

/* Tablette : grille d’onglets 4 × 2 ; le rail devient une jauge sous la grille. */
@media (max-width: 1099px) {
  .bottleneck { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .process-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .process-rail { position: relative; inset: auto; order: 1; grid-column: 1 / -1; height: 2px; margin-top: 4px; border-radius: 2px; overflow: hidden; }
  .process-rail-progress { inset: 0; clip-path: inset(0 calc(100% - var(--process-ratio, 0) * 100%) 0 0); }
  .process-tab { align-items: flex-start; gap: 8px; min-height: 52px; padding: 10px 12px; border-color: #21193226; text-align: left; }
  .process-tab-number { width: 26px; height: 26px; }
  .process-tab[aria-selected="true"] { border-color: var(--deep); background: var(--deep); color: var(--paper); }
  .process-tab[aria-selected="true"] .process-tab-number { scale: none; border-color: #f4f3ee66; background: transparent; }
  .process-panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .process-heading { grid-template-columns: minmax(0, 1fr); }
  .process-heading > p { margin-top: 28px; }
}
@media (max-width: 767px) {
  .process-columns { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .bottleneck-head { display: none; }
  .bottleneck-row { grid-template-columns: minmax(0, 1fr); row-gap: 10px; padding: 18px 0; }
  .bottleneck-arrow { display: none; }
  .bottleneck-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--depth); }
  .bottleneck-system { padding: 14px 14px 2px; }
}
/* Mobile : grille 2 × 4, numéros en simple séquence pour garder des cases compactes. */
@media (max-width: 600px) {
  .process h2 { font-size: clamp(38px, 11vw, 46px); }
  .process-heading > p { font-size: 16px; line-height: 1.65; }
  .bottleneck { margin-top: 56px; }
  .bottleneck-intro > p, .bottleneck-today, .bottleneck-system p { font-size: 16px; }
  .process-chain { margin: 56px -8px 0; padding: 18px 14px 16px; border-radius: 16px; }
  .process-chain-top { flex-direction: column; gap: 12px; }
  .process-legend { flex-direction: column; gap: 8px; }
  .process-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 24px 0 16px; }
  .process-tab { gap: 4px; min-height: 56px; padding: 8px 10px; }
  .process-tab-number { display: block; width: auto; height: auto; border: 0; background: none; line-height: 1.4; }
  .process-tab[aria-selected="true"] .process-tab-number { color: var(--mist); }
  .process-panel { gap: 20px; padding: 20px 16px; }
  .process-column dd { font-size: 16px; }
  .process-stepper { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 8px; }
  .process-stepper-count { display: none; }
  .process-nav { width: 100%; gap: 8px; padding-inline: 12px; }
  .process-bottom { flex-direction: column; align-items: flex-start; }
}
/* Très petits écrans : le libellé écrit porte le sens, la flèche décorative s’efface. */
@media (max-width: 360px) { .process-nav .icon { display: none; } }

/* Mouvement : réponses de 120 à 240 ms, rail en 400 ms, aucune boucle. */
@media (prefers-reduced-motion: no-preference) {
  .process-rail-progress { transition: clip-path var(--duration-panel) var(--ease-standard); }
  .process-tab { transition: color var(--duration-feedback) var(--ease-standard), background-color var(--duration-feedback) var(--ease-standard), border-color var(--duration-feedback) var(--ease-standard), scale var(--duration-press) var(--ease-standard); }
  .process-tab-number { transition: color var(--duration-feedback) var(--ease-standard), background-color var(--duration-feedback) var(--ease-standard), border-color var(--duration-feedback) var(--ease-standard), scale var(--duration-ui) var(--ease-standard); }
  .process-nav { transition: background-color var(--duration-feedback) var(--ease-standard), border-color var(--duration-feedback) var(--ease-standard), scale var(--duration-press) var(--ease-standard); }
  .process-nav .icon, .bottleneck-arrow .icon { transition: translate var(--duration-ui) var(--ease-standard); }
  .bottleneck-system { transition: background-color var(--duration-feedback) var(--ease-standard); }
  .bottleneck-link { transition: text-decoration-color var(--duration-feedback) var(--ease-standard); }
  .process-tab:active, .process-nav:not(:disabled):active { scale: .98; }
  .bottleneck-row:focus-within .bottleneck-arrow .icon { translate: 3px -3px; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .process-nav-next:hover .icon { translate: 3px 0; }
  .process-nav-prev:hover .icon { translate: -3px 0; }
  .bottleneck-row:hover .bottleneck-arrow .icon { translate: 3px -3px; }
  .bottleneck-row:hover .bottleneck-system { background: #e4dcef; }
}

/* Couleurs forcées : les fonds disparaissent. L’onglet courant garde un contour
   Highlight doublé et un libellé souligné ; focalisé, il garde son anneau de focus
   habituel au lieu du trait intérieur. Le rail avance en Highlight plein. */
@media (forced-colors: active) {
  .process-tab[aria-selected="true"] { border-color: Highlight; }
  .process-tab[aria-selected="true"]:not(:focus-visible) { outline: 1px solid Highlight; outline-offset: -2px; }
  .process-tab[aria-selected="true"] .process-tab-label { text-decoration: underline 2px; text-underline-offset: 4px; }
  .process-rail-progress { forced-color-adjust: none; background: Highlight; }
}

/* Mouvement réduit et impression : état final complet, sans cadrage ni décalage résiduels. */
@media (prefers-reduced-motion: reduce), print {
  .process-chain { clip-path: none !important; }
  .process-heading > p, .bottleneck-intro > p, .bottleneck-row, .process-bottom, .process-panel, .process-panel-head, .process-column { opacity: 1 !important; translate: none !important; }
}
@media print {
  .process-tabs, .process-stepper, .process-live { display: none !important; }
  .process-chain { padding: 0; border: 0; background: none; }
  .process-panels.is-stacked { gap: 12px; margin-top: 20px; border: 0; background: none; box-shadow: none; }
  .process-panels.is-stacked > .process-panel { grid-area: auto; visibility: visible !important; border-color: #0f0e1733; }
  .process-panel { box-shadow: none; break-inside: avoid; }
  .bottleneck-row { break-inside: avoid; }
  .bottleneck-system { border: 1px solid #0f0e1733; background: none; }
}
