/* Direction D : sobriété de revue + filets épais, tampons et ombres franches de photocopie.
   Un seul accent. Deux thèmes (clair / sombre), automatiques ou choisis. Aucune animation. */

/* ---------- Polices (facultatives) ----------
   Fichiers .ttf dans src/polices/ (voir README). S'ils sont absents, le navigateur utilise
   les polices de secours listées dans les variables plus bas. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/polices/BricolageGrotesque-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Special Elite";
  src: url("/polices/SpecialElite-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Thèmes ---------- */
:root {
  color-scheme: light;
  --papier: #f1f1ec;
  --encre: #181818;
  --sourdine: #55554f;
  --filet: #c9c9c1;
  --surface: #e6e6df;
  --accent: #c4102f;            /* ~5,3:1 sur le papier clair */
  --ombre: #181818;

  --police-texte: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --police-titre: "Bricolage Grotesque", "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  --police-ui: "Helvetica Neue", Arial, "Liberation Sans", system-ui, sans-serif;
  --police-mono: "Special Elite", "American Typewriter", "Courier New", Courier, monospace;

  --colonne: 68ch;
  --marge: clamp(1rem, 4vw, 2.5rem);
}

/* Sombre : papier inversé, noir chaud. L'accent est éclairci pour rester lisible (~6:1). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --papier: #15120f;
    --encre: #f0eadc;
    --sourdine: #b3aa99;
    --filet: #3b352e;
    --surface: #221d18;
    --accent: #ff5c70;
    --ombre: #4a4238;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --papier: #15120f;
  --encre: #f0eadc;
  --sourdine: #b3aa99;
  --filet: #3b352e;
  --surface: #221d18;
  --accent: #ff5c70;
  --ombre: #4a4238;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police-texte);
  line-height: 1.6;
  hyphens: auto;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

.saut {
  position: absolute; left: var(--marge); top: -4rem;
  background: var(--encre); color: var(--papier); padding: .5rem 1rem; font-family: var(--police-ui);
}
.saut:focus { top: .5rem; }

/* ---------- En-tête ---------- */
.entete, main, .pied {
  width: min(100% - 2 * var(--marge), 72rem);
  margin-inline: auto;
}
.entete { border-top: 10px solid var(--encre); padding-top: .75rem; }
.entete__ligne { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; }
.entete__nom {
  font-family: var(--police-titre); font-size: 2.1rem; font-weight: 800; font-stretch: 75%;
  letter-spacing: -.02em; line-height: 1; text-decoration: none;
  text-shadow: 2px 2px 0 var(--accent);
}
.entete__nom:hover { color: inherit; }
.entete ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; margin: 0; padding: 0; font-family: var(--police-ui); font-size: .9rem; }
.entete nav a { text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.entete nav a:hover { border-bottom-color: var(--accent); }
.entete nav a[aria-current="page"] { border-bottom-color: var(--encre); font-weight: 700; }

.entete__bas {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  margin-top: .75rem; padding-bottom: .75rem; border-bottom: 3px solid var(--encre);
}
.mention-ia { margin: 0; font-family: var(--police-mono); font-size: .8rem; color: var(--sourdine); }
.contenu__tete .mention-ia { margin-top: 1rem; }

.theme-bouton {
  font: inherit; font-family: var(--police-mono); font-size: .8rem; color: var(--encre);
  background: var(--papier); border: 1.5px solid var(--encre); padding: .2rem .6rem; cursor: pointer;
  transform: rotate(1deg); box-shadow: 2px 2px 0 var(--ombre);
}
.theme-bouton:hover { color: var(--accent); border-color: var(--accent); }
.theme-bouton[hidden] { display: none; }

/* ---------- Métadonnées, étiquettes, fiabilité ---------- */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 .9rem; color: var(--sourdine); }
time, .meta, .etiquette, .fiabilite { font-family: var(--police-mono); font-size: .82rem; }
time { color: var(--sourdine); }

.etiquette, .meta .fiabilite { padding: .1rem .5rem; border: 1.5px solid currentColor; color: var(--encre); }
.etiquette { display: inline-block; transform: rotate(-1.5deg); }

