/*
 * The nightly page (/tonight, /night/<date>), in the Matchday look (docs/design/nightly/matchday-spec.md).
 * Every value comes from theme.css; markup from scripts/nightly/lib/page.ts (shell) and games.ts (rows).
 */
* { box-sizing: border-box; }
html { background: var(--ice); }
body { max-width: var(--measure-wide); margin: 0 auto; background: var(--ice); color: var(--text); font: var(--weight-regular) var(--size-body)/var(--lead-body) var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible { outline: var(--line-bold) solid var(--light); outline-offset: var(--line-bold); }
p, h1, h2, ol { margin: 0; }
ol { padding: 0; list-style: none; }
small { font-size: var(--size-micro); color: var(--text-faint); }
.wrap { padding-inline: var(--space-5); }
.sr { position: absolute; width: var(--line); height: var(--line); overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The stage: one photograph behind the top bar and the headline, ending hard where the games begin. */
.stage { position: relative; }
.photo, .stage::before { position: absolute; inset: calc(var(--hero-height) - var(--photo-height)) 0 auto auto; width: 100%; height: var(--photo-height); }
.photo { object-fit: cover; object-position: var(--photo-focus); -webkit-mask-image: var(--fade-photo); mask-image: var(--fade-photo); }
.stage::before { content: ""; z-index: 1; background: var(--shade-hero); }
.top, main { position: relative; z-index: 1; }

.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: var(--bar-height); }
.wordmark { display: inline-flex; align-items: center; min-height: var(--touch); font-size: var(--size-wordmark); font-style: italic; font-weight: var(--weight-wordmark); letter-spacing: var(--track-tight); line-height: var(--lead-tight); text-decoration: none; }
.wordmark span { color: var(--red); }
.date { font-size: var(--size-small); font-weight: var(--weight-strong); text-align: right; }

.hero { display: flex; flex-direction: column; min-height: calc(var(--hero-height) - var(--bar-height)); padding-block: var(--space-4) var(--space-6); }
h1 { font-size: var(--size-hero); font-weight: var(--weight-heavy); line-height: var(--lead-display); letter-spacing: var(--track-display); }
h1 em { display: block; color: var(--red); font-style: normal; }
.lede { margin-top: var(--space-5); max-width: var(--measure-hero); font-size: var(--size-body); font-weight: var(--weight-medium); line-height: var(--lead-snug); }
.updated { margin-top: var(--space-2); color: var(--text-dim); font-size: var(--size-small); }
/* A night the feed has not checked in its time: "Running late." leads the line in red; night.js sets the class in an
   open tab once the time passes. */
.updated .late { display: none; color: var(--red); font-weight: var(--weight-strong); }
.updated.is-late .late { display: inline; }

/* A game: its time block, then the away and home teams. A bold rule closes every row. Rows run one page inset past
   the type on both sides, so the time block reaches a narrow window's edge and its figures keep the headline's edge. */
.games { padding-inline: 0; }
.game { padding-right: var(--space-5); display: grid; grid-template-columns: var(--col-time-compact) minmax(0, 1fr); column-gap: var(--space-4); padding-block: var(--space-5); border-bottom: var(--line-bold) solid var(--light); }
/* The time block fills its row down to the rule. */
.when { grid-row: 1 / span 3; display: flex; flex-direction: column; justify-content: center; margin-block: calc(-1 * var(--space-5)); padding: var(--space-5); }
.when .hour { display: block; font-size: var(--size-numeral); font-weight: var(--weight-heavy); line-height: var(--lead-display); letter-spacing: var(--track-display); font-variant-numeric: tabular-nums; }
.when .zone { display: block; margin-top: var(--space-1); font-size: var(--size-title); font-weight: var(--weight-heavy); line-height: var(--lead-tight); }
.when.is-now { background: var(--red); color: var(--light); }
.when.is-now .zone { white-space: nowrap; }
.when.is-done { color: var(--text-dim); }

.team { min-width: 0; }
.team + .team { margin-top: var(--space-4); }
.club { display: flex; align-items: center; gap: var(--space-3); font-size: var(--size-body); line-height: var(--lead-tight); }
.tick { flex: none; width: var(--tick-width); height: var(--tick-height); background: var(--tick, var(--text-faint)); }
.goalie { margin-top: var(--space-2); font-size: var(--size-name); font-weight: var(--weight-heavy); line-height: var(--lead-tight); letter-spacing: var(--track-tight); overflow-wrap: anywhere; }
.goalie .or { font-weight: var(--weight-regular); color: var(--text-dim); letter-spacing: 0; }
.goalie.is-open { color: var(--text-dim); font-weight: var(--weight-strong); }
/* A name links to the player's page: underlined faintly, so the row still reads as type. */
.goalie a, .out a { text-decoration-color: var(--rule); text-underline-offset: var(--space-1); }
.goalie a:hover, .out a:hover { text-decoration-color: currentColor; }
.call { margin-top: var(--space-1); font-size: var(--size-body); line-height: var(--lead-tight); }
.call b { font-weight: var(--weight-regular); }
.call.is-confirmed b { color: var(--green); font-weight: var(--weight-heavy); }
.call.is-projected b { font-weight: var(--weight-heavy); }
.why { color: var(--text-dim); font-size: var(--size-small); }
.out { margin-top: var(--space-3); color: var(--text-dim); font-size: var(--size-small); }
.out b { margin-right: var(--space-1); color: var(--text); font-weight: var(--weight-heavy); letter-spacing: var(--track-caps); text-transform: uppercase; }
.out.is-none { color: var(--text-faint); }
.note { grid-column: 2 / -1; margin-top: var(--space-3); color: var(--text-faint); font-size: var(--size-small); }
.footnote { margin-top: var(--space-4); color: var(--text-faint); font-size: var(--size-small); }

.empty { padding-block: var(--space-6); border-bottom: var(--line-bold) solid var(--light); }
.empty a { font-size: var(--size-name); font-weight: var(--weight-heavy); letter-spacing: var(--track-tight); text-decoration-thickness: var(--line-bold); text-underline-offset: var(--space-1); }

/* Seven nights: weekday over its game count; the page's own night is the lit cell. */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: var(--space-7); }
.day { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); min-height: var(--touch); padding: var(--space-3) 0; border-top: var(--line-bold) solid var(--light); text-decoration: none; transition: opacity var(--quick) var(--ease); }
.day:hover { opacity: var(--dim-hover); }
.day-name { color: var(--text-dim); font-size: var(--size-micro); font-weight: var(--weight-strong); letter-spacing: var(--track-caps); text-transform: uppercase; }
.day-count { font-size: var(--size-name); font-weight: var(--weight-heavy); line-height: var(--lead-tight); font-variant-numeric: tabular-nums; }
.day.is-current { background: var(--light); border-color: var(--light); color: var(--ice); }
.day.is-current .day-name { color: var(--ice); }

