/* ====================================================================
   Le blog de kyy42.com : gabarit des articles et de leur index (blog.py).
   Lit /site.css, la feuille de l'accueil, et ne la modifie jamais : tout
   ici est préfixé .billet ou .blog. Mêmes jetons, mêmes polices, même vert
   réservé aux grands titres et aux aplats ; le texte reste à l'encre.
   ==================================================================== */

/* Le ruban fixe de l'accueil ne vient pas sur le blog (EKKO, 10/10/2026) : la page ne lui réserve rien. */
:root { --ruban-h: 0px; }

.billet {
  display: block;
  padding-top: clamp(28px, 4.4vw, 72px);
  --lecture: 640px;
}

/* ------------------------------ tête ---------------------------------- */

/* Sur l'accueil le logo est un texte ; ici il ramène à l'accueil, sans soulignement. */
.entete a.logo { text-decoration: none; }

.billet__ariane ol { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 15px; line-height: 1.4; color: var(--muet-petit); }
.billet__ariane li { min-width: 0; }
.billet__ariane li:not(:last-child)::after { content: "/"; margin-left: 10px; color: var(--muet); }
.billet__ariane a { color: inherit; }
.billet__ariane a:hover { color: var(--encre); }
.billet__ariane [aria-current] { color: var(--encre); }

.billet__cocon { margin-top: clamp(32px, 4.4vw, 64px); color: var(--muet-petit); }

.billet__titre {
  max-width: 21ch;
  margin-top: clamp(12px, 1.4vw, 20px);
  font-family: var(--f-titre);
  font-size: clamp(40px, 5.4vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--vert);
}

.billet__meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: clamp(20px, 2.2vw, 32px); font-size: 15px; line-height: 1.5; color: var(--muet-petit); }
.billet__meta > span:not(:last-child)::after { content: "·"; margin: 0 10px; }
.billet__tete .billet__meta > span:first-child { color: var(--encre); font-weight: 500; }

/* -------------------------- encadrés ---------------------------------- *
 * La forme maison du cartel et du bouton : deux angles opposés coupés, un
 * filet vert d'un pixel. Mêmes trois pièces que sur l'accueil : ombre
 * intérieure pour les côtés, deux barrettes tournées pour les diagonales.   */

.billet__etiquette {
  font-size: var(--t-sur);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muet-petit);
}

/* « En bref », « Bon à savoir » et « À retenir » : le même cartel, sans aplat. */
.billet__bref,
.billet__encadre {
  --filet: 1px;
  position: relative;
  max-width: var(--lecture);
  padding: clamp(22px, 2.4vw, 34px) clamp(22px, 2.8vw, 40px);
  background: var(--papier);
  box-shadow: inset 0 0 0 var(--filet) var(--vert);
  clip-path: polygon(-2px calc(var(--coupe) + 1.5px), calc(var(--coupe) + 1.5px) -2px, calc(100% + 2px) -2px, calc(100% + 2px) calc(100% - var(--coupe) - 1.5px), calc(100% - var(--coupe) - 1.5px) calc(100% + 2px), -2px calc(100% + 2px));
}
.billet__bref { margin-top: clamp(32px, 3.6vw, 52px); }
.billet__bref::before,
.billet__bref::after,
.billet__encadre::before,
.billet__encadre::after {
  content: "";
  position: absolute;
  width: calc(var(--coupe) * 1.41421);
  height: calc(var(--filet) + 0.35px);
  background: var(--vert);
  rotate: -45deg;
  pointer-events: none;
}
.billet__bref::before,
.billet__encadre::before { left: 0; top: var(--coupe); transform-origin: 0 0; }
.billet__bref::after,
.billet__encadre::after { right: 0; bottom: var(--coupe); transform-origin: 100% 100%; }
.billet__bref .billet__etiquette,
.billet__encadre .billet__etiquette { color: var(--vert); }
.billet__bref p + p { margin-top: 10px; font-size: clamp(18px, 17px + 0.3vw, 21px); line-height: 1.55; }

/* Dans la colonne de texte, sur toute sa largeur. */
.billet__figure { margin-top: clamp(40px, 5vw, 80px); }
/* Le blanc du dessin se fond dans le papier : aucun bord de cadre. */
.billet__figure img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.billet__figure figcaption { margin-top: 10px; font-size: 14px; line-height: 1.4; color: var(--muet-petit); }

/* ----------------------- sommaire et corps ---------------------------- */

.billet__grille {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  margin-top: clamp(40px, 5vw, 80px);
}

.billet__sommaire { max-width: var(--lecture); padding-block: 18px 22px; border-block: 1px solid var(--trait); }
.billet__sommaire ol { margin-top: 12px; counter-reset: sommaire; display: grid; gap: 8px; }
.billet__sommaire li { counter-increment: sommaire; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); font-size: 16px; line-height: 1.35; }
.billet__sommaire li::before { content: counter(sommaire, decimal-leading-zero); color: var(--vert); font-variant-numeric: tabular-nums; }
.billet__sommaire a { color: var(--encre); width: fit-content; }
.billet__sommaire a:hover { color: var(--vert); }

@media (min-width: 1100px) {
  .billet__grille { grid-template-columns: minmax(220px, 300px) minmax(0, var(--lecture)); gap: clamp(48px, 6vw, 120px); }
  .billet__sommaire { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - var(--ruban-h) - 48px); overflow-y: auto; }
}

