/*
  TV dashboard, laid out on a fixed 1920x1080 stage that dashboard.js scales to
  the screen. Kept to CSS that Samsung's 2021 TV browser (Chromium 76-era)
  understands: no flexbox `gap`, `inset`, `clamp()`, `:is()` or `@layer`.
*/

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #05070b;
  --panel: #0c1017;
  --line: #182030;
  --text: #f2f4f8;
  --muted: #a3acbc;
  --dim: #667085;
  --accent: #78c1ff;
  --warm: #ffc35c;
  --mint: #6ee7b7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  color: var(--text);
  font-family: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 28px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

ul {
  list-style: none;
}

/* ---------- Stage: 12 columns, three rows ---------- */

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  padding: 48px 56px 34px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 400px minmax(0, 1fr) 28px;
  gap: 28px;
  transform-origin: 0 0;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px 34px;
}

.note {
  font-size: 26px;
  color: var(--muted);
}

/* ---------- Icons ---------- */

.icon {
  display: inline-block;
  line-height: 0;
  vertical-align: middle;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.6;
}

.wx-sun { color: var(--warm); }
.wx-moon { color: #c8d3ff; }
.wx-cloud { color: #c3cbd8; }
.wx-rain { color: var(--accent); }
.wx-snow { color: #e4efff; }
.wx-storm { color: #b49cff; }

/* Big weather icons drift up and down slowly, each out of step. */
.float {
  animation: float 6s ease-in-out infinite;
}

.float-2 { animation-delay: -1.5s; }
.float-3 { animation-delay: -3s; }
.float-4 { animation-delay: -4.5s; }
.float-5 { animation-delay: -0.75s; }

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* ---------- Clock (top left) ---------- */

.clock {
  grid-column: 1 / 5;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 8px 10px;
}

.clock-time {
  display: flex;
  align-items: flex-start;
  font-size: 184px;
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.clock-s {
  margin: 22px 0 0 16px;
  font-size: 48px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--dim);
}

.clock-date {
  margin-top: 18px;
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
}

/* ---------- Weather cards (top right) ---------- */

.weather {
  grid-column: 5 / 13;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-column-gap: 16px;
}

.place {
  padding: 20px 18px 16px;
  background: var(--panel) linear-gradient(180deg, var(--tint) 0%, rgba(12, 16, 23, 0) 62%);
}

.tone-sun { --tint: rgba(255, 170, 60, 0.22); }
.tone-moon { --tint: rgba(110, 125, 255, 0.22); }
.tone-cloud { --tint: rgba(150, 170, 195, 0.16); }
.tone-rain { --tint: rgba(60, 140, 255, 0.24); }
.tone-snow { --tint: rgba(210, 230, 255, 0.2); }
.tone-storm { --tint: rgba(150, 100, 255, 0.24); }

.place-name {
  height: 38px;
  font-size: 32px;
  font-weight: 700;
  line-height: 38px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.place-now {
  display: flex;
  align-items: center;
  height: 74px;
  margin-top: 6px;
}

.place-now .icon {
  width: 54px;
  height: 54px;
  margin-right: 14px;
}

.place-temp {
  font-size: 68px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.place-cond {
  height: 28px;
  font-size: 21px;
  font-weight: 500;
  line-height: 28px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hours {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.hour-time {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
  line-height: 20px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.hour .icon {
  width: 28px;
  height: 28px;
  margin: 6px 0;
}

.hour-temp {
  display: block;
  font-size: 20px;
  line-height: 24px;
  font-weight: 600;
}

.days {
  margin-top: 6px;
}

.day {
  display: grid;
  grid-template-columns: 44px 28px minmax(0, 1fr) 74px;
  align-items: center;
  height: 30px;
  font-size: 19px;
}

.day-name {
  font-weight: 500;
  color: var(--muted);
}

.day .icon {
  width: 22px;
  height: 22px;
}

.day-rain {
  font-size: 15px;
  color: var(--accent);
}

.day-temps {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.day-lo {
  margin-left: 8px;
  font-weight: 400;
  color: var(--dim);
}

/* ---------- Slideshows (bottom): full photo, text on top ---------- */

.slides {
  grid-row: 2;
  padding: 0;
}

.explore { grid-column: 1 / 7; --hue: var(--mint); }
.food { grid-column: 7 / 13; --hue: var(--warm); }

.pages {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  background: var(--panel);
}

.pages-1 .page { opacity: 1; }

.slide-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A thin dark fade at the bottom so the name reads well on any photo. */
.page:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, rgba(5, 7, 11, 0.8) 0%, rgba(5, 7, 11, 0.35) 22%, rgba(5, 7, 11, 0) 40%);
}

.slide-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 0 40px 30px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.slide-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 46px;
  font-weight: 700;
  line-height: 54px;
  letter-spacing: -0.02em;
}

.slide-where {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 600;
  line-height: 34px;
  color: var(--hue);
}

/* ---------- Footer ---------- */

.footer {
  grid-column: 1 / 13;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  font-size: 20px;
  color: var(--dim);
  white-space: nowrap;
}

.offline-note {
  display: none;
  color: var(--warm);
}

.offline .offline-note {
  display: inline;
}
