/* =========================================================================
   The Mast Log - single stylesheet.
   One long reading column with a wide left gutter for stamps, segment
   numbers and pull quotes. No web fonts, no CDN, no script, no tracking.
   Class vocabulary: prefix mast- (transmitter plant and studio words).
   Everything that gets re-dressed lives in the :root block below.
   ========================================================================= */

:root {
  /* --- Colour ------------------------------------------------------- */
  --paper:        #eceaea;   /* equipment grey stock, no cream cast      */
  --recess:       #dedbdc;   /* inset blocks, table heads                */
  --ink:          #17151a;   /* running text                             */
  --ink-soft:     #4b4750;   /* meta, captions, notes                    */
  --signal:       #4a2170;   /* deep violet: links, numbers, markers     */
  --signal-deep:  #331350;   /* hover and focus of the accent            */
  --meter:        #8a5208;   /* amber readout: ticks, stamps, units      */
  --rule:         #c3bec1;   /* hairlines, dotted leaders, borders       */

  /* --- Type (system stacks only) ------------------------------------ */
  --face-display: Optima, "Optima nova", Candara, "Gill Sans Nova",
                  "Gill Sans MT", "Gill Sans", "Trebuchet MS", sans-serif;
  --face-text:    Georgia, "Iowan Old Style", "Droid Serif", "Noto Serif",
                  "Liberation Serif", serif;
  --face-readout: Verdana, "DejaVu Sans", "Bitstream Vera Sans", Tahoma,
                  Geneva, sans-serif;

  /* --- Measure and rhythm ------------------------------------------- */
  --measure:  39rem;         /* reading column                           */
  --gutter:   11rem;         /* left gutter for marginalia               */
  --breath:   3.1rem;        /* vertical space between blocks            */
  --body:     clamp(1.06rem, 1rem + 0.32vw, 1.24rem);
  --leading:  1.68;

  /* --- Details ------------------------------------------------------- */
  --hair:     1px;
  --radius:   3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:       #17161a;
    --recess:      #211f25;
    --ink:         #eae7ec;
    --ink-soft:    #b0abb5;
    --signal:      #bda0e6;
    --signal-deep: #d8c6f2;
    --meter:       #dfa74c;
    --rule:        #3a3542;
  }
}

/* =========================================================================
   1. Reset
   ========================================================================= */

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--face-text);
  font-size: var(--body);
  line-height: var(--leading);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--face-display);
  font-weight: 600;
  line-height: 1.16;
  margin: 0;
  letter-spacing: 0.002em;
}

p, ul, ol, figure, table, blockquote, dl { margin: 0; }

a { color: var(--signal); text-underline-offset: 0.18em; }
a:hover { color: var(--signal-deep); }

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

hr { border: 0; }

/* =========================================================================
   2. Keyboard access
   ========================================================================= */

.mast-bypass {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  font-family: var(--face-readout);
  font-size: 0.85rem;
  z-index: 30;
}
.mast-bypass:focus { left: 0.6rem; top: 0.6rem; color: var(--paper); }

/* =========================================================================
   3. The feedline: one column plus a left gutter for marginalia
   ------------------------------------------------------------------------
   .mast-feedline carries every block on the page. On wide screens it holds
   back a left gutter (--gutter) where stamps, segment numbers and pull
   quotes sit, without ever pushing the page sideways.
   ========================================================================= */

.mast-feedline {
  width: min(100% - 2.2rem, var(--measure));
  margin-inline: auto;
  position: relative;
}

@media (min-width: 72rem) {
  .mast-feedline {
    width: min(100% - 4rem, calc(var(--measure) + var(--gutter)));
    padding-left: var(--gutter);
  }
}

.mast-spill { margin-left: 0; }
@media (min-width: 72rem) {
  .mast-spill { margin-left: calc(-1 * var(--gutter)); }
}

/* =========================================================================
   4. Crown (top navigation) and the dial strip
   ========================================================================= */

.mast-crown {
  border-bottom: var(--hair) solid var(--rule);
  padding: 1.2rem 0 1rem;
}

.mast-crown__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem 1.6rem;
}

.mast-callsign {
  font-family: var(--face-display);
  font-size: 1.34rem;
  font-weight: 600;
  letter-spacing: 0.012em;
  color: var(--ink);
  text-decoration: none;
}
.mast-callsign:hover { color: var(--signal); }

.mast-callsign__strap {
  display: block;
  font-family: var(--face-readout);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.mast-dial ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.05rem;
}

