/* PROGRAM GUIDE (zillion-tickets#353). The sign and the digits are CSS only,
   after Frank's two photos: a red ON AIR lamp with screws on a dark metal
   housing, and in its black panel red-orange seven-segment digits whose unlit
   segments still show faintly. Viewport units are written calc(... / var(--zw-s, 1))
   (docs/web.md: the WEB scale). */
.screen.wide { max-width: var(--zw-col, 1200px); }
.page-title { font-size: 1.35rem; font-weight: 900; letter-spacing: .12em; margin: 4px 2px 14px; }

/* ── the ON AIR sign ─────────────────────────────────────────────────────── */
.onair {
  --u: clamp(5px, calc(1.1vw / var(--zw-s, 1)), 11px);   /* one unit of the sign */
  display: flex; flex-direction: column; align-items: center; margin: 4px auto 22px; width: min(100%, calc(var(--u) * 78));
}
.onair .screw {
  flex: none; width: calc(var(--u) * 1.6); height: calc(var(--u) * 1.6); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8d8d8, #6d6d70 55%, #2a2a2c);
  box-shadow: inset 0 0 0 1px #00000080, 0 1px 1px #000;
  position: relative;
}
.onair .screw::after { content: ''; position: absolute; left: 15%; right: 15%; top: 45%; height: 12%; background: #1c1c1e; transform: rotate(-35deg); border-radius: 2px; }
.onair .lamp {
  display: flex; align-items: center; gap: calc(var(--u) * 1.4);
  padding: calc(var(--u) * .9) calc(var(--u) * 1.1);
  border-radius: calc(var(--u) * 1.2);
  background: linear-gradient(#5a5a5e, #2e2e31 45%, #1f1f22);
  box-shadow: 0 calc(var(--u) * .3) calc(var(--u) * .9) #000a, inset 0 1px 0 #ffffff30;
}
.onair .lamp b {
  display: block; padding: calc(var(--u) * .7) calc(var(--u) * 2.6);
  border-radius: calc(var(--u) * .6);
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif; font-weight: 900;
  font-size: calc(var(--u) * 4.4); line-height: 1; letter-spacing: .02em; color: #fff4dc;
  text-shadow: 0 0 calc(var(--u) * .5) #ffd9a0, 0 0 calc(var(--u) * 1.6) #ff3b1f;
  background:
    repeating-linear-gradient(90deg, #ffffff0d 0 2px, #00000014 2px 5px),
    radial-gradient(ellipse at 50% 55%, #ff3a1c 0%, #c4120a 55%, #6d0705 100%);
  box-shadow: inset 0 0 0 2px #3b0503, inset 0 0 calc(var(--u) * 1.6) #2a0201, 0 0 calc(var(--u) * 2.4) #ff2a1080;
}
.onair .neck {
  width: calc(var(--u) * 30); height: calc(var(--u) * 1.4); margin-top: calc(var(--u) * -.2);
  border-radius: calc(var(--u) * .6) calc(var(--u) * .6) 0 0;
  background: linear-gradient(#3a3a3d, #252528);
}
.onair .body {
  align-self: stretch; display: flex; align-items: center; gap: calc(var(--u) * 1);
  padding: calc(var(--u) * 1.6) calc(var(--u) * 1.1);
  border-radius: calc(var(--u) * 1.6);
  background: linear-gradient(#4a4a4e, #2c2c2f 30%, #222225 70%, #19191b);
  box-shadow: 0 calc(var(--u) * .5) calc(var(--u) * 1.6) #000c, inset 0 1px 0 #ffffff2a;
}
.onair .panel {
  flex: 1 1 auto; min-width: 0;
  padding: calc(var(--u) * .9);
  border-radius: calc(var(--u) * 1);
  /* the brushed steel bezel */
  background: linear-gradient(180deg, #e2e2e2, #8d8d90 20%, #c9c9cb 50%, #77777a 80%, #b5b5b8);
  box-shadow: 0 0 0 1px #111, inset 0 0 0 1px #00000060;
}
.onair .digits {
  display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 1.1);
  padding: calc(var(--u) * 2.2) calc(var(--u) * 2);
  border-radius: calc(var(--u) * .5);
  background: radial-gradient(ellipse at 50% 40%, #120707, #050303 70%);
  box-shadow: inset 0 0 calc(var(--u) * 1.4) #000;
  font-size: calc(var(--u) * 9.6);   /* the height of one digit */
  transform: skewX(-5deg);
}
.onair .tz { margin: 8px 0 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

/* A seven-segment digit: a b c d e f g, the usual letters (a on top, then
   clockwise, g in the middle). 0.56em wide, 1em high, segments 0.1em thick. */
.dg { position: relative; width: .56em; height: 1em; flex: none; filter: drop-shadow(0 0 .05em #ff3c0099); }
.dg i { position: absolute; display: block; background: #ff3c0016; }
.dg i.on { background: linear-gradient(#ff9a3c, #ff5a1c 55%, #ff3a14); }
.dg .sa, .dg .sd, .dg .sg { left: .06em; right: .06em; height: .1em; clip-path: polygon(0 50%, 12% 0, 88% 0, 100% 50%, 88% 100%, 12% 100%); }
.dg .sa { top: 0; } .dg .sg { top: .45em; } .dg .sd { bottom: 0; }
.dg .sb, .dg .sc, .dg .se, .dg .sf { width: .1em; height: .44em; clip-path: polygon(50% 0, 100% 12%, 100% 88%, 50% 100%, 0 88%, 0 12%); }
.dg .sb { right: 0; top: .05em; } .dg .sc { right: 0; bottom: .05em; }
.dg .sf { left: 0; top: .05em; } .dg .se { left: 0; bottom: .05em; }
.colon { display: flex; flex-direction: column; gap: .28em; flex: none; }
.colon i { display: block; width: .09em; height: .09em; border-radius: 50%; background: #ff3c0040; }

/* ── the studio choice ───────────────────────────────────────────────────── */
.studios { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.studios[hidden] { display: none; }
.stab {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font: inherit; font-size: .82rem; font-weight: 800; color: var(--ink); cursor: pointer;
  background: #1a1a20; border: 1px solid #ffffff2e; border-radius: 999px; padding: 7px 14px;
}
.stab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(60vw / var(--zw-s, 1)); }
.stab i { flex: none; width: 6px; height: 1.1em; border-radius: 3px; background: transparent; }
.stab.tinted i { background: var(--sc); }
.stab:hover { border-color: var(--accent); }
.stab[aria-selected="true"] { border-color: var(--sc, var(--accent)); box-shadow: 0 0 0 1px var(--sc, var(--accent)) inset; background: #24242c; }
.msg { color: var(--dim); font-size: .9rem; margin: 0 2px 10px; min-height: 1em; }
.msg:empty { display: none; }

/* ── the week, a TV guide ────────────────────────────────────────────────── */
.gframe {
  --sc: #ffffff3a; --sink: #fff;
  border: 2px solid var(--sc); border-radius: 16px; background: #0d0d12e6; overflow: hidden;
}
.gframe.tinted { box-shadow: 0 0 18px color-mix(in srgb, var(--sc) 35%, transparent); }
.gframe[hidden] { display: none; }
.ghead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid #ffffff1a; }
.gtitle { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 240px; }
.gtitle b { font-size: 1rem; font-weight: 900; letter-spacing: .04em; overflow-wrap: anywhere; }
.gnow { font-size: .82rem; color: var(--dim); overflow-wrap: anywhere; }
.golive {
  flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: .82rem; font-weight: 900; letter-spacing: .06em; padding: 9px 16px; border-radius: 999px;
  background: var(--accent); color: #000;
}
.gframe.tinted .golive { background: var(--sc); color: var(--sink); }
.golive:hover { filter: brightness(1.1); }
.gscroll { overflow-x: auto; overscroll-behavior-x: contain; }
.ggrid {
  display: grid; grid-template-columns: 74px repeat(24, minmax(54px, 1fr));
  grid-auto-rows: minmax(54px, auto); gap: 3px; padding: 8px; min-width: calc(74px + 24 * 57px);
}
.gcorner { grid-row: 1; grid-column: 1; position: sticky; left: 0; background: #0d0d12; z-index: 2; box-shadow: 5px 0 0 #0d0d12, -8px 0 0 #0d0d12; }
.ghour {
  grid-row: 1; min-height: 0; align-self: end; font-size: .7rem; font-weight: 700; color: var(--dim);
  padding: 0 4px 2px; border-left: 1px solid #ffffff1f;
}
.ggrid { grid-template-rows: 22px; }
.ghour.cur { color: var(--ink); border-left-color: var(--sc); }
.gday {
  grid-column: 1; position: sticky; left: 0; z-index: 2; display: flex; align-items: center;
  padding: 0 8px; font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  background: #15151b; border-radius: 8px; color: var(--dim);
  box-shadow: 5px 0 0 #0d0d12, -8px 0 0 #0d0d12;   /* covers the grid gap and the padding, so a scrolled block never peeks out beside it */
}
.gday.today { color: var(--ink); background: #22222b; }
.gblk {
  position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 6px 8px; border-radius: 8px; background: #1b1b22; border: 1px solid #ffffff14; overflow: hidden;
  padding-left: calc(8px + var(--pin, 0px));   /* guide.js pin(): the part under the sticky day column */
}
.gblk.today { background: #22222c; }
.gblk.empty { background: transparent; border-style: dashed; border-color: #ffffff12; }
.gblk i { font-style: normal; font-size: .66rem; font-weight: 700; color: var(--dim); }
.gblk span { font-size: .8rem; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.gblk.now { border: 2px solid var(--sc); background: #2a2a36; }
.gframe.tinted .gblk.now { box-shadow: 0 0 12px color-mix(in srgb, var(--sc) 45%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--sc) 40%, transparent); }
.gblk.now em {
  position: absolute; top: 4px; right: 6px; font-style: normal; font-size: .58rem; font-weight: 900; letter-spacing: .08em;
  padding: 1px 6px; border-radius: 999px; background: var(--sc); color: var(--sink);
}
.gframe:not(.tinted) .gblk.now em { background: #fff; color: #000; }
/* A one-hour block is narrow: smaller text, whole words over up to three lines. */
.gblk.short { padding: 5px 5px; padding-left: calc(5px + var(--pin, 0px)); }
.gblk.short span { font-size: .64rem; letter-spacing: 0; overflow-wrap: break-word; word-break: normal; -webkit-line-clamp: 3; line-clamp: 3; }
.gblk.short i { font-size: .58rem; }
@media (max-width: 600px) {
  /* The studios as one row that swipes sideways, so the week stays in view. */
  .studios { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px; }
  .studios::-webkit-scrollbar { display: none; }
  .stab { flex: none; font-size: .74rem; padding: 6px 11px; }
  .ggrid { grid-template-columns: 58px repeat(24, minmax(64px, 1fr)); min-width: calc(58px + 24 * 67px); }
  .gday { font-size: .68rem; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) { .golive:hover { filter: none; } }
