/* ==========================================================================
   TaazTV — TV display.

   The board is authored at exactly 1920×1080 and scaled to fit whatever
   screen it lands on, so a 65" panel at 1–2 m shows the same proportions
   the design was drawn at. Everything here is sized for that distance.
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Hide the pointer once the board has been left alone — it is a TV. */
body.idle { cursor: none; }

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
}

/* ── the 1920×1080 stage ───────────────────────────────────────────────────
   Always 1920×1080 in layout; JS scales it to the screen. Centring is done
   with a transform rather than the layout, because an element larger than
   its container cannot be centred by `place-items` without clipping. */

#stage {
  position: absolute;
  top: 50%;
  right: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  transform: translate(50%, -50%);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  overflow: hidden;
  display: grid;
  grid-template-columns: 640px 1fr;
  grid-template-rows: 128px 1fr 96px;
}

#stage > .top    { grid-column: 1 / span 2; grid-row: 1; }
#stage > .side   { grid-column: 1; grid-row: 2 / span 2; }
#stage > .board  { grid-column: 2; grid-row: 2; }
#stage > .ticker { grid-column: 2; grid-row: 3; }

/* Sections switch off cleanly: the row or column collapses to zero and the
   survivors stretch into the space. */
#stage[data-topbar="0"]  { grid-template-rows: 0 1fr 96px; }
#stage[data-ticker="0"]  { grid-template-rows: 128px 1fr 0; }
#stage[data-topbar="0"][data-ticker="0"] { grid-template-rows: 0 1fr 0; }
#stage[data-sidebar="0"] { grid-template-columns: 0 1fr; }

#stage[data-topbar="0"]  > .top    { display: none; }
#stage[data-ticker="0"]  > .ticker { display: none; }
#stage[data-sidebar="0"] > .side   { display: none; }
#stage[data-board="0"]   > .board  { display: none; }

#stage[data-sidebar="0"] > .board,
#stage[data-sidebar="0"] > .ticker { grid-column: 1 / span 2; }

/* Board off: the sidebar takes the floor and lays its panels out in a row. */
#stage[data-board="0"] > .side {
  grid-column: 1 / span 2;
  grid-row: 2;
  flex-direction: row;
  border-inline-end: 0;
}
#stage[data-board="0"] > .side > .panel { flex: 1 1 0; min-width: 0; }
#stage[data-board="0"] > .ticker { grid-column: 1 / span 2; }

/* ══════════════════════════════════════════════════════════════════════════
   Top bar
   ══════════════════════════════════════════════════════════════════════ */

