/* The How long do TV shows last page (landing/how-long-do-tv-shows-last.html),
   on top of formatter-page.css (the base, .wrap, .section, .pitch, .others,
   .btn). Copied to landing/how-long-do-tv-shows-last/page.css by build.mjs.

   The data lives on a deep teal band, a programme guide after dark: cyan
   cells for seasons, a hollow cell for a show that ended after one, and one
   warm signal colour, orange, for a show still on the air. The site is
   light-only and so is the rest of this page; the band is a fixed design,
   not a theme. The chart colours are repeated in page.js (T), because the
   share image is drawn on a canvas that cannot read CSS. Change one, change
   both. See .claude/data-pages-registry.md. */

.tv {
  --tv-grid: #0e2b36;
  --tv-grid-2: #123744;
  --tv-grid-3: #17434f;
  --tv-rule: rgba(190, 225, 232, 0.14);
  --tv-rule-2: rgba(190, 225, 232, 0.26);
  --tv-ink: #e9f3f4;
  --tv-ink-2: #a9c6cc;
  --tv-ink-3: #6f9299;
  --tv-cell: #58b8c4;
  --tv-cell-deep: #3a8f9b;
  --tv-signal: #ff8a4c;
  --tv-signal-deep: #e86f2f;
  --cell-w: 9px;
  --cell-h: 14px;
  --cell-gap: 2px;
}

/* ───────────────────── the band ───────────────────── */
.tv-band {
  background: var(--tv-grid);
  color: var(--tv-ink);
  padding: 52px 0 72px;
}
.tv-band ::selection { background: var(--tv-signal); color: var(--tv-grid); }
.tv-band a { color: var(--tv-cell); }
.tv-kicker { margin: 0; font-size: 14px; color: var(--tv-ink-2); }
.tv-head {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px 56px; align-items: end;
}
.tv-band h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 5.2vw, 68px);
  font-weight: 500; letter-spacing: -0.025em; line-height: 1;
  margin: 10px 0 0; text-wrap: balance;
}
.tv-lede {
  font-size: 17px; line-height: 1.6; color: var(--tv-ink-2);
  margin: 0 0 4px; max-width: 48ch;
}

/* ───────────────────── the controls ───────────────────── */
.tv-controls {
  margin: 38px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px 16px; align-items: end;
}
.tv-control { min-width: 0; }
.tv-control > label, .tv-seg legend, .tv-chips-label {
  display: block; margin: 0 0 6px; font-size: 13px; color: var(--tv-ink-2);
}
.tv-control input, .tv-control select {
  width: 100%; min-height: 42px;
  font: inherit; font-size: 15px; color: var(--tv-ink);
  background: var(--tv-grid-2); border: 1px solid var(--tv-rule-2); border-radius: 10px;
  padding: 8px 12px;
}
.tv-control select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9c6cc' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.tv-control input::placeholder { color: var(--tv-ink-3); }
.tv-control input:focus-visible, .tv-control select:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 2px; }
.tv-control input[type="search"]::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); }
.tv-seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.tv-seg > label { display: inline-block; position: relative; }
.tv-seg legend { padding: 0; }
.tv-seg label + label { margin-left: -1px; }
.tv-seg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.tv-seg span {
  display: inline-block; min-height: 42px; padding: 9px 14px;
  font-size: 14.5px; font-weight: 500; color: var(--tv-ink-2);
  background: var(--tv-grid-2); border: 1px solid var(--tv-rule-2);
  cursor: pointer; user-select: none;
}
.tv-seg label:first-of-type span { border-radius: 10px 0 0 10px; }
.tv-seg label:last-of-type span { border-radius: 0 10px 10px 0; }
.tv-seg input:checked + span { background: var(--tv-ink); color: var(--tv-grid); border-color: var(--tv-ink); position: relative; z-index: 1; }
.tv-seg input:focus-visible + span { outline: 2px solid var(--tv-signal); outline-offset: 2px; position: relative; z-index: 2; }
.tv-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.tv-range span { font-size: 13.5px; color: var(--tv-ink-3); }

