/* ============================================================
   GUIDES UNIQUEMENT — hub /guides et gabarit d'article (spec
   architecte SEO 11/08). Propriétaire UNIQUE des classes guide-*
   et guides-* (règle « un composant = un fichier »).
   Couleurs/typo/rayons : tokens.css (source de vérité), aucune
   valeur brute hors dimensions structurelles (largeurs, tailles
   rem), comme dans home.css. Chargé APRÈS tokens → composants →
   entete-publique → portail : les surcharges locales (h1, liens)
   sont volontairement scopées .guide / .guides-hub.
   Ton : éditorial calme — la typo travaille, pas la décoration.
   ============================================================ */

/* ============================================================
   1. Article : colonne de lecture
   ------------------------------------------------------------
   ~65-70 caractères par ligne : 700px à 17px avec Satoshi.
   Le texte courant monte à 17px (confort longform, ≥ 16px AA).
   ============================================================ */
.guide {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-4) 0 var(--space-8);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.7;
}

/* ---------- Fil d'Ariane ---------- */
.guide-ariane {
  font-size: var(--text-small);
  color: var(--ink-faint);
  margin-bottom: var(--space-5);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.guide-ariane a {
  color: var(--ink-soft);
  text-decoration: none;
  /* cible tactile : la rangée reste fine visuellement, la zone cliquable non */
  padding: 12px 0;
  margin: -12px 0;
  display: inline-block;
}
.guide-ariane a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.guide-ariane [aria-current="page"] { color: var(--ink-faint); }

/* ---------- Titre, chapeau, signature ---------- */
.guide h1 {
  font-size: clamp(2rem, 4.6vw, 2.7rem); /* plus ample que le h1 portail (1.9rem) */
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-h2);
  line-height: 1.12;
  text-wrap: balance;
  margin-bottom: var(--space-4);
}
.guide-chapeau {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
  text-wrap: pretty;
  margin-bottom: var(--space-4);
}
.guide-date {
  font-size: var(--text-small);
  color: var(--ink-faint);
  margin-bottom: var(--space-6);
}

/* ---------- « En bref » (le bloc que Google cite) ----------
   Encadré calme : filet accent à gauche, fond à peine teinté,
   pas d'aplat criard. */
.guide-enbref {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-field) var(--radius-field) 0;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}
.guide-enbref-titre {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  margin-bottom: var(--space-2);
}
.guide-enbref p { color: var(--ink); font-weight: 500; }

/* ============================================================
   2. Corps de l'article (HTML issu du Markdown)
   ============================================================ */
.guide-corps { color: var(--ink); }

.guide-corps h2 {
  font-size: 1.55rem;
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-h2);
  line-height: 1.2;
  text-wrap: balance;
  margin: var(--space-7) 0 var(--space-4);
}
.guide-corps h3 {
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: 1.3;
  margin: var(--space-6) 0 var(--space-3);
}
/* Un H2 qui ouvre un bloc de corps (après l'encart CTA) ne
   cumule pas sa marge haute avec l'espace du bloc précédent */
.guide-corps > :first-child { margin-top: 0; }
.guide-corps > :last-child { margin-bottom: 0; }

.guide-corps p { margin-bottom: var(--space-4); text-wrap: pretty; }

.guide-corps a {
  font-weight: 700; /* couleur : filet global des liens */
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.guide-corps a:hover { text-decoration-thickness: 2px; }

.guide-corps ul,
.guide-corps ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}
.guide-corps li { margin-bottom: var(--space-2); }
.guide-corps li::marker { color: var(--ink-faint); }

.guide-corps blockquote {
  border-left: 3px solid var(--line);
  padding-left: var(--space-4);
  margin: var(--space-5) 0;
  color: var(--ink-soft);
}
.guide-corps blockquote p:last-child { margin-bottom: 0; }

.guide-corps hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--space-6) 0;
}

.guide-corps img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-card);
  margin: var(--space-5) 0;
}

/* Code : inline discret, blocs qui défilent DANS leur cadre */
.guide-corps code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--space-1);
  padding: 1px 5px;
}
.guide-corps pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
  overflow-x: auto; /* le bloc défile, jamais la page */
}
.guide-corps pre code { background: none; border: none; padding: 0; }

/* Tableaux : sur mobile ils défilent horizontalement dans leur
   propre cadre (display:block + overflow), la page ne bouge pas.
   Deux aides de lecture : la PREMIÈRE COLONNE reste collée (on sait
   toujours de quelle ligne on parle), et des ombres de défilement
   (dégradés à attache locale) signalent qu'il y a du contenu au-delà. */
.guide-corps table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-size: 0.95rem;
  line-height: 1.5;
  background:
    linear-gradient(to right, var(--bg), transparent 18px) left / 100% 100%,
    linear-gradient(to left, var(--bg), transparent 18px) right / 100% 100%,
    radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / 0.14), transparent) left / 14px 100%,
    radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 0.14), transparent) right / 14px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.guide-corps th,
.guide-corps td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  min-width: 96px;
}
.guide-corps th:first-child,
.guide-corps td:first-child {
  position: sticky;
  left: 0;
  background: var(--bg);
  font-weight: 700;
}
.guide-corps th {
  font-weight: 700;
  border-bottom: 2px solid color-mix(in srgb, var(--ink-faint) 45%, var(--line));
  white-space: nowrap;
}

