/* Corridor display — Apple-inspired, white with a burgundy accent.
   1rem scales with the screen: 20px at 1920×1080, 40px at 3840×2160. */
:root {
  --accent: #8A123C;
  --accent-tint: #F6E9EE;
  --ink: #1D1D1F;
  --ink-2: #3A3A3C;
  --muted: #6E6E73;
  --faint: #8E8E93;
  --line: #E8E8ED;
  --tile: #F4F4F6;
  --bg: #FFFFFF;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: min(calc(100vh / 54), calc(100vw / 96));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; cursor: none; }
h1, h2, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }

.banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5; text-align: center;
  background: var(--ink); color: #fff; font-size: 0.9rem; padding: 0.45rem 1rem;
}

.layout {
  height: 100vh; display: grid; grid-template-columns: 7fr 3fr;
  padding: 2.8rem 3.2rem 2.4rem; column-gap: 3.2rem;
}

/* ---------------------------------------------------------------- left */
.left { display: flex; flex-direction: column; min-height: 0; }
.left-head { margin-bottom: 2rem; }
.brand { display: flex; align-items: center; gap: 1rem; min-height: 1.4rem; }
.logo { height: 2.4rem; width: auto; }
.dept { font-size: 1rem; font-weight: 600; letter-spacing: 0.18em; color: var(--accent); }
.month { font-size: 3.4rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; margin-top: 0.5rem; }

