/*
 * Valley Heights Activities sign. Everything is sized from --u, one hundredth
 * of the height of a 16:9 screen, so the layout is identical at 1080p and 4K
 * and never scrolls. --fit-now and --fit-list are lowered by the script when
 * unusually long text would overflow the card or the list.
 */
:root {
  --u: min(1vh, calc(100vw / 177.78));
  --fit-now: 1;
  --fit-list: 1;
  --bg-top: #123a32;
  --bg-bottom: #0a1f1b;
  --ink: #f8f2e4;
  --muted: #b9cbc1;
  --rule: rgba(248, 242, 228, 0.14);
  --gold: #e3b866;
  --gold-deep: #c8973c;
  --card: #fbf6ea;
  --card-edge: #efe3c8;
  --card-ink: #12302a;
  --card-muted: #4c6a61;
  --now: #c45a2c;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Mulish", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-bottom);
}

body {
  cursor: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.vha-sign {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--u) * 4) calc(var(--u) * 6) calc(var(--u) * 4.4);
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(ellipse 55% 60% at 0% 0%, rgba(227, 184, 102, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 70% at 100% 100%, rgba(98, 160, 132, 0.18), transparent 70%),
    linear-gradient(165deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

/* ---------- Header ---------- */

.vha-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(var(--u) * 4);
  padding-bottom: calc(var(--u) * 2.2);
}

.vha-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--u) * 0.28);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(227, 184, 102, 0.5) 45%, rgba(227, 184, 102, 0) 100%);
}

.vha-heading {
  margin: 0;
  font-family: var(--serif);
  font-size: calc(var(--u) * 6.6);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.vha-heading-topic {
  color: var(--gold);
  font-style: italic;
  font-weight: 600;
}

.vha-clock {
  text-align: right;
  white-space: nowrap;
}

.vha-clock-time {
  font-size: calc(var(--u) * 6.2);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.vha-clock-date {
  margin-top: calc(var(--u) * 1);
  font-size: calc(var(--u) * 2.5);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Body ---------- */

.vha-body {
  flex: 1;
  min-height: 0;
  display: grid;
  margin-top: calc(var(--u) * 3);
  overflow: hidden;
}

.is-now .vha-body {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  column-gap: calc(var(--u) * 5);
}

.is-upcoming .vha-body {
  grid-template-columns: minmax(0, 1fr);
}

.vha-section-title,
.vha-now-label {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.4);
  margin: 0 0 calc(var(--u) * 1.2);
  font-family: var(--sans);
  font-size: calc(var(--u) * 2.5);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.vha-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(227, 184, 102, 0.5), rgba(227, 184, 102, 0));
}

/* ---------- Happening now ---------- */

.vha-now {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vha-now-label {
  color: var(--ink);
  letter-spacing: 0.12em;
}

.vha-pulse {
  position: relative;
  width: calc(var(--u) * 1.7);
  height: calc(var(--u) * 1.7);
  border-radius: 50%;
  background: var(--now);
  box-shadow: 0 0 0 calc(var(--u) * 0.4) rgba(196, 90, 44, 0.3);
  animation: vha-pulse 2.4s ease-in-out infinite;
}

@keyframes vha-pulse {
  0%, 100% { box-shadow: 0 0 0 calc(var(--u) * 0.3) rgba(196, 90, 44, 0.45); }
  50% { box-shadow: 0 0 0 calc(var(--u) * 1.1) rgba(196, 90, 44, 0); }
}

.vha-now-cards {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 2.2);
}

.vha-now-card {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--u) * 4) calc(var(--u) * 4.4) calc(var(--u) * 3.6);
  overflow: hidden;
  border-radius: calc(var(--u) * 2.2);
  color: var(--card-ink);
  background: linear-gradient(170deg, var(--card) 0%, var(--card-edge) 100%);
  box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 6) rgba(0, 0, 0, 0.35);
}

.vha-now-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: calc(var(--u) * 1);
  background: linear-gradient(180deg, var(--now), var(--gold-deep));
}

.vha-now-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.vha-now-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  margin: 0;
  font-family: var(--serif);
  font-size: calc(var(--u) * 7.4 * var(--fit-now));
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.vha-now-details {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1.2);
  margin-top: calc(var(--u) * 2.6);
}

.vha-now-time {
  font-size: calc(var(--u) * 4 * var(--fit-now));
  font-weight: 800;
  line-height: 1.1;
  color: var(--card-ink);
}

.vha-now-location {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1);
  font-size: calc(var(--u) * 3.3 * var(--fit-now));
  font-weight: 600;
  line-height: 1.2;
  color: var(--card-muted);
}

.vha-now-location svg {
  flex: none;
  width: 0.9em;
  height: 0.9em;
  fill: var(--now);
}

.vha-progress {
  flex: none;
  padding-top: calc(var(--u) * 2.4);
}

.vha-progress-bar {
  height: calc(var(--u) * 1);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(18, 48, 42, 0.12);
}

