/* Light and dark colours follow the visitor's system setting */
:root {
  --bg: #f6f3ee;
  --text: #2a2620;
  --muted: #6b6358;
  --accent: #b5481f;
  --accent-text: #ffffff;
  /* Centre of the glow behind the logo: soft white, not pure white */
  --glow: #fbf9f5;
  /* Weather section: card background, rain (blue) and below-zero temperatures */
  --card: #ffffff;
  --line: #e4ddd2;
  --rain: #1f6fb5;
  --cold: #1f6fb5;
  --warm: #b5481f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --text: #ece6dc;
    --muted: #a59c8f;
    --accent: #e0703f;
    --accent-text: #1c1a17;
    --glow: #d9d4cb;
    --card: #25221e;
    --line: #3a352f;
    --rain: #6aaee8;
    --cold: #6aaee8;
    --warm: #e0703f;
  }
}

* { box-sizing: border-box; }

/* Centre the content in the window, with the footer at the bottom */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  flex: 1;
  max-width: 36rem;
  margin: 0 auto;
  padding: 3rem 1rem;
  text-align: center;
}

/* A white circle behind the icon that fades out into the page colour at its
   edge, so the icon's white square background doesn't show as a box */
.logo-glow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  background: radial-gradient(circle closest-side, var(--glow) 0%, var(--glow) 40%, var(--bg) 100%);
}

/* Multiply makes the icon's white pixels take the colour beneath them:
   white in the middle of the circle, the faded colour at the square's corners */
.logo { width: 128px; height: 128px; mix-blend-mode: multiply; }

h1 { margin: 1rem 0 0.5rem; font-size: 2.4rem; line-height: 1.2; }

.lead { font-size: 1.25rem; }

/* "Coming up": the items side by side, as wide as the video so they fit on one line */
.coming-up {
  width: min(56rem, calc(100vw - 2rem));
  margin: 2rem 0 0 50%;
  transform: translateX(-50%);
}
.coming-up h2 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--muted); font-weight: 600; }
.coming-up dl {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  margin: 0;
}
.coming-up dt { font-size: 0.8rem; color: var(--muted); }
.coming-up dd { margin: 0; font-weight: 600; }
/* The time on the visitor's own clock, under the countdown (filled in by coming-up.js) */
.coming-up-local { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.coming-up-local:empty { display: none; }
.coming-up dd a { color: var(--accent); }
.coming-up-note { margin: 0.4rem 0 0; font-size: 0.75rem; color: var(--muted); }

/* The video is wider than the text column, up to the window width */
.video {
  width: min(56rem, calc(100vw - 2rem));
  margin: 2rem 0 2rem 50%;
  transform: translateX(-50%);
}

.video-label { margin: 0 0 0.5rem; }
.video-label .video-title { display: block; color: var(--muted); font-size: 0.95rem; }

.live-badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 4px;
  background: #d32f2f;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Keep the player 16:9 at any width */
.video-frame {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* --- Weather ------------------------------------------------------------- */

/* As wide as the video, so the hour strip has room */
.weather {
  width: min(56rem, calc(100vw - 2rem));
  margin: 2rem 0 2rem 50%;
  transform: translateX(-50%);
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.weather h2 { margin: 0 0 0.75rem; font-size: 1.4rem; }
.weather h3 { margin: 1.5rem 0 0.5rem; font-size: 1rem; color: var(--muted); font-weight: 600; }

.weather-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}
.weather-now-icon { width: 72px; height: 72px; }
.weather-now-temp { font-size: 3rem; font-weight: 700; line-height: 1; color: var(--warm); }
.weather-now-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; text-align: left; }
.weather-now-facts dt { font-size: 0.8rem; color: var(--muted); }
.weather-now-facts dd { margin: 0; font-weight: 600; }

/* One column per hour; scrolls sideways when the window is too narrow */
.weather-hours {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(3.6rem, 1fr);
  gap: 0.25rem;
  margin: 0;
  padding: 0 0 0.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.weather-hours li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem 0.2rem;
  border-radius: 8px;
  scroll-snap-align: start;
}
/* The current hour stands out a little */
.weather-hours li:first-child { background: color-mix(in srgb, var(--line) 50%, transparent); }
.weather-time { font-size: 0.85rem; color: var(--muted); }
.weather-hours img { width: 40px; height: 40px; }
.weather-symbol-text { font-size: 0.7rem; line-height: 1.2; min-height: 40px; }
.weather-temp { font-weight: 600; color: var(--warm); }
.weather-temp.cold { color: var(--cold); }
.weather-rain { font-size: 0.8rem; color: var(--rain); min-height: 1.2em; }

.weather-credit { margin: 1rem 0 0; font-size: 0.8rem; color: var(--muted); }
.weather-credit a { color: inherit; }

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}
.button:hover, .button:focus-visible { filter: brightness(1.1); }

footer {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
