/* NWA Stack. One stylesheet, no JavaScript. Mobile first: written for a 320px phone, widened with min-width.
   Fonts: Lora (reading) and Mulish (interface), self-hosted, SIL Open Font License (public/fonts/README.md).
   The worker's confirm and unsubscribe pages (worker/lib.js actionPage) use this file too: keep .wrap,
   .narrow, .brand, .button, and body.action working. */

@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/lora-400.b11ee4fc.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/lora-400i.2ad4f70d.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/lora-700.a5d9bb5c.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/mulish-400.b00cc37b.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/mulish-700.6d13eae2.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/mulish-800.d7167028.woff2') format('woff2'); }
/* Fallbacks with Lora's and Mulish's vertical metrics, so lines don't jump when the web fonts arrive. */
@font-face { font-family: 'Lora Fallback'; src: local('Georgia'), local('Times New Roman'), local('Liberation Serif'); ascent-override: 100.6%; descent-override: 27.4%; line-gap-override: 0%; }
@font-face { font-family: 'Mulish Fallback'; src: local('Arial'), local('Helvetica'), local('Liberation Sans'); ascent-override: 100.5%; descent-override: 25%; line-gap-override: 0%; }

:root {
  --ink: #1d1d1b;
  --muted: #57564f;
  --paper: #fbf9f4;
  --card: #ffffff;
  --line: #e5e0d4;
  --sand: #f4efe4;
  --pine: #1d4d3a;
  --pine-dark: #143528;
  --lake: #1f4e5f;
  --amber: #e0a526;
  --amber-ink: #8a5a00;
  --night: 10 28 36; /* rgb channels for overlays */

  --serif: 'Lora', 'Lora Fallback', Georgia, 'Times New Roman', serif;
  --sans: 'Mulish', 'Mulish Fallback', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.95rem);
  --step-0: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2.25rem, 1.6rem + 3vw, 4rem);

  --measure: 42rem;
  --wide: 64rem;
  --radius: 10px;
  --target: 2.75rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 20px rgb(var(--night) / 0.08);

  --lake-bg: url('/images/beaver-lake-640.jpg');
  color-scheme: light;
  accent-color: var(--pine);
}
@supports (background-image: image-set(url('/x.avif') type('image/avif'))) {
  :root { --lake-bg: image-set(url('/images/beaver-lake-640.avif') type('image/avif'), url('/images/beaver-lake-640.webp') type('image/webp'), url('/images/beaver-lake-640.jpg') type('image/jpeg')); }
}
@media (min-width: 40rem) {
  :root { --lake-bg: url('/images/beaver-lake-1024.jpg'); }
  @supports (background-image: image-set(url('/x.avif') type('image/avif'))) {
    :root { --lake-bg: image-set(url('/images/beaver-lake-1024.avif') type('image/avif'), url('/images/beaver-lake-1024.webp') type('image/webp'), url('/images/beaver-lake-1024.jpg') type('image/jpeg')); }
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0) / 1.65 var(--serif);
  text-rendering: optimizeLegibility;
}
/* The Beaver Lake photo, faded behind the top of every page. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: 34rem;
  z-index: -1;
  background: linear-gradient(to bottom, rgb(251 249 244 / 0.8), rgb(251 249 244 / 0.9) 45%, var(--paper)), var(--lake-bg) center 35% / cover no-repeat;
  pointer-events: none;
}
body.home::before { display: none; }

a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--step-3); margin: 0.25rem 0 0.75rem; letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); margin: 2.5rem 0 0.75rem; }
h3 { font-size: var(--step-1); margin: 0; }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: 1rem; }
.content { padding-block: 2rem 3.5rem; }
.narrow { padding-top: 3rem; }
.kicker {
  margin: 0;
  font: 800 0.8rem/1.2 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-ink);
}
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); margin: 0 0 1.5rem; }
.section-title { font-size: var(--step-1); font-family: var(--sans); font-weight: 800; letter-spacing: 0.02em; margin: 0 0 1rem; }

.skip { position: absolute; left: -999px; top: 0; z-index: 20; padding: 0.6rem 1rem; background: var(--card); color: var(--ink); font-family: var(--sans); }
.skip:focus { left: 1rem; top: 1rem; }

/* Header */
.site-header {
  position: relative;
  z-index: 2;
  background: rgb(251 249 244 / 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px);
}
.bar { max-width: var(--wide); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: var(--target); color: var(--ink); text-decoration: none; font: 800 1.2rem/1 var(--sans); letter-spacing: -0.01em; }
.brand .mark { flex: none; border-radius: 7px; }
.site-header nav ul, .site-footer nav ul { list-style: none; margin: 0; padding: 0; }
.site-header nav ul { display: flex; align-items: center; gap: 0.25rem 1rem; }
.site-header nav a { display: inline-flex; align-items: center; min-height: var(--target); font: 700 0.95rem/1 var(--sans); color: var(--ink); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current='page'] { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; text-underline-offset: 0.45em; }
.site-header nav a.button { color: var(--sand); text-decoration: none; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--target); padding: 0.55rem 1.3rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--pine); color: var(--sand);
  font: 800 1rem/1 var(--sans); text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.button:hover { background: var(--pine-dark); }
