/*
 * Guides ciblup.com/guides (run 3, mode lecture). Charger /css/tokens.css, /css/base.css PUIS /css/guides.css.
 * Direction : page de lecture blanche, sans carte ; un filet irisé sous le H1 comme seule couleur ; encadré « Avec Ciblup »
 * bordé --line ; sources numérotées en bas ; aucune image décorative ; un seul bouton plein (Télécharger pour Mac).
 * Aucune valeur de couleur ici : tout vient de tokens.css. Aucun script : le sommaire est en double (replié sous 1100 px,
 * colonne à droite au-dessus), l'un des deux est masqué par la largeur.
 */

/* ---------- Gabarit ---------- */

.l-read {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.read-head { border-bottom: 1px solid var(--line); }
.read-head-in,
.read {
  width: 100%;
  max-width: calc(var(--doc-w) + var(--sp-12) * 9);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
.read-head-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: calc(var(--hit) + var(--sp-4));
}
.read-nav { list-style: none; padding: 0; display: flex; gap: var(--sp-1); }
.read-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  padding: 0 var(--sp-3);
  border-radius: var(--r-control);
  font-size: var(--text-md);
  color: var(--mute);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.read-nav a:hover { background: var(--hover); color: var(--ink); }
.read-nav a[aria-current="page"] { color: var(--ink); font-weight: var(--w-strong); }

.read {
  flex: 1 0 auto;
  padding-block: var(--sp-8) var(--sp-12);
  /* Le texte courant des guides est à 18 px : les « ch » de la colonne se calculent sur cette taille. */
  font-size: var(--text-xl);
  line-height: var(--lh-body);
}
.read-foot { padding: var(--sp-6) var(--sp-4) var(--sp-8); border-top: 1px solid var(--line); }

/* ---------- En-tête d'un guide : fil d'Ariane, H1, filet irisé, date ---------- */

.crumbs ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--sp-1);
  font-size: var(--text-md);
  color: var(--mute);
}
.crumbs li { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  color: var(--ink);
}
.crumbs [aria-current="page"] { overflow-wrap: anywhere; }

.guide-head { max-width: 66ch; }
.guide-head h1 {
  margin-top: var(--sp-2);
  font-size: var(--text-title);
}
/* Filet irisé de 3 px (direction run 3, pièce 4) : la seule couleur de la page, jamais sous du texte. */
.guide-head h1::after {
  content: "";
  display: block;
  width: calc(var(--sp-12) * 2);
  height: 3px;
  margin-top: var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--iri);
}
.guide-head .lead,
.byline { margin-top: var(--sp-4); }
.byline { font-size: var(--text-md); color: var(--mute); font-variant-numeric: tabular-nums; }

/* ---------- Corps : colonne de 66 caractères, sommaire à droite dès 1100 px ---------- */

.guide-grid { margin-top: var(--sp-8); }
.guide-body { min-width: 0; max-width: 66ch; }

.essentiel {
  padding: var(--sp-6);
  background: var(--side);
  border-radius: var(--r-card);
}
.essentiel h2 { font-size: var(--text-lg); letter-spacing: normal; }
.essentiel p { margin-top: var(--sp-2); }

.toc-fold { margin-top: var(--sp-6); }
.toc-side { display: none; }

.prose { max-width: none; margin-top: var(--sp-10); }
.prose h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  scroll-margin-top: var(--sp-6);
}
.prose > section + *,
.prose > aside + *,
.prose > nav + * { margin-top: var(--sp-12); }
.prose section > * + *,
.prose aside > * + *,
.prose nav > * + * { margin-top: var(--sp-4); }
.prose section > h2 + * { margin-top: var(--sp-3); }
.prose ul, .prose ol { padding-left: var(--sp-6); }
.prose li + li { margin-top: var(--sp-2); }
.prose li::marker { color: var(--mute); font-variant-numeric: tabular-nums; }

/* Appel de source [n] : lien vers la source, en ligne dans la phrase. */
.ref {
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
  text-decoration-thickness: 1px;
  white-space: nowrap;
}