.vha-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f5c4f, var(--gold-deep));
}

.vha-progress-text {
  display: block;
  margin-top: calc(var(--u) * 1.2);
  font-size: calc(var(--u) * 2.5 * var(--fit-now));
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--card-muted);
}

.now-count-2 .vha-now-card,
.now-count-3 .vha-now-card {
  padding: calc(var(--u) * 2.6) calc(var(--u) * 3.6) calc(var(--u) * 2.4);
}

.now-count-2 .vha-now-title {
  -webkit-line-clamp: 2;
  font-size: calc(var(--u) * 4.8 * var(--fit-now));
}

.now-count-3 .vha-now-title {
  -webkit-line-clamp: 1;
  font-size: calc(var(--u) * 3.8 * var(--fit-now));
}

.now-count-2 .vha-now-details,
.now-count-3 .vha-now-details {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: calc(var(--u) * 2.4);
  margin-top: calc(var(--u) * 1.4);
}

.now-count-2 .vha-now-time,
.now-count-3 .vha-now-time {
  font-size: calc(var(--u) * 3 * var(--fit-now));
}

.now-count-2 .vha-now-location,
.now-count-3 .vha-now-location {
  font-size: calc(var(--u) * 2.7 * var(--fit-now));
}

.now-count-2 .vha-progress,
.now-count-3 .vha-progress {
  padding-top: calc(var(--u) * 1.4);
}

.now-count-3 .vha-progress-text {
  display: none;
}

/* ---------- Coming up ---------- */

.vha-upcoming {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.vha-list {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--rows, 9), minmax(0, 1fr));
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  column-gap: calc(var(--u) * 6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.vha-row {
  display: grid;
  grid-template-columns: calc(var(--u) * 19) minmax(0, 1fr);
  align-items: center;
  column-gap: calc(var(--u) * 2.6);
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.vha-when {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 0.3);
  white-space: nowrap;
}

.vha-day {
  font-size: calc(var(--u) * 1.9 * var(--fit-list));
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.vha-day.is-repeat {
  visibility: hidden;
}

.vha-start {
  font-size: calc(var(--u) * 3.4 * var(--fit-list));
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.vha-what {
  min-width: 0;
}

.vha-title {
  overflow: hidden;
  font-size: calc(var(--u) * 3.4 * var(--fit-list));
  font-weight: 700;
  line-height: 1.18;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.vha-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: calc(var(--u) * 2.2);
  margin-top: calc(var(--u) * 0.4);
  overflow: hidden;
  font-size: calc(var(--u) * 2.3 * var(--fit-list));
  font-weight: 600;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
}

.vha-meta:empty {
  display: none;
}

.vha-loc {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--u) * 0.7);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vha-loc span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.vha-loc svg {
  flex: none;
  width: 0.95em;
  height: 0.95em;
  fill: var(--gold);
}

.vha-until,
.vha-soon {
  flex: none;
}

.vha-soon {
  padding: 0 calc(var(--u) * 1.2);
  border-radius: 999px;
  font-weight: 800;
  color: var(--bg-bottom);
  background: var(--gold);
}

/* Two roomy columns when nothing is in progress. */
.is-upcoming .vha-row {
  grid-template-columns: calc(var(--u) * 20) minmax(0, 1fr);
}

.is-upcoming .vha-day {
  font-size: calc(var(--u) * 2.1 * var(--fit-list));
}

.is-upcoming .vha-start {
  font-size: calc(var(--u) * 4 * var(--fit-list));
}

.is-upcoming .vha-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  font-size: calc(var(--u) * 4 * var(--fit-list));
  overflow-wrap: anywhere;
}

.is-upcoming .vha-meta {
  font-size: calc(var(--u) * 2.6 * var(--fit-list));
}

.is-upcoming .vha-row.is-next {
  margin-right: calc(var(--u) * -2);
  padding-right: calc(var(--u) * 2);
  margin-left: calc(var(--u) * -2);
  padding-left: calc(var(--u) * 2);
  border-radius: calc(var(--u) * 1.4);
  border-bottom-color: transparent;
  background: linear-gradient(90deg, rgba(227, 184, 102, 0.16), rgba(227, 184, 102, 0.04));
  box-shadow: inset calc(var(--u) * 0.6) 0 0 var(--gold);
}

.vha-empty-note {
  margin: calc(var(--u) * 2) 0 0;
  font-family: var(--serif);
  font-size: calc(var(--u) * 3.4);
  font-style: italic;
  color: var(--muted);
}

/* ---------- Messages ---------- */

.is-message .vha-body {
  place-items: center;
  text-align: center;
}

.vha-message-main {
  margin: 0;
  font-family: var(--serif);
  font-size: calc(var(--u) * 5.6);
  font-style: italic;
  font-weight: 600;
  line-height: 1.2;
}

.vha-message-sub {
  margin: calc(var(--u) * 2) 0 0;
  font-size: calc(var(--u) * 3);
  font-weight: 600;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .vha-pulse {
    animation: none;
  }
}
