/* vrc.dj  TV: a channel's page, /tv (pages/tv.php, views/tv_page.php).
   The stage monitor is rig.css's; this is the page around it: the channel's
   logo and ON AIR, the now/next caption under the screen, the like and Watch,
   and the guide beside it (chat takes the side column in phase 2). Flat
   broadcast graphics in the site's tokens; both themes. --tv-tone is the
   channel's colour, --tv-on the text that reads on it and --tv-ink-l its ink
   on the light theme (tv_channel_style(), set on .tvp). */

/* the channel's colour as ink on the page (a channel page, a row of the guide, /tv/guide) */
.tvp, .epg-row { --tv-tone-ink: color-mix(in srgb, var(--tv-tone, #f43f5e) 55%, #fff); }
[data-theme="light"] :is(.tvp, .epg-row) { --tv-tone-ink: var(--tv-ink-l, color-mix(in srgb, var(--tv-tone, #f43f5e) 80%, #000)); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) :is(.tvp, .epg-row) { --tv-tone-ink: var(--tv-ink-l, color-mix(in srgb, var(--tv-tone, #f43f5e) 80%, #000)); }
}
/* width 100%: the page's width never follows what the side shows (the guide's long titles widened it, the chat narrowed it) */
.tvp { width: 100%; max-width: 1320px; margin: 0 auto; padding: 16px 24px 40px;
  display: grid; grid-template-columns: min(calc((100vh - 300px) * 1.7778 + 25px), calc(100% - 380px)) minmax(320px, 1fr);
  gap: 22px; align-items: start; }
.tvp-main { min-width: 0; }
.tvp-dim { color: color-mix(in srgb, var(--text) 62%, transparent); font-weight: 400; }

/* the channel's logo, ON AIR and the count */
.tvp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tvp-bug { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 900; color: var(--white); letter-spacing: -.01em; white-space: nowrap; }
.tvp-bug b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 3px; background: var(--tv-tone, #f43f5e); color: #fff; font-size: 19px; font-weight: 900; }
.tvp-onair { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--tv-tone-ink); white-space: nowrap; }
.tvp-onair i { width: 8px; height: 8px; border-radius: 50%; background: var(--tv-tone, #f43f5e); }
.tvp-onair .tvp-dim { letter-spacing: 0; text-transform: none; font-weight: 600; font-size: 12.5px; }
.tvp-head-sp { flex: 1; }
.tvp-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-bright);
  background: var(--bg-elevated); color: var(--text); font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.tvp-btn:hover { color: var(--white); border-color: color-mix(in srgb, var(--text) 35%, transparent); }

/* under the screen: now/next, like, Watch */
.tvp-under { display: flex; align-items: flex-start; gap: 16px; margin-top: 12px; }
.tvp-l3 { flex: 1; min-width: 0; }
.tvp-now { position: relative; display: flex; flex-direction: column; padding: 9px 16px 11px 14px; border-left: 4px solid var(--tv-tone, #f43f5e); background: var(--bg-elevated); }
.tvp-k { font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: var(--tv-tone-ink); }
.tvp-why { color: var(--tv-tone-ink); font-weight: 800; }
.tvp-t { font-size: 1.3rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; color: var(--white); margin: 2px 0 1px; text-decoration: none; overflow-wrap: anywhere; }
.tvp-t:hover { text-decoration: underline; text-underline-offset: 3px; }
.tvp-s { font-size: .9rem; font-weight: 700; color: var(--text); }
.tvp-s a { color: inherit; text-decoration: none; }
.tvp-s a:hover { text-decoration: underline; }
.tvp-elapsed { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.tvp-elapsed::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p); background: var(--tv-tone, #f43f5e); }
.tvp-next { padding: 7px 14px 7px 18px; font-size: .84rem; color: var(--text); }
.tvp-next .tvp-k { color: color-mix(in srgb, var(--text) 65%, transparent); letter-spacing: .14em; margin-right: 6px; }
.tvp-next .tvp-why { text-transform: uppercase; letter-spacing: .08em; font-size: .78em; }
.tvp-ctl { display: flex; align-items: center; gap: 10px; padding-top: 4px; flex-shrink: 0; }
.tvp .tvp-watch { background: var(--tv-tone, #f43f5e); border-color: color-mix(in srgb, var(--tv-tone, #f43f5e) 65%, #000); color: var(--tv-on, #fff); }
.tvp .tvp-watch:hover { background: color-mix(in srgb, var(--tv-tone, #f43f5e) 85%, #fff); color: var(--tv-on, #fff); }
.tvp .tvp-watch [data-tv-watch-icon] { display: inline-block; }
.tvp .tvp-watch.is-on { background: transparent; color: var(--tv-tone-ink); border-color: color-mix(in srgb, var(--tv-tone, #f43f5e) 50%, transparent); }
.tvp-empty { margin: 12px 0 0; color: color-mix(in srgb, var(--text) 70%, transparent); }

/* the guide */
.tvp-side { position: sticky; top: 84px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); padding: 14px 0 6px; max-height: calc(100vh - 100px - var(--pb-room, 0px)); overflow-y: auto; }
.tvp-side-h { font-size: .8rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: color-mix(in srgb, var(--text) 70%, transparent); margin: 0 16px 8px; }
.tvp-side-note { margin: 10px 16px 8px; font-size: .78rem; color: color-mix(in srgb, var(--text) 62%, transparent); }
/* the timeline (render_tv_guide(), tv-guide.js): a set's block is as tall as
   it is long (--m minutes at --tvg-ppm), never shorter than its two lines */
.tvg { --tvg-ppm: 1.05px; position: relative; list-style: none; margin: 0; padding: 0 14px 0 0; }
.tvg-b { position: relative; display: grid; grid-template-columns: 78px minmax(0, 1fr); height: max(50px, calc(var(--m) * var(--tvg-ppm))); }
.tvg-b + .tvg-b { border-top: 1px solid color-mix(in srgb, var(--text) 7%, transparent); }
.tvg-when { padding: 9px 8px 0 16px; font-size: .74rem; font-weight: 700; color: color-mix(in srgb, var(--text) 62%, transparent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tvg-blk { display: flex; flex-direction: column; min-width: 0; margin: 3px 0; padding: 6px 10px 6px 11px; border-left: 3px solid color-mix(in srgb, var(--tv-tone, #f43f5e) 28%, transparent);
  border-radius: 0 6px 6px 0; overflow: hidden; text-decoration: none; transition: background-color .15s, border-color .15s; }
.tvg-blk:hover, .tvg-blk:focus-visible { background: color-mix(in srgb, var(--tv-tone, #f43f5e) 10%, transparent); border-left-color: var(--tv-tone, #f43f5e); }
.tvg-blk:focus-visible { outline: 2px solid var(--tv-tone, #f43f5e); outline-offset: -2px; }
.tvg-b.is-on .tvg-blk { background: color-mix(in srgb, var(--tv-tone, #f43f5e) 12%, transparent); border-left-color: var(--tv-tone, #f43f5e); }
.tvg-b.is-on .tvg-when { color: var(--tv-tone-ink); }
.tvg-b--premiere .tvg-blk { border-left-color: var(--tv-tone, #f43f5e); }
.tvg-b.is-past { opacity: .45; }
.tvg-why { font-size: .64rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; color: var(--tv-tone-ink); line-height: 1.3; }
.tvg-t { font-size: .88rem; font-weight: 700; color: var(--white); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvg-a { font-size: .78rem; color: color-mix(in srgb, var(--text) 68%, transparent); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvg-day { list-style: none; padding: 14px 16px 6px; font-size: .66rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: color-mix(in srgb, var(--text) 55%, transparent); }
.tvg-now { position: absolute; left: 72px; right: 14px; z-index: 2; height: 0; border-top: 2px solid var(--tv-tone, #f43f5e); pointer-events: none; transition: top 1s linear; }
.tvg-now::before { content: ''; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--tv-tone, #f43f5e); }
.tvg-now[hidden] { display: none; }
.tvg-full { display: flex; align-items: center; gap: 6px; margin: 10px 16px 2px; font-size: .84rem; font-weight: 700; color: var(--tv-tone-ink); text-decoration: none; }
.tvg-full:hover { text-decoration: underline; text-underline-offset: 3px; }
.tvg-full .bi { transition: translate .2s var(--ease); }
.tvg-full:hover .bi { translate: 3px 0; }
:root[data-motion="reduce"] :is(.tvg-now, .tvg-full .bi, .tvg-blk) { transition: none; }

/* phones: the screen across the width, the guide under it */
@media (max-width: 767px) {
  .tvp { grid-template-columns: 1fr; padding: 8px 0 24px; gap: 14px; }
  .tvp-head { padding: 0 12px; margin-bottom: 8px; gap: 10px; }
  .tvp-onair .tvp-dim { display: none; }
  .tvp-btn--guide { display: none; }
  .tvp-mon .wr-mon-box { border-radius: 0; border-left: 0; border-right: 0; padding: 18px 6px 9px; }
  .tvp-under { flex-direction: column; gap: 8px; padding: 0 12px; }
  .tvp-l3 { width: 100%; }
  .tvp-t { font-size: 1.1rem; }
  .tvp-ctl { width: 100%; justify-content: space-between; }
  .tvp-side { position: static; max-height: none; border-radius: 0; border-left: 0; border-right: 0; }
}
