/* Airing history pages. No inline styles anywhere: the site's
   Content-Security-Policy allows only this file. */

:root {
	color-scheme: light dark;
	--page: #f9f9f7;
	--surface: #fcfcfb;
	--ink: #0b0b0b;
	--ink-2: #52514e;
	--muted: #6f6d68;
	--line: #e1e0d9;
	--line-2: #c3c2b7;
	--link: #1c5cab;
	--wash: #eef3fb;
	/* Airings in a month: one hue, more is darker. */
	--heat-0: #ecebe6;
	--heat-1: #b7d3f6;
	--heat-2: #86b6ef;
	--heat-3: #3987e5;
	--heat-4: #1c5cab;
	--heat-5: #0d366b;
	--bar: #3987e5;
}

@media (prefers-color-scheme: dark) {
	:root {
		--page: #0d0d0d;
		--surface: #1a1a19;
		--ink: #f0efec;
		--ink-2: #c3c2b7;
		--muted: #9a9892;
		--line: #2c2c2a;
		--line-2: #383835;
		--link: #86b6ef;
		--wash: #1b2330;
		/* On a dark page more is lighter. */
		--heat-0: #262624;
		--heat-1: #104281;
		--heat-2: #1c5cab;
		--heat-3: #3987e5;
		--heat-4: #86b6ef;
		--heat-5: #cde2fb;
		--bar: #3987e5;
	}
}

* { box-sizing: border-box; }

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

