/* ==========================================================================
   Fort Collins Public Media
   One stylesheet. No preprocessor, no framework, no build step.

   Design intent: this is a broadcast facility, not a startup. The look is
   editorial and high-contrast — heavy type, generous space, one signal color
   used sparingly for anything live or actionable. No gradients, no drop
   shadows, no rounded-everything. Rules and blocks do the structural work.

   To rebrand: change the tokens in :root. Nothing below hardcodes a color.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Palette */
  --ink:        #16191d;  /* body text, dark surfaces */
  --ink-soft:   #545c66;  /* secondary text */
  --paper:      #fbf9f5;  /* page background — warm, not white */
  --paper-alt:  #f0ece4;  /* banded sections */
  --rule:       #d9d3c8;  /* hairlines */
  --signal:     #d8452a;  /* on-air red: live, urgent, primary action */
  --signal-ink: #ffffff;
  --accent:     #1f6a66;  /* links and quiet emphasis */

  /* Type. Swap these two lines to adopt real webfonts later; everything
     else scales off them. */
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  --font-body:    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Fluid type scale */
  --step--1: clamp(0.86rem, 0.83rem + 0.15vw, 0.94rem);
  --step-0:  clamp(1.02rem, 0.98rem + 0.20vw, 1.13rem);
  --step-1:  clamp(1.28rem, 1.18rem + 0.45vw, 1.55rem);
  --step-2:  clamp(1.60rem, 1.40rem + 0.95vw, 2.15rem);
  --step-3:  clamp(2.00rem, 1.60rem + 1.90vw, 3.10rem);
  --step-4:  clamp(2.50rem, 1.75rem + 3.40vw, 4.60rem);

  /* Space and measure */
  --wrap: 68rem;
  --measure: 38rem;
  --gap: clamp(1rem, 0.7rem + 1.4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #ece8e1;
    --ink-soft:  #a1a8b2;
    --paper:     #131619;
    --paper-alt: #1c2126;
    --rule:      #2f363d;
    --signal:    #ff6a4d;
    --signal-ink:#1a0d09;
    --accent:    #58bdb5;
  }
}

/* --- Base ----------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-underline-offset: 0.18em;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p, ul, ol, dl, table { margin: 0 0 1.1em; }

a { color: var(--accent); text-decoration-thickness: 1px; }
a:hover { color: var(--signal); }

img { max-width: 100%; height: auto; display: block; }

code { font-family: var(--font-mono); font-size: 0.9em; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--signal); color: var(--signal-ink);
  padding: 0.75rem 1.25rem; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --- Layout --------------------------------------------------------------- */

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

/* Prose holds text to a comfortable reading measure, but grids and data
   tables are allowed the full column width. Hence the measure lives on the
   text elements rather than on the container. */
.prose { max-width: 100%; }
.prose > p,
.prose > h2,
.prose > h3,
.prose > blockquote,
.prose > .transaction,
.prose > ul:not(.grid):not(.rows),
.prose > ol { max-width: var(--measure); }

.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose li { margin-bottom: 0.35em; }

.muted { color: var(--ink-soft); }
.lede  { font-size: var(--step-1); color: var(--ink-soft); max-width: var(--measure); line-height: 1.4; }

.eyebrow {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 650;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.band { background: var(--paper-alt); padding: clamp(2.5rem, 6vw, 5rem) 0; margin-top: 4rem; }
/* On a dark band the secondary tokens have to flip too, or every muted
   element renders dark-on-dark. Redefining them here means components inside
   need no special cases. */
.band-ink {
  background: var(--ink);
  color: var(--paper);
  --ink-soft: color-mix(in srgb, var(--paper) 66%, transparent);
  --rule: color-mix(in srgb, var(--paper) 24%, transparent);
}
.band-ink h2 { color: var(--paper); }
.band-ink a { color: var(--paper); }

/* --- Header --------------------------------------------------------------- */

.site-head {
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
}

.site-head-inner {
  display: flex; align-items: center; gap: var(--gap);
  min-height: 4.25rem;
}

.wordmark {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: inherit; margin-right: auto;
}

/* The mark: a solid block, like a tally light. Deliberately not a logo — it
   is a placeholder shape that reads as intentional until a real one exists. */
.wordmark-mark {
  width: 1.05rem; height: 1.05rem;
  background: var(--signal);
  flex: none;
}

.wordmark-text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark-text b {
  font-family: var(--font-display);
  font-size: 1.02rem; font-weight: 780; letter-spacing: -0.02em;
}
.wordmark-text span {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-soft);
}

