:root {
  --paper: #120d24;
  --card: #1b1838;
  --ink: #f3f0fa;
  --muted: #b4b0cc;
  --line: #2f2c57;
  --accent: #ff5a5f;
  --link: #7fd6cf;
  --gold: #3fc1b4;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --paper: #f4f2fa;
    --card: #ffffff;
    --ink: #1c1740;
    --muted: #55526f;
    --line: #d8d3ec;
    --accent: #d42a2f;
    --link: #1c6f6a;
    --gold: #1f9d92;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

.masthead {
  background: linear-gradient(90deg, #2b1748 0%, #241a4f 35%, #172935 75%, #1c3f41 100%);
  border-bottom: 3px solid var(--accent);
  color: #fff;
}

.masthead .banner { color: #fff; font: 700 1.5rem Georgia, serif; text-decoration: none; padding: 0.8rem 1rem; display: block; width: 100%; max-width: 80rem; margin: 0 auto; }
.masthead .banner img { display: block; width: 100%; height: auto; min-height: 4rem; }

.masthead .brand-text {
  display: block;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.6rem 1rem 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.6rem 1rem 0.75rem;
  font-size: 0.95rem;
}

.masthead nav a { color: #dcd8f0; text-decoration: none; }
.masthead nav a:hover { color: #fff; text-decoration: underline; }

main, footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1rem;
}

main { padding-bottom: 2rem; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }
h1 { font-size: 1.8rem; margin: 1.5rem 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 1.75rem 0 0.75rem; border-bottom: 1px solid var(--line); padding-bottom: 0.25rem; }

.intro p, .lede { color: var(--muted); font-size: 1.05rem; margin: 1rem 0 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}

.card.nostalgic { border-left-color: var(--gold); }
.card[hidden] { display: none; }

.card-title { font-size: 1.1rem; margin: 0 0 0.25rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); text-decoration: underline; }

.card p { margin: 0.3rem 0; }
.meta { font-size: 0.85rem; color: var(--muted); }
.source { font-weight: 600; margin-right: 0.5rem; }
.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--gold);
  color: #241b12;
  font-size: 0.75rem;
  font-weight: 600;
}
.excerpt { font-size: 0.95rem; }
.note, .episode { font-size: 0.92rem; }
.why { font-size: 0.8rem; color: var(--muted); font-style: italic; }
.tags span {
  display: inline-block;
  margin: 0.1rem 0.35rem 0.1rem 0;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}
.filters input[type="search"], .filters select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  max-width: 100%;
}
.check { display: inline-flex; gap: 0.35rem; align-items: center; }
.count { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); font-style: italic; }

.thisday {
  background: var(--card);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 0.25rem 1rem 0.75rem;
  margin-top: 1.25rem;
}
.thisday[hidden] { display: none; }
.thisday h2 { border: 0; margin-top: 0.75rem; }
.thisday ul { margin: 0; padding-left: 1.1rem; }

.months { list-style: none; padding: 0; }
.months li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }

table.status { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.status th, table.status td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.status tr.bad td:nth-child(2) { color: var(--accent); }

footer {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
footer p { margin: 0.25rem 0; }

.card .also { font-size: 0.9rem; color: var(--muted, #6b5b4b); }
.card .also a { color: inherit; }

/* Story cards with thumbnails */
.card { border-radius: 12px; display: flex; gap: 1rem; align-items: flex-start; padding: 0.9rem 1rem; }
.card-body { flex: 1 1 auto; min-width: 0; }
.card .meta { margin: 0.1rem 0; }
.card .source { text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.78rem; color: var(--accent); }
.card-title { font-size: 1.15rem; line-height: 1.25; }
.thumb { order: 2; flex: 0 0 7.5rem; width: 7.5rem; height: 7.5rem; border-radius: 8px; overflow: hidden; background: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.lead { flex-direction: column; padding: 0; overflow: hidden; border-left-width: 1px; }
.card.lead.nostalgic { border-left-color: var(--line); border-top: 4px solid var(--gold); }
.card.lead .thumb { order: 0; flex: none; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; }
.card.lead .card-body { padding: 0.9rem 1rem 1rem; width: 100%; box-sizing: border-box; }
.card.lead .card-title { font-size: 1.5rem; }
@media (max-width: 30rem) { .thumb { flex-basis: 5.5rem; width: 5.5rem; height: 5.5rem; } }

/* Episodes */
.yt { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.yt iframe, .yt-lite, .yt-lite img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.yt-lite .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 3.5rem; height: 3.5rem; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; padding-left: 0.2rem; box-sizing: border-box; }
.yt-lite:hover .play, .yt-lite:focus .play { background: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.featured { margin: 0.5rem 0 1.5rem; }
.featured .card-title { font-size: 1.4rem; margin-top: 0.6rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem; margin: 1rem 0; }
.ep .card-title { font-size: 1rem; margin: 0.5rem 0 0.1rem; }
.ep-audio { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.ep-audio audio { width: 100%; margin-top: 0.4rem; }
.listen-links { color: var(--muted); }

/* About page marquee */
.marquee { margin: 1.25rem 0 0; }
.marquee img { display: block; width: 100%; max-width: 35rem; height: auto; border-radius: 10px; border: 1px solid var(--line); }

/* Family page */
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem; margin: 1rem 0; }
.card.fam { display: block; padding: 0 0 0.9rem; overflow: hidden; margin: 0; }
.card.fam .fam-pic img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card.fam .card-title, .card.fam p { margin: 0.6rem 1rem 0; }

/* Live Shows */
.day { margin: 1.5rem 0; }
.day[hidden], .show[hidden] { display: none; }
.day-head { font-size: 1.15rem; margin: 0 0 0.5rem; }
.show-list { list-style: none; margin: 0; padding: 0; }
.show { display: flex; gap: 0.9rem; align-items: baseline; padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--line); }
.show-time { flex: 0 0 5.2rem; font-weight: 600; color: var(--muted); font-size: 0.95rem; }
.show-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.show-title { color: var(--ink); text-decoration: none; font-weight: 600; }
.show-title:hover { color: var(--accent); text-decoration: underline; }
.show-venue { color: var(--muted); font-size: 0.85rem; }
.show-tix { flex: 0 0 auto; font-size: 0.85rem; border: 1px solid var(--gold); border-radius: 999px; padding: 0.1rem 0.7rem; text-decoration: none; }
.shows-note { color: var(--muted); font-size: 0.85rem; margin-top: 2rem; }
@media (max-width: 30rem) { .show-time { flex-basis: 4.2rem; } }
