/* ABOUTME: The board's look (canvas 07, values at 1920 × 1080 scaled with the viewport): black by default or the venue's
   ABOUTME: light look, its logo top right, one column per stop, official line colours, the countdown as the hero. */
:root {
  /* 16 px at 1920 wide; everything below is in rem so a 4K TV and an old iPad get the same board. */
  font-size: calc(100vw / 120);
  --bg: #000;
  --text: #fff;
  --secondary: #e6e6ea;
  --tertiary: #8e8e93;
  --quiet: #5b5b60;
  --hairline: rgba(255, 255, 255, 0.14);
  --live: #32d74b;
  --late: #ff453a;
  --brand: #e8b900;
  --stale-badge: #5b5b60;
  --stale-badge-text: #e6e6ea;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
/* The venue's light look (issue #84): warm paper, ink type, and the semantic colours darkened to read on it.
   The accent, when the venue has one, arrives as --accent on the root and colours the small type only. --bg is
   LOOK_BACKGROUND.light in the contract, which judges accents against it: change both together. */
:root[data-mode="light"] {
  --bg: #f6f5f2;
  --text: #1c1c1e;
  --secondary: #3a3a3c;
  --tertiary: #6e6e73;
  --quiet: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.12);
  --live: #186b2c;
  --late: #b3121c;
  --brand: #8a6d00;
  --stale-badge: #5b5b60;
  --stale-badge-text: #fff;
}
@media (orientation: portrait) {
  :root {
    font-size: calc(100vh / 120);
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  cursor: none;
}
.board {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 4.6rem 5.4rem;
}
.head {
  display: flex;
  align-items: flex-start;
  gap: 2.4rem;
  padding-bottom: 2.4rem;
}
.head-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}
.kicker {
  font:
    600 1.5rem / 1 ui-monospace,
    Menlo,
    monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent, var(--tertiary));
}
.kicker.warn {
  color: var(--brand);
}
.title {
  margin: 0;
  font: 600 3.4rem / 1 var(--sans);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head-side {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}
.clock {
  font: 600 3.4rem / 1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.head-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}
/* The weather beside the clock (issue #99): a few words in the quiet type, nothing when the screen has it off. */
.weather {
  font: 400 1.25rem / 1 var(--sans);
  color: var(--tertiary);
  white-space: nowrap;
}
.weather[hidden] {
  display: none;
}
.logo {
  max-height: 5.4rem;
  max-width: 15rem;
  object-fit: contain;
}
.stops {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--columns, 2), 1fr);
  gap: 4.4rem;
  min-height: 0;
}
.stop {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stop-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding-bottom: 1.4rem;
}
.mark {
  width: 2.8rem;
  height: 2.8rem;
  color: #fff;
  font:
    700 2rem / 2.8rem Helvetica,
    Arial,
    sans-serif;
  text-align: center;
  flex: none;
}
.mark.suburban {
  border-radius: 50%;
  background: #008d4f;
  font-size: 1.9rem;
}
.mark.subway {
  background: #0057a8;
}
.mark.tram {
  background: #d82020;
  font-size: 1.9rem;
}
.mark.bus {
  background: #a5027d;
  font-size: 1.9rem;
}
.mark.ferry {
  background: #0080c0;
  font-size: 1.9rem;
}
.mark.regional,
.mark.express {
  background: #b1002d;
  font-size: 1.3rem;
}
.stop-name {
  flex: 1;
  font: 600 2.5rem / 1 var(--sans);
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.walk {
  font: 400 1.8rem / 1 var(--sans);
  color: var(--tertiary);
  white-space: nowrap;
}
.row {
  display: grid;
  grid-template-columns: 9.2rem 1fr 9.6rem;
  align-items: center;
  gap: 1.8rem;
  padding: 1.6rem 0;
  box-shadow: inset 0 1px 0 var(--hairline);
}
.row:last-child {
  box-shadow:
    inset 0 1px 0 var(--hairline),
    inset 0 -1px 0 var(--hairline);
}
.badge {
  background: var(--badge-bg, #5b5b60);
  color: var(--badge-fg, #e6e6ea);
  font: 700 2.5rem / 1 var(--sans);
  text-align: center;
  padding: 0.9rem 0;
  border-radius: 0.5rem;
  letter-spacing: -0.01em;
}
.badge.pill {
  border-radius: 2rem;
}
.stale .badge {
  background: var(--stale-badge);
  color: var(--stale-badge-text);
}
.stale .row {
  opacity: 0.55;
}
/* On paper the fade is gentler, so a grey badge still reads at 4.5:1 once composited (WCAG AA). */
:root[data-mode="light"] .stale .row {
  opacity: 0.85;
}
.direction {
  font: 400 2.7rem / 1 var(--sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.detail {
  display: block;
  font-size: 1.5rem;
  color: var(--tertiary);
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.detail .late {
  color: var(--late);
}
.detail .ontime {
  color: var(--live);
}
.countdown {
  font: 600 4.4rem / 1 var(--sans);
  text-align: right;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.countdown .prime {
  font-size: 0.47em;
  color: var(--tertiary);
  margin-left: 0.05em;
  vertical-align: 0.35em;
}
.empty {
  font: 400 2rem / 1.3 var(--sans);
  color: var(--tertiary);
  padding: 1.6rem 0;
}
.foot {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-top: 2.2rem;
  font: 400 1.7rem / 1 var(--sans);
  color: var(--tertiary);
}
.dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--tertiary);
  flex: none;
}
.dot.live {
  background: var(--live);
}
.dot.stale {
  background: var(--brand);
}
.spacer {
  flex: 1;
}
.foot .mark {
  width: auto;
  height: auto;
  font: inherit;
  color: var(--quiet);
}
.notice {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
}
.notice h2 {
  margin: 0;
  font: 600 3.4rem / 1.15 var(--sans);
  letter-spacing: -0.02em;
}
.notice p {
  margin: 0;
  font: 400 2rem / 1.4 var(--sans);
  color: var(--tertiary);
  max-width: 60rem;
}
.notice .link {
  color: var(--accent, var(--brand));
  font-family: ui-monospace, Menlo, monospace;
}

/* Cancelled rows, last so they win over the plain row rules. */
.row.gone .direction,
.row.gone .time {
  text-decoration: line-through;
}
.row.gone .countdown {
  color: var(--tertiary);
}
.row.gone {
  opacity: 0.5;
}

/* `hidden` must win over the display rules above. */
.stops[hidden],
.notice[hidden],
.logo[hidden] {
  display: none;
}

/* Portrait screens stack the stops; the row grid needs the width. */
@media (orientation: portrait) {
  .stops {
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
  }
}
