/* ============================================================================
   FCBM — site stylesheet.

   No framework, no JavaScript, no webfonts, no layout breakpoints. Normal
   document flow plus a max-width is already responsive; every breakpoint is
   something that can be wrong on a screen size nobody tested.

   The media queries here are *preference* queries, not layout ones. They are
   binary and set by the reader, so they carry none of that risk.

   Type is system-ui: the device's own interface font — SF on Apple, Segoe on
   Windows, Roboto on Android. Modern everywhere, zero bytes, no flash of
   unstyled text.

   Every colour pair below is checked against WCAG AA (4.5:1 for body text) in
   both themes. The weakest is the focus ring at 5.84:1.
   ========================================================================= */

:root {
  color-scheme: light dark;

  --bg:      #ffffff;
  --surface: #f4f2ef;
  --ink:     #17161c;
  --muted:   #55515c;
  --line:    #dedae0;
  --accent:  #8a1750;
  --focus:   #0b63c4;

  --measure: 40rem;
  --radius:  10px;
}

/* Arriving on a dark-mode device and being hit with a white page is a real
   discourtesy, so follow the system rather than forcing light. The accent
   lightens because #8a1750 scores 2.3:1 on a dark ground and fails AA. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #111015;
    --surface: #1a191f;
    --ink:     #ece9ef;
    --muted:   #a9a4b1;
    --line:    #2e2c35;
    --accent:  #f191b6;
    --focus:   #7cb7ff;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

/* Keyboard users should never have to guess where they are. */
a:focus-visible, button:focus-visible, audio:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* First tab stop on every page, hidden until focused. */
.skip {
  position: absolute; left: -9999px; z-index: 10;
  background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; top: 0; }

.wrap { max-width: var(--measure); margin-inline: auto; padding-inline: 1.25rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- masthead ----------------------------------------------------------- */
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-block: 3rem 2.5rem;
  text-align: center;
}

/* The circular mark reads correctly on both light and dark grounds, so it is
   left exactly as drawn in both themes. */
.mark { width: 104px; height: 104px; margin: 0 auto .75rem; display: block; }

.sitename {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 .4rem;
  letter-spacing: -.01em;
  font-weight: 700;
}
.sitename a { color: inherit; text-decoration: none; }
.sitename a:hover { text-decoration: underline; }
.tagline { margin: 0 auto; max-width: 30rem; color: var(--muted); text-wrap: balance; }

/* Inner pages keep the identity but give the content the room: 245 episode
   pages do not each need a full title card before the reader reaches anything. */
.masthead--compact { padding-block: 1.5rem 1.25rem; }
.masthead--compact .mark { width: 52px; height: 52px; margin-bottom: .4rem; }
.masthead--compact .sitename { font-size: 1.05rem; font-weight: 600; }
.masthead--compact .tagline { display: none; }

/* ---- nav ---------------------------------------------------------------- */
.nav { border-bottom: 1px solid var(--line); }
.nav ul {
  list-style: none; margin: 0; padding: .85rem 0;
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center;
}
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--accent); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---- content ------------------------------------------------------------ */
main { display: block; padding-block: 2.5rem 1rem; }

a { color: var(--accent); text-underline-offset: .15em; }

h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
main h1 { font-size: 1.7rem; margin: 0 0 .75rem; }
main h2 { font-size: 1.35rem; margin: 0 0 1.25rem; }
main h3 { font-size: 1.1rem; }
main section + section { margin-top: 2.5rem; }

/* ---- episode / post lists ----------------------------------------------- */
.episodes { list-style: none; margin: 0; padding: 0; }
.episode { padding-block: 1.4rem; border-bottom: 1px solid var(--line); }
.episode:first-child { padding-top: 0; }
.episode h3 { margin: 0 0 .2rem; line-height: 1.3; }
.episode h3 a { text-decoration: none; }
.episode h3 a:hover { text-decoration: underline; }
.meta { margin: 0 0 .4rem; color: var(--muted); font-size: .875rem; }
.blurb { margin: 0; color: var(--muted); font-size: .95rem; }
.more { margin: 1.5rem 0 0; }

/* ---- single episode ----------------------------------------------------- */
article .meta { margin-bottom: 1rem; }
audio { width: 100%; display: block; margin: 1.5rem 0; }
.download { font-size: .9rem; }

.adjacent { list-style: none; margin: 2.5rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid var(--line); }
.adjacent li { margin-bottom: .4rem; color: var(--muted); font-size: .95rem; }

/* ---- listen card -------------------------------------------------------- */
.listen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.listen h2 { margin-bottom: .4rem; }
.listen p { margin: .4rem 0; color: var(--muted); }
.feed {
  display: inline-block; margin-top: .3rem; padding: .4rem .6rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem; word-break: break-all; color: var(--ink);
}

/* ---- prose -------------------------------------------------------------- */
img, svg, video { max-width: 100%; height: auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }

/* Footnotes are an aside you arrive at, so they read as one. */
.footnotes { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.footnotes hr { display: none; }
.footnotes ol { padding-left: 1.5rem; }
.footnotes p { margin: .25rem 0; }

/* ---- pagination --------------------------------------------------------- */
.pagination { margin-top: 2rem; color: var(--muted); font-size: .95rem; }
.pagination a { margin: 0 .5rem; }

/* ---- footer ------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: .9rem;
}
footer p { margin: .35rem 0; }