.pager { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-5); font-size: var(--size-title); font-weight: var(--weight-heavy); }
.pager a { display: inline-flex; align-items: center; min-height: var(--touch); text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager a[rel="prev"]::before { content: "\2190\00a0"; }
.pager a[rel="next"]::after { content: "\00a0\2192"; }

.method { margin-top: var(--space-7); padding-bottom: var(--space-7); }
.method h2 { font-size: var(--size-title); font-weight: var(--weight-heavy); letter-spacing: var(--track-tight); }
.method p { margin-top: var(--space-2); max-width: var(--measure); color: var(--text-dim); font-size: var(--size-small); }

/* The one invitation: it stays at the foot of the window until the page's own foot. */
.cta { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; min-height: var(--bar-height); background: var(--ice); border-top: var(--line) solid var(--rule); }
.cta-row { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-4); }
.cta p { font-size: var(--size-cta); font-weight: var(--weight-heavy); line-height: var(--lead-tight); letter-spacing: var(--track-tight); }
.cta p span { display: inline-block; }
.button { display: inline-flex; flex: none; align-items: center; min-height: var(--touch); padding-inline: var(--space-5); border-radius: var(--radius-control); background: var(--light); color: var(--ice); font-size: var(--size-title); font-weight: var(--weight-heavy); text-decoration: none; transition: opacity var(--quick) var(--ease); }
.button.is-loud { background: var(--red); color: var(--light); }
.button:hover { opacity: var(--dim-hover); }

footer { padding-block: var(--space-6); color: var(--text-faint); font-size: var(--size-small); }
footer p + p { margin-top: var(--space-2); }
footer a { display: inline-flex; align-items: center; min-height: var(--touch); margin-right: var(--space-4); }

/* A window with room: type over the photograph's dark side, the two teams side by side on shared lines. */
@media (min-width: 48.0625rem) {
  .date, .club, .call, .when .zone, .button.is-loud { font-size: var(--size-label); }
  .hero { justify-content: center; padding-top: 0; }
  h1 { max-width: var(--measure-headline); }
  .lede { font-size: var(--size-title); }
  .out, .note, .footnote { font-size: var(--size-body); }
  small, .day-name { font-size: var(--size-small); }
  .button.is-loud { min-height: var(--touch-loud); padding-inline: var(--space-6); }
  .game { grid-template-columns: var(--col-time) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(5, auto); column-gap: var(--space-5); }
  .when { grid-row: 1 / -1; }
  .team { display: grid; grid-row: 1 / span 4; grid-template-rows: subgrid; }
  .team + .team { margin-top: 0; }
  .day { align-items: flex-start; padding-inline: var(--space-3); }
}

@media (prefers-reduced-motion: reduce) {
  .day, .button { transition: none; }
}
