/* Subsistenzradio – public page. Only local resources, system fonts. */
:root {
  --bg: #f2ede2;
  --surface: #fbf8f1;
  --ink: #1c1a16;
  --muted: #6a6457;
  --line: #ddd5c4;
  --accent: #d63a1d;
  --accent-ink: #fff;
  --moss: #3f6b3a;
  --onair-bg: #1c1a16;
  --onair-ink: #f5f0e4;
  --onair-muted: #b9b1a1;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --surface: #1d1b17;
    --ink: #eee8db;
    --muted: #a39c8d;
    --line: #353128;
    --accent: #ff5b3a;
    --moss: #93c27d;
    --onair-bg: #26231d;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
p { margin: 0 0 .8em; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- header ---------- */
.site-head { border-bottom: 3px solid var(--ink); background: var(--bg); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand:hover { color: inherit; }
.logo { width: 46px; height: 46px; color: var(--accent); flex: none; }
.logo-sm { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 900; font-size: 1.45rem; letter-spacing: .05em; text-transform: uppercase; line-height: 1.05; }
.brand-tag { font-size: .85rem; color: var(--muted); }
.search { display: flex; align-items: stretch; flex: 1 1 260px; max-width: 380px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); overflow: hidden; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: .95rem; padding: 8px 14px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.search button { border: 0; background: var(--ink); color: var(--bg); width: 46px; cursor: pointer; display: grid; place-items: center; }
.search button svg { width: 20px; height: 20px; }
@media (max-width: 640px) { .search { max-width: none; flex-basis: 100%; } }

.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 0; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 8px 12px 10px; font-weight: 800; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; border-bottom: 4px solid transparent;
}
.main-nav a:first-child { padding-left: 0; }
.main-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

main.wrap { padding-top: 28px; padding-bottom: 56px; }

/* ---------- typography blocks ---------- */
.page-title { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 900; letter-spacing: -.01em; margin-bottom: .35em; }
.lead { font-size: 1.1rem; color: var(--muted); margin-bottom: 1.4em; }
.sec-title {
  display: flex; align-items: center; gap: 10px; margin: 36px 0 14px;
  font-size: .9rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
}
.sec-title::before { content: ""; width: 18px; height: 6px; background: var(--accent); border-radius: 2px; }
.day-head { font-size: 1rem; font-weight: 800; margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-size: 1.15rem; font-weight: 800; margin: 1.6em 0 .5em; }
.prose h3 { font-size: 1rem; font-weight: 800; margin: 1.3em 0 .4em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: .2em 0; }
.prose a { overflow-wrap: anywhere; }
.legal { font-size: .97rem; }
.empty { color: var(--muted); padding: 18px 0; }
.more { display: inline-block; margin-top: 12px; font-weight: 700; font-size: .95rem; }

/* ---------- buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  border: 2px solid currentColor; font-weight: 800; font-size: .95rem; text-decoration: none; cursor: pointer;
  background: transparent; color: inherit;
}
.btn:hover { color: var(--accent); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { color: var(--accent-ink); filter: brightness(1.08); }
.chip {
  display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .85rem; font-weight: 600; text-decoration: none; background: var(--surface); margin: 2px 4px 2px 0;
}
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .7rem; font-weight: 900;
  letter-spacing: .1em; text-transform: uppercase; background: var(--line); color: var(--ink); vertical-align: middle;
}
.badge-live { background: var(--accent); color: var(--accent-ink); }
.badge-podcast { background: var(--moss); color: #fff; }
.badge-upcoming { background: var(--ink); color: var(--bg); }

/* ---------- on air hero ---------- */
.onair {
  display: grid; grid-template-columns: 1fr; gap: 0;
  background: var(--onair-bg); color: var(--onair-ink); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 860px) { .onair { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); } }
.onair a:hover { color: #fff; }
.onair-main { padding: 26px 22px; }
@media (min-width: 720px) { .onair-main { padding: 34px 36px; } }
.onair-state { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--onair-muted); }
.onair .dot { width: 12px; height: 12px; border-radius: 50%; background: #6b665c; flex: none; }
.onair.is-live .onair-state { color: #ff7a5c; }
.onair.is-live .dot { background: #ff4a24; box-shadow: 0 0 0 0 rgba(255, 74, 36, .6); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 74, 36, .55); } 70% { box-shadow: 0 0 0 12px rgba(255, 74, 36, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 74, 36, 0); } }
.onair.is-rotation .onair-state { color: #9fd18a; }
.onair.is-rotation .dot { background: #7fc267; animation: none; box-shadow: 0 0 0 4px rgba(127, 194, 103, .2); }
.onair-desc a { color: inherit; }
@media (prefers-reduced-motion: reduce) { .onair.is-live .dot { animation: none; } }
.onair-kicker { color: var(--onair-muted); font-weight: 700; margin-bottom: 6px; }
.onair-title { font-size: clamp(1.8rem, 5vw, 3.1rem); font-weight: 900; letter-spacing: -.015em; line-height: 1.05; margin: 6px 0 10px; overflow-wrap: anywhere; }
.onair-title a { text-decoration: none; }
.onair-meta { color: var(--onair-muted); }
.onair-desc { color: var(--onair-ink); opacity: .88; max-width: 60ch; }
.onair .btn { margin-top: 8px; }
.onair .btn:not(.btn-accent) { color: var(--onair-ink); }

.np-box { padding: 24px 22px 26px; border-top: 1px dashed rgba(255, 255, 255, .2); display: flex; flex-direction: column; }
@media (min-width: 860px) { .np-box { border-top: 0; border-left: 1px dashed rgba(255, 255, 255, .2); padding: 34px 30px; } }
.np-box .label { font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--onair-muted); margin-bottom: 4px; }
.np-title { font-size: 1.25rem; font-weight: 800; line-height: 1.3; margin-bottom: 22px; overflow-wrap: anywhere; }
.np-recent { list-style: none; margin: 0 0 8px; padding: 0; font-size: .92rem; }
.np-recent li { padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); overflow-wrap: anywhere; }
.np-recent .mono { color: var(--onair-muted); margin-right: 6px; }
.np-box .more { margin-top: auto; padding-top: 10px; color: var(--onair-ink); }
.np-box .muted { color: var(--onair-muted); }

/* click-to-load YouTube */
.embed { position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 720px; margin: 16px 0 8px; border-radius: 10px; overflow: hidden; background: #000; color: #f5f0e4; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px; text-align: center;
  background: repeating-linear-gradient(-45deg, #1f1d19 0 14px, #24221d 14px 28px); }
.embed-ph p { font-size: .82rem; color: #b9b1a1; max-width: 46ch; margin: 0; }
.embed-ph a { color: #f5f0e4; }
.embed-btn { display: inline-flex; align-items: center; gap: 12px; border: 0; border-radius: 999px; padding: 12px 22px 12px 14px; background: var(--accent); color: #fff; font: 800 1rem var(--font); cursor: pointer; }
.embed-btn:hover { filter: brightness(1.08); }
.play { width: 30px; height: 30px; border-radius: 50%; background: #fff; position: relative; }
.play::after { content: ""; position: absolute; left: 11px; top: 8px; border-left: 12px solid var(--accent); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.detail .embed { margin-top: 22px; }

/* ---------- lists ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 48px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item-nodate { grid-template-columns: 1fr; }
.datebox {
  width: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 2px solid var(--ink); border-radius: 10px; padding: 6px 2px; text-decoration: none; line-height: 1.05; align-self: start;
}
.db-wd { font-size: .68rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.db-d { font-size: 1.55rem; font-weight: 900; }
.db-m { font-size: .68rem; font-weight: 700; color: var(--muted); }
.item-live .datebox { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.item-live .datebox .db-m { color: inherit; }
.item-body { min-width: 0; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .85rem; color: var(--muted); margin-bottom: 2px; }
.item-title { font-size: 1.12rem; font-weight: 800; overflow-wrap: anywhere; }
.item-title a { text-decoration: none; }
.item-desc { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.item-links { margin-top: 6px; }

.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li { display: grid; grid-template-columns: 56px 1fr; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.t-time { color: var(--muted); }
.t-title { font-weight: 600; overflow-wrap: anywhere; }
.t-show { grid-column: 2; font-size: .82rem; color: var(--muted); text-decoration: none; }
@media (min-width: 720px) {
  .tracks li { grid-template-columns: 64px 1fr minmax(0, 34%); }
  .t-show { grid-column: auto; text-align: right; }
}

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; font-weight: 700; }
.pager-info { color: var(--muted); font-weight: 500; font-size: .9rem; }

/* ---------- detail ---------- */
.back { display: inline-block; margin-bottom: 18px; font-weight: 700; text-decoration: none; color: var(--muted); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; color: var(--muted); }
.detail-links { margin: 18px 0 8px; }
.audio { margin: 16px 0; }
.audio figcaption { font-weight: 700; margin-bottom: 6px; }
.audio audio { width: 100%; max-width: 520px; }
.about { margin-top: 12px; }

/* ---------- footer ---------- */
.site-foot { border-top: 3px solid var(--ink); padding: 22px 0 34px; font-size: .9rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-note { color: var(--muted); font-size: .8rem; margin-top: 12px; }