.button:active { transform: translateY(1px); }
.button-small { min-height: 2.5rem; padding: 0.45rem 1.05rem; font-size: 0.92rem; }

/* Home hero: the Beaver Lake photo, dimmed so white text reads at AA contrast. */
.hero {
  position: relative;
  isolation: isolate;
  color: #fff;
  background: linear-gradient(to bottom, rgb(var(--night) / 0.55), rgb(var(--night) / 0.32) 50%, rgb(var(--night) / 0.55)), var(--lake-bg) center 40% / cover no-repeat;
}
.hero::after { content: ''; position: absolute; inset: auto 0 0; height: 3.5rem; background: linear-gradient(to bottom, transparent, var(--paper)); z-index: -1; }
.hero-inner { max-width: var(--measure); padding-block: clamp(2.5rem, 8vw, 5.5rem) 3rem; }
.hero .kicker { color: #f6d27a; }
.hero h1 { color: #fff; margin-bottom: 0.5rem; text-shadow: 0 2px 18px rgb(var(--night) / 0.45); }
.hero .lede { color: #f4efe4; max-width: 34rem; text-shadow: 0 1px 10px rgb(var(--night) / 0.5); }
.hero .subscribe { color: var(--ink); }

/* Subscribe card */
.subscribe {
  margin: 2rem 0;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.subscribe h2 { margin: 0 0 0.25rem; font-size: var(--step-1); }
.subscribe > p { margin: 0 0 0.75rem; color: var(--muted); }
.subscribe label { display: block; font: 700 0.95rem/1.4 var(--sans); }
.subscribe .row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.35rem 0 0.75rem; }
.subscribe input[type='email'] {
  flex: 1 1 14rem; min-height: var(--target); padding: 0.5rem 0.85rem;
  font: 400 1rem/1.2 var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid #9c978b; border-radius: 999px;
}
.subscribe input[type='email']:focus-visible { border-color: var(--pine); }
.subscribe .hint { margin: 0.5rem 0 0; font: 400 0.85rem/1.5 var(--sans); color: var(--muted); }
.cf-turnstile { min-height: 65px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Issue list */
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.issue-card {
  position: relative;
  padding: 1.1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.issue-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(0 0 0 / 0.05), 0 12px 28px rgb(var(--night) / 0.12); }
.issue-card time { display: block; margin-bottom: 0.3rem; font: 800 0.78rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber-ink); }
.issue-card h2, .issue-card h3 { font-size: var(--step-1); margin: 0; }
.issue-card h2 a, .issue-card h3 a { color: var(--ink); text-decoration: none; }
.issue-card h2 a::after, .issue-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); } /* whole card is the link target */
.issue-card h2 a:hover, .issue-card h3 a:hover { text-decoration: underline; }
.issue-card p { margin: 0.4rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.empty { color: var(--muted); font-style: italic; }
.more { margin-top: 1.25rem; font-family: var(--sans); font-weight: 700; }

.byline-card { margin-top: 3rem; padding: 1.25rem; border-left: 4px solid var(--pine); background: var(--sand); border-radius: 0 var(--radius) var(--radius) 0; }
.byline-card h2 { margin: 0 0 0.25rem; font-size: var(--step-1); }
.byline-card p { margin: 0; }

/* Page headers (archive, tag, author) */
.page-head { margin-bottom: 1.75rem; }
.page-head .lede { margin-bottom: 0; }
.author-head .links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 1rem 0 0; padding: 0; font: 700 0.95rem/1.4 var(--sans); }
.author-head .links li:first-child { color: var(--muted); font-weight: 400; }
.author-head + .section-title { margin-top: 2.5rem; }

/* Issues and pages */
.post h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem); }
.post > header { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.post .meta { margin: 0; font: 400 0.92rem/1.5 var(--sans); color: var(--muted); }
.post .meta a { color: var(--muted); }
.post .feature { display: block; width: 100%; margin: 0 0 1.75rem; border-radius: var(--radius); }
.post .body > :first-child { margin-top: 0; }
.post .body h2 { font-size: var(--step-2); }
.post .body h3 { font-size: var(--step-1); margin: 2rem 0 0.5rem; }
.post .body img { display: block; margin: 1.5rem auto; border-radius: var(--radius); }
.post .body blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.1rem; border-left: 4px solid var(--amber); color: var(--muted); font-style: italic; }
.post .body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.post .body ul, .post .body ol { padding-left: 1.25rem; }
.post .body li + li { margin-top: 0.35rem; }
.post .body code { font-size: 0.9em; background: var(--sand); padding: 0.1em 0.35em; border-radius: 4px; }
.post + .subscribe { margin-top: 3rem; }

