/* Reading typography for a 13 000-word edition read in one sitting. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Le bandeau d'édition déborde de la colonne jusqu'aux bords de la fenêtre :
 * sans cette coupe, une barre de défilement horizontale apparaîtrait sur toute
 * la page. Le défilement doux sert les sauts de chapitre — mais un mouvement
 * imposé de plusieurs dizaines de milliers de pixels donne la nausée à qui
 * demande justement qu'on lui en épargne. */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--font-texte);
  font-size: 1.1875rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

/* Headings carry the editorial accent; sizes stay close so that six chapters
 * and twenty-odd subsections keep a readable hierarchy over a long scroll. */
h1,
h2,
h3 {
  font-family: var(--font-titre);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
}

h2 {
  font-size: clamp(1.625rem, 4vw, 2.125rem);
  margin: 3rem 0 1rem;
}

/* A chapter heading opens its section, which already carries the spacing. */
.chapitre h2 {
  margin-top: 0;
}

h3 {
  font-size: 1.375rem;
  margin: 2.5rem 0 0.75rem;
}

p {
  margin: 0 0 1.35rem;
}

/* Justified running text, hyphens included — variant A, weighed against
 * ragged-right in Claude Design and kept. Hyphenation is not optional here:
 * without it, justifying a narrow column opens rivers of white between words.
 * The document is lang="fr", so the browser hyphenates with French rules.
 * Headings and the table of contents stay ragged-right — justifying short lines
 * only stretches them — and so does the "À retenir" body, which overrides this
 * rule: set in Playfair italic, it reads as a quotation, not as running text. */
.edition__corps p,
.edition__corps li,
.callout p {
  text-align: justify;
  hyphens: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--bleu);
  outline-offset: 2px;
  border-radius: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--filet);
  margin: 3rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--filet);
  color: var(--texte-doux);
  font-style: italic;
}

/* Skip link: off-screen until focused. */
.evitement {
  position: absolute;
  left: -9999px;
}

.evitement:focus {
  position: static;
  display: inline-block;
  padding: 0.75rem 1rem;
  background: var(--surface);
}

/* Chrome: night in both themes (see tokens.css). */
.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 3.5rem);
  background: var(--nuit-profonde);
  border-bottom: 1px solid rgb(212 175 55 / 16%);
}

.entete__marque {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--nuit-texte);
  font-family: var(--font-titre);
  font-size: 1.1875rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.entete__marque img {
  display: block;
}

.entete__ia {
  color: var(--or);
}

.entete__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.875rem);
  font-size: 0.90625rem;
}

.entete__nav > a:not(.bouton-or) {
  color: var(--nuit-doux);
  text-decoration: none;
}

.entete__nav > a:not(.bouton-or):hover {
  color: var(--nuit-texte);
}

.entete__theme {
  background: none;
  border: 1px solid var(--nuit-filet);
  border-radius: 999px;
  color: var(--nuit-doux);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
}

.entete__theme:hover {
  color: var(--nuit-texte);
  border-color: var(--or);
}

/* The one call to action, repeated on the home page. Gold on night clears AA
 * comfortably; the hover state goes to off-white rather than dimming. */
.bouton-or {
  background: var(--or);
  border-radius: 2px;
  color: var(--nuit);
  font-weight: 700;
  padding: 0.625rem 1rem;
  text-decoration: none;
}

.bouton-or:hover {
  background: var(--blanc-casse);
  color: var(--nuit);
}

main {
  padding: 0 1.5rem 4rem;
}

.contenu--bandes {
  padding: 0;
}

.pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.125rem;
  padding: clamp(1.875rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 3.5rem);
  background: var(--nuit-profonde);
  color: var(--nuit-doux);
  font-size: 0.84375rem;
}

.pied__marque {
  color: var(--nuit-texte);
  font-family: var(--font-titre);
  font-size: 1rem;
}

.pied__liens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.875rem, 2vw, 1.625rem);
}

.pied__liens a {
  color: var(--nuit-doux);
  text-decoration: none;
}

.pied__liens a:hover {
  color: var(--or);
  text-decoration: underline;
}

/* --nuit-efface ne donne que 2,6:1 sur le chrome nuit — sous AA. Le hero avait
 * déjà été traité pour cette raison ; le pied portait encore le token, sur
 * toutes les pages. --nuit-doux monte à 7,7:1 en restant discret. */
.pied__domaine {
  color: var(--nuit-doux);
}
