/* WUFR — The Public Listening Service
   Design tokens follow the WUFR design system board, with these changes:
   - --accent-text (#B83A0A) for small orange text so it stays readable
   - "On Air" instead of "Live" (episodes, not a live stream)
   - no green "live" colour */

:root {
  --ink: #1F1F1F;
  --accent: #E0440A;
  --accent-text: #B83A0A;
  --accent-tint: #FBE6DC;
  --secondary: #3A3A3A;
  --neutral: #6B6B6B;
  --bg: #F5F4F2;
  --surface: #FFFFFF;
  --border: #E0DEDB;
  --on-dark: #F5F4F2;
  --on-dark-muted: #C9C7C3;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;
  --r-subtle: 4px; --r: 8px; --r-card: 12px; --r-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  --max: 1280px;
  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-text); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* ---------- header ---------- */
.site-header { position: relative; background: #E5E4E2; }
.site-header img { width: 100%; height: auto; }
.header-hotspots a { position: absolute; top: 28%; height: 14%; }
.header-hotspots a:focus-visible { outline-offset: 0; }
.mobile-nav { display: none; }
@media (max-width: 760px) {
  .header-hotspots { display: none; }
  .mobile-nav {
    display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: center;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px var(--s3);
  }
  .mobile-nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 6px 0; }
  .mobile-nav a[aria-current="page"] { border-bottom: 3px solid var(--accent); }
}

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: var(--s4) var(--s3) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--s5); }
.section-title {
  margin: 0 0 var(--s3); font-size: 30px; line-height: 1.15; font-weight: 700;
  border-bottom: 3px solid var(--ink); padding-bottom: var(--s2);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3);
}
.section-title small { font-size: 18px; font-weight: 400; font-style: italic; color: var(--neutral); }

/* ---------- buttons & pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 10px 18px; border-radius: var(--r-subtle);
  font: 700 15px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; font-size: 19px; }
.btn-primary:hover { background: var(--accent-text); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--secondary); color: #fff; }
.btn-ghost-dark { background: transparent; color: var(--on-dark); border-color: var(--on-dark-muted); }
.btn-ghost-dark:hover { background: var(--on-dark); color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.pill-onair {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff; padding: 6px 14px; border-radius: var(--r-subtle);
  font: 700 19px/1.2 var(--font); letter-spacing: 0.06em; text-transform: uppercase;
}
.pill-onair::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.is-playing .pill-onair::before { animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.badge-new {
  display: inline-block; font: 700 12px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-text); border: 1px solid var(--accent-text); border-radius: var(--r-subtle); padding: 3px 6px;
}

.icon { width: 1em; height: 1em; flex: none; }

/* ---------- player ---------- */
.player {
  background: var(--ink); color: var(--on-dark); border-radius: var(--r);
  padding: var(--s3) var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s3);
}
.player-top { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; }
.player-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.play-btn {
  width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--on-dark);
  background: transparent; color: var(--on-dark); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.play-btn:hover { background: var(--on-dark); color: var(--ink); }
.play-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.play-btn:disabled:hover { background: transparent; color: var(--on-dark); }
.play-btn svg { width: 34px; height: 34px; }
.now { flex: 1 1 260px; min-width: 0; }
.now-kicker { font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-dark-muted); font-weight: 600; }
.now-title { font-size: 28px; font-weight: 700; line-height: 1.15; margin: 2px 0 0; }
.now-sub { font-size: 17px; color: var(--on-dark-muted); }
.wave { flex: 1 1 220px; display: flex; align-items: center; gap: 3px; height: 48px; }
.wave span { flex: 1; background: var(--on-dark-muted); border-radius: 1px; min-height: 4px; transform-origin: center; }
.is-playing .wave span { animation: wave 1.2s ease-in-out infinite; }
@keyframes wave { 50% { transform: scaleY(0.45); } }
@media (prefers-reduced-motion: reduce) {
  .is-playing .wave span, .is-playing .pill-onair::before { animation: none; }
}
.volume { display: flex; align-items: center; gap: var(--s2); color: var(--on-dark-muted); }
.volume input { width: 120px; accent-color: var(--on-dark); }

.seek { display: flex; align-items: center; gap: var(--s3); font-size: 15px; color: var(--on-dark-muted); font-variant-numeric: tabular-nums; }
.seek input { flex: 1; accent-color: var(--accent); min-width: 0; }

