/* ================= base: layout + reading comfort rules shared by every theme =================
   reading policy: body text >= 18px, line-height ~1.7, line length 60-70 characters,
   left-aligned (never justified), soft but strong contrast (>= 7:1 for body text),
   balanced headings, no orphans in paragraphs, generous paragraph spacing, motion only if allowed. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--size-body); line-height: var(--lh-body); font-kerning: normal; font-synthesis: none; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3 { font-family: var(--font-head); text-wrap: balance; }
p, li { text-wrap: pretty; }
:lang(fr) .prose p { hyphens: auto; -webkit-hyphens: auto; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--surface); color: var(--text); padding: 8px 12px; }

/* header / nav */
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { text-decoration: none; }

/* home */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; }
.card { display: flex; flex-direction: column; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card p { margin: 0 0 16px; }
.card .more { margin-top: auto; }
.kicker { margin: 0; }
.more { font-weight: 700; color: var(--accent-text); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* article */
.crumbs { font-size: .875em; padding-top: 28px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.post-head { max-width: var(--measure); }
.lede { color: var(--muted); }
.meta { font-size: .875em; color: var(--muted); }
.disclosure { max-width: var(--measure); font-size: .85em; line-height: 1.6; color: var(--muted); padding: 12px 16px; background: var(--soft); }
.toc p { margin: 0 0 6px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 5px 0; line-height: 1.4; }
.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .4em 0; }
.prose li::marker { color: var(--accent-text); }
.prose h2 { margin: 2.1em 0 .6em; scroll-margin-top: 24px; }
.prose h3 { margin: 1.7em 0 .4em; }
.prose strong { font-weight: 700; color: var(--strong, inherit); }
.prose code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .88em; padding: .1em .35em; background: var(--soft); border-radius: 4px; }
.table-wrap { overflow-x: auto; margin: 1.6em 0; max-width: 100%; }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .88em; line-height: 1.5; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { border-bottom: 2px solid var(--text); }
.prose tbody th { font-weight: 700; }
.tip { margin: 1.8em 0; }
.page { max-width: var(--measure); }
.page h1 { margin-top: 1.2em; }
main.page { padding-bottom: 64px; }

/* author + related */
.author { display: flex; gap: 18px; align-items: flex-start; margin: 56px 0 40px; max-width: var(--measure); }
.avatar { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 1.4rem/1 var(--font-head); }
.author p { margin: 0 0 6px; font-size: .92em; line-height: 1.6; }
.author .name { font-weight: 700; }
.author .role { color: var(--muted); }
.related { margin-bottom: 72px; max-width: var(--measure); }
.related ul { list-style: none; padding: 0; display: grid; gap: 16px; }
.related li a { font-weight: 700; }
.related li span { display: block; color: var(--muted); font-size: .9em; line-height: 1.55; }

/* footer */
.site-footer { color: var(--muted); font-size: .875rem; line-height: 1.6; padding: 32px 0; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: inherit; }

/* reading progress bar (pure css, only in browsers that support scroll timelines) */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 10; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { animation: progress linear both; animation-timeline: scroll(root); }
    @keyframes progress { to { transform: scaleX(1); } }
  }
}
@supports not (animation-timeline: scroll()) { .progress { display: none; } }