.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav ul {
  display: flex; gap: 1.35rem;
  list-style: none; margin: 0; padding: 0;
}
.site-nav a {
  color: var(--ink); text-decoration: none;
  font-size: var(--step--1); font-weight: 550;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--signal); }

.nav-toggle { display: none; }

@media (max-width: 60rem) {
  .nav-toggle {
    display: grid; place-items: center;
    width: 2.75rem; height: 2.75rem;
    background: none; border: 1px solid var(--rule); cursor: pointer;
  }
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block; width: 1.15rem; height: 2px; background: var(--ink);
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before,
  .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after  { top:  6px; }

  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.25rem 1.25rem;
  }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a {
    display: block; padding: 0.8rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: var(--step-0);
  }
  .site-nav .btn-cta { margin-top: 1rem; text-align: center; }
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  font-size: var(--step--1);
  font-weight: 650;
  text-decoration: none;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn:hover { background: var(--ink); color: var(--paper); }

.btn-primary,
.btn-cta {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--signal-ink);
}
.btn-primary:hover,
.btn-cta:hover {
  background: transparent;
  color: var(--signal);
}

/* --- Hero ----------------------------------------------------------------- */

.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem); }

/* With a photo, the type sits on an opaque panel rather than on the image.
   The studio shot can be as busy and colorful as it likes; the words stay
   readable either way. This is the fix for the old full-bleed hero. */
.hero-photo {
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  padding-block: clamp(4rem, 9vw, 8rem);
}
.hero-photo .hero-panel {
  background: var(--paper);
  padding: clamp(1.75rem, 4vw, 3rem);
  max-width: 46rem;
}
.hero-photo .hero-panel .lede { max-width: 40ch; }
.hero h1 {
  font-size: var(--step-4);
  max-width: 16ch;
  margin-bottom: 0.4em;
}
.hero .lede { font-size: var(--step-1); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.page-head {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* --- Cards and grids ------------------------------------------------------ */

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  list-style: none; padding: 0; margin: 0;
}

/* Narrower minimum, so four short cards sit on one row instead of 3 + 1. */
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.card {
  border: 1px solid var(--rule);
  padding: 1.4rem;
  background: var(--paper);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.card h3 { margin: 0; font-size: var(--step-1); }
.card p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); }
.card a { text-decoration: none; }
.card a:hover { text-decoration: underline; }
.card-foot { margin-top: auto; padding-top: 0.9rem; }