/* the tuning dial */
.dial { background: #ECEBE6; color: var(--ink); border-radius: var(--r-subtle); padding: 14px var(--s4) 10px; position: relative; overflow: hidden; }
.dial-stations { position: relative; height: 30px; }
.dial-stations button {
  position: absolute; top: 0; transform: translateX(-50%);
  background: none; border: 0; padding: 4px 6px; min-width: 44px; min-height: 30px; cursor: pointer;
  font: 700 18px/1 var(--font); color: var(--ink);
}
.dial-stations button[aria-pressed="true"] { color: var(--accent-text); }
.dial-ticks { height: 20px; margin-top: 4px; background-image: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 20px); opacity: 0.55; }
.dial-needle { position: absolute; top: 40px; bottom: 8px; width: 4px; background: var(--accent); border-radius: 2px; transition: left 0.5s ease; }
.dial-caption { font-size: 13px; letter-spacing: 0.12em; font-weight: 700; margin-top: 6px; color: var(--secondary); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.panel-head {
  margin: 0; display: flex; align-items: center; gap: var(--s2); padding: 10px var(--s3);
  font-size: 19px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff;
}
.panel-head.accent { background: var(--accent); }
.panel-head.dark { background: var(--secondary); }
.panel-head svg { width: 24px; height: 24px; }
.panel-head .head-link { margin-left: auto; color: #fff; font-size: 14px; letter-spacing: 0.02em; text-transform: none; font-weight: 600; }
.panel-body { padding: 0 var(--s3); }
.empty { padding: var(--s4) var(--s2); color: var(--neutral); font-style: italic; }

.bulletin { display: flex; gap: var(--s3); padding: 12px var(--s2); border-bottom: 1px solid var(--border); position: relative; }
.bulletin:last-child { border-bottom: 0; }
.bulletin.pinned::before { content: ""; position: absolute; left: -16px; top: 18px; bottom: 18px; width: 5px; background: var(--accent); }
.bulletin h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.bulletin p { font-size: 16px; }
.bulletin p { margin: 4px 0 0; }
.bulletin time { margin-left: auto; font-size: 14px; color: var(--neutral); white-space: nowrap; }

.rundown-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 2px var(--s3);
  padding: 9px var(--s2); border-bottom: 1px solid var(--border); position: relative;
}
.rundown-row:last-child { border-bottom: 0; }
.rundown-row .t { font-variant-numeric: tabular-nums; }
.rundown-row .t button { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border); }
.rundown-row .t button:hover, .rundown-row .t button:focus-visible { color: var(--accent-text); }
.rundown-row .name { font-weight: 700; }
.rundown-row .credit { grid-column: 2; font-size: 14px; color: var(--neutral); }
.rundown-row .credit a { color: var(--neutral); }
.rundown-row.current { background: var(--accent-tint); }
.rundown-row.current::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; background: var(--accent); }
.rundown-row .onair-tag { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--accent-text); margin-left: var(--s2); }

/* ---------- quick tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px var(--s2);
  text-decoration: none; color: var(--ink); font-weight: 700; text-align: center;
}
.tile svg { width: 28px; height: 28px; color: var(--accent); }
.tile:hover { outline: 2px solid var(--accent); color: var(--ink); }

/* ---------- episode cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--s4); }
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-cover { aspect-ratio: 16 / 9; background: #D9D8D5; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.card-cover.placeholder { display: flex; align-items: center; justify-content: center; color: var(--neutral); }
.card-cover.placeholder svg { width: 56px; height: 56px; }
.card-body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.card-kicker { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.card h3 { margin: 0; font-size: 24px; line-height: 1.2; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card-meta { font-size: 15px; color: var(--neutral); }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding-top: var(--s2); }

/* ---------- on demand segments ---------- */
.segs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 var(--s5); }
.seg { display: flex; align-items: center; gap: var(--s3); border-bottom: 1px solid var(--border); padding: 12px 0; }
.seg-play {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: transparent;
  color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.seg-play:hover, .seg-play[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-play svg { width: 14px; height: 14px; }
.seg-title { flex: 1; font-size: 18px; font-weight: 600; }
.seg-from { font-size: 14px; color: var(--neutral); white-space: nowrap; }
.seg-from a { color: var(--neutral); }

/* ---------- upcoming & about ---------- */
.upcoming-row { display: grid; grid-template-columns: 110px 1fr; gap: var(--s3); padding: 12px var(--s2); border-bottom: 1px solid var(--border); }
.upcoming-row:last-child { border-bottom: 0; }
.upcoming-row .d { font-weight: 600; }
.upcoming-row .n { grid-column: 2; font-size: 15px; color: var(--neutral); }
.about { margin-top: var(--s3); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s4); display: flex; gap: var(--s4); align-items: flex-start; }
.about svg { width: 28px; height: 28px; color: var(--accent); flex: none; margin-top: 4px; }
.about-text > :first-child { margin-top: 0; }
.about-text > :last-child { margin-bottom: 0; }
.subscribe { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }

/* ---------- episode page ---------- */
.ep-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s5); align-items: start; }
.ep-hero .card-cover { border-radius: var(--r-card); }
.ep-hero h1 { margin: 4px 0 var(--s2); font-size: clamp(32px, 5vw, 48px); line-height: 1.1; }
.ep-hero p { margin: 0 0 var(--s3); }
.back { font-weight: 600; text-decoration: none; }

