/* Feuille de style unique — générée par generator/build.py (jetons injectés depuis config.yml) */
:root {
  --bg: #ffffff;
  --surface: #f3f5f7;
  --ink: #1b1f24;
  --muted: #5a6370;
  --line: #d9dee4;
  --accent: #146fb4;
  --accent-ink: #ffffff;
  --measure: 42rem;
  --wide: 66rem;
  --radius: .5rem;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font: var(--font-sans);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1b1f25;
    --ink: #e7e9ec;
    --muted: #a3abb5;
    --line: #2c333c;
    --accent: #7cbcf0;
    --accent-ink: #0d1a26;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-family: var(--font);
  font-size: 106.25%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color: var(--ink);
}
body { margin: 0; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding: 2rem 0 3rem; }
.wrap { width: min(100% - 2.5rem, var(--measure)); margin-inline: auto; }
.wrap--wide { width: min(100% - 2.5rem, var(--wide)); }

/* Typographie */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.3rem); margin: 0 0 .6rem; line-height: 1.15; }
h2 { font-size: 1.45rem; margin: 2.4rem 0 .8rem; }
h3 { font-size: 1.15rem; margin: 1.7rem 0 .5rem; }
h2 + h3 { margin-top: 1rem; }
p, ul, ol, dl, table, blockquote, pre { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: .2rem 0; }
li > ul, li > ol { margin: .3rem 0 .3rem; }
a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { text-decoration-thickness: .15em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding: .2rem 0 .2rem 1rem; color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
pre { background: var(--surface); padding: 1rem; border-radius: var(--radius); overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
th { background: var(--surface); }
small, .meta { font-size: .9rem; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Lien d'évitement */
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--accent); color: var(--accent-ink); padding: .5rem .9rem; border-radius: var(--radius); z-index: 10; }
.skip:focus { top: 1rem; }

/* En-tête */
.site-header { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.site-header .wrap--wide { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: inherit; text-decoration: none; }
.brand img { width: 2rem; height: 2rem; border-radius: .35rem; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.site-header nav a { color: var(--muted); text-decoration: none; padding: .2rem 0; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0 2rem; font-size: .9rem; color: var(--muted); }
.site-footer .wrap--wide { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.site-footer a { color: inherit; }
.site-footer p { margin: 0; }

/* Fil d'Ariane et métadonnées */
.breadcrumb ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; font-size: .9rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: .35rem; }
.breadcrumb a { color: inherit; }
.page-header { margin-bottom: 1.6rem; }
.page-header .meta { margin: 0; }
.terms { display: inline; }
.terms a { margin-right: .3rem; }

/* Contenu */
.content > :first-child { margin-top: 0; }
.content img, .content iframe { max-width: 100%; height: auto; }
.content img { display: block; border-radius: var(--radius); background: var(--surface); }
.content figure { margin: 1.6rem 0; }
.content figure img { width: 100%; }
figcaption { font-size: .9rem; color: var(--muted); margin-top: .5rem; text-align: center; }
.galerie { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .8rem; margin: 1.6rem 0; }
.galerie figure { margin: 0; }
.galerie img { aspect-ratio: 3 / 2; object-fit: cover; }
figure.portrait { max-width: 15rem; margin-inline: auto; }
figure.portrait img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
figure.video { aspect-ratio: 16 / 9; }
figure.video iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }

/* Grille de vignettes */
.grid { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.6rem 1.4rem; }
.card { display: flex; flex-direction: column; gap: .4rem; margin: 0; }
.card a { color: inherit; text-decoration: none; }
/* height: auto neutralise l'attribut height="…" de l'image, sinon il prime sur aspect-ratio */
.card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--surface); display: block; }
.card h3, .card h2 { font-size: 1.1rem; margin: .5rem 0 0; }
.card a:hover h3, .card a:hover h2 { color: var(--accent); text-decoration: underline; }
.card p { margin: 0; font-size: .95rem; }
.card .meta { font-size: .85rem; }
.section-title { font-size: 1.3rem; margin: 3rem 0 .4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }

/* Navigation entre contenus */
.pager { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.pager a { max-width: 48%; text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager .next { margin-left: auto; text-align: right; }
.pager small { display: block; color: var(--muted); }
.related { margin-top: 2.5rem; }
.related h2 { font-size: 1.2rem; margin-top: 0; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { padding: .45rem 0; border-top: 1px solid var(--line); }
.related li small { display: block; }

/* FAQ */
.faq h3 { margin-top: 1.4rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 2.5rem 0 0; }
.pagination a, .pagination span { display: inline-block; min-width: 2.4rem; text-align: center; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.pagination [aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Page 404 */
.notfound { text-align: center; padding: 3rem 0; }

@media (max-width: 40rem) {
  html { font-size: 100%; }
  .pager { flex-direction: column; }
  .pager a, .pager .next { max-width: none; text-align: left; margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .site-header nav, .site-footer, .pager, .related, .skip { display: none; }
  main { padding: 0; }
  a { color: inherit; text-decoration: none; }
}