.tv-chips-row { margin: 22px 0 0; }
.tv-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tv-chip {
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--tv-ink-2);
  background: transparent; border: 1px solid var(--tv-rule-2); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; white-space: nowrap;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s;
}
.tv-chip small { color: var(--tv-ink-3); font-size: 12px; margin-left: 5px; font-weight: 400; }
.tv-chip:hover { border-color: var(--tv-ink-2); color: var(--tv-ink); }
.tv-chip[aria-pressed="true"] { background: var(--tv-cell); border-color: var(--tv-cell); color: var(--tv-grid); }
.tv-chip[aria-pressed="true"] small { color: var(--tv-grid); opacity: 0.75; }
.tv-chip[hidden] { display: none; }
.tv-chip:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 2px; }
.tv-text-btn {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--tv-cell);
  background: none; border: 0; padding: 8px 0 0; margin-right: 18px; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em;
}
.tv-text-btn:hover { text-decoration-color: currentColor; }
.tv-text-btn:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 3px; border-radius: 3px; }
.tv-text-btn[hidden] { display: none; }

.tv-read { margin: 26px 0 0; font-size: 16px; line-height: 1.55; color: var(--tv-ink-2); max-width: 70ch; }
.tv-read b { color: var(--tv-ink); font-weight: 600; }

/* ───────────────────── the figures ───────────────────── */
.tv-figures {
  margin: 22px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px;
  border-top: 1px solid var(--tv-rule); border-bottom: 1px solid var(--tv-rule);
}
.tv-fig { padding: 18px 0 20px; min-width: 0; }
.tv-fig + .tv-fig { border-left: 1px solid var(--tv-rule); padding-left: 28px; margin-left: -28px; }
.tv-fig .v {
  margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 4vw, 54px);
  line-height: 1; letter-spacing: -0.02em; color: var(--tv-ink); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-fig .v.name { font-size: clamp(22px, 2.2vw, 28px); white-space: normal; line-height: 1.15; }
.tv-fig .v small { font-size: 0.5em; color: var(--tv-ink-2); margin-left: 4px; font-weight: 400; }
.tv-fig .k { margin: 8px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--tv-ink-2); }

/* ───────────────────── the guide ───────────────────── */
.tv-guide-fig { margin: 30px 0 0; }
.tv-guide { display: grid; gap: 0; border-top: 1px solid var(--tv-rule); }
.tv-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  gap: 0 18px; align-items: start;
  padding: 11px 0 10px; border-bottom: 1px solid var(--tv-rule);
}
.tv-row-name { margin: 0; padding-top: 1px; font-size: 14px; font-weight: 600; color: var(--tv-ink); line-height: 1.3; min-width: 0; }
.tv-row-name small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--tv-ink-3); font-variant-numeric: tabular-nums; }
.tv-row-name small b { color: var(--tv-signal); font-weight: 500; }
.tv-runs-wrap { min-width: 0; }
.tv-runs {
  display: flex; flex-wrap: wrap; gap: 5px 8px;
  max-height: calc(3 * (var(--cell-h) + 5px) - 5px); overflow: hidden;
  padding: 1px 0; align-content: flex-start;
}
.tv-runs.is-open { max-height: none; }
.tv-run {
  --s: 1;
  display: block; flex: none;
  width: calc(var(--s) * (var(--cell-w) + var(--cell-gap)) - var(--cell-gap));
  max-width: 100%;
  height: var(--cell-h); padding: 0; margin: 0; border: 0; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--tv-cell) 0 var(--cell-w), transparent var(--cell-w) calc(var(--cell-w) + var(--cell-gap)));
  cursor: pointer; position: relative; color: var(--tv-grid);
  font: 600 10px/var(--cell-h) var(--sans); text-align: right;
}
.tv-run.one { background: none; box-shadow: inset 0 0 0 1.5px var(--tv-cell-deep); }
.tv-run.on {
  background:
    linear-gradient(var(--tv-signal), var(--tv-signal)) right / var(--cell-w) 100% no-repeat,
    repeating-linear-gradient(90deg, var(--tv-cell) 0 var(--cell-w), transparent var(--cell-w) calc(var(--cell-w) + var(--cell-gap)));
}
.tv-run.one.on { box-shadow: none; background: var(--tv-signal); }
.tv-run.long::after { content: attr(data-s); position: absolute; right: 3px; top: 0; }
.tv-run.long.on::after { right: calc(var(--cell-w) + 4px); color: var(--tv-grid); }
.tv-run:hover, .tv-run.is-current { outline: 2px solid var(--tv-ink); outline-offset: 1px; z-index: 1; }
.tv-run:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 2px; z-index: 1; }
.tv-runs-more {
  margin: 6px 0 0; padding: 0; border: 0; background: none;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--tv-cell); cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em;
}
.tv-runs-more:hover { text-decoration-color: currentColor; }
.tv-runs-more:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 3px; border-radius: 3px; }
.tv-runs-more[hidden] { display: none; }
.tv-guide-empty { margin: 0; padding: 36px 0; color: var(--tv-ink-2); font-size: 16px; }
.tv-legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0;
  font-size: 13px; color: var(--tv-ink-2);
}
.tv-legend span { display: inline-flex; align-items: center; gap: 2px; }
.tv-legend .cell { display: inline-block; width: var(--cell-w); height: var(--cell-h); background: var(--tv-cell); border-radius: 1px; }
.tv-legend .cell.hollow { background: none; box-shadow: inset 0 0 0 1.5px var(--tv-cell-deep); border-radius: 2px; }
.tv-legend .cell.on { background: var(--tv-signal); }
.tv-legend i + i { margin-left: 0; }
.tv-legend i:last-of-type { margin-right: 8px; }

