/* Robot News — a retro "TV" way to flip through Real News. Real Lessons.
   CSP-safe: all styling lives here, all behavior in /js/news-tv.js.
   Uses the site tokens (--blue, --purple, --yellow, --navy, --ink, --bg…). */

.pagehead--news { text-align: center; }

.tv { max-width: 720px; margin: 0 auto; }

/* ---------------------------------------------------------------- the set */
.tv__set {
  position: relative;
  margin: 2.4rem auto 0;
  padding: 22px 22px 16px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, #1b2c52 0%, #14213f 60%, #101b33 100%);
  box-shadow:
    0 26px 60px -22px rgba(16, 27, 51, 0.7),
    inset 0 2px 0 rgba(255, 255, 255, 0.08),
    inset 0 -6px 16px rgba(0, 0, 0, 0.35);
  border: 3px solid #0c1428;
}

/* antenna */
.tv__antenna {
  position: absolute;
  left: 50%;
  top: -46px;
  width: 200px;
  height: 50px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}
.tv__antenna span {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 54px;
  background: #101b33;
  border-radius: 4px;
  transform-origin: bottom center;
}
.tv__antenna span:first-child { transform: rotate(-32deg); }
.tv__antenna span:last-child { transform: rotate(32deg); }
.tv__antenna span::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 2px #101b33;
}

/* ---------------------------------------------------------------- screen */
.tv__screenwrap {
  position: relative;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(160deg, #26364f, #16233d);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5);
}
.tv__screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #0a1320;
  cursor: zoom-in;
  border: 2px solid #05386b33;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv__poster {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}
.tv__nosignal {
  display: none;
  padding: 1.5rem;
  text-align: center;
  color: #8ea3c4;
  font: 800 1.05rem/1.5 var(--font-head, system-ui);
  letter-spacing: 0.02em;
}
.tv__screen:hover .tv__poster { transform: scale(1.02); }

/* scanlines + curved-glass vignette */
.tv__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 2px,
      transparent 4px
    );
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.55),
    inset 0 0 14px rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  opacity: 0.7;
}

/* channel bug + LIVE */
.tv__bug {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(10, 19, 32, 0.72);
  color: #eaf2ff;
  font: 700 0.72rem/1 var(--font-head, system-ui);
  letter-spacing: 0.05em;
}
.tv__live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ff5a63;
}
.tv__live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a63;
  animation: tv-blink 1.4s ease-in-out infinite;
}

/* "tap to read" nudge */
.tv__tap {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 194, 61, 0.95);
  color: #101b33;
  font: 800 0.72rem/1 var(--font-head, system-ui);
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: tv-bob 2.2s ease-in-out infinite;
}

/* static flicker on channel change */
.tv__static {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, #0a1320, #24405f 2px, #0a1320 4px),
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.25), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.18), transparent 40%);
  background-size: 100% 4px, 60px 60px, 80px 80px;
}
.tv__screen.is-changing .tv__static { animation: tv-flip 0.42s steps(2) 1; }
.tv__screen.is-changing .tv__poster { opacity: 0; }

/* ---------------------------------------------------------------- controls */
.tv__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.tv__btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd873, var(--yellow) 55%, #e0a01f);
  color: #101b33;
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 0 #b9801a, 0 8px 14px rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.tv__btn:hover { transform: translateY(-1px); }
.tv__btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b9801a, 0 3px 8px rgba(0, 0, 0, 0.3); }
.tv__btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.tv__dial {
  min-width: 120px;
  text-align: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: #0a1320;
  color: #7ee0a0;
  font: 800 0.9rem/1.15 var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}
