/* Reset minimal. On ne réinitialise que ce qui gêne, pas plus. */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
}

/* Rythme vertical : un seul type de marge, jamais empilée en haut. */
h1, h2, h3, p, ul, ol, table, pre, blockquote, figure {
  margin: 0 0 1.2em 0;
}

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--texte);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; margin-top: 2em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }

p {
  color: var(--texte);
}

ul, ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 0.4em;
}

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

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

code, pre {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  background: var(--fond-doux);
  padding: 0.15em 0.35em;
}

pre {
  background: var(--fond-doux);
  border: 1px solid var(--trait);
  padding: 1em;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  margin-left: 0;
  padding-left: 1em;
  border-left: 3px solid var(--trait-fort);
  color: var(--texte-doux);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  border-bottom: 1px solid var(--trait);
  padding: 0.5em 0.8em;
  text-align: left;
}

th {
  font-family: var(--sans);
  font-weight: 600;
}

/* Un tableau déborde à l'intérieur de son conteneur, jamais le body. */
.deborde {
  overflow-x: auto;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Lien d'évitement : hors écran sauf au focus clavier. */
.saut-contenu {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--fond-eleve);
  color: var(--texte);
  padding: 0.6em 1em;
  border: 1px solid var(--trait-fort);
}

.saut-contenu:focus {
  left: 1em;
  top: 1em;
}
