/* Le choc libéral-égalitaire — feuille de style de la maquette (novembre 2026)
   Identité reprise de la couverture : blanc, noir, rouge Odile Jacob, capitales étroites. */

:root {
  --paper: #ffffff;
  --paper-2: #f6f4f1;
  --ink: #1b1a19;
  --muted: #625d58;
  --rule: #e4e0da;
  --red: #ed1b24;          /* rouge de la couverture */
  --red-ink: #c0141b;      /* rouge des liens (contraste AA sur blanc) */
  --tint: #fdf1f0;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);

  --f-display: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-text: "Iowan Old Style", "Palatino Linotype", "Sitka Text", Cambria, Georgia, serif;
  --f-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 44rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131313;
    --paper-2: #1c1b1a;
    --ink: #ecebe8;
    --muted: #a7a29c;
    --rule: #2e2c2a;
    --red: #ff3b3b;
    --red-ink: #ff6f69;
    --tint: #2a1716;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5);
  }
  .cover { filter: brightness(.92); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 0; }
.red { color: var(--red); }

/* ---------- Mot-symbole ---------- */
.wordmark {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: condensed;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
  white-space: nowrap;
}
.wordmark.small { font-size: 1rem; }

/* ---------- En-tête ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.head-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.site-nav { display: flex; gap: 1.25rem; font-family: var(--f-ui); font-size: .9rem; margin-left: auto; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--red-ink); }

/* ---------- Recherche ---------- */
.search { position: relative; font-family: var(--f-ui); }
.search input {
  width: 15rem; font: inherit; font-size: .9rem; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px;
  padding: .45rem .9rem;
}
.search input:focus { outline: none; border-color: var(--red); background: var(--paper); }
.search.big { margin: 1.5rem 0 2rem; max-width: var(--measure); }
.search.big input { width: 100%; font-size: 1.05rem; padding: .8rem 1.2rem; }
.results {
  position: absolute; right: 0; top: calc(100% + .4rem); width: min(34rem, 92vw);
  max-height: 70vh; overflow: auto; background: var(--paper);
  border: 1px solid var(--rule); border-radius: .6rem; box-shadow: var(--shadow); z-index: 30;
}
.search.big .results { left: 0; right: auto; width: 100%; }
.results a { display: block; padding: .7rem 1rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.on { background: var(--paper-2); }
.results .r-t { font-weight: 600; display: block; }
.results .r-c { font-size: .78rem; color: var(--red-ink); text-transform: uppercase; letter-spacing: .04em; }
.results .r-x { font-family: var(--f-text); font-size: .88rem; color: var(--muted); display: block; margin-top: .15rem; }
.results mark { background: var(--tint); color: inherit; padding: 0 .1em; }
.results .none { padding: .8rem 1rem; color: var(--muted); font-size: .9rem; }

/* ---------- Accueil ---------- */
.hero { border-bottom: 1px solid var(--rule); }
.hero-inner { display: grid; grid-template-columns: minmax(14rem, 22rem) 1fr; gap: clamp(2rem, 6vw, 5rem); padding-top: clamp(2rem, 6vw, 4.5rem); padding-bottom: clamp(2rem, 6vw, 4.5rem); align-items: start; }
.cover { width: 100%; box-shadow: var(--shadow); border: 1px solid var(--rule); }
.author, .booktitle, .subtitle {
  font-family: var(--f-display); font-weight: 700; font-stretch: condensed; text-transform: uppercase; margin: 0;
}
.author { font-size: 1.15rem; letter-spacing: .04em; }
.booktitle { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: .95; margin: .6rem 0 .8rem; letter-spacing: .005em; }
.booktitle span { display: block; }
.subtitle { text-transform: none; font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.15; font-weight: 600; }
.pub { font-family: var(--f-ui); font-size: .9rem; color: var(--muted); margin: .9rem 0 1.6rem; }
.blurb { max-width: 38rem; }
.blurb p { margin: 0 0 .9rem; }
.cta { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  font-family: var(--f-ui); font-weight: 600; font-size: .95rem; text-decoration: none;
  background: var(--red); color: #fff; padding: .7rem 1.25rem; border-radius: .35rem; border: 1px solid var(--red);
}
.btn:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { color: var(--red-ink); border-color: var(--red-ink); }

.block { padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: .5rem; }
.block-title {
  font-family: var(--f-display); font-weight: 700; font-stretch: condensed; text-transform: uppercase;
  font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.05; margin: 0 0 1rem;
}
.block-title::before { content: ""; display: block; width: 2.5rem; height: 4px; background: var(--red); margin-bottom: .8rem; }
.lead { max-width: var(--measure); font-size: 1.12rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.two p { max-width: 34rem; }
.more { font-family: var(--f-ui); font-weight: 600; font-size: .95rem; }
.more::after { content: " →"; }
.author-block { padding-bottom: 3rem; }
.author-block p { max-width: var(--measure); }

.chapters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.chapters li { border-bottom: 1px solid var(--rule); }
.chapters a {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
  padding: 1rem .25rem; color: var(--ink); text-decoration: none;
}
.chapters a:hover { background: var(--paper-2); }
.chapters a:hover .ch-title { color: var(--red-ink); }
.ch-num { font-family: var(--f-display); font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--red); text-align: center; }
.ch-txt { display: flex; flex-direction: column; }
.ch-kick { font-family: var(--f-display); font-weight: 700; font-stretch: condensed; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
.ch-title { font-size: 1.2rem; line-height: 1.3; }
.ch-meta { font-family: var(--f-ui); font-size: .8rem; color: var(--muted); text-align: right; line-height: 1.4; }

/* ---------- Pages de chapitre ---------- */
.chap-head { padding: clamp(1.8rem, 5vw, 3.2rem) 0 clamp(1.4rem, 3vw, 2rem); border-bottom: 1px solid var(--rule); }
.kicker { font-family: var(--f-ui); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .9rem; }
.chap-num { font-family: var(--f-display); font-weight: 700; font-stretch: condensed; text-transform: uppercase; color: var(--red); font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1; letter-spacing: .02em; margin: 0 0 .45rem; }
.kicker a { color: var(--muted); text-decoration: none; }
.kicker a:hover { color: var(--red-ink); }
.chap-head h1 {
  font-family: var(--f-display); font-weight: 700; font-stretch: condensed; text-transform: uppercase;
  font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1; margin: 0; max-width: 52rem; letter-spacing: .005em;
}
.chap-meta { font-family: var(--f-ui); font-size: .9rem; color: var(--muted); margin: .8rem 0 0; }

.chap-grid { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); padding-top: 2rem; }
.chap-body { max-width: var(--measure); min-width: 0; }

.toc { position: sticky; top: 5.5rem; align-self: start; max-height: calc(100vh - 7rem); overflow: auto; font-family: var(--f-ui); font-size: .84rem; line-height: 1.35; padding-right: .5rem; }
.toc summary { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; color: var(--muted); cursor: pointer; list-style: none; padding: .2rem 0 .6rem; }
.toc summary::-webkit-details-marker { display: none; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; }
.toc-list a, .toc-list .off { display: flex; justify-content: space-between; align-items: baseline; gap: .7rem; padding: .22rem 0; text-decoration: none; }
.toc-list a { color: var(--ink); }
.toc-list a:hover .toc-t { color: var(--red-ink); }
.toc-list .off { color: var(--muted); opacity: .7; }
.toc-p { flex: none; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc-lab { display: block; font-family: var(--f-display); font-stretch: condensed; font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--red); margin-bottom: .1rem; }
.toc-list .lv1, .toc-list .lv2 { font-weight: 700; margin-top: .9rem; }
.toc-list .lv1:first-child { margin-top: 0; }
.toc-list .lv3 { font-weight: 700; margin-top: .75rem; }
.toc-list .lv3:first-child { margin-top: 0; }
.toc-list .lv4 { padding-left: .7rem; border-left: 2px solid var(--rule); }
.toc-list .lv4 a, .toc-list .lv4 .off { padding: .18rem 0; }
.toc-list a.active .toc-t { color: var(--red-ink); }
.toc-list .lv4:has(a.active) { border-left-color: var(--red); }

.sec { margin-bottom: 2.5rem; }
.sec h2 {
  font-family: var(--f-display); font-weight: 700; font-stretch: condensed; text-transform: uppercase;
  font-size: clamp(1.4rem, 2.6vw, 1.75rem); line-height: 1.1; margin: 0 0 1.4rem; padding-top: .9rem; border-top: 4px solid var(--red);
}
.sec-lab { display: block; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1; letter-spacing: .02em; color: var(--red); margin-bottom: .35rem; }
.rub { padding: 0 0 1.6rem; margin: 0 0 1.8rem; border-bottom: 1px solid var(--rule); }
.rub:last-child { border-bottom: 0; }
.rub h3 { position: relative; font-family: var(--f-ui); font-size: 1.12rem; line-height: 1.35; font-weight: 700; margin: 0 0 .9rem; }
.rub h3 .anchor { position: absolute; left: -1.3rem; color: var(--red); text-decoration: none; opacity: 0; transition: opacity .15s; }
.rub:hover h3 .anchor, .rub h3 .anchor:focus { opacity: 1; }
.rub:target h3 { color: var(--red-ink); }
.rub p { margin: 0 0 .85rem; overflow-wrap: break-word; }

.passage { margin: 0 0 1.1rem; padding: .9rem 1.1rem .7rem; background: var(--paper-2); border-left: 3px solid var(--red); }
.passage p { font-style: italic; margin: 0 0 .35rem; }
.passage .page { font-style: normal; font-family: var(--f-ui); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; text-align: right; }

.anoter { background: var(--tint); border-left: 3px solid var(--red); padding: .8rem 1.1rem; margin: .4rem 0 1rem; }
.anoter p { margin: 0; }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0 3rem; font-family: var(--f-ui); }
.pn { display: block; border: 1px solid var(--rule); border-radius: .4rem; padding: .8rem 1rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.pn span { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pn:hover { border-color: var(--red); color: var(--red-ink); }
.pn.next { text-align: right; }

.simple { min-height: 50vh; padding-bottom: 3rem; }

/* ---------- Pied de page ---------- */
.site-foot { border-top: 1px solid var(--rule); background: var(--paper-2); margin-top: 2rem; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.6rem; padding-bottom: 1.6rem; font-family: var(--f-ui); font-size: .85rem; color: var(--muted); }
.foot-inner p { margin: 0; }
.foot-inner a { color: var(--muted); }

/* ---------- Petits écrans ---------- */
@media (max-width: 64rem) {
  .head-inner { flex-wrap: wrap; gap: .4rem 1rem; padding-top: .6rem; padding-bottom: .6rem; }
  .site-nav { margin-left: 0; order: 3; width: 100%; gap: 1rem; font-size: .85rem; }
  .site-head .search { margin-left: auto; }
  .site-head .search input { width: 11rem; }
  .chap-grid { grid-template-columns: 1fr; padding-top: 1rem; }
  .toc { position: static; max-height: none; border: 1px solid var(--rule); border-radius: .4rem; padding: .6rem .9rem; background: var(--paper-2); }
  .toc summary { padding: .1rem 0; color: var(--ink); }
  .toc summary::after { content: " ▾"; color: var(--red); }
  .toc[open] summary { margin-bottom: .6rem; }
  html { scroll-padding-top: 7.5rem; }
}
@media (max-width: 44rem) {
  body { font-size: 1.02rem; }
  .rub p, .blurb p, .lead { hyphens: auto; }
  .hero-inner { grid-template-columns: 1fr; }
  .cover { max-width: 14rem; }
  .two { grid-template-columns: 1fr; }
  .chapters a { grid-template-columns: 1fr; gap: .3rem; }
  .ch-meta { text-align: left; }
  .ch-num { font-size: 1.9rem; }
  .site-head .search { flex: 1 1 100%; order: 4; margin-left: 0; }
  .site-head .search input { width: 100%; }
  .rub h3 .anchor { display: none; }
  .prevnext { grid-template-columns: 1fr; }
}

@media print {
  .site-head, .toc, .prevnext, .site-foot, .search { display: none !important; }
  .chap-grid { display: block; }
  a { color: inherit; }
  .passage, .anoter { background: none; }
}

/* ---------- Version de validation ---------- */
.valid-banner { background: #111; color: #fff; text-align: center; font-family: var(--f-ui); font-size: .8rem; letter-spacing: .04em; padding: .35rem 1rem; }

/* ---------- Menu déroulant « D’où viennent les chiffres » ---------- */
.nav-dd { position: relative; }
.nav-dd > summary { list-style: none; cursor: pointer; color: var(--ink); white-space: nowrap; }
.nav-dd > summary::-webkit-details-marker { display: none; }
.nav-dd > summary::after { content: " ▾"; color: var(--red); }
.nav-dd > summary:hover, .nav-dd[open] > summary { color: var(--red-ink); }
.dd-menu { position: absolute; top: calc(100% + .7rem); left: 0; z-index: 40; width: min(27rem, calc(100vw - 2rem));
  max-height: calc(100vh - 7rem); overflow: auto; list-style: none; margin: 0; padding: .4rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: .6rem; box-shadow: var(--shadow); }
.dd-menu li { margin: 0; }
.dd-menu a { display: block; padding: .45rem .65rem; border-radius: .35rem; color: var(--ink); text-decoration: none; }
.dd-menu a:hover, .dd-menu a:focus-visible { background: var(--paper-2); }
.dd-menu a[aria-current="page"] { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--red); }
.dd-lab { display: block; font-family: var(--f-display); font-weight: 700; font-stretch: condensed; text-transform: uppercase; letter-spacing: .02em; font-size: .98rem; color: var(--red); }
.dd-t { display: block; font-size: .82rem; line-height: 1.3; color: var(--muted); }
.dd-all { border-bottom: 1px solid var(--rule); margin-bottom: .3rem !important; padding-bottom: .3rem; }
.dd-all a { font-weight: 600; font-size: .85rem; }

/* ---------- Pages sans sommaire latéral (introduction, préambule) ---------- */
.chap-grid.no-toc { grid-template-columns: minmax(0, 1fr); }
.chap-head h1.chap-num { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 .45rem; }

/* ---------- Dans les médias ---------- */
.media { margin: 0 0 1rem; }
.media p { margin: 0; padding: .7rem 0; border-bottom: 1px solid var(--rule); line-height: 1.45; }
.media p:first-child { border-top: 1px solid var(--rule); }

/* ---------- Ordinaux : majuscule en petit exposant (XIXᴱ siècle) ---------- */
sup.ord { font-size: .6em; line-height: 0; vertical-align: super; }

/* ---------- Rangée de liens vers les autres pages de références ---------- */
.chap-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: -.3rem 0 1.4rem; font-family: var(--f-ui); font-size: .82rem; }
.chap-switch a { display: inline-block; min-width: 2.1rem; text-align: center; padding: .28rem .6rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); text-decoration: none; background: var(--paper); }
.chap-switch a:hover { border-color: var(--red); color: var(--red-ink); }
.chap-switch a[aria-current="page"] { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.chap-switch .cs-lab { margin: 0 .1rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; font-weight: 600; }
@media (max-width: 44rem) { .chap-switch .cs-lab { flex-basis: 100%; margin: .2rem 0 0; } }