/* ───────────────────── the tooltip ───────────────────── */
.tv-tip {
  position: fixed; z-index: 60; left: 0; top: 0;
  width: max-content; max-width: min(320px, calc(100vw - 24px));
  background: #f3f8f8; color: #0f2a33;
  border-radius: 10px; padding: 11px 14px 12px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55);
  font-size: 13.5px; line-height: 1.45; pointer-events: none;
}
.tv-tip .t { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.2; margin: 0; }
.tv-tip .r { margin: 4px 0 0; font-size: 13px; color: #3f5f66; }
.tv-tip .r b { color: #c2561d; font-weight: 600; }
.tv-tip .w { margin: 6px 0 0; }
.tv-tip .m { margin: 5px 0 0; color: #3f5f66; font-size: 12.5px; }

/* ───────────────────── share ───────────────────── */
.tv-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 30px 0 0; }
.tv-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--tv-ink); background: transparent;
  border: 1px solid var(--tv-rule-2); border-radius: 999px;
  padding: 10px 18px; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.tv-btn:hover { border-color: var(--tv-ink-2); }
.tv-btn:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 3px; }
.tv-btn-signal { background: var(--tv-signal); border-color: var(--tv-signal); color: var(--tv-grid); }
.tv-btn-signal:hover { background: #ffa06d; border-color: #ffa06d; }
.tv-btn:disabled { opacity: 0.6; cursor: default; }
.tv-share-note { font-size: 14px; color: var(--tv-ink-2); display: inline-flex; align-items: center; gap: 7px; }
.tv-share-note svg { color: #7fe0c0; }

/* ───────────────────── the list ───────────────────── */
.tv-list { margin: 30px 0 0; border-top: 1px solid var(--tv-rule); }
.tv-list summary {
  list-style: none; cursor: pointer; padding: 16px 0 0;
  font-size: 15px; font-weight: 600; color: var(--tv-ink);
  display: flex; align-items: center; gap: 10px;
}
.tv-list summary::-webkit-details-marker { display: none; }
.tv-list summary::before {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--tv-ink-2); border-bottom: 2px solid var(--tv-ink-2);
  transform: rotate(-45deg); transition: transform 0.15s; margin-left: 2px;
}
.tv-list[open] summary::before { transform: rotate(45deg); }
.tv-list summary:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 3px; border-radius: 4px; }
.tv-table-wrap { margin-top: 14px; overflow-x: auto; }
.tv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tv-table th { text-align: left; font-weight: 600; color: var(--tv-ink-2); font-size: 12.5px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--tv-rule-2); }
.tv-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--tv-rule); vertical-align: top; color: var(--tv-ink-2); font-variant-numeric: tabular-nums; }
.tv-table td:first-child { color: var(--tv-ink); font-weight: 500; }
.tv-table td:first-child a { color: var(--tv-ink); }
.tv-table td:first-child a:hover { color: var(--tv-cell); }
.tv-table td.on { color: var(--tv-signal); }
.tv-table-note { margin: 12px 0 0; font-size: 13px; color: var(--tv-ink-3); }
.tv-table-note:empty { display: none; }