.tv__dial small { display: block; color: #6f7f99; font-size: 0.66rem; letter-spacing: 0.14em; }

/* speaker grille dots under the screen row */
.tv__grille {
  margin: 12px auto 2px;
  width: 120px;
  height: 12px;
  border-radius: 999px;
  background-image: radial-gradient(circle, #0c1428 1.6px, transparent 2px);
  background-size: 11px 11px;
  opacity: 0.6;
}

/* ---------------------------------------------------------------- ticker */
.tv__ticker {
  display: flex;
  align-items: stretch;
  margin: 18px auto 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 22px -12px rgba(16, 27, 51, 0.5);
  border: 2px solid #101b33;
}
.tv__ticker-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #e33b45;
  color: #fff;
  font: 900 0.82rem/1 var(--font-head, system-ui);
  letter-spacing: 0.06em;
}
.tv__ticker-track {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background: var(--yellow);
}
.tv__ticker-text {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  color: #101b33;
  font: 700 0.86rem/2.4 var(--font-head, system-ui);
  animation: tv-ticker 26s linear infinite;
}
.tv__ticker-track:hover .tv__ticker-text { animation-play-state: paused; }

/* ---------------------------------------------------------------- meta + lessons */
.tv__meta { margin: 22px auto 0; text-align: center; max-width: 620px; }
.tv__kicker {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font: 800 0.72rem/1 var(--font-head, system-ui);
  letter-spacing: 0.08em;
}
.tv__headline {
  margin: 0.6rem 0 0.35rem;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  color: var(--navy);
  line-height: 1.12;
}
.tv__date { margin: 0; color: var(--ink-faint); font-weight: 700; font-size: 0.9rem; }
.tv__summary { margin: 0.7rem 0 0; color: var(--ink-soft); font-size: 1.02rem; }

.tv__viewbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.1rem;
  padding: 0.7rem 1.25rem;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: 800 0.95rem/1 var(--font-head, system-ui);
  box-shadow: 0 6px 16px -6px var(--blue);
  transition: transform 0.08s ease, background 0.15s ease;
}
.tv__viewbtn:hover { transform: translateY(-1px); background: var(--blue-bright); }
.tv__viewbtn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.tv__lessons { margin: 1.6rem auto 0; text-align: center; }
.tv__lessons-h {
  margin: 0 0 0.7rem;
  font: 800 0.82rem/1 var(--font-head, system-ui);
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.tv__chips { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.tv__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--blue);
  color: var(--blue-deep);
  text-decoration: none;
  font: 700 0.9rem/1 var(--font-head, system-ui);
  transition: transform 0.08s ease, background 0.12s ease, color 0.12s ease;
}
.tv__chip::before { content: "💡"; }
.tv__chip:hover { background: var(--blue); color: #fff; transform: translateY(-2px); }

/* anchor robot */
.tv__anchor {
  display: block;
  width: 108px;
  height: auto;
  margin: 1.8rem auto 0;
}

.tv__foot { text-align: center; margin-top: 2rem; color: var(--ink-soft); }
.tv__noscript { text-align: center; color: var(--ink-soft); }

/* ---------------------------------------------------------------- lightbox */
.tv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  padding: 4vh 4vw;
  background: rgba(10, 19, 32, 0.86);
  overflow: auto;
}
.tv-lightbox.is-open { display: block; }
.tv-lightbox__inner { max-width: 900px; margin: 0 auto; text-align: center; }
.tv-lightbox__img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}
.tv-lightbox__close {
  position: sticky;
  top: 0;
  float: right;
  border: 0;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--yellow);
  color: #101b33;
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}
.tv-lightbox__close:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

/* ---------------------------------------------------------------- animation */
@keyframes tv-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes tv-bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
@keyframes tv-flip { 0% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes tv-ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

@media (max-width: 560px) {
  .tv__set { border-radius: 22px; padding: 16px 16px 12px; }
  .tv__btn { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .tv__live::before, .tv__tap, .tv__ticker-text,
  .tv__screen.is-changing .tv__static { animation: none; }
  .tv__screen.is-changing .tv__poster { opacity: 1; }
  .tv__ticker-text { padding-left: 0; }
}