.billet__corps { min-width: 0; max-width: var(--lecture); font-size: var(--t-corps); line-height: 1.65; }
.billet__corps > * + * { margin-top: 1.1em; }
.billet__corps h2 {
  margin-top: clamp(56px, 6vw, 88px);
  font-family: var(--f-titre);
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--vert);
  scroll-margin-top: 24px;
}
.billet__corps h2:first-child { margin-top: 0; }
.billet__corps h3 { margin-top: 2em; font-size: clamp(19px, 18px + 0.3vw, 22px); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.billet__corps h2 + *, .billet__corps h3 + * { margin-top: 0.7em; }
.billet__corps strong { font-weight: 600; }
.billet__corps a { color: var(--encre); text-decoration: underline; text-decoration-color: var(--vert); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.billet__corps a:hover { color: var(--vert); }

.billet__corps ul > li,
.billet__corps ol > li { position: relative; padding-left: 1.6em; }
.billet__corps ul > li + li,
.billet__corps ol > li + li { margin-top: 0.45em; }
/* Une puce carrée : le pixel du petit agent du logo. */
.billet__corps ul > li::before { content: ""; position: absolute; left: 0.2em; top: 0.68em; width: 6px; height: 6px; background: var(--vert); }
.billet__corps ol { counter-reset: liste; }
.billet__corps ol > li { counter-increment: liste; }
.billet__corps ol > li::before { content: counter(liste) "."; position: absolute; left: 0; color: var(--vert); font-weight: 600; font-variant-numeric: tabular-nums; }

.billet__corps blockquote { padding-left: 1em; border-left: 2px solid var(--vert); font-family: var(--f-titre); font-size: 1.35em; line-height: 1.3; }

.billet__tableau { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.billet__tableau table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.billet__tableau th,
.billet__tableau td { padding: 12px 18px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--trait); }
.billet__tableau th { font-size: var(--t-sur); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--encre); }
.billet__tableau td:first-child { font-weight: 500; }

/* Sous 600 px, un rang devient une carte : chaque valeur sous le libellé de sa colonne, sans défilement. */
@media (max-width: 599px) {
  .billet__tableau { overflow: visible; }
  .billet__tableau table,
  .billet__tableau tbody,
  .billet__tableau tr,
  .billet__tableau td { display: block; width: 100%; min-width: 0; }
  .billet__tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .billet__tableau tr { padding-block: 16px 18px; border-top: 1px solid var(--encre); }
  .billet__tableau tr:last-child { border-bottom: 1px solid var(--trait); }
  .billet__tableau td { padding: 0; border: 0; }
  .billet__tableau td + td { margin-top: 10px; }
  .billet__tableau td::before {
    content: attr(data-libelle);
    display: block;
    margin-bottom: 2px;
    font-size: var(--t-sur);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muet-petit);
  }
}

.billet__encadre { margin-block: 2em; }
.billet__encadre p + p { margin-top: 8px; }

.billet__corps .billet__figure { margin-block: 2.2em; }

/* Typographie posée au build (typo_fr.py) : « 1er » en exposant, « casse-t-elle » jamais coupé. */
.billet sup { font-size: 0.68em; line-height: 0; vertical-align: 0.5em; }
.insecable { white-space: nowrap; }

/* --------------------------- appel ------------------------------------ *
 * Plus sur les articles (le pied vert suffit, EKKO 10/10/2026) ; gardé pour
 * les pages de service montées par pages.py sur ce gabarit.               */

.billet__appel {
  margin-top: clamp(64px, 7vw, 112px);
  padding: clamp(32px, 4vw, 56px) clamp(24px, 4vw, 56px);
  background: var(--vert);
  color: var(--papier);
  font-weight: 500;
}
.billet__appel-titre { font-family: var(--f-titre); font-size: clamp(32px, 3.6vw, 54px); font-weight: 400; line-height: 1.02; letter-spacing: -0.02em; }
.billet__appel p + p { margin-top: 14px; max-width: 46ch; }
.billet__appel .bouton { margin-top: clamp(24px, 2.6vw, 36px); }

/* ------------------- pied du maillage descendant ---------------------- *
 * Les articles parus du même cocon, posés par blog.py à chaque parution. */

.billet__suite { margin-top: clamp(56px, 6vw, 88px); padding-top: 18px; border-top: 1px solid var(--encre); }
.billet__corps .billet__suite ul { margin-top: 12px; }
.billet__corps .billet__suite a { text-decoration: none; }
.billet__corps .billet__suite a:hover { color: var(--vert); }

/* ---------------------------- index ----------------------------------- */

.blog__lead { max-width: 46ch; margin-top: clamp(16px, 1.8vw, 24px); font-size: clamp(19px, 18px + 0.4vw, 24px); line-height: 1.45; }
.blog__liste { margin-top: clamp(48px, 6vw, 96px); border-bottom: 1px solid var(--trait); }
.blog__entree { display: grid; gap: 10px; padding-block: clamp(28px, 3vw, 44px); border-top: 1px solid var(--trait); max-width: 92ch; }
.blog__entree h2 { font-family: var(--f-titre); font-size: clamp(30px, 3.4vw, 50px); line-height: 1.02; letter-spacing: -0.02em; }
.blog__entree h2 a { color: var(--vert); }
.blog__entree p { max-width: 68ch; }
.blog__entree .billet__meta { margin-top: 0; }

/* Le pied de l'accueil suit l'article : il garde son écart, sans le doubler. */
.billet-page .pied { margin-top: clamp(80px, 9vw, 160px); }