@media (max-width: 560px) {
  body { font-size: calc(var(--size-body) - 1px); }
  .author { flex-direction: column; }
}
@media print {
  .site-header, .site-footer, .toc, .progress, .related, .disclosure { display: none; }
  body { background: #fff; color: #000; }
}

/* drop-cap paragraph keeps its float inside (avoids the letter spilling into a following list) */
.prose > h2:first-child + p { display: flow-root; }
/* kicker label inside cards keeps its small size */
.card p.kicker { font-size: .74rem; margin: 0; }

/* ================= theme 1 — "Le Quotidien" : newspaper editorial, ivory paper, burgundy ink =================
   body: Source Serif 4 (Adobe, drawn for long on-screen reading, optical sizes)
   headings: Playfair Display (high-contrast newspaper display serif) */
@font-face { font-family: "Source Serif"; src: url("/fonts/source-serif.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url("/fonts/source-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
:root {
  --font-body: "Source Serif", Georgia, "Times New Roman", serif;
  --font-head: "Playfair Display", "Source Serif", Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --size-body: 1.1875rem; --lh-body: 1.72; --measure: 66ch; --max: 1160px;
  --bg: #fbf8f2; --surface: #fffdf8; --soft: #f5e8e4; --text: #262125; --muted: #5d5156; --line: #e8ddd3; --strong: #17121a;
  --accent: #9b1c31; --accent-text: #8a1a2c; --on-accent: #fff; --link: #8a1a2c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171214; --surface: #1f181b; --soft: #2c1f23; --text: #efe6e2; --muted: #bfb0ad; --line: #3a2d31; --strong: #fff7f2;
          --accent: #e0566c; --accent-text: #f58b9b; --on-accent: #1a0709; --link: #f58b9b; }
}
body { font-optical-sizing: auto; }

/* masthead: left-aligned title, double rule like a printed newspaper */
.site-header { border-bottom: 4px double var(--strong); }
.site-header .wrap { padding-block: 22px 14px; align-items: flex-end; }
.brand { font: 800 clamp(1.5rem, 4vw, 2.2rem)/1 var(--font-head); color: var(--strong); letter-spacing: -0.01em; }
.mark { display: none; }
.site-header nav { gap: 26px; }
.site-header nav a { font: 600 .76rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); padding-bottom: 4px; }
.site-header nav a:hover { color: var(--accent-text); box-shadow: 0 2px 0 var(--accent); }

h1, h2, h3 { color: var(--strong); font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; }
.hero { padding: 64px 0 24px; max-width: 900px; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.4rem); font-weight: 800; margin: 0 0 22px; }
.hero p { font-size: 1.22rem; color: var(--muted); margin: 0; max-width: 58ch; font-style: italic; padding-left: 18px; border-left: 3px solid var(--accent); }
.section-t { font: 700 .76rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .18em; color: var(--strong); margin: 56px 0 24px; padding: 10px 0; border-block: 1px solid var(--strong); }

/* cards: numbered stories, featured lead story on top */
.cards { counter-reset: story; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; }
.card { counter-increment: story; padding-left: 22px; border-left: 1px solid var(--line); }
.card::before { content: "N° " counter(story, decimal-leading-zero); font: 700 .76rem/1 var(--font-ui); letter-spacing: .14em; color: var(--accent-text); margin-bottom: 12px; }
.card.featured { grid-column: 1 / -1; padding: 0 0 36px; border-left: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: 56px; }
.card.featured::before { grid-column: 1 / -1; }
.card.featured > * { grid-column: 1; }
.card.featured p:not(.kicker), .card.featured .more { grid-column: 2; }
.card.featured .kicker { grid-row: 2; }
.card.featured h2 { grid-row: 3 / span 2; font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; margin: 10px 0 0; }
.card.featured p:not(.kicker) { grid-row: 3; font-size: 1.1rem; align-self: end; }
.card.featured .more { grid-row: 4; }
.card h2 { font-size: 1.55rem; margin: 8px 0 12px; }
.card p { color: var(--muted); font-size: 1.02rem; line-height: 1.65; }
.kicker { font: 600 .74rem/1.4 var(--font-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.more { font: 700 .8rem/1.3 var(--font-ui); text-transform: uppercase; letter-spacing: .1em; }
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .card.featured { display: flex; }
}
.pitch { margin: 72px 0; padding: 36px 40px; max-width: 820px; background: var(--surface); border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: 5px; }
.pitch h2 { margin: 0 0 12px; font-size: 1.8rem; }
.pitch p:last-child { margin-bottom: 0; }

/* article: left-aligned header + sticky table of contents in the margin on wide screens */
.crumbs { font-family: var(--font-ui); font-size: .8rem; }
.post-head .kicker { margin-top: 24px; color: var(--accent-text); }
.post-head h1 { font-size: clamp(2.2rem, 5.4vw, 3.4rem); font-weight: 800; margin: 12px 0 18px; }
.lede { font-size: 1.3rem; line-height: 1.6; font-style: italic; margin: 0 0 18px; }
.meta { font-family: var(--font-ui); font-size: .8rem; margin: 0 0 28px; padding: 10px 0; border-block: 1px solid var(--line); }
.disclosure { font-family: var(--font-ui); font-size: .8rem; border-radius: 2px; }
.toc { margin: 28px 0; font-family: var(--font-ui); font-size: .88rem; max-width: var(--measure); }
.toc p { text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; color: var(--strong); padding-bottom: 8px; border-bottom: 2px solid var(--strong); }
.toc ol { padding-left: 1.2em; margin-top: 10px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent-text); text-decoration: underline; }
@media (min-width: 1100px) {
  .post-body { display: grid; grid-template-columns: 220px minmax(0, var(--measure)); gap: 64px; align-items: start; }
  .toc { position: sticky; top: 28px; margin: 6px 0 0; }
  .crumbs, .post-head, .disclosure, .author, .related { margin-left: 284px; }
  .crumbs { padding-left: 0; }
}
/* drop cap */
.prose > h2:first-child + p::first-letter { float: left; font: 800 4.2em/.8 var(--font-head); color: var(--accent); margin: .06em .12em 0 0; }
.prose h2 { font-size: 1.95rem; }
.prose h3 { font: 700 1.05rem/1.3 var(--font-ui); text-transform: uppercase; letter-spacing: .06em; color: var(--strong); }
.prose table { font-family: var(--font-ui); font-size: .82em; }
.prose thead th { border-bottom-color: var(--strong); text-transform: uppercase; letter-spacing: .06em; font-size: .85em; }
/* tips: boxed note with a double frame */
.tip { padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: 4px; font-size: 1.02em; }
.tip strong { color: var(--accent-text); }
.author { padding: 26px 0 0; border-top: 4px double var(--strong); }
.avatar { background: var(--accent); font-family: var(--font-head); }
.author p { font-family: var(--font-ui); }
.related h2 { font-size: 1.45rem; }
.related li span { font-family: var(--font-ui); }

.site-footer { border-top: 4px double var(--strong); }