.sections { flex: 1; min-height: 0; display: flex; flex-direction: column; row-gap: 2rem; }
.sec { flex: none; display: flex; flex-direction: column; min-height: 0; }
.sec-head { display: flex; align-items: baseline; gap: 1.2rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.sec-head h2 { font-size: 1.9rem; font-weight: 650; letter-spacing: -0.015em; }
.sec-sub { font-size: 1.1rem; color: var(--muted); }
.pager { margin-left: auto; font-size: 1rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; }

.page { position: absolute; inset: 0 0 auto 0; opacity: 0; visibility: hidden; transition: opacity 600ms ease, visibility 0s linear 600ms; }
.page.is-active { opacity: 1; visibility: visible; transition: opacity 600ms ease; }
.page.measuring { position: static; transition: none; }

.item { display: grid; grid-template-columns: 5.2rem 1fr; column-gap: 1.5rem; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.tile {
  width: 5.2rem; height: 5.2rem; border-radius: 1rem; background: var(--tile);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.tile-wd { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile-day { font-size: 2.2rem; font-weight: 650; letter-spacing: -0.02em; margin: 0.22rem 0 0.2rem; font-variant-numeric: tabular-nums; }
.tile-mon { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.tile-mon.is-other { color: var(--ink-2); }
.item.is-today .tile { background: var(--accent-tint); }
.item.is-today .tile-day { color: var(--accent); }

.item-body { min-width: 0; }
.item-title {
  font-size: 1.7rem; font-weight: 600; line-height: 1.22; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-meta { margin-top: 0.35rem; font-size: 1.2rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.1rem; row-gap: 0.2rem; }
.item-meta .team { color: var(--ink-2); font-weight: 600; }
.item-meta .sep { margin: 0 0.55rem; color: var(--faint); }
.tag { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.18rem 0.55rem; border-radius: 99rem; margin-right: 0.75rem; }
.tag-today { color: var(--accent); background: var(--accent-tint); }
.tag-ended { color: var(--muted); background: var(--tile); }
.tag-example { color: var(--muted); border: 1px solid var(--line); }
.item.is-ended .item-title, .item.is-ended .tile { opacity: 0.45; }

/* Secondary sections ("Later this month", "Coming up") use compact rows. */
.sec:not([data-key=week]) .sec-head h2 { font-size: 1.5rem; }
.sec:not([data-key=week]) .sec-sub { font-size: 1rem; }
.sec:not([data-key=week]) .item { grid-template-columns: 3.6rem 1fr; column-gap: 1.1rem; padding: 0.5rem 0; }
.sec:not([data-key=week]) .tile { width: 3.6rem; height: 3.6rem; border-radius: 0.7rem; }
.sec:not([data-key=week]) .tile-day { font-size: 1.45rem; margin: 0.1rem 0 0.08rem; }
.sec:not([data-key=week]) .tile-wd, .sec:not([data-key=week]) .tile-mon { font-size: 0.65rem; }
.sec:not([data-key=week]) .item-title { font-size: 1.2rem; -webkit-line-clamp: 1; }
.sec:not([data-key=week]) .item-meta { font-size: 0.95rem; margin-top: 0.15rem; }
.sec:not([data-key=week]) .tag { font-size: 0.75rem; }

.month-label { font-size: 0.95rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); padding: 1.1rem 0 0.2rem; }
.page > .month-label:first-child { padding-top: 0.8rem; }
.empty { font-size: 1.4rem; color: var(--muted); padding: 1.3rem 0; }
.board-message { font-size: 1.6rem; color: var(--muted); max-width: 40rem; line-height: 1.4; padding-top: 1rem; }

/* ---------------------------------------------------------------- right */
.right { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); padding-left: 3.2rem; }
.clock { padding-bottom: 1.6rem; }
.time { font-size: 5.4rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.time .ampm { font-size: 2.1rem; font-weight: 600; letter-spacing: 0.02em; margin-left: 0.5rem; color: var(--muted); }
.date { font-size: 1.1rem; color: var(--muted); margin-top: 0.6rem; }

.panel-label { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.8rem; }
.feed { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.feed-frame { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 0.9rem; }
.feed-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; pointer-events: none; }
.feed-iframe.is-ready { opacity: 1; transition: opacity 600ms ease; }
.feed-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; font-size: 1.05rem; line-height: 1.45; color: var(--muted); background: var(--tile); border-radius: 0.9rem; }
.feed-state[hidden] { display: none; }

.weather { padding-top: 1.3rem; margin-top: 1.4rem; border-top: 1px solid var(--line); }
.weather-label { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.weather-main { display: flex; align-items: center; gap: 1rem; margin-top: 0.7rem; }
.weather-icon { width: 2.8rem; height: 2.8rem; color: var(--ink-2); flex: none; }
.weather-icon svg { width: 100%; height: 100%; }
.weather-temp { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.weather-text { margin-left: 0.4rem; line-height: 1.3; }
.weather-cond { font-size: 1.1rem; color: var(--ink-2); font-weight: 500; }
.weather-hl { font-size: 1rem; color: var(--muted); display: flex; gap: 0.9rem; font-variant-numeric: tabular-nums; }
.weather-unavailable { font-size: 1.2rem; color: var(--muted); margin-top: 0.6rem; }
.weather-stale, .status { display: flex; align-items: center; gap: 0.5rem; }
.weather-stale { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.weather-attr { font-size: 0.75rem; color: var(--faint); margin-top: 0.55rem; }
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #C7C7CC; flex: none; }
.is-stale .dot, .weather-stale .dot { background: #D18B00; }

.status { font-size: 0.85rem; color: var(--faint); margin-top: 1rem; min-height: 1.2rem; }

/* This week: a soft grey box so it stands apart from the other sections. */
.sec[data-key=week] { background: #F4F4F6; border-radius: 1.2rem; padding: 1.1rem 1.6rem 0.3rem; }
.sec[data-key=week] .sec-head { border-bottom-color: #E2E2E7; }
.sec[data-key=week] .item { border-bottom-color: #E2E2E7; }
.sec[data-key=week] .tile { background: #FFFFFF; }
.sec[data-key=week] .tag-ended { background: #FFFFFF; }

/* Countdown: bold burgundy cards between "This week" and "Later this month". */
.cd { flex: none; display: flex; flex-direction: column; }
.cd .sec-head { border-bottom: 0; padding-bottom: 0.6rem; }
.cd .sec-head h2 { font-size: 1.5rem; }
.cd-viewport { display: grid; }
.cd-page { grid-area: 1 / 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
  opacity: 0; visibility: hidden; transition: opacity 600ms ease, visibility 0s linear 600ms; }
.cd-page[data-cols='1'] { grid-template-columns: minmax(0, 1fr); }
.cd-page[data-cols='2'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cd-page.is-active { opacity: 1; visibility: visible; transition: opacity 600ms ease; }
.cd-card { background: var(--accent); color: #FFFFFF; border-radius: 1rem; padding: 0.95rem 1.4rem; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; }
.cd-text { min-width: 0; }
.cd-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-meta { font-size: 1rem; opacity: 0.85; margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-num { display: flex; align-items: baseline; gap: 0.5rem; flex: none; }
.cd-value { font-size: 3.4rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.cd-unit { font-size: 1.05rem; font-weight: 600; opacity: 0.85; }
/* Three side by side: stack the number under the name. */
.cd-page[data-cols='3'] .cd-card { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.cd-page[data-cols='3'] .cd-text { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .page, .page.is-active, .feed-iframe.is-ready, .cd-page, .cd-page.is-active { transition: none; }
}
