/* UK radio directory – one stylesheet for every page type */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #efeee8;
  --ink: #15181f;
  --ink-2: #4a4f5c;
  --ink-3: #737885;
  --line: #dddbd3;
  --accent: #d9372b;          /* on-air red: play buttons, live dots */
  --accent-ink: #ffffff;
  --accent-soft: #fbe6e3;
  --dab: #0f7c74;             /* DAB / digital */
  --dab-soft: #dff1ee;
  --fm: #3f51b5;              /* FM / AM */
  --fm-soft: #e5e8f8;
  --warn: #9a6400;
  --warn-soft: #fbf0d9;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(20 24 31 / 6%), 0 4px 16px rgb(20 24 31 / 6%);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1f232c;
    --ink: #ecebe6;
    --ink-2: #b5b8c2;
    --ink-3: #8a8e9a;
    --line: #2c313c;
    --accent: #ff5a4c;
    --accent-ink: #1a0503;
    --accent-soft: #3a1714;
    --dab: #4cc6bb;
    --dab-soft: #12302d;
    --fm: #8f9dff;
    --fm-soft: #1d2140;
    --warn: #f2b84b;
    --warn-soft: #33270f;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  padding-bottom: 88px; /* room for the sticky player */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; margin-top: 2.2rem; }
h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.4rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.num, .freq { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 2px solid var(--accent-ink); }
.site-nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: .92rem; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--accent); }
.site-footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .875rem; }
.site-footer a { color: var(--ink-2); }

/* ---------- breadcrumbs */
.crumbs { font-size: .85rem; color: var(--ink-3); margin: 20px 0 8px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.crumbs a { text-decoration: none; }

/* ---------- hero */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin: 12px 0 24px; }
.hero-logo { width: 112px; height: 112px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow);
  object-fit: contain; padding: 0; overflow: hidden; }
.hero-logo.placeholder { display: grid; place-items: center; font-weight: 800; font-size: 2rem; color: var(--ink-3); }
.hero h1 { margin-bottom: .25em; }
.hero .tagline { color: var(--ink-2); margin: 0 0 14px; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; gap: 14px; }
  .hero-logo { width: 84px; height: 84px; border-radius: 16px; }
}

/* ---------- buttons, chips, badges */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; font-weight: 650; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  text-decoration: none; transition: transform .12s ease, background .12s ease; }
.btn:hover { color: var(--ink); background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn-play { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-play:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.06); }
.btn-play .icon { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.btn-play.is-playing .icon { width: 10px; height: 12px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .85rem;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.fm { background: var(--fm-soft); color: var(--fm); font-family: var(--mono); }
.chip.dab { background: var(--dab-soft); color: var(--dab); }
.chip.plain { font-family: var(--sans); }
.chip.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .78rem; font-weight: 650; }
.badge.good { background: var(--dab-soft); color: var(--dab); }
.badge.fringe { background: var(--warn-soft); color: var(--warn); }
.badge.band-fm, .badge.band-am { background: var(--fm-soft); color: var(--fm); }
.badge.band-dab { background: var(--dab-soft); color: var(--dab); }

/* ---------- layout blocks */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: .94rem; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.answer { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 18px 20px; margin: 8px 0 24px; box-shadow: var(--shadow); }
.answer p:last-child { margin-bottom: 0; }
.answer .big { font-size: 1.25rem; font-weight: 750; }
.listen-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin: 12px 0; }
.listen-way { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.listen-way strong { display: block; margin-bottom: 4px; }
.listen-way .val { font-size: .95rem; color: var(--ink-2); }
.listen-way .val.freq { font-family: var(--mono); }

/* ---------- station cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 12px 0; }
.card { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; transition: border-color .12s ease; }
.card:hover { border-color: var(--ink-3); color: inherit; }
.card img, .card .ph { width: 52px; height: 52px; border-radius: 10px; object-fit: contain; background: var(--surface-2); }
.card .ph { display: grid; place-items: center; font-weight: 800; color: var(--ink-3); }
.card .name { font-weight: 700; line-height: 1.25; }
.card .sub { font-size: .82rem; color: var(--ink-3); font-family: var(--mono); }

/* ---------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 12px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); background: var(--surface-2);
  position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.freq { white-space: nowrap; font-weight: 650; }
table.data tr.group td { background: var(--surface-2); font-weight: 700; color: var(--ink-2); font-size: .85rem; }
table.data tr[hidden] { display: none; }
@media (max-width: 560px) { table.data .opt { display: none; } }
.filter { display: flex; gap: 10px; align-items: center; margin: 16px 0 4px; flex-wrap: wrap; }
.filter input { flex: 1 1 260px; font: inherit; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); }
.filter input:focus { outline: 2px solid var(--fm); outline-offset: 1px; }

/* ---------- map */
.map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); margin: 12px 0; background: var(--surface-2); }
@media (max-width: 560px) { .map { height: 280px; } }

/* ---------- prose & copy slots */
.prose { max-width: 70ch; }
.source-note { font-size: .82rem; color: var(--ink-3); margin-top: 10px; }
body.review [data-draft-copy] { outline: 2px dashed var(--dab); outline-offset: 6px; margin-top: 10px; }
body.review [data-draft-copy]::before { content: "Drafted copy – check facts before publishing"; display: inline-block;
  margin-bottom: 8px; font-size: .72rem; font-weight: 700; color: var(--dab); background: var(--dab-soft);
  padding: 1px 8px; border-radius: 6px; }
body.review [data-auto-copy] { outline: 2px dashed var(--warn); outline-offset: 6px; margin-top: 10px; }
body.review [data-auto-copy]::before { content: "Auto copy – replace with written text"; display: inline-block; margin-bottom: 8px;
  font-size: .72rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 8px; border-radius: 6px; }

/* ---------- sticky player */
.player-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 24px rgb(0 0 0 / 10%); transform: translateY(110%); transition: transform .2s ease; }
.player-bar.is-open { transform: none; }
.player-bar .wrap { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center; min-height: 68px; }
.player-bar img { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: var(--surface-2); }
.player-bar .now { min-width: 0; }
.player-bar .now strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar .status { font-size: .8rem; color: var(--ink-3); }
.player-bar .status.err { color: var(--accent); }
.player-bar input[type=range] { width: 110px; accent-color: var(--accent); }
@media (max-width: 560px) { .player-bar input[type=range] { display: none; } .player-bar .wrap { grid-template-columns: 44px 1fr auto; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
