/* Infra Society, le guide « Chiffrer un projet d'énergie » (site/bibliotheque/chiffrer-un-projet-d-energie.html ;
   refonte, bloc B8, construit en avance sur la branche refonte-b1).

   C'est le style que la page portait dans un bloc <style> (le gabarit de Maël, référence du 16/09), sorti dans cette
   feuille (P-38 : une feuille par page) sans rien changer au dessin, sauf ce qui suit :
   - tout est porté par body.ch-guide (aucune règle nue, P-42 ; plus de :root ni de règle sur body, a, p, h1-h3 hors du
     guide) : l'en-tête et le pied de la charpente n'en reçoivent rien ; les variables vivent sur body.ch-guide ;
   - dix classes renommées « guide-… » parce qu'elles existent aussi dans commun/styles/site.css (P-43) ;
   - contrastes relevés (fiche B8, § 9 ; 4,5 pour 1 au moins) : orange des liens, des mots-clés du code, de
     « Attention » et des badges (#d94a00 → #b94c0d, l'orange « texte » de la charpente) ; commentaires du code
     (#8b8c90 → #66676b) ; texte encre sur l'orange des en-têtes de tableau, des ronds et des numéros (le blanc faisait
     2,87 pour 1 : DEC-97) ;
   - non reprises, parce que plus aucun élément ne les porte : .barre, .barre a, .barre img, .rubrique,
     .ouverture .rubrique et le « footer » de l'ancien pied (refonte/ETAT-B1.md, § 6) ;
   - survols coupés sous « mouvement réduit ».
   Le thème de Prism (coloration du code) est gardé tel quel, contrastes à part. */

body.ch-guide {
  --papier: #fff; --papier-doux: #f6f6f4; --encre: #16171a; --gris: #6e6f73; --filet: #e4e4e2;
  --orange: #ff6a00; --orange-t: #b94c0d; --orange-clair: #fff0e5;
  --bleu: #2d3bff; --bleu-t: #2436e0; --bleu-clair: #eceeff; --vert: #00b368; --vert-t: #00804f; --vert-clair: #e3f8ee;
  --sans: "Inter", Arial, sans-serif; --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  margin: 0; background: var(--papier);
}
body.ch-guide :where(.colonne), body.ch-guide :where(.colonne) * { box-sizing: border-box; }
body.ch-guide .guide-sprite { position: absolute; }   /* les symboles d'ECTO et des flèches (autrefois un style en ligne) */
body.ch-guide .colonne { width: min(100% - 40px, 680px); margin-inline: auto; color: var(--encre); font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }

/* ouverture : ECTO debout au-dessus du titre */
body.ch-guide .guide-ouverture { display: flex; align-items: flex-end; gap: 16px; margin-top: 56px; }
body.ch-guide .guide-ouverture svg { width: 58px; height: auto; flex-shrink: 0; }

body.ch-guide :where(.colonne) h1, body.ch-guide :where(.colonne) h2, body.ch-guide :where(.colonne) h3 { font-weight: 400; margin: 0; text-wrap: balance; }
body.ch-guide :where(.colonne) h1 { font-size: clamp(34px, 5.4vw, 48px); line-height: 1.06; letter-spacing: -.025em; font-weight: 300; margin-top: 22px; }
body.ch-guide .guide-chapeau { margin-top: 20px; font-size: 19px; line-height: 1.55; color: #3a3b3f; }
body.ch-guide :where(.colonne) h2 {
  display: flex; align-items: center; gap: 14px; font-size: clamp(26px, 3.6vw, 32px); line-height: 1.14; letter-spacing: -.02em;
  margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--filet);
}
/* les numéros se posent dans le corps d'ECTO, à la place des yeux */
body.ch-guide .guide-n { position: relative; flex-shrink: 0; width: 42px; height: 37px; color: var(--orange); }
body.ch-guide .guide-n svg { position: absolute; inset: 0; width: 100%; height: 100%; }
body.ch-guide .guide-n b { position: absolute; left: 53%; top: 61%; transform: translate(-50%, -50%); font: 600 15px/1 var(--sans); color: var(--encre); }
body.ch-guide h2 .guide-n { align-self: center; }
body.ch-guide :where(.colonne) h3 { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 500; line-height: 1.3; margin-top: 34px; }
body.ch-guide h3 .rond {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--orange); color: var(--encre); font: 600 13px/1 var(--sans); font-variant-numeric: tabular-nums;
}
body.ch-guide :where(.colonne) p { margin: 14px 0 0; }
body.ch-guide :where(.colonne) strong { font-weight: 500; }
body.ch-guide .guide-etiquette { font-weight: 500; }