/* Footer */
.site-footer { margin-top: 2rem; background: var(--pine-dark); color: #dfe7df; font: 400 0.95rem/1.6 var(--sans); }
.site-footer a { color: #fff; }
.footer-grid { max-width: var(--wide); display: grid; gap: 1.5rem; padding-block: 2.5rem 1.5rem; }
.footer-brand { margin: 0 0 0.35rem; font: 800 1.15rem/1.2 var(--sans); color: #fff; }
.footer-grid p { margin: 0; max-width: 34rem; }
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: var(--target); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.footer-base { max-width: var(--wide); padding-block: 1rem 2rem; border-top: 1px solid rgb(255 255 255 / 0.15); font-size: 0.85rem; color: #c3cfc6; }
.footer-base p { margin: 0; }

/* The worker's confirm and unsubscribe pages */
body.action .brand { min-height: 0; margin-bottom: 1.5rem; }
body.action .brand a { color: var(--ink); text-decoration: none; }
body.action h1 { font-size: var(--step-2); }

@media (min-width: 48rem) {
  .content { padding-block: 3rem 4.5rem; }
  .footer-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .subscribe { padding: 1.5rem 1.75rem 1.25rem; }
  .hero-inner { padding-bottom: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .issue-card:hover { transform: none; }
}
@media (forced-colors: active) {
  .issue-card, .subscribe { border: 1px solid CanvasText; }
  .hero { background: Canvas; color: CanvasText; }
  .hero h1, .hero .lede, .hero .kicker { color: CanvasText; text-shadow: none; }
}
@media print {
  body::before, .site-header nav, .subscribe, .site-footer nav { display: none; }
  .hero { background: none; color: var(--ink); margin: 0; padding: 0; }
  .hero h1, .hero .lede { color: var(--ink); text-shadow: none; }
}
