/* =========================================================
   DOCUMENT — les longues pages de lecture du carnet
   /plan · /strategie · /veille
   ---------------------------------------------------------
   Chargée APRÈS carnet.css (qui pose les jetons et la barre
   commune). Modèle : la page « Dossier Reis » — bandeau vert
   sapin, pastille citron devant chaque titre, gras surligné.

   Règle : uniquement les jetons de carnet.css, aucune couleur
   en dur → le sombre suit tout seul (automatique ou forcé).
   Tout est rangé sous .page : rien ne touche la barre commune.
   ========================================================= */

/* ---------- La colonne de lecture ---------- */
.page {
  --gouttiere: clamp(16px, 4vw, 28px);
  box-sizing: border-box;
  max-width: calc(760px + 2 * var(--gouttiere));
  margin: 0 auto;
  padding: 0 var(--gouttiere) 96px;
  color: var(--ink);
  font: 400 17px/1.65 var(--body);
}
.page *, .page *::before, .page *::after { box-sizing: border-box; }
.page :where(h1, h2, h3, p, ul, ol, li, table) { margin: 0; }

/* ---------- 1. Le bandeau (le chapeau de la page) ---------- */
.page .chapeau {
  background: var(--band);
  color: var(--band-ink);
  /* pleine largeur depuis une colonne étroite, sans débordement :
     l'image de bordure déborde à gauche et à droite sans créer de
     défilement, et suit exactement le bord bas du bloc (le couple
     box-shadow + clip-path laissait un liseré d'un pixel) */
  border-image: conic-gradient(var(--band) 0 0) fill 0 / 0 / 0 100vmax;
  padding: clamp(28px, 5vw, 48px) 0 clamp(24px, 4vw, 40px);
}
.page .chapeau .sur {
  margin: 0 0 14px;
  color: var(--citron);
  font: 600 12px/1.35 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.page .chapeau h1 {
  margin: 0 0 16px;
  color: var(--band-ink);
  font: 800 clamp(30px, 5.5vw, 48px)/1.04 var(--display);
  letter-spacing: -.02em;
  text-wrap: balance;
}
.page .chapeau .intro {
  margin: 0;
  max-width: 62ch;
  color: var(--band-ink-2);
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}
.page .chapeau .intro :is(b, strong) {
  color: var(--band-ink);
  font-weight: 600;
  background: none;
  padding: 0;
}
.page .chapeau a {
  color: var(--band-ink);
  text-decoration-color: var(--citron);
}

/* ---------- 2. Titres de section ---------- */
.page h2 {
  margin: clamp(44px, 6vw, 60px) 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font: 700 clamp(23px, .6vw + 21px, 26px)/1.2 var(--display);
  letter-spacing: -.01em;
  text-wrap: balance;
}
.page h2::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 11px;
  border-radius: 3px;
  background: var(--citron);
  box-shadow: 0 0 0 2px var(--band);
  vertical-align: .08em;
}
/* Le premier titre suit le bandeau : pas de filet en double */
.page .chapeau + h2 { margin-top: 40px; padding-top: 0; border-top: 0; }

/* Le numéro de section (.num) passe en surtitre au-dessus du titre ;
   la pastille reste devant le texte, alignée sur sa première ligne. */