.mast-dial a {
  font-family: var(--face-readout);
  font-size: 0.78rem;
  letter-spacing: 0.045em;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.mast-dial a:hover { color: var(--signal); border-bottom-color: var(--rule); }
.mast-dial a[aria-current] { color: var(--ink); border-bottom-color: var(--signal); }

/* The tuning scale: this site's own mark. Decorative only. */
.mast-scale {
  border-bottom: var(--hair) solid var(--rule);
  margin-bottom: var(--breath);
  padding: 0.5rem 0 0.45rem;
}
/* two tick heights: a tall amber mark every 20 %, a short one every 4 % */
.mast-scale__ticks {
  height: 13px;
  background-image:
    repeating-linear-gradient(to right, var(--meter) 0 1px, transparent 1px 20%),
    repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px 4%);
  background-size: 100% 13px, 100% 7px;
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, 0 6px;
}
.mast-scale__marks {
  display: flex;
  justify-content: space-between;
  font-family: var(--face-readout);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-top: 0.3rem;
}

/* =========================================================================
   5. Page opening and article header
   ========================================================================= */

.mast-open { padding-top: 0.5rem; }

.mast-overline {
  font-family: var(--face-readout);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--meter);
  margin-bottom: 1rem;
}
.mast-overline a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
.mast-overline a:hover { border-bottom-color: currentColor; }

.mast-headline {
  font-size: clamp(2.15rem, 1.5rem + 2.9vw, 3.5rem);
  letter-spacing: -0.012em;
  margin-bottom: 1.1rem;
}

.mast-standfirst {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  line-height: 1.52;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

.mast-byline {
  font-family: var(--face-readout);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  padding-bottom: 1.4rem;
  border-bottom: 2px solid var(--ink);
}
.mast-byline span::after {
  content: "/";
  margin-left: 1rem;
  color: var(--rule);
}
.mast-byline span:last-child::after { content: ""; margin: 0; }

/* =========================================================================
   6. Long copy
   ========================================================================= */

.mast-copy { counter-reset: mast-segment; padding-top: 1.7rem; }

.mast-copy p { margin-bottom: 1.2rem; max-width: var(--measure); }

.mast-copy > ul, .mast-copy > ol {
  margin: 0 0 1.6rem;
  padding-left: 1.25rem;
  max-width: var(--measure);
}
.mast-copy li { margin-bottom: 0.55rem; }
.mast-copy li::marker { color: var(--meter); }

.mast-copy a { color: var(--signal); text-decoration: underline; }

.mast-copy strong { font-weight: 700; }

/* Opening initial, used on some pages only */
.mast-initial::first-letter {
  float: left;
  font-family: var(--face-display);
  font-size: 3.1em;
  font-weight: 600;
  line-height: 0.9;
  padding: 0.02em 0.1em 0 0;
  color: var(--signal);
}

/* Numbered segments. The number is generated in CSS, never typed. */
.mast-segment {
  font-size: clamp(1.36rem, 1.2rem + 0.66vw, 1.78rem);
  margin: 3rem 0 1rem;
  padding-top: 0.9rem;
  border-top: var(--hair) solid var(--rule);
  position: relative;
  max-width: var(--measure);
}

.mast-segment::before {
  counter-increment: mast-segment;
  content: counter(mast-segment, decimal-leading-zero);
  display: block;
  font-family: var(--face-readout);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--meter);
  margin-bottom: 0.5rem;
}

@media (min-width: 72rem) {
  .mast-segment::before {
    position: absolute;
    left: calc(-1 * var(--gutter));
    top: 0.55rem;
    width: calc(var(--gutter) - 1.8rem);
    text-align: right;
    font-family: var(--face-display);
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--rule);
    margin: 0;
  }
}

.mast-subhead {
  font-family: var(--face-readout);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 2.2rem 0 0.8rem;
  color: var(--ink);
  max-width: var(--measure);
}

/* Liner: the pulled line. Rules above and below, never a side bar. */
.mast-liner {
  margin: 2.6rem 0;
  padding: 1.1rem 0;
  border-top: 2px solid var(--signal);
  border-bottom: 2px solid var(--signal);
  font-family: var(--face-display);
  font-size: clamp(1.22rem, 1.08rem + 0.62vw, 1.6rem);
  line-height: 1.34;
  color: var(--ink);
}
@media (min-width: 72rem) {
  .mast-liner { margin-left: calc(-1 * var(--gutter)); }
}
.mast-liner p { margin: 0; max-width: none; }
.mast-liner cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--face-readout);
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Cart: the inset block (definition, reminder, caution) */
.mast-cart {
  background: var(--recess);
  border-left: 4px solid var(--meter);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.4rem;
  margin: 2.4rem 0;
  max-width: var(--measure);
}
.mast-cart__label {
  font-family: var(--face-readout);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--meter);
  margin-bottom: 0.65rem;
}
.mast-cart p { margin-bottom: 0.8rem; }
.mast-cart p:last-child { margin-bottom: 0; }
.mast-cart ul, .mast-cart ol { margin: 0; padding-left: 1.25rem; }
.mast-cart li::marker { color: var(--meter); }
.mast-cart li { margin-bottom: 0.4rem; }
.mast-cart li:last-child { margin-bottom: 0; }