.card .price,
.price {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 780;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* Definition-style rows — used for facilities, carriage, equipment. */
.rows { list-style: none; margin: 0 0 1.5em; padding: 0; }
.rows li {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1rem;
  justify-content: space-between; align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.rows li b { font-weight: 650; }
.rows li span { color: var(--ink-soft); font-size: var(--step--1); }

/* --- Tags ----------------------------------------------------------------- */

.tag {
  display: inline-block;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; padding: 0.2rem 0.5rem;
  border: 1px solid var(--rule); color: var(--ink-soft);
}
.tag-warn { border-color: var(--signal); color: var(--signal); }

/* --- Transactions --------------------------------------------------------- */

.transaction { margin: 1.75rem 0; }
.transaction-provider {
  display: block; margin-top: 0.5rem;
  font-size: var(--step--1); color: var(--ink-soft);
}

/* Unconfigured transaction. Loud on purpose — it should never survive to
   production without someone noticing. */
.transaction-todo {
  border-left: 4px solid var(--signal);
  background: var(--paper-alt);
  padding: 1rem 1.15rem;
  font-size: var(--step--1);
}
.transaction-todo b { display: block; margin-bottom: 0.25rem; font-size: var(--step-0); }
.transaction-todo .muted { display: block; margin-top: 0.4rem; }

/* --- Embeds --------------------------------------------------------------- */

.embed { margin: 2rem 0; }
.embed iframe { width: 100%; border: 0; aspect-ratio: 16 / 9; }
.embed-audio iframe { aspect-ratio: auto; height: 180px; }

/* The live player gets a frame so it reads as a piece of equipment rather
   than a hole in the page. */
.embed-live {
  border: 1px solid var(--rule);
  background: #000;
  margin-block: 1.5rem;
  /* Capped so the player reads as one element on the page rather than
     swallowing the whole viewport at desktop widths. */
  max-width: 56rem;
}
.embed-live iframe { display: block; }

/* --- Sections ------------------------------------------------------------- */

.section { margin-top: clamp(3rem, 6vw, 5rem); }

.section-head {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: end; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.section-head h2 { margin: 0; }
.section-head .eyebrow { margin-bottom: 0.35rem; }

/* --- On-air bar ----------------------------------------------------------- */

/* Sits directly under the hero. Reads as a ticker without moving, because a
   thing that scrolls by itself is harder to read, not easier. */
.onair-bar {
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
}
.onair-bar[hidden] { display: none; }
.onair-bar > * { display: inline; }

.onair-bar {
  padding: 0.85rem clamp(1.25rem, 4vw, 3rem);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; align-items: baseline;
}

.onair-label {
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; font-size: 0.72rem;
  color: var(--signal);
  margin-right: 0.35rem;
}
.onair-next { color: var(--ink-soft); }

.onair-inline {
  border: 1px solid var(--rule);
  background: var(--paper-alt);
  color: var(--ink);
  margin-bottom: 2rem;
}

/* --- Featured ------------------------------------------------------------- */

.featured { margin-top: clamp(2.5rem, 5vw, 4rem); }

.grid-feature { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }

.card-feature { border-top: 4px solid var(--signal); }
.card-feature .tag { align-self: start; }
.feature-when { font-weight: 650; color: var(--ink) !important; }

/* --- Show cards ----------------------------------------------------------- */

.grid-show { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }

.card-show { padding: 0; border: 1px solid var(--rule); gap: 0; }
.card-show h3 {
  font-size: var(--step-0); font-weight: 650; line-height: 1.25;
  padding: 0.9rem 1rem 0.35rem;
}
.card-show h3 a { color: var(--ink); }
.card-show .show-meta {
  padding: 0 1rem 0.25rem;
  font-size: 0.8rem;
}
.card-show .show-meta:last-child { padding-bottom: 1rem; }

.show-thumb { display: block; background: var(--paper-alt); }
.show-thumb img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
}

/* --- Archive -------------------------------------------------------------- */

.rows-inline { display: flex; flex-wrap: wrap; gap: 0 2rem; }
.rows-inline li { border: 0; padding: 0.4rem 0; }

.rows-tight li { padding: 0.5rem 0; }

.rows-connect li { border-bottom-color: color-mix(in srgb, currentColor 25%, transparent); }

.rows-archive li[hidden] { display: none; }

/* Cablecast titles are frequently one long underscore-joined token —
   Midnight_Limited_1940_2026-07-14_11_59_43 — with no place to break. On a
   phone that pushes the whole page sideways. */
.rows-archive li b,
.rows-archive li span,
.card-show h3 { overflow-wrap: anywhere; }

.filter {
  position: sticky; top: 4.25rem; z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
  margin-bottom: 1rem;
}
.filter[hidden] { display: none; }
.filter label {
  display: block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); margin-bottom: 0.4rem;
}
.filter input {
  width: min(100%, 26rem);
  font: inherit; font-size: var(--step-0);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink);
}
.filter-count { margin: 0.5rem 0 0; font-size: var(--step--1); color: var(--ink-soft); }

/* --- Footer --------------------------------------------------------------- */

.site-foot {
  margin-top: 5rem;
  border-top: 3px solid var(--ink);
  padding-top: 3rem;
  font-size: var(--step--1);
}

.site-foot-inner {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.foot-title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-soft); margin-bottom: 0.9rem; font-weight: 700;
}
.site-foot address { font-style: normal; margin-bottom: 1em; }
.foot-links { list-style: none; margin: 0; padding: 0; }
.foot-links li { margin-bottom: 0.45rem; }

.foot-legal {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem;
  justify-content: space-between;
  margin-top: 3rem; padding: 1.25rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}
.foot-legal p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