body.ch-guide :where(.colonne) ul { list-style: none; margin: 14px 0 0; padding: 0; }
body.ch-guide :where(.colonne) ul li { position: relative; padding-left: 22px; margin-top: 8px; }
body.ch-guide :where(.colonne) ul li::before { content: ""; position: absolute; left: 0; top: .66em; width: 8px; height: 8px; background: var(--orange); }

body.ch-guide :where(.colonne) a { color: var(--orange-t); text-decoration: none; border-bottom: 1px solid rgba(255, 106, 0, .45); transition: border-color .2s; }
body.ch-guide :where(.colonne) a:hover { border-bottom-color: var(--orange-t); }
body.ch-guide .guide-fl { display: inline-block; width: 14px; height: 10px; margin: 0 7px; vertical-align: .02em; color: var(--orange); }

/* encadrés : Repère bleu, Attention orange, Astuce vert */
body.ch-guide .encadre { margin-top: 26px; padding: 18px 22px 20px; background: var(--bleu-clair); border-left: 4px solid var(--bleu); border-radius: 0 10px 10px 0; --c: var(--bleu); }
body.ch-guide .encadre.attention { background: var(--orange-clair); border-color: var(--orange); --c: var(--orange-t); }
body.ch-guide .encadre.guide-astuce { background: var(--vert-clair); border-color: var(--vert); --c: var(--vert-t); }
body.ch-guide .encadre .guide-titre { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 500; }
body.ch-guide .encadre .guide-titre svg { width: 20px; height: auto; color: var(--c); flex-shrink: 0; }
body.ch-guide .encadre .guide-titre .type { font: 600 11.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
body.ch-guide .encadre > p:not(.guide-titre), body.ch-guide .encadre ul { margin-top: 10px; }
body.ch-guide .encadre :is(p, li) { font-size: 16px; }
body.ch-guide .encadre ul li::before { background: var(--c); }
body.ch-guide .encadre pre { background: var(--papier); }

/* code */
body.ch-guide :where(.colonne) code { font: 400 .84em/1.5 var(--code); background: var(--papier-doux); border: 1px solid var(--filet); border-radius: 5px; padding: 1px 5px; }
body.ch-guide :where(.colonne) pre { margin: 16px 0 0; background: var(--papier-doux); border: 1px solid var(--filet); border-radius: 10px; padding: 18px 20px; overflow-x: auto; }
body.ch-guide :where(.colonne) pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.75; white-space: pre; }
body.ch-guide pre.prompt code { white-space: pre-wrap; }
body.ch-guide .token.keyword, body.ch-guide .token.builtin { color: var(--orange-t); }
body.ch-guide .token.string { color: var(--vert-t); }
body.ch-guide .token.number, body.ch-guide .token.boolean { color: var(--bleu-t); }
body.ch-guide .token.function, body.ch-guide .token.class-name { color: var(--encre); font-weight: 500; }
body.ch-guide .token.comment { color: #66676b; }
body.ch-guide .token.operator, body.ch-guide .token.punctuation { color: var(--gris); }

/* la fiche */
body.ch-guide .guide-fiche { margin-top: 24px; overflow-x: auto; }
body.ch-guide :where(.colonne) table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
body.ch-guide :where(.colonne) th { background: var(--orange); color: var(--encre); font: 600 14px/1.2 var(--sans); text-align: left; padding: 12px 14px; }
body.ch-guide :where(.colonne) th:first-child { border-radius: 8px 0 0 0; }
body.ch-guide :where(.colonne) th:last-child { border-radius: 0 8px 0 0; }
body.ch-guide :where(.colonne) td { padding: 11px 14px; border-bottom: 1px solid var(--filet); vertical-align: top; }
body.ch-guide :where(.colonne) td:first-child { font-weight: 500; white-space: nowrap; }
body.ch-guide td.chiffres { font-variant-numeric: tabular-nums; white-space: nowrap; }
body.ch-guide :where(.colonne) tr:hover td { background: var(--orange-clair); }
body.ch-guide .releve { font: 400 13.5px/1.5 var(--sans); color: var(--gris); margin-top: 10px; }


/* pour aller plus loin : deux cartes aux coins arrondis */
body.ch-guide .suite { margin: 88px 0 24px; }
body.ch-guide .suite .kicker { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; font: 500 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }
body.ch-guide .suite .kicker::before, body.ch-guide .suite .kicker::after { content: ""; flex: 1; height: 1px; background: var(--filet); }
body.ch-guide .ticket { display: block; margin: 0 0 16px; border: 1px solid var(--encre); border-radius: 20px; overflow: hidden; transition: border-color .25s ease; }
body.ch-guide .ticket .dedans {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px 18px 22px; background: var(--papier); color: var(--encre); transition: background .25s ease;
}
body.ch-guide .timbre { flex-shrink: 0; width: 46px; height: 46px; object-fit: cover; display: block; mix-blend-mode: multiply; }
body.ch-guide .guide-corps { flex: 1; min-width: 0; }
body.ch-guide .tete { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
body.ch-guide .guide-nom { font-size: 21px; font-weight: 500; line-height: 1.1; letter-spacing: -.015em; }
body.ch-guide .badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
body.ch-guide .badge {
  font: 500 11px/1 var(--sans); letter-spacing: .04em; color: var(--orange-t); background: var(--orange-clair);
  border: 1px solid transparent; border-radius: 99px; padding: 5px 9px; transition: color .25s, border-color .25s, background .25s;
}
body.ch-guide .desc { display: block; margin-top: 6px; font-size: 14.5px; line-height: 1.45; color: #3a3b3f; transition: color .25s; }
body.ch-guide .fleche {
  flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff;
  transition: transform .25s ease, background .25s, color .25s;
}
body.ch-guide .fleche svg { display: block; width: 14px; height: 14px; }
body.ch-guide .ticket:hover { border-color: var(--orange); }
body.ch-guide .ticket:hover .dedans { background: var(--orange-clair); }
body.ch-guide .ticket:hover .badge { background: #fff; }
body.ch-guide .ticket:hover .fleche { transform: translate(2px, -2px); }
@media (max-width: 560px) {
  body.ch-guide .ticket .dedans { flex-wrap: wrap; align-items: flex-start; gap: 14px; padding: 18px; }
  body.ch-guide .guide-corps { flex-basis: 100%; order: 2; }
  body.ch-guide .fleche { margin-left: auto; }
  body.ch-guide .tete { display: block; }
  body.ch-guide .badges { justify-content: flex-start; margin: 10px 0 0; }
}

/* la date de mise à jour du guide, qui était dans son ancien pied (B1) */
body.ch-guide .mise-a-jour { margin-top: 40px; padding: 22px 0 48px; border-top: 1px solid var(--filet); font: 400 13.5px/1.5 var(--sans); color: var(--gris); }

/* « mouvement réduit » : aucun survol qui bouge (lecture B8, § 4.3) */
@media (prefers-reduced-motion: reduce) {
  body.ch-guide .colonne *, body.ch-guide .colonne *::before, body.ch-guide .colonne *::after { transition: none !important; }
  body.ch-guide .ticket:hover .fleche { transform: none; }
}