/* Plate: the one picture a page is allowed */
.mast-plate { margin: 2.6rem 0; }
.mast-plate img {
  width: 100%;
  height: auto;
  display: block;
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
}
.mast-plate figcaption {
  font-family: var(--face-readout);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 0.7rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--meter);
}

/* Chart: any table scrolls inside its own frame */
.mast-chart {
  overflow-x: auto;
  margin: 2.3rem 0;
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
.mast-chart table {
  border-collapse: collapse;
  min-width: 40rem;
  width: 100%;
  font-family: var(--face-readout);
  font-size: 0.82rem;
}
.mast-chart th:first-child,
.mast-chart td:first-child { white-space: nowrap; }
.mast-chart caption {
  caption-side: top;
  text-align: left;
  padding: 0.85rem 0.95rem;
  font-family: var(--face-readout);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: var(--hair) solid var(--rule);
}
.mast-chart th, .mast-chart td {
  text-align: left;
  padding: 0.6rem 0.95rem;
  border-bottom: var(--hair) solid var(--rule);
  vertical-align: top;
}
.mast-chart thead th {
  background: var(--signal);
  color: var(--paper);
  letter-spacing: 0.05em;
}
.mast-chart tbody tr:nth-child(even) { background: var(--recess); }
.mast-chart tbody tr:last-child td { border-bottom: 0; }

@media (prefers-color-scheme: dark) {
  .mast-chart thead th { background: var(--signal); color: #17161a; }
}

/* =========================================================================
   7. Cues and tail notes
   ========================================================================= */

.mast-cue {
  font-family: var(--face-readout);
  font-size: 0.62em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  padding: 0 0.12em;
}
.mast-cue:hover { text-decoration: underline; }

.mast-tail {
  margin-top: 3.2rem;
  padding-top: 1.2rem;
  border-top: 2px solid var(--ink);
}
.mast-tail__label {
  font-family: var(--face-readout);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.mast-tail ol {
  margin: 0;
  padding-left: 1.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.mast-tail li { margin-bottom: 0.8rem; }
.mast-tail li::marker { font-family: var(--face-readout); color: var(--meter); }
.mast-loop {
  font-family: var(--face-readout);
  text-decoration: none;
  margin-left: 0.35rem;
}

/* =========================================================================
   8. Rundown (contents, printed at the end of a piece)
   ========================================================================= */

.mast-rundown {
  margin-top: 3rem;
  padding: 1.4rem 0 0;
  border-top: var(--hair) solid var(--rule);
}
.mast-rundown__label {
  font-family: var(--face-readout);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.mast-rundown ol { list-style: none; margin: 0; padding: 0; counter-reset: mast-cuesheet; }
.mast-rundown li { margin-bottom: 0.6rem; }
/* four columns: generated number, label, leader, running time */
.mast-rundown a {
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(1.5rem, 1fr) auto;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--face-readout);
  font-size: 0.86rem;
}
.mast-rundown a:hover { color: var(--signal); }
.mast-rundown a::before {
  counter-increment: mast-cuesheet;
  content: counter(mast-cuesheet, decimal-leading-zero);
  color: var(--meter);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}
.mast-leader {
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-0.28em);
}
.mast-rundown__time { color: var(--ink-soft); font-size: 0.74rem; }

/* =========================================================================
   9. Log entries (home, section pages). One column, no cards.
   ========================================================================= */

.mast-log { list-style: none; margin: 0; padding: 0; }

.mast-cut {
  padding: 1.7rem 0;
  border-bottom: var(--hair) solid var(--rule);
  position: relative;
}
.mast-cut:first-child { padding-top: 0.3rem; }
.mast-log > .mast-cut:last-child { border-bottom: 0; padding-bottom: 0.6rem; }

.mast-cut__stamp {
  display: block;
  font-family: var(--face-readout);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--meter);
  margin-bottom: 0.5rem;
}

@media (min-width: 72rem) {
  .mast-cut__stamp {
    position: absolute;
    left: calc(-1 * var(--gutter));
    top: 2rem;
    width: calc(var(--gutter) - 1.8rem);
    text-align: right;
    margin: 0;
  }
  .mast-cut:first-child .mast-cut__stamp { top: 0.6rem; }
}

.mast-cut__title {
  font-size: clamp(1.28rem, 1.14rem + 0.62vw, 1.62rem);
  margin-bottom: 0.55rem;
}
.mast-cut__title a { color: var(--ink); text-decoration: none; }
.mast-cut__title a:hover { color: var(--signal); text-decoration: underline; }

.mast-cut__brief { color: var(--ink-soft); margin-bottom: 0.65rem; }

.mast-cut__foot {
  font-family: var(--face-readout);
  font-size: 0.74rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
}
.mast-cut__foot a { color: var(--signal); text-decoration: none; }
.mast-cut__foot a:hover { text-decoration: underline; }

/* =========================================================================
   10. Bays: the section index. A list of links, never a grid.
   ========================================================================= */

.mast-bays { list-style: none; margin: 0; padding: 0; }
.mast-bays li {
  padding: 1rem 0;
  border-bottom: var(--hair) dotted var(--rule);
}
.mast-bays a {
  font-family: var(--face-display);
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--meter);
}
.mast-bays a:hover { color: var(--signal); border-bottom-color: var(--signal); }
.mast-bays p {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* =========================================================================
   11. Service blocks: rules, blocks, next reads, shuttle
   ========================================================================= */

.mast-rule {
  height: 0;
  border-top: 2px solid var(--ink);
  margin: var(--breath) 0;
  max-width: var(--measure);
}
.mast-rule--thin { border-top: var(--hair) solid var(--rule); }

.mast-block { margin-bottom: var(--breath); }

.mast-block__label {
  font-family: var(--face-readout);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 1.3rem;
}

.mast-note {
  font-family: var(--face-readout);
  font-size: 0.79rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 1.3rem;
}

.mast-segue { margin-top: 2.9rem; }
.mast-segue ul { list-style: none; margin: 0; padding: 0; }
.mast-segue li { padding: 0.8rem 0; border-bottom: var(--hair) dotted var(--rule); }
.mast-segue a {
  font-family: var(--face-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.mast-segue a:hover { color: var(--signal); text-decoration: underline; }
.mast-segue span {
  display: block;
  font-family: var(--face-readout);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--meter);
  margin-bottom: 0.25rem;
}
.mast-segue p {
  margin: 0.3rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.mast-shuttle {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  margin-top: 2.2rem;
  padding-top: 1.1rem;
  border-top: var(--hair) solid var(--rule);
  font-family: var(--face-readout);
  font-size: 0.82rem;
}
.mast-shuttle a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.mast-shuttle a:hover { border-bottom-color: var(--signal); }
.mast-shuttle__none { color: var(--ink-soft); }

/* =========================================================================
   12. Keys: the glossary list
   ========================================================================= */

.mast-keys { margin: 0; max-width: var(--measure); }
.mast-keys dt {
  font-family: var(--face-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 1.5rem;
  padding-top: 0.9rem;
  border-top: var(--hair) solid var(--rule);
}
.mast-keys dt:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.mast-keys dd {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
}
.mast-keys dd a { color: var(--signal); }

.mast-index {
  font-family: var(--face-readout);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0.9rem 0;
  border-top: var(--hair) solid var(--rule);
  border-bottom: var(--hair) solid var(--rule);
}
.mast-index a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.mast-index a:hover { border-bottom-color: var(--signal); }

/* =========================================================================
   13. Sign-off (footer)
   ========================================================================= */

.mast-signoff {
  margin-top: calc(var(--breath) * 1.7);
  border-top: 3px solid var(--ink);
  padding: 1.7rem 0 3.4rem;
  font-family: var(--face-readout);
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.mast-signoff__name {
  font-family: var(--face-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.55rem;
}
.mast-signoff p { margin-bottom: 0.95rem; max-width: var(--measure); }
.mast-signoff ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
}
.mast-signoff a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); }
.mast-signoff a:hover { color: var(--signal); border-bottom-color: var(--signal); }
.mast-signoff__fine { font-size: 0.74rem; letter-spacing: 0.03em; }

/* =========================================================================
   14. Print
   ========================================================================= */

@media print {
  :root {
    --paper: #ffffff; --recess: #f2f2f2; --ink: #000000;
    --signal: #000000; --meter: #000000; --ink-soft: #333333;
  }
  .mast-dial, .mast-segue, .mast-shuttle, .mast-bypass, .mast-scale { display: none; }
  .mast-feedline { width: auto; padding-left: 0; }
  .mast-liner, .mast-segment::before, .mast-cut__stamp {
    margin-left: 0; position: static; text-align: left;
  }
  a { text-decoration: none; }
}