body {
	margin: 0 auto;
	padding: 1.25rem 1rem 4rem;
	max-width: 60rem;
	background: var(--page);
	color: var(--ink);
	font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1 { margin: 0.2rem 0 0.4rem; font-size: 1.9rem; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
h2 { margin: 2.5rem 0 0.6rem; font-size: 1.2rem; }
h3 { margin: 1.5rem 0 0.3rem; font-size: 1rem; }
h3 .n, .yr, .sub { color: var(--muted); font-weight: 400; }
h1 .yr { font-weight: 400; }

.crumbs { margin: 0; font-size: 0.875rem; }
.lede { margin: 0; max-width: 44rem; color: var(--ink-2); }
.fine { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.875rem; }

.scroll { overflow-x: auto; }

/* A run of airings: time, title, kind. */
.shows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.shows li {
	display: grid;
	grid-template-columns: 9.5rem 1fr auto;
	gap: 0 1rem;
	align-items: baseline;
	padding: 0.4rem 0.25rem;
	border-bottom: 1px solid var(--line);
}
main > section[id] .shows li { grid-template-columns: 5.5rem 1fr auto; }
.shows time { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shows .kind { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.shows .unknown .what { color: var(--muted); font-style: italic; }
.shows .tag { grid-column: 2 / -1; justify-self: start; }

.tag {
	display: inline-block;
	padding: 0 0.4em;
	border: 1px solid var(--line-2);
	border-radius: 0.6em;
	color: var(--ink-2);
	font-size: 0.75rem;
	line-height: 1.5;
	white-space: nowrap;
	vertical-align: 0.1em;
}

/* The title table and what narrows it. */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; align-items: center; margin: 0 0 0.8rem; }
.filters[hidden] { display: none; }
.filters label { display: flex; gap: 0.45rem; align-items: center; color: var(--ink-2); font-size: 0.875rem; }
.filters input, .filters select {
	padding: 0.35rem 0.5rem;
	border: 1px solid var(--line-2);
	border-radius: 6px;
	background: var(--surface);
	color: var(--ink);
	font: inherit;
}
.filters input { width: 14rem; max-width: 100%; }
.filters output { margin-left: auto; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

table { border-collapse: collapse; }
.titles { width: 100%; }
.titles th, .titles td { padding: 0.4rem 0.6rem 0.4rem 0.25rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.titles thead th { position: sticky; top: 0; background: var(--page); border-bottom-color: var(--line-2); font-size: 0.875rem; white-space: nowrap; }
.titles th button { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.titles th button:hover { color: var(--link); }
.titles th[aria-sort="ascending"] button::after { content: " ↑"; }
.titles th[aria-sort="descending"] button::after { content: " ↓"; }
.titles td { font-variant-numeric: tabular-nums; }
.titles td:first-child { min-width: 14rem; }
.titles td:not(:first-child) { color: var(--ink-2); white-space: nowrap; }
.titles .num, .heat .num { text-align: right; }
.titles tbody tr:hover { background: var(--wash); }
.titles tr[hidden] { display: none; }

.months th, .months td { padding: 0.25rem 0.9rem 0.25rem 0; text-align: left; font-variant-numeric: tabular-nums; }
.months th { padding-right: 1.25rem; }

.about { max-width: 44rem; color: var(--ink-2); }
.about ul { padding-left: 1.2rem; }
.about li { margin: 0.35rem 0; }
code { font-size: 0.95em; }

/* One title's page. */
.facts { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 1.75rem 0 0; }
.facts div { min-width: 6rem; }
.facts dt { color: var(--muted); font-size: 0.8125rem; }
.facts dd { margin: 0; font-size: 1.125rem; font-weight: 600; }
.facts .sub { display: block; font-size: 0.875rem; }

.heat { margin: 2.25rem 0 0; }
.heat figcaption { margin-bottom: 0.5rem; font-size: 1.2rem; font-weight: 700; }
.heat th, .heat td { padding: 0; }
.heat thead th { padding-bottom: 0.2rem; color: var(--muted); font-size: 0.75rem; font-weight: 400; text-align: center; }
.heat abbr { text-decoration: none; }
.heat tbody th { padding-right: 0.75rem; color: var(--ink-2); font-size: 0.875rem; font-weight: 400; font-variant-numeric: tabular-nums; text-align: left; }
.heat td.num { padding-left: 0.9rem; color: var(--ink-2); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
/* A month's cell. Its number is there for screen readers and the tooltip;
   the colour says it to the eye. The margin is the gap between cells. */
.c {
	display: block;
	width: 1.6rem;
	height: 1.35rem;
	margin: 1px;
	border-radius: 3px;
	overflow: hidden;
	color: transparent;
	font-size: 0.625rem;
	text-decoration: none;
	user-select: none;
}
a.c:hover, a.c:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.l0 { background: var(--heat-0); }
.l1 { background: var(--heat-1); }
.l2 { background: var(--heat-2); }
.l3 { background: var(--heat-3); }
.l4 { background: var(--heat-4); }
.l5 { background: var(--heat-5); }
.scale { display: flex; flex-wrap: wrap; gap: 0.3rem 0.4rem; align-items: center; margin: 0.6rem 0 0; color: var(--muted); font-size: 0.8125rem; }
.scale .c { width: 0.9rem; height: 0.9rem; margin: 0 0 0 0.5rem; }
.scale .c:first-child { margin-left: 0; }

.tip {
	position: absolute;
	z-index: 2;
	padding: 0.25rem 0.5rem;
	border-radius: 5px;
	background: var(--ink);
	color: var(--page);
	font-size: 0.8125rem;
	white-space: nowrap;
	pointer-events: none;
}
.tip[hidden] { display: none; }

.dates { margin: 0; padding: 0; list-style: none; columns: 13rem; column-gap: 2rem; }
.dates li { padding: 0.12rem 0; break-inside: avoid; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* One month's page. */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-size: 0.9375rem; }
.days { display: flex; flex-wrap: wrap; gap: 0.15rem 0.2rem; margin-top: 0.8rem; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.days a { min-width: 1.9rem; padding: 0.1rem 0.3rem; border-radius: 5px; text-align: center; text-decoration: none; }
.days a:hover { background: var(--wash); }
section[id]:target h2 { text-decoration: underline; text-decoration-color: var(--link); text-decoration-thickness: 3px; text-underline-offset: 0.3em; }

/* One year's page, and the front page's way to it. */
.years { margin: 0.6rem 0 0; color: var(--ink-2); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.years a { margin-left: 0.55rem; }
.months th a { font-weight: 600; }
.prose { margin: 0; max-width: 44rem; color: var(--ink-2); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
.pair h3 { margin-top: 0.4rem; }

/* A ranked list: the name, a bar, the number the bar draws. */
.bars { width: 100%; }
.bars.wide { max-width: 44rem; }
.bars th, .bars td { padding: 0.3rem 0.6rem 0.3rem 0.25rem; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.bars th { font-weight: 400; text-align: left; }
.bars .num { padding-right: 0.25rem; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bars .k { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.bars .track { width: 9rem; padding-left: 0; vertical-align: middle; }
.bars.wide .track { width: 15rem; }
.bar { display: block; height: 0.55rem; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--bar); }

/* A day of the year is a smaller cell than a month of the logs. */
.cal .c { width: 1.3rem; height: 1.3rem; }
.heat + section h3 { margin-top: 1.75rem; }
.shows.busy li { grid-template-columns: 6.5rem 1fr auto; }
.shows .rate { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }

@media (max-width: 34rem) {
	h1 { font-size: 1.5rem; }
	.titles .first, .titles .k { display: none; }
	.titles td:first-child { min-width: 0; }
	.shows li, main > section[id] .shows li { grid-template-columns: auto 1fr; }
	.shows .kind { display: none; }
	.filters output { margin-left: 0; }
	/* Twelve months and the year's total across a phone. */
	.heat td .c { width: 1.2rem; height: 1.2rem; }
	.heat tbody th { padding-right: 0.4rem; }
	.heat td.num { padding-left: 0.4rem; }
	.pair { grid-template-columns: 1fr; }
	.bars .track, .bars.wide .track { width: 5.5rem; }
	.bars .k { display: none; }
	.shows.busy li { grid-template-columns: auto 1fr; }
	.shows .rate { grid-column: 2; }
}

/* Bar lengths, in hundredths of the longest bar. Inline styles are not allowed here. */
.w1{width:1%}.w2{width:2%}.w3{width:3%}.w4{width:4%}.w5{width:5%}.w6{width:6%}.w7{width:7%}.w8{width:8%}.w9{width:9%}.w10{width:10%}
.w11{width:11%}.w12{width:12%}.w13{width:13%}.w14{width:14%}.w15{width:15%}.w16{width:16%}.w17{width:17%}.w18{width:18%}.w19{width:19%}.w20{width:20%}
.w21{width:21%}.w22{width:22%}.w23{width:23%}.w24{width:24%}.w25{width:25%}.w26{width:26%}.w27{width:27%}.w28{width:28%}.w29{width:29%}.w30{width:30%}
.w31{width:31%}.w32{width:32%}.w33{width:33%}.w34{width:34%}.w35{width:35%}.w36{width:36%}.w37{width:37%}.w38{width:38%}.w39{width:39%}.w40{width:40%}
.w41{width:41%}.w42{width:42%}.w43{width:43%}.w44{width:44%}.w45{width:45%}.w46{width:46%}.w47{width:47%}.w48{width:48%}.w49{width:49%}.w50{width:50%}
.w51{width:51%}.w52{width:52%}.w53{width:53%}.w54{width:54%}.w55{width:55%}.w56{width:56%}.w57{width:57%}.w58{width:58%}.w59{width:59%}.w60{width:60%}
.w61{width:61%}.w62{width:62%}.w63{width:63%}.w64{width:64%}.w65{width:65%}.w66{width:66%}.w67{width:67%}.w68{width:68%}.w69{width:69%}.w70{width:70%}
.w71{width:71%}.w72{width:72%}.w73{width:73%}.w74{width:74%}.w75{width:75%}.w76{width:76%}.w77{width:77%}.w78{width:78%}.w79{width:79%}.w80{width:80%}
.w81{width:81%}.w82{width:82%}.w83{width:83%}.w84{width:84%}.w85{width:85%}.w86{width:86%}.w87{width:87%}.w88{width:88%}.w89{width:89%}.w90{width:90%}
.w91{width:91%}.w92{width:92%}.w93{width:93%}.w94{width:94%}.w95{width:95%}.w96{width:96%}.w97{width:97%}.w98{width:98%}.w99{width:99%}.w100{width:100%}