/* ---------- ticker (news crawl) ---------- */
.ticker { display: flex; align-items: stretch; background: #C2380A; color: #fff; overflow: hidden; font-size: 17px; }
.ticker-label {
  flex: none; background: var(--ink); padding: 8px var(--s3); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: center;
}
.ticker-track { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker-move { display: inline-flex; white-space: nowrap; animation: crawl 60s linear infinite; padding: 8px 0; }
.ticker-move > span { display: inline-flex; }
.ticker:hover .ticker-move { animation-play-state: paused; }
.ticker-item { padding: 0 var(--s5) 0 0; }
.ticker-item::after { content: "■"; font-size: 10px; margin-left: var(--s5); vertical-align: middle; opacity: 0.7; }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-move { animation: none; }
  .ticker-move > span[aria-hidden] { display: none; }
}

/* ---------- dashboard (first screen) ---------- */
.dashboard { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-start; }
.dash-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: var(--s3); }
.dash-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- stat bar ---------- */
.statbar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--secondary); color: var(--on-dark); border-radius: var(--r);
}
.stat { padding: 12px var(--s4); display: flex; flex-direction: column; border-left: 1px solid #555; }
.stat:first-child { border-left: 0; }
.stat-k { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-muted); font-weight: 600; }
.stat-v { font-size: 26px; font-weight: 700; line-height: 1.2; text-transform: uppercase; }

/* ---------- compact archive ---------- */
.archive { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 12px var(--s4); }
.arow {
  display: flex; align-items: center; gap: var(--s3); background: var(--surface);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; min-width: 0;
}
.arow-thumb { flex: none; width: 96px; height: 72px; border-radius: var(--r-subtle); overflow: hidden; background: #D9D8D5; }
.arow-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.arow-text { flex: 1; min-width: 0; }
.arow-text h3 { margin: 0; font-size: 19px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-text h3 a { color: var(--ink); text-decoration: none; }
.arow-text h3 a:hover { text-decoration: underline; }
.arow-text .card-kicker { font-size: 13px; }
.arow-text .card-meta { font-size: 14px; }
.arow-actions { display: flex; gap: 6px; flex: none; }
.btn-sm { min-height: 44px; padding: 8px 12px; font-size: 13px; }

/* ---------- dark On Demand band ---------- */
.band { background: var(--ink); color: var(--on-dark); position: relative; margin-top: 64px; }
.band::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 64px;
  background: url(/assets/img/treeline.png) center bottom / auto 100% repeat-x;
}
.band-inner { max-width: var(--max); margin: 0 auto; padding: var(--s4) var(--s3) var(--s5); }
.section-title.on-dark { border-color: var(--on-dark); color: var(--on-dark); }
.section-title.on-dark small { color: var(--on-dark-muted); }
.band .seg { border-color: #3A3A3A; }
.band .seg-play { border-color: var(--on-dark); color: var(--on-dark); }
.band .seg-play:hover, .band .seg-play[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.band .seg-from, .band .seg-from a { color: var(--on-dark-muted); }
.band .empty { color: var(--on-dark-muted); }

/* ---------- dark footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark); position: relative; margin-top: 72px; }
.footer-trees {
  position: absolute; left: 0; right: 0; bottom: 100%; height: 56px;
  background: url(/assets/img/treeline.png) left bottom / auto 100% repeat-x;
}
.site-footer .inner {
  max-width: var(--max); margin: 0 auto; padding: var(--s4) var(--s3) var(--s5);
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: var(--s3); }
.footer-logo { display: inline-flex; align-items: flex-start; font-size: 56px; font-weight: 700; line-height: 0.9; letter-spacing: -1px; }
.footer-logo svg { width: 24px; height: 48px; color: var(--accent); margin-left: 2px; }
.footer-name { font-weight: 700; font-size: 19px; }
.footer-tag { font-style: italic; color: var(--on-dark-muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px var(--s4); }
.footer-links a { color: var(--on-dark); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: #FF8A5C; text-decoration: underline; }
.footer-note { flex-basis: 100%; margin: 0; padding-top: var(--s3); border-top: 1px solid #3A3A3A; font-size: 14px; color: var(--on-dark-muted); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .player-main { gap: 12px var(--s3); }
  .player .play-btn { width: 64px; height: 64px; border-width: 2px; }
  .player .play-btn svg { width: 24px; height: 24px; }
  .now { flex: 1 1 160px; }
  .now-kicker { font-size: 13px; }
  .now-title { font-size: 21px; }
  .now-sub { font-size: 15px; }
  .wave { flex-basis: 100%; height: 28px; }
  .dial { padding: 10px 14px 8px; }
  .dial-stations button { font-size: 16px; }
  .panel-head { font-size: 16px; letter-spacing: 0.04em; }
  .panel-head .head-link { white-space: nowrap; font-size: 13px; }
  .mobile-nav { padding: 6px var(--s3); gap: var(--s3); }
  .arow { flex-wrap: wrap; }
  .arow-actions { width: 100%; }
  .arow-actions .btn { flex: 1; }
  .ticker-label { display: none; }
  .footer-logo { font-size: 44px; }
  .player { padding: var(--s3); }
  .now-title { font-size: 24px; }
  .section-title { font-size: 28px; }
  .upcoming-row { grid-template-columns: 1fr; }
  .upcoming-row .n { grid-column: 1; }
  .volume { display: none; }
}