/* ---------- Mobile : chaque ligne devient une carte ----------
   Sous 640px, plus AUCUN défilement horizontal : guides.js pose
   l'intitulé de colonne sur chaque cellule (data-label) et le
   tableau s'empile — première cellule = titre de la carte, les
   autres = « intitulé » puis valeur. */
@media (max-width: 640px) {
  .guide-corps table.table-adaptee {
    background: none;
  }
  .guide-corps .table-adaptee thead { display: none; }
  .guide-corps .table-adaptee,
  .guide-corps .table-adaptee tbody,
  .guide-corps .table-adaptee tr,
  .guide-corps .table-adaptee td { display: block; width: 100%; }
  .guide-corps .table-adaptee tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    background: var(--surface);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
  }
  .guide-corps .table-adaptee td {
    border: none;
    padding: var(--space-2) 0;
    min-width: 0;
  }
  .guide-corps .table-adaptee td:first-child {
    position: static;
    background: none;
    font-size: 1.02rem;
    padding-top: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: var(--space-2);
  }
  .guide-corps .table-adaptee td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    margin-bottom: 2px;
  }
  .guide-corps .table-adaptee td:last-child { padding-bottom: 0; }
}

/* ============================================================
   3. Encarts d'action (sobres, réassurance collée au bouton)
   ============================================================ */

/* ---------- CTA encart (au fil de la lecture) ---------- */
.guide-cta-encart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
}
.guide-cta-encart p {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: var(--space-4);
}
.guide-cta-encart p strong { color: var(--ink); }

/* ---------- CTA final (conclusion, un ton au-dessus) ---------- */
.guide-cta {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  margin: var(--space-7) 0 0;
  text-align: center;
}
.guide-cta h2 {
  font-size: 1.45rem;
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-h2);
  line-height: 1.2;
  text-wrap: balance;
  margin-bottom: var(--space-3);
}
.guide-cta p {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 auto var(--space-5);
  text-wrap: pretty;
}

/* Réassurance : même vue que le bouton, jamais ailleurs (règle
   mise en valeur n° 4). En rangée sur desktop, empilée si étroit. */
.guide-cta-encart .btn,
.guide-cta .btn { margin-right: var(--space-4); }
.guide-cta-note {
  display: inline-block;
  font-size: var(--text-small);
  color: var(--ink-faint);
  padding: var(--space-2) 0;
  vertical-align: middle;
}

/* ============================================================
   4. FAQ (H3 questions + réponses, aérées)
   ============================================================ */
.guide-faq { margin-top: var(--space-8); }
.guide-faq h2 {
  font-size: 1.55rem;
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-h2);
  line-height: 1.2;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.guide-faq h3 {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  margin: var(--space-5) 0 var(--space-2);
}
.guide-faq p { color: var(--ink-soft); }

/* ============================================================
   5. « Sur le même sujet »
   ============================================================ */
.guide-liees { margin-top: var(--space-8); }
.guide-liees h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: var(--space-3);
}
.guide-liees ul { list-style: none; margin: 0; padding: 0; }
.guide-liees li {
  padding: var(--space-4) 0; /* ≥ 44px de zone par entrée */
  border-top: 1px solid var(--line);
}
.guide-liees li:last-child { border-bottom: 1px solid var(--line); }
.guide-liees a {
  display: block;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.guide-liees a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.guide-liee-ligne {
  display: block;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: var(--space-1);
}

/* ============================================================
   6. Hub /guides : groupes par catégorie, scannable
   ============================================================ */
.guides-hub {
  max-width: 700px; /* même colonne que l'article : continuité */
  margin: 0 auto;
  padding: var(--space-4) 0 var(--space-8);
}
.guides-hub h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.4rem);
  line-height: 1.15;
}
.guides-chapeau {
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
  margin-bottom: var(--space-7);
}
.guides-groupe { margin-bottom: var(--space-6); }
.guides-groupe h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
}
.guides-groupe ul { list-style: none; margin: 0; padding: 0; }
.guides-groupe li { border-top: 1px solid var(--line); }
.guides-groupe li:last-child { border-bottom: 1px solid var(--line); }
.guides-groupe a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px; /* règle « l'indicateur respire » */
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-2) var(--space-3) 0; /* ≥ 8px bord droit */
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.guides-groupe a::after {
  content: "→";
  flex-shrink: 0;
  font-weight: 500;
  color: var(--ink-faint);
  transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.guides-groupe a:hover { color: var(--accent-ink); }
.guides-groupe a:hover::after { transform: translateX(4px); color: var(--accent-ink); }

/* ============================================================
   7. Points de rupture (cohérents avec l'existant : 860 / 480)
   ============================================================ */
@media (max-width: 860px) {
  .guide, .guides-hub { padding-top: var(--space-2); }
}
@media (max-width: 480px) {
  .guide { font-size: 1rem; } /* 16px : jamais en dessous */
  .guide h1 { font-size: 1.7rem; }
  .guide-chapeau { font-size: 1.1rem; }
  .guide-corps h2, .guide-faq h2 { font-size: 1.35rem; }
  .guide-enbref { padding: var(--space-4); }
  .guide-cta-encart { padding: var(--space-5); }
  .guide-cta { padding: var(--space-5) var(--space-4); }
  /* Bouton pleine largeur, réassurance dessous (toujours même vue) */
  .guide-cta-encart .btn, .guide-cta .btn {
    display: flex; justify-content: center; width: 100%; margin-right: 0;
  }
  .guide-cta-note { display: block; margin-top: var(--space-2); }
}