.top {
  background: var(--dark-blue);
  color: var(--background-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 0 40px 0 26px;
}
.top-brand { display: flex; align-items: center; gap: 22px; min-width: 0; }
.top-logo { width: 76px; height: 76px; flex: none; filter: brightness(0) invert(1); }
.top-title {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 62px;
  line-height: 1;
  letter-spacing: .005em;
  white-space: nowrap;
}
.top-subtitle {
  font-size: 24px;
  line-height: 1.3;
  color: rgba(245, 245, 245, .75);
  margin-top: 3px;
  white-space: nowrap;
}
/* Bottom-aligned, so the weather sits on the same line as the welcome text
   on the other side of the bar and the date directly beside it. */
.top-right { display: flex; align-items: flex-end; gap: 34px; }

.top-weather {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  line-height: 1.3;
  color: rgba(245, 245, 245, .75);
  white-space: nowrap;
  padding-bottom: 1px;
}
.top-weather svg { color: var(--light-blue); flex: none; }
.top-weather .place { color: rgba(245, 245, 245, .5); }
.top-clock-wrap { text-align: left; }
.top-clock {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 62px;
  line-height: 1;
  letter-spacing: .005em;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.top-date {
  font-size: 24px;
  line-height: 1.3;
  color: rgba(245, 245, 245, .75);
  margin-top: 3px;
  white-space: nowrap;
}
.top-date .hdate { color: rgba(80, 184, 238, .95); }

/* ══════════════════════════════════════════════════════════════════════════
   Sidebar
   ══════════════════════════════════════════════════════════════════════ */

.side {
  background: var(--color-bg);
  border-inline-end: 1px solid var(--color-divider);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.panel { padding: 12px 20px 10px; flex: none; min-height: 0; }
/* No `overflow` here: the registration marks are drawn outside the frame,
   so clipping the panel would erase them. The list inside does the clipping. */
.panel-grow { flex: 1; display: flex; flex-direction: column; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-heading); font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  white-space: nowrap;
}
.panel-title svg { flex: none; }
.panel-hours {
  flex: none;
  font-size: 21px;
  padding: 4px 12px;
  white-space: nowrap;
  direction: ltr;
}

.menu-items { display: grid; column-gap: 20px; }
.menu-items > div {
  display: flex;
  align-items: center;
  min-height: 34px;
  font-size: 23px;
  line-height: 1.2;
  padding: 2px 0;
  border-bottom: 1px solid var(--color-divider);
}

.sched-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 2px 0;
  border-bottom: 1px solid var(--color-divider);
}
.sched-row .t {
  flex: none;
  width: 78px;
  font-family: var(--font-heading); font-weight: 700;
  font-size: 25px;
  line-height: 1.2;
  color: var(--color-accent-700);
  direction: ltr;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.sched-row .n { flex: 1; min-width: 0; font-size: 22px; line-height: 1.2; font-weight: 600; }
.sched-row .p { flex: none; font-size: 20px; line-height: 1.2; color: var(--color-neutral-700); white-space: nowrap; }
.sched-row.is-now { background: var(--color-accent-100); }
.sched-row.is-past { opacity: .42; }

.contacts-scroll { overflow: hidden; min-height: 0; }
.contacts-group-label {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 22px;
  letter-spacing: .06em;
  line-height: 1.2;
  color: var(--color-neutral-700);
  padding: 4px 0 0;
  white-space: nowrap;
}
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 30px;
  font-size: 21px;
  line-height: 1.2;
  padding: 2px 0;
  border-bottom: 1px solid var(--color-divider);
}
.contact-row .n { font-weight: 600; white-space: nowrap; }
.contact-row .v {
  direction: ltr;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent-700);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   Middle board — mode A: rising card columns
   ══════════════════════════════════════════════════════════════════════ */

.board { min-height: 0; overflow: hidden; padding: 26px 40px; }

.cards-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 24px;
}
.cards-col {
  overflow: hidden;
  min-height: 0;
  mask-image: linear-gradient(to bottom, transparent 0, #000 46px, #000 calc(100% - 66px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 46px, #000 calc(100% - 66px), transparent 100%);
}
.cards-track {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 0 6px;
  will-change: transform;
}
/* Cards that fit without scrolling simply sit still, centred. */
.cards-col.is-static { mask-image: none; -webkit-mask-image: none; display: flex; align-items: center; }
.cards-col.is-static .cards-track { width: 100%; transform: none !important; }

/* Cards rise into place, one after another. This plays when the set of
   cards changes — not while someone is typing into one of them. */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(46px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cards-grid.is-entering .card {
  animation: card-rise .62s cubic-bezier(.22, .68, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@media (prefers-reduced-motion: reduce) {
  .cards-grid.is-entering .card { animation: none; }
}

/* ── mode B: 16:9 carousel ─────────────────────────────────────────────── */

.carousel {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
/* Same reason as the sidebar panels: the frame carries the marks, so the
   clipping moves to an inner layer. */
.carousel-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg);
}
.carousel-clip { position: absolute; inset: 0; overflow: hidden; }
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
  z-index: 1;
}
.carousel-slide.is-on { opacity: 1; transform: translateY(0); z-index: 2; }
.carousel-bar-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--color-accent-200);
  z-index: 3;
}
.carousel-bar { height: 100%; width: 0; background: var(--dark-blue); }
.carousel-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 2px;
  min-height: 14px;
}
.carousel-dots { display: flex; align-items: center; gap: 10px; }
.carousel-dots span {
  height: 14px;
  width: 16px;
  border: 1px solid var(--color-accent-700);
  background: transparent;
  transition: width .4s ease, background .4s ease;
}
.carousel-dots span.is-on { width: 44px; background: var(--dark-blue); }
.carousel-count {
  font-size: 22px;
  color: var(--color-neutral-700);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

/* Cards, slides and pictures live in css/board.css — the admin panel loads
   the same file so the editor and the board cannot drift apart. */

/* ══════════════════════════════════════════════════════════════════════════
   Ticker
   ══════════════════════════════════════════════════════════════════════ */

.ticker {
  background: var(--dark-blue);
  color: var(--background-light);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.ticker-label {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 32px;
  font-family: var(--font-heading); font-weight: 700;
  font-size: 32px;
  line-height: 1;
}
.ticker-rule { width: 1px; height: 52px; background: rgba(245, 245, 245, .28); flex: none; }
.ticker-view { flex: 1; overflow: hidden; min-width: 0; }
.ticker-track {
  display: flex;
  gap: 52px;
  white-space: nowrap;
  font-size: 28px;
  line-height: 96px;
  will-change: transform;
}
.ticker-track .sep { color: var(--light-blue); }

/* ══════════════════════════════════════════════════════════════════════════
   Empty board — everything is switched off
   ══════════════════════════════════════════════════════════════════════ */

.blank {
  grid-column: 1 / span 2;
  grid-row: 1 / span 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  color: var(--color-neutral-700);
  background: var(--color-bg);
}
.blank img { width: 120px; opacity: .5; }
.blank h1 { font-family: var(--font-heading); font-weight: 700; font-size: 54px; margin: 0; color: var(--color-text); }
.blank p { font-size: 26px; margin: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   The way back to the admin panel. It follows the mouse being present, not
   a timer: it fades in on any movement and is gone the instant the pointer
   leaves the window, so it never sits on a board nobody is standing at.
   ══════════════════════════════════════════════════════════════════════ */

#to-admin {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(10, 74, 122, .94);
  color: #fff;
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .3);
  transition: opacity .14s ease, background .14s ease;
}
#to-admin:hover { background: var(--primary-blue); }
#to-admin::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--sliders-icon) center / contain no-repeat;
  mask: var(--sliders-icon) center / contain no-repeat;
}
/* No transition on the way out — "gone" should mean gone. */
#to-admin.is-gone { opacity: 0; pointer-events: none; transition: none; }

:root {
  --sliders-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round"><path d="M4 6h16M4 12h16M4 18h16"/><circle cx="9" cy="6" r="2" fill="black"/><circle cx="15" cy="12" r="2" fill="black"/><circle cx="8" cy="18" r="2" fill="black"/></svg>');
}