.fiabilite { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.meta .fiabilite { transform: rotate(1deg); }
.fiabilite__jauge { display: inline-flex; gap: 2px; }
.fiabilite__jauge i { width: .6rem; height: .6rem; border: 1.5px solid currentColor; display: block; }
.fiabilite--solide i,
.fiabilite--partielle i:nth-child(-n+2),
.fiabilite--fragile i:first-child { background: currentColor; }
.fiabilite--fragile, .meta .fiabilite--fragile { color: var(--accent); }

/* ---------- Accueil ---------- */
.une { padding: 2.5rem 0 2rem; border-bottom: 3px solid var(--encre); }
.une__titre {
  max-width: 18ch; margin: 0 0 1rem;
  font-family: var(--police-titre); font-size: clamp(2.5rem, 7.5vw, 5.25rem); line-height: .98;
  font-weight: 800; font-stretch: 75%; letter-spacing: -.02em; text-wrap: balance;
}
.une__titre a { text-decoration: none; }
.une__titre a:hover { color: var(--accent); }
.chapeau { max-width: 52ch; margin: 0; font-size: 1.2rem; line-height: 1.45; }

.bloc { padding: 1.75rem 0; border-bottom: 1px solid var(--filet); }
.bloc h2 {
  display: inline-block; margin: 0 0 1.25rem; padding: .1rem .7rem;
  font-family: var(--police-titre); font-size: 1.25rem; font-weight: 800; font-stretch: 75%;
  background: var(--accent); color: var(--papier); transform: rotate(-1deg);
}
.bloc__suite { margin: 1rem 0 0; font-family: var(--police-ui); font-size: .9rem; }

/* ---------- Listes ---------- */
.liste-breves, .liste-articles, .liste-corrections { list-style: none; margin: 0; padding: 0; }
.liste-breves li, .liste-articles li, .liste-corrections li { padding: .9rem 0; border-top: 1px solid var(--filet); }
.liste-breves li:first-child, .liste-articles li:first-child, .liste-corrections li:first-child { border-top: 0; padding-top: 0; }

.liste-breves li { display: grid; grid-template-columns: 11rem 1fr auto; gap: .25rem 1.5rem; align-items: baseline; }
.liste-breves a { font-weight: 700; }

.liste-articles li, .liste-corrections li { display: grid; gap: .2rem; justify-items: start; }
.liste-articles a, .liste-corrections a {
  font-family: var(--police-titre); font-size: 1.45rem; font-weight: 800; font-stretch: 75%; line-height: 1.15;
}
.liste-articles__resume { color: var(--sourdine); max-width: 60ch; }

/* ---------- Pages simples ---------- */
.page { max-width: var(--colonne); padding: 2.5rem 0 3rem; }
.page h1 { margin: 0 0 1.5rem; font-family: var(--police-titre); font-size: clamp(2.2rem, 6vw, 3.5rem); line-height: 1; font-weight: 800; font-stretch: 75%; letter-spacing: -.02em; }
.page h2 { margin: 2rem 0 .5rem; font-family: var(--police-titre); font-size: 1.5rem; font-weight: 800; font-stretch: 75%; line-height: 1.15; }

/* ---------- Article et brève ---------- */
.contenu { padding: 2.5rem 0 3rem; }
.contenu__tete { max-width: 52rem; }
.contenu h1 {
  margin: 0 0 1rem;
  font-family: var(--police-titre); font-size: clamp(2.3rem, 6vw, 4.25rem); line-height: 1;
  font-weight: 800; font-stretch: 75%; letter-spacing: -.02em; text-wrap: balance;
}
.contenu--breve h1 { font-size: clamp(2rem, 5vw, 3.25rem); }

.demo, .alerte {
  max-width: var(--colonne); margin: 0 0 1.5rem; padding: .75rem 1rem;
  border: 2px solid var(--accent); box-shadow: 4px 4px 0 var(--ombre);
  font-family: var(--police-ui); font-size: .9rem;
}
.alerte { margin-top: 1.5rem; border-left-width: 8px; }

.contenu__corps { display: grid; gap: 2rem; margin-top: 2rem; }
.texte { max-width: var(--colonne); min-width: 0; }
.texte p, .texte ul, .texte ol { margin: 0 0 1.1em; }
.texte h2 { margin: 2em 0 .5em; font-family: var(--police-titre); font-size: 1.75rem; font-weight: 800; font-stretch: 75%; line-height: 1.1; }
.texte blockquote { margin: 1.5em 0; padding-left: 1rem; border-left: 4px solid var(--accent); }
.texte pre, .texte code { font-size: .9em; }
.texte pre { overflow-x: auto; padding: 1rem; background: var(--surface); }
.texte img { display: block; margin: 1.5rem 0 .4rem; }
.texte img + em { display: block; margin-bottom: 1.5rem; font-family: var(--police-mono); font-size: .8rem; color: var(--sourdine); font-style: normal; }

.illustration { margin: 0 0 1.5rem; }
.illustration figcaption { font-family: var(--police-mono); font-size: .8rem; color: var(--sourdine); margin-top: .35rem; }

.avis, .corrections-article {
  margin: 2.25rem 0 0; padding: 1rem 1.25rem; background: var(--surface);
  border: 2px solid var(--encre); box-shadow: 5px 5px 0 var(--ombre);
}
.avis h2, .corrections-article h2 { margin: 0 0 .5rem; font-family: var(--police-mono); font-size: .9rem; font-weight: 400; color: var(--accent); }
.avis p { margin: 0; }
.corrections-article ul { margin: 0; padding-left: 1.1rem; }
.corrections-article time { margin-right: .5rem; }

/* Sources : sous le texte sur mobile, colonne latérale collée sur grand écran */
.sources { min-width: 0; padding-top: 1rem; border-top: 3px solid var(--encre); font-family: var(--police-ui); font-size: .88rem; }
.sources h2 { margin: 0 0 .75rem; font-family: var(--police-titre); font-size: 1.3rem; font-weight: 800; font-stretch: 75%; }
.sources ol { margin: 0; padding-left: 1.25rem; }
.sources li { margin-bottom: .75rem; overflow-wrap: anywhere; }
.sources__detail { display: block; font-family: var(--police-mono); font-size: .78rem; color: var(--sourdine); }
.sources__verif { margin: 1rem 0 0; font-family: var(--police-mono); font-size: .78rem; color: var(--sourdine); }

@media (min-width: 62rem) {
  .contenu__corps { grid-template-columns: minmax(0, var(--colonne)) minmax(14rem, 18rem); gap: 4rem; align-items: start; }
  .sources { position: sticky; top: 1rem; }
}
@media (max-width: 40rem) {
  .liste-breves li { grid-template-columns: 1fr; }
}

/* ---------- Pied ---------- */
.pied { margin-top: 2rem; padding: 1rem 0 2rem; border-top: 3px solid var(--encre); font-family: var(--police-mono); font-size: .8rem; color: var(--sourdine); }
.pied p { margin: 0; max-width: 70ch; }

@media print {
  .entete nav, .theme-bouton, .saut, .pied { display: none; }
  :root { --papier: #fff; --encre: #000; --sourdine: #333; --surface: #eee; --accent: #c4102f; --ombre: #000; }
  .sources { position: static; }
}