/* Tableaux : seul le tableau défile en largeur sur petit écran, jamais la page. */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  scrollbar-color: var(--line-strong) transparent;
}
.table-scroll table {
  width: 100%;
  min-width: calc(var(--sp-12) * 10);
  border-collapse: collapse;
  font-size: var(--text-md);
  line-height: var(--lh-body);
  font-variant-numeric: tabular-nums;
}
.table-scroll th,
.table-scroll td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.table-scroll thead th { background: var(--side); font-weight: var(--w-strong); color: var(--ink-2); }
.table-scroll tbody tr:last-child td { border-bottom: 0; }

/* Modèle d'e-mail à trous. */
.model {
  margin: 0;
  padding: var(--sp-6);
  background: var(--side);
  border-radius: var(--r-card);
  font-size: var(--text-lg);
}
.model > * + * { margin-top: var(--sp-3); }

/* FAQ : question en titre court, réponse dessous. */
.faq h3 { font-size: var(--text-lg); margin-top: var(--sp-6); }
.faq h3 + p { margin-top: var(--sp-2); }

/* Encadré « Avec Ciblup » : bordé --line, sans fond ni couleur. */
.with-ciblup {
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.with-ciblup h2 { font-size: var(--text-xl); }

/* Sources numérotées : la cible d'un appel [n] est marquée d'un fond Brume. */
.sources ol { font-size: var(--text-md); color: var(--ink-2); }
.sources li { overflow-wrap: anywhere; scroll-margin-top: var(--sp-6); border-radius: var(--r-control); }
.sources li:target { background: var(--hover); outline: var(--sp-1) solid var(--hover); }
.sources a { color: var(--ink); }

.also ul { list-style: none; padding: 0; }
.also li + li { margin-top: 0; }
.also a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
}

/* Un seul bouton plein, en bas. */
.read-cta {
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-6);
}
.read-cta .btn .icon { stroke-width: 1.75; }
.read-cta .help { font-size: var(--text-md); color: var(--mute); }

/* Sommaire en colonne (≥ 1100 px) : collé en haut pendant la lecture. */
.toc-side-title { font-size: var(--text-md); font-weight: var(--w-strong); padding: 0 var(--sp-3); }
.toc-side ol { list-style: none; padding: 0; margin-top: var(--sp-2); }
.toc-side a {
  display: flex;
  align-items: center;
  min-height: var(--hit);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-control);
  font-size: var(--text-md);
  line-height: var(--lh-tight);
  color: var(--mute);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.toc-side a:hover { background: var(--hover); color: var(--ink); }

@media (min-width: 1100px) {
  .guide-head h1 { font-size: calc(var(--text-title) + var(--sp-2)); }
  .guide-grid {
    display: grid;
    grid-template-columns: minmax(0, 66ch) minmax(calc(var(--sp-12) * 5), 1fr);
    gap: var(--sp-12);
    align-items: start;
  }
  .toc-fold { display: none; }
  .toc-side {
    display: block;
    position: sticky;
    top: var(--sp-6);
    padding-left: var(--sp-6);
    border-left: 1px solid var(--line);
  }
}

/* ---------- Page /guides : trois groupes ---------- */

.read-index .guide-head { max-width: var(--doc-w); }
.guide-groups {
  margin-top: var(--sp-10);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--sp-12) * 5)), 1fr));
  gap: var(--sp-10) var(--sp-8);
}
.guide-group h2 { font-size: var(--text-xl); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.guide-group ul { list-style: none; padding: 0; }
.guide-group li { padding-block: var(--sp-4); border-bottom: 1px solid var(--line); }
.guide-group li > a {
  display: inline-block;
  padding-block: var(--sp-1);
  font-family: var(--font-display);
  font-weight: var(--w-display);
  font-size: var(--text-lg);
  line-height: var(--lh-tight);
  text-decoration: none;
}
.guide-group li > a:hover { text-decoration: underline; }
.guide-group li > p { font-size: var(--text-md); color: var(--mute); }

/* ---------- 390 ---------- */

@media (max-width: 479px) {
  .read-head-in, .read { padding-inline: var(--sp-4); }
  .read { padding-block: var(--sp-6) var(--sp-10); }
  .essentiel, .with-ciblup, .model { padding: var(--sp-4); }
  .read-cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .read-nav a, .toc-side a { transition: none; }
}
