/* Riah TV on a television (body.tv, turned on by tv.js). The picture fills the
   screen and everything else hides; a 10-foot info bar and guide sit on top.
   Sizes are in vh so 720p and 1080p screens look the same, and everything keeps
   5% clear of the edges for TVs that crop (overscan). */

body.tv { overflow: hidden; background: #000; cursor: none; }
body.tv .riah-marks,
body.tv .riah-header,
body.tv .controls,
body.tv .now,
body.tv .upnext,
body.tv .guide,
body.tv .credits,
body.tv .foot { display: none; }
body.tv .page { max-width: none; margin: 0; padding: 0; }
body.tv .stage { display: block; margin: 0; }
body.tv .player {
  position: fixed; inset: 0; aspect-ratio: auto;
  border: 0; border-radius: 0;
}

/* The "Up next" card and the right-back card, at TV size. */
body.tv .screen { padding: 8vh 8vw; gap: 1.6vh; justify-content: center; }
body.tv .screen-label { font-size: 2.4vh; }
body.tv .screen-title { font-size: 7.5vh; }
body.tv .screen-meta { font-size: 2.6vh; }
body.tv .screen-start { font-size: 2.8vh; padding: 1.4vh 3vh; min-height: 0; }
body.tv .player-note { inset: auto 5vw 5vh 5vw; padding: 1.4vh 2vh; font-size: 2.6vh; }

/* ---------- info bar ---------- */
.tv-hud { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
.tv-hud[hidden] { display: none; }
.tv-hud > * { pointer-events: auto; }
.tv-top, .tv-bottom { padding: 5vh 5vw; }
.tv-top {
  display: flex; align-items: center; gap: 3vh;
  background: linear-gradient(rgb(0 0 0 / 0.75), transparent);
}
.tv-top .riah-lockup { font-size: 4vh; }
.tv-live {
  display: inline-flex; align-items: center; gap: 1vh;
  color: var(--riah-keep);
  font: 700 2.2vh/1 var(--riah-font-data); letter-spacing: 0.12em; text-transform: uppercase;
}
.tv-live i { width: 1.2vh; height: 1.2vh; border-radius: 50%; background: var(--riah-keep); animation: pulse 2s ease-in-out infinite; }
.tv-live.is-behind, #live.is-behind { color: var(--riah-ink); }
.tv-live.is-behind i, #live.is-behind i { background: var(--riah-dim); animation: none; }
.tv-clock { margin-left: auto; color: var(--riah-body); font: 400 2.2vh/1 var(--riah-font-data); }

.tv-bottom {
  background: linear-gradient(transparent, rgb(0 0 0 / 0.85) 30%);
  padding-top: 12vh;
}
.tv-bottom p { margin: 0; }
.tv-eyebrow { color: var(--riah-dim); font: 700 2vh/1.2 var(--riah-font-data); letter-spacing: 0.12em; text-transform: uppercase; }
.tv-title {
  margin: 0.8vh 0 0.6vh; max-width: 70vw;
  color: var(--riah-ink); font: 400 6.4vh/1.05 var(--riah-font-identity); letter-spacing: -0.01em;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tv-meta { color: var(--riah-body); font-size: 2.4vh; max-width: 70vw; }
.tv-bar { height: 0.7vh; margin: 2vh 0 1vh; background: rgb(255 255 255 / 0.18); border-radius: 0.35vh; overflow: hidden; }
.tv-bar span { display: block; height: 100%; width: 0; background: var(--riah-ink); transition: width 1s linear; }
.tv-times { display: flex; justify-content: space-between; gap: 3vh; color: var(--riah-dim); font: 400 2.1vh/1.3 var(--riah-font-data); }
.tv-actions { display: flex; gap: 1.6vh; margin-top: 2.6vh; }
.tv-btn {
  min-width: 18vh; padding: 1.4vh 2.8vh;
  background: var(--riah-surface-raised); color: var(--riah-ink);
  border: 0.25vh solid var(--riah-rule-strong); border-radius: var(--riah-radius-control);
  font: 500 2.5vh/1.1 var(--riah-font-ui); cursor: none;
}
.tv-btn[hidden] { display: none; }
.tv-hint { margin-top: 1.8vh !important; color: var(--riah-dim); font-size: 1.9vh; }

/* Focus has to read from across the room: pink ring, lifted, and filled. */
.tv-focus:focus { outline: 0.5vh solid var(--riah-pink); outline-offset: 0.4vh; }
.tv-btn:focus { background: var(--riah-ink); color: var(--riah-bg); border-color: var(--riah-ink); }
body.tv .screen-start:focus { outline: 0.5vh solid var(--riah-pink); outline-offset: 0.4vh; }

/* ---------- guide ---------- */
.tv-guide {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(46vw, 92vh);
  padding: 5vh 5vw 5vh 3vh;
  background: rgb(10 10 12 / 0.94); border-left: 0.2vh solid var(--riah-rule-strong);
  display: flex; flex-direction: column; gap: 1.6vh;
}
.tv-guide[hidden] { display: none; }
body.tv-guide-open .tv-bottom { padding-right: calc(min(46vw, 92vh) + 3vh); }
body.tv-guide-open .tv-top .tv-clock { display: none; }
.tv-guide-title { margin: 0; color: var(--riah-ink); font: 400 4.4vh/1.1 var(--riah-font-identity); }
.tv-guide-list { list-style: none; margin: 0; padding: 0.6vh; overflow-y: auto; flex: 1; scrollbar-width: none; }
.tv-guide-list::-webkit-scrollbar { display: none; }
.tv-guide-list li + li { margin-top: 0.8vh; }
.tv-prog {
  display: grid; grid-template-columns: 11vh 1fr; column-gap: 1.6vh; width: 100%;
  padding: 1.2vh 1.6vh; text-align: left;
  background: transparent; color: var(--riah-body);
  border: 0.2vh solid transparent; border-radius: var(--riah-radius-control);
  font: 400 2.2vh/1.3 var(--riah-font-ui); cursor: none;
}
.tv-prog:focus { background: var(--riah-surface-raised); border-color: var(--riah-rule-strong); }
.tv-prog-time { grid-row: span 2; color: var(--riah-dim); font: 400 2.1vh/1.4 var(--riah-font-data); }
.tv-prog-title { color: var(--riah-ink); font-weight: 500; font-size: 2.5vh; }
.tv-prog-sub { color: var(--riah-dim); font-size: 1.9vh; }
.tv-prog-more { display: none; grid-column: 2; margin-top: 0.8vh; color: var(--riah-body); font-size: 2vh; }
.tv-prog.is-open .tv-prog-more { display: block; }
.tv-guide-note { margin: 0; color: var(--riah-body); font-size: 2vh; }

@media (prefers-reduced-motion: reduce) { .tv-live i { animation: none; } .tv-bar span { transition: none; } }