/* ───────────────────── the chapters ───────────────────── */
.tv-chapters { background: var(--tv-grid-2); padding: 20px 0 64px; }
.tv-ch { padding: 56px 0 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px 56px; align-items: start; }
.tv-ch + .tv-ch { margin-top: 56px; border-top: 1px solid var(--tv-rule); }
.tv-ch-title {
  grid-column: 1 / -1; margin: 0;
  font-family: var(--serif); font-size: clamp(26px, 2.8vw, 36px); font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance;
}
.tv-ch-head { margin: 0; font-size: 19px; line-height: 1.45; color: var(--tv-ink); max-width: 40ch; }
.tv-ch-head b { color: var(--tv-signal); font-weight: 600; }
.tv-ch-head .n { font-family: var(--serif); font-size: 1.45em; line-height: 1; letter-spacing: -0.01em; }
.tv-ch-body { margin: 14px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--tv-ink-2); max-width: 46ch; grid-column: 1; }
.tv-ch-chart { grid-column: 2; grid-row: 2 / span 2; min-width: 0; }
.tv-ch-chart svg { display: block; width: 100%; height: auto; }
.tv-ch-chart svg [data-tip] { cursor: default; }
.tv-ch-chart svg [data-tip]:focus { outline: none; }
.tv-ch-chart svg [data-tip]:focus-visible { outline: 2px solid var(--tv-signal); outline-offset: 1px; }
.tv-ch-foot { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tv-ch-foot .tv-btn { font-size: 13.5px; padding: 8px 14px; }
.tv-ch-foot .tv-share-note { font-size: 13px; }
.tv-ch-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--tv-ink-2); }
.tv-ch-text b { color: var(--tv-ink); font-weight: 600; }
.tv-ch-text a { color: var(--tv-cell); font-weight: 500; }
.tv-ch-text a:hover { text-decoration: underline; }

/* the longest runs, as a list of runs */
.tv-longest { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.tv-longest li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: baseline; }
.tv-longest .who { font-size: 14px; color: var(--tv-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-longest .who small { color: var(--tv-ink-3); font-size: 12.5px; margin-left: 6px; }
.tv-longest .n { font-family: var(--serif); font-size: 20px; color: var(--tv-ink); font-variant-numeric: tabular-nums; }
.tv-longest .bar { grid-column: 1 / -1; height: 10px; border-radius: 2px; max-width: 100%; --cell-h: 10px; --cell-w: 6px; }

/* ───────────────────── about the data ───────────────────── */
.tv-about { padding-top: 72px; }
.tv-about-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.tv-about h3 { margin: 22px 0 8px; font-size: 16px; font-weight: 600; }
.tv-about h3:first-child { margin-top: 0; }
.tv-about p, .tv-about li { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.tv-about p { margin: 0 0 12px; }
.tv-about ul { margin: 0; padding: 0 0 0 18px; }
.tv-about li { margin: 0 0 8px; }
.tv-about li strong { color: var(--ink); font-weight: 600; }
.tv-about a { color: var(--accent); font-weight: 600; }
.tv-about a:hover { text-decoration: underline; }
.tv-about .tv-download { margin: 20px 0 0; }
.tv-about .tv-small { font-size: 13.5px; color: var(--muted); margin-top: 14px; }

/* ───────────────────── narrow screens ───────────────────── */
@media (max-width: 1080px) {
  .tv-controls { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .tv-control-range { grid-column: span 2; }
}
@media (max-width: 980px) {
  .tv-head { grid-template-columns: minmax(0, 1fr); }
  .tv-ch { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tv-ch-chart { grid-column: 1; grid-row: auto; margin-top: 10px; }
  .tv-ch-body { max-width: 62ch; }
  .tv-about-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .tv { --cell-w: 7px; --cell-h: 12px; }
  .tv-band { padding: 40px 0 52px; }
  .tv-band h1 { font-size: 40px; }
  .tv-lede { font-size: 16px; }
  .tv-controls { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 28px; }
  .tv-control-range { grid-column: auto; }
  .tv-seg span { padding: 9px 12px; font-size: 14px; }
  .tv-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  .tv-fig { padding: 14px 0 16px; }
  .tv-fig + .tv-fig { padding-left: 18px; margin-left: -18px; }
  .tv-fig:nth-child(3) { border-left: 0; padding-left: 0; margin-left: 0; border-top: 1px solid var(--tv-rule); }
  .tv-fig:nth-child(4) { border-top: 1px solid var(--tv-rule); }
  .tv-fig .v { font-size: 34px; }
  .tv-fig .v.name { font-size: 20px; }
  .tv-row { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 10px 0; }
  .tv-row-name small { display: inline; margin-left: 8px; }
  .tv-runs { max-height: calc(4 * (var(--cell-h) + 5px) - 5px); }
  .tv-ch { padding-top: 40px; }
  .tv-ch + .tv-ch { margin-top: 40px; }
  .tv-ch-head { font-size: 17px; }
  .tv-table th:nth-child(5), .tv-table td:nth-child(5) { display: none; }
  .tv-about { padding-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-chip, .tv-btn, .tv-list summary::before { transition: none; }
}
