/*
  The base stylesheet of the static zone: the blog, and the search pages, which
  add /pages.css on top. Ships no JavaScript at all — that is the whole
  point of this zone, since the AI answer engines do not execute it.
  Colours mirror src/index.css: saffron #F26C3C, vanilla creme #FBF6E9, warm
  near-black #181211. Saffron TEXT uses the darker #D2430F because #F26C3C on a
  light ground fails WCAG AA at body sizes.
*/
:root {
  --ground: #fbf6e9;
  --surface: #ffffff;
  --ink: #241a17;
  --ink-soft: #6a5b55;
  --rule: #e6dcc8;
  --accent: #d2430f;
  --accent-fill: #f26c3c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #181211;
    --surface: #211a18;
    --ink: #f3ece1;
    --ink-soft: #b3a49c;
    --rule: #362b27;
    --accent: #ff8a5c;
    --accent-fill: #f26c3c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Shared with the search pages (scripts/site-chrome.mjs), so the header and
   footer live here rather than in either page type's own styles. */
header.site { border-bottom: 1px solid var(--rule); }
footer.site { background: #34271e; color: #e7dac2; margin-top: 4rem; font-size: 0.92rem; }
.site-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
footer.site .site-inner { padding: 2rem 1.25rem; }
footer.site p { margin: 0 auto 0 0; }
.site-inner nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.wordmark {
  margin-right: auto;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.wordmark, .site-inner nav a { color: inherit; text-decoration: none; }
header.site nav a:not(.btn):hover { color: var(--accent); }
footer.site a { color: inherit; }

/* #D2430F, not the brand #F26C3C: white text on the brighter saffron fails
   WCAG AA at button sizes. */
.btn {
  display: inline-block;
  background: #d2430f;
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
}
.site-inner nav a.btn { color: #fff; }
.btn:hover { background: #b53a0d; }

main { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  margin: 1rem 0 0.5rem;
  text-wrap: balance;
}
h2 { font-size: 1.55rem; line-height: 1.25; margin: 2.75rem 0 0.75rem; text-wrap: balance; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
h4, h5 { font-size: 1.02rem; margin: 1.5rem 0 0.4rem; color: var(--ink-soft); }

p { margin: 0 0 1.1rem; }
.meta { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 1.5rem; }

/* The answer-first paragraph: the reader (and an answer engine) gets the answer
   before anything else, so it is styled to read as the lede, not an intro. */
.answer {
  font-size: 1.2rem;
  line-height: 1.55;
  font-weight: 600;
  border-left: 3px solid var(--accent-fill);
  padding: 0.15rem 0 0.15rem 1rem;
  margin: 0 0 2rem;
}

img { max-width: 100%; height: auto; border-radius: 10px; display: block; }
img.hero { margin: 0 0 1.75rem; width: 100%; }
article img { margin: 1.5rem 0; }

blockquote {
  margin: 1.5rem 0; padding: 0.5rem 0 0.5rem 1.1rem;
  border-left: 3px solid var(--rule); color: var(--ink-soft);
}
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }
code { background: var(--surface); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.92em; }

/* Wide content must scroll inside itself, never the page. */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { border-bottom: 1px solid var(--rule); padding: 0.6rem 0.5rem; text-align: left; }
.table-wrap, pre { overflow-x: auto; }

.author {
  display: flex; gap: 1rem; align-items: flex-start;
  margin: 3.5rem 0 0; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
}
.author-photo { border-radius: 50%; flex-shrink: 0; width: 72px; height: 72px; object-fit: cover; }
.author-name { font-weight: 700; margin: 0 0 0.2rem; }
.author-role { font-weight: 400; color: var(--ink-soft); }
.author-links a { margin-right: 0.15rem; }
.author-bio { margin: 0 0 0.4rem; }
.author-exp { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 0.5rem; }
.author-links { margin: 0; font-size: 0.95rem; }

ul.posts { list-style: none; padding: 0; display: grid; gap: 2.5rem; }
ul.posts h2 { margin: 0.75rem 0 0.25rem; font-size: 1.35rem; }
ul.posts a { color: inherit; text-decoration: none; }
ul.posts a:hover h2 { color: var(--accent); }
ul.posts p { color: var(--ink-soft); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