.page h2:has(> .num) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 11px;
  align-items: start;
}
.page h2:has(> .num)::before {
  margin: calc((1.2em - 11px) / 2) 0 0;
}
.page h2 > .num {
  order: -1;
  grid-column: 1 / -1;
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font: 600 12px/1.35 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.page h3 {
  margin: 32px 0 8px;
  color: var(--ink);
  font: 600 18px/1.35 var(--body);
  text-wrap: balance;
}

/* ---------- 3. La prose ---------- */
.page p { margin: 14px 0; max-width: 68ch; text-wrap: pretty; }
.page p.note { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.page ul { margin: 14px 0; padding-left: 1.3em; max-width: 68ch; }
.page li { margin: 7px 0; }
.page li::marker { color: var(--accent); }
.page :is(strong, b) { font-weight: 600; }
.page em { font-style: italic; color: var(--ink-2); }

/* Le gras de la prose : surligné citron, comme sur Reis */
.page :is(p, li) strong,
.page p b {
  padding: 0 2px;
  border-radius: 2px;
  background: linear-gradient(transparent 56%, var(--surligne) 56%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  font-weight: 600;
}

.page a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.page code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: .84em;
  overflow-wrap: anywhere;
}

/* ---------- 4. L'encadré important (ex-cadre orange) ---------- */
.page .encadre {
  margin: 28px 0;
  padding: clamp(18px, 3.5vw, 24px) clamp(18px, 4vw, 28px);
  border: 0;
  border-radius: 14px;
  background: var(--band);
  color: var(--band-ink);
}
.page .encadre .t {
  margin: 0 0 10px;
  color: var(--citron);
  font: 600 12px/1.35 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.page .encadre p { margin: 10px 0 0; max-width: 64ch; color: var(--band-ink); }
.page .encadre :is(strong, b) {
  padding: 0;
  background: none;
  color: var(--citron);
  font-weight: 600;
}
.page .encadre code { background: rgba(255, 255, 255, .1); color: var(--band-ink); }

/* ---------- 5. Les cartes : phases du plan, blocs, fiches ---------- */
.page :is(.phase, .bloc) {
  margin: 18px 0;
  padding: clamp(18px, 3.5vw, 24px) clamp(18px, 4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.page :is(.phase, .bloc) h3 {
  margin: 0 0 10px;
  font: 700 20px/1.25 var(--display);
  letter-spacing: -.005em;
}
.page .bloc p b { padding: 0; background: none; color: var(--ink); }

.page .phase .quand {
  margin-bottom: 8px;
  color: var(--accent);
  font: 600 12px/1.4 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.page .phase ul { margin: 12px 0 0; padding-left: 1.2em; }
.page .phase li { margin: 8px 0; max-width: 64ch; font-size: 16px; line-height: 1.6; }
.page .phase .but {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
.page .phase .but b { color: var(--ink); }

/* ---------- 6. Les tableaux ---------- */
/* L'enveloppe défile à l'horizontale sur petit écran ; une ombre
   discrète au bord signale qu'il reste des colonnes à voir. */
.page .defile {
  margin: 22px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background:
    linear-gradient(90deg, var(--ground) 30%, transparent) left center / 36px 100% no-repeat local,
    linear-gradient(270deg, var(--ground) 30%, transparent) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .18), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .18), transparent) right center / 12px 100% no-repeat scroll;
}
.page .defile > table {
  width: 100%;
  border-collapse: collapse;
  font: 400 15px/1.5 var(--body);
  font-variant-numeric: tabular-nums;
}
/* au-delà de deux colonnes, on garde des colonnes lisibles plutôt
   que de les écraser : l'enveloppe défile */
.page .defile > table:has(tr > :nth-child(3)) { min-width: 540px; }
.page .defile > table:has(tr > :nth-child(4)) { min-width: 640px; }

.page th,
.page td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.page tr > :first-child { padding-left: 0; }
.page tr > :last-child { padding-right: 0; }
.page th {
  padding-top: 6px;
  color: var(--ink-2);
  font: 600 12px/1.35 var(--body);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.page td b { color: var(--ink); }
.page :is(th, td).n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Sémantique : fort / oui → positif · faible / non → négatif */
.page :is(.ok, .oui, .fort) { color: var(--positif); font-weight: 600; }
.page :is(.non, .faible) { color: var(--negatif); font-weight: 600; }
.page .att { color: var(--attention); font-weight: 600; }

/* ---------- 7. Le pied ---------- */
.page .pied {
  /* le filet prend toute la colonne, le texte garde une mesure courte */
  max-width: none;
  margin: 64px 0 0;
  padding: 20px max(0px, 100% - 64ch) 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}
.page p.pied :is(b, strong) { padding: 0; background: none; color: var(--ink); }

.page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media print {
  .page .chapeau { border-image: none; padding-inline: 16px; }
  .page .defile { overflow: visible; background: none; }
}
