/* =========================================================================
   Channel page — static styles.
   Per-channel theme values (colors, overlays, accent) are injected by
   views/channel.ejs as CSS custom properties in an inline <style> :root
   block. Everything here references those variables and never changes
   per channel, so this file is cacheable (served with ?v=assetVersion).
   ========================================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* iOS: drop the default grey tap flash — our own :active/focus states replace it. */
a,
button {
  -webkit-tap-highlight-color: transparent;
}

:root {
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', 'Poppins', sans-serif;
  --page-pad: 1.75rem;
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow-card: 0 18px 36px rgba(0, 0, 0, 0.2);
  /* Semantic status colors — keep in sync with badge/CTA usage below */
  --live: #dc2626;
  --paid: #22c55e;
}

/* Visually hidden but available to screen readers (channel h1 when a logo
   is shown instead of a text title). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Toggled by IntersectionObserver on looping-animation elements that are
   off-screen. Pseudo-elements carry the pulse, hence ::before/::after. */
.anim-paused,
.anim-paused::before,
.anim-paused::after {
  animation-play-state: paused !important;
}

html {
  background: var(--bg);
  height: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* --page-backdrop is either the channel's background image or a set of
   accent-derived radial gradients (composed in the inline theme block). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background: var(--page-backdrop);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(180deg,
    var(--bg-veil-1) 0%,
    var(--bg-veil-2) 45%,
    var(--bg-veil-3) 100%);
}

/* Safari 26 ignorerar <meta theme-color>; den tar toolbar-färgen från ett
   position:fixed fullbreddselement (≥6px) med solid background-color, annars
   body. Våra fixed bakgrundslager (body::before/::after) saknar background-color
   → Safari samplar transparent → systemgrå. Denna strip är tint-källan. */
.safari-tint {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: max(6px, env(safe-area-inset-top));
  background-color: var(--theme-color);
  z-index: 5;
  pointer-events: none;
}

/* Rendered only when the channel has a background image with overlay > 0. */
.page-overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg,
    var(--overlay-1) 0%,
    var(--overlay-2) 60%,
    var(--overlay-3) 100%);
  backdrop-filter: saturate(1.08);
}

.page-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--page-pad);
  flex: 1;
  width: 100%;
}

/* Compact Header */
.channel-header {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.55rem 0 0.9rem;
  margin-bottom: 0.85rem;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 50%;
}

.channel-logo {
  height: 76px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.channel-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  align-self: center;
}

.header-divider {
  width: 1px;
  align-self: stretch;
  background: var(--card-border);
  flex-shrink: 0;
}

.channel-description {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
  align-self: center;
  max-width: 60ch;
  text-wrap: pretty;
}

/* Content Grid (fallback for VOD-only) */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

/* Big Grid Layout — smaller posters, all expanded */
.content-grid-big {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.content-grid-big .content-poster {
  aspect-ratio: 3/4;
}

.content-grid-big .content-title {
  font-size: 0.75rem;
}

.content-grid-big .content-info {
  padding: 0.4rem 0.2rem;
}

.content-grid-big .content-synopsis {
  display: none;
}

@media (max-width: 768px) {
  .content-grid-big {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.5rem;
  }

  .content-grid-big .content-title {
    font-size: 0.7rem;
  }
}

@media (max-width: 400px) {
  .content-grid-big {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
}

/* Hero + Schedule Layout */
.hero-schedule-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 1.25rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.hero-schedule-wrapper.hero-only {
  grid-template-columns: minmax(0, 1fr);
}

/* Hero Banner — Cinematic.
   The card's size is fixed by the grid column (width) + aspect-ratio (height) — never by
   the image. width:100% makes it always fill its column full-width regardless of content;
   the background image is taken out of flow (position:absolute) and object-fit: cover, so a
   weird-proportioned image is zoomed/cropped to fill the card. The 3.5/1 ratio MATCHES the
   banner upload crop, so the whole uploaded banner shows un-cropped; the page-container's
   1240px max-width keeps the height naturally bounded (~338px) — no hard cap needed. */
.hero-banner {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3.5/1;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  color: white;
  border: 1px solid var(--edge-line);
  box-shadow: var(--shadow-card);
}

.hero-banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s ease, filter 0.55s ease;
}

@media (hover: hover) {
  .hero-banner:hover .hero-banner-bg {
    transform: scale(1.045);
    filter: saturate(1.08);
  }
}

.hero-banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.56) 34%,
    rgba(0, 0, 0, 0.24) 64%,
    rgba(0, 0, 0, 0.08) 100%
  ),
  linear-gradient(
    120deg,
    var(--accent-22) 0%,
    var(--accent-10) 40%,
    transparent 68%
  );
}

.hero-banner-content {
  position: relative;
  z-index: 1;
  padding: 2.1rem;
  width: 100%;
  max-width: 760px;
}

/* Badge row above the hero title — flex keeps LIVE/KOMMANDE + Gratis pills on
   one line with a uniform gap (no reliance on inline whitespace). The row owns
   the spacing toward the title; individual pills carry no outer margins. */
.hero-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hero-badge.live {
  background: rgba(220, 38, 38, 0.85);
}

.hero-badge.live::before {
  content: '';
  width: 7px;
  height: 7px;
  background: white;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

.hero-badge.upcoming {
  /* backdrop-filter is inherited from the .hero-badge base. */
  background: rgba(255, 255, 255, 0.2);
}

/* Free ("Gratis") badge — green reads as "watchable at no cost", sits next to
   LIVE/KOMMANDE inside .hero-badges. */
.hero-badge.free {
  background: rgba(34, 197, 94, 0.85);
  color: #fff;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 0.45rem;
  line-height: 1.1;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  text-wrap: balance;
}

.hero-countdown {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.68rem 1.45rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.15s, filter 0.2s;
}

@media (hover: hover) {
  .hero-cta:hover {
    transform: translateY(-1px) scale(1.02);
    filter: brightness(1.04);
  }
}

.hero-cta.live {
  background: rgba(220, 38, 38, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
  /* Breathing ring — "live" is the one state that earns ambient motion.
     Paused off-screen via .anim-paused (IntersectionObserver). */
  animation: liveBreathe 2.6s ease-in-out infinite;
}

@keyframes liveBreathe {
  0%   { box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4), 0 0 0 0 rgba(220, 38, 38, 0.45); }
  70%  { box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4), 0 0 0 11px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4), 0 0 0 0 rgba(220, 38, 38, 0); }
}

@media (hover: hover) {
  .hero-cta.live:hover {
    animation: none;
    box-shadow: 0 6px 28px rgba(220, 38, 38, 0.55);
  }
}

.hero-cta.paid {
  background: rgba(34, 197, 94, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
}

.hero-cta.paid:hover {
  box-shadow: 0 6px 28px rgba(34, 197, 94, 0.5);
}

.hero-cta.upcoming {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
}

/* Purchase CTA — light button tinted toward the channel accent so the buy
   action reads on-brand. Plain-gradient fallback first for browsers
   without color-mix. */
.hero-cta.buy {
  background: linear-gradient(130deg, rgba(255, 249, 235, 0.8) 0%, rgba(255, 255, 255, 0.74) 100%);
  background: linear-gradient(130deg, color-mix(in srgb, var(--warm-accent) 16%, rgba(255, 255, 255, 0.8)) 0%, rgba(255, 255, 255, 0.74) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1f2937;
  box-shadow: 0 8px 24px var(--accent-30), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-cta.buy:hover {
  box-shadow: 0 10px 28px var(--accent-38);
}

/* LÅS UPP — locked behind a bundle; the banner links to the bundle purchase. Amber to
   match the poster .lock-badge so "unlock" reads the same on banners and cards. */
.hero-cta.lock {
  background: rgba(245, 158, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.hero-cta.lock:hover {
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.5);
}

.hero-cta svg {
  width: 16px;
  height: 16px;
}

/* ========== GLINT DIRECTOR ==========
   A JS sequencer (bottom of channel.ejs) puts .glint on ONE element at a
   time — hero → bundle banner → featured card — with a rest between sweeps,
   leading the eye down the page instead of everything shimmering at once.
   The overlays are transform-animated (GPU-cheap) and invisible at rest. */
.hero-banner::after,
.bundle-offer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 50%;
  background: linear-gradient(105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.07) 40%,
    rgba(255, 255, 255, 0.13) 50%,
    rgba(255, 255, 255, 0.07) 60%,
    transparent 100%);
  transform: skewX(-14deg);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-banner.glint::after,
.bundle-offer.glint::after {
  animation: glintSweep 1.4s ease-in-out 1;
}

@keyframes glintSweep {
  0%   { opacity: 0; transform: translateX(0) skewX(-14deg); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(340%) skewX(-14deg); }
}

/* Schedule Sidebar — compact TV-guide */
.schedule-sidebar {
  background: linear-gradient(180deg,
    var(--sched-bg-1) 0%,
    var(--sched-bg-2) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--edge-line-soft);
  border-radius: var(--radius-md);
  padding: 1rem 0.9rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  /* Don't let schedule content force the grid row taller than the banner —
     the banner's aspect-ratio sets the row height, schedule scrolls within. */
  height: 0;
  min-height: 100%;
}

.schedule-heading {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-heading::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--warm-accent);
  border-radius: 2px;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s, transform 0.18s;
  border-left: 3px solid transparent;
}

.schedule-item.is-live {
  border-left-color: var(--live);
  background: rgba(220, 38, 38, 0.08);
}

@media (hover: hover) {
  .schedule-item:hover {
    background: var(--ink-soft);
    transform: translateX(2px);
  }

  .schedule-item.is-live:hover {
    background: rgba(220, 38, 38, 0.12);
  }
}

.schedule-item-details {
  min-width: 0;
}

.schedule-item-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.schedule-item-when {
  font-family: var(--font-display);
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.schedule-item-price {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* LÅS UPP in the tablå price slot — amber to match .lock-badge/.hero-cta.lock. */
.schedule-item-price.lock {
  color: rgb(245, 158, 11);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.68rem;
}

/* Bundle Offers — Full-Width Promotional Banners */
.bundle-offers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.bundle-offer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg,
    var(--ink-soft) 0%,
    var(--ink-ghost) 100%);
  border: 1px solid var(--edge-line-soft);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Frosted poster wash — the bundle's own poster, blown up + cover-cropped,
   blurred and faded so it tints the banner background. Poster URL is fed in
   per-bundle via the inline --bundle-bg custom property. */
.bundle-offer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bundle-bg);
  background-size: cover;
  background-position: center;
  filter: blur(3px) saturate(1.15);
  transform: scale(1.15);
  opacity: 0.28;
  z-index: 0;
  pointer-events: none;
}

/* Keep the actual content above the frosted poster wash */
.bundle-offer-poster,
.bundle-offer-info,
.bundle-offer-cta {
  position: relative;
  z-index: 1;
}

/* Glint sweep sits above both the poster wash and the content */
.bundle-offer::after {
  z-index: 2;
}

/* Cycling mode — horizontal scroll-snap carousel. All banners live in a
   scroll track (one full-width banner visible at a time on desktop); switching
   smooth-scrolls sideways instead of jump-cutting. Dots sit outside the track
   (below it) so they aren't dragged into the horizontal scroll. Mobile reuses
   the same mechanic with narrower peeking slides (see media query below). */
.bundle-offers-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bundle-offers-track::-webkit-scrollbar {
  display: none;
}
.bundle-offers-track .bundle-offer {
  flex: 0 0 100%;
  scroll-snap-align: start;
}
.bundle-cycling-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 0.5rem;
}
.bundle-cycling-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-30);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.bundle-cycling-dot.active {
  background: var(--text-85);
  transform: scale(1.3);
}

@media (hover: hover) {
  .bundle-offer:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  }
}

.bundle-offer-poster {
  width: 80px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.bundle-offer-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bundle-offer-info {
  flex: 1;
  min-width: 0;
}

.bundle-offer-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  /* Fixed frosted-glass chip — no theme accent (some channels have none, which
     collapses --warm-accent to black and makes this illegible). White text on a
     dark translucent pill reads on both the dark banner and bright poster. */
  color: #fff;
  background: rgba(15, 18, 26, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  padding: 4px 9px;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.bundle-offer-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.bundle-offer-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  text-wrap: pretty;
}

.bundle-offer-cta {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.bundle-offer-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.35;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}

/* Same accent-tinted treatment as .hero-cta.buy */
.bundle-offer-btn.buy {
  background: linear-gradient(120deg, #fff7e2 0%, #ffffff 100%);
  background: linear-gradient(120deg, color-mix(in srgb, var(--warm-accent) 14%, #ffffff) 0%, #ffffff 100%);
  color: #2f2a1f;
  box-shadow: 0 6px 16px var(--accent-24);
}

@media (hover: hover) {
  .bundle-offer:hover .bundle-offer-btn.buy {
    transform: scale(1.03);
    box-shadow: 0 8px 20px var(--accent-28);
  }
}

.bundle-offer-btn.free {
  background: var(--surface-soft);
  color: inherit;
}

.bundle-offer-btn.paid {
  background: rgba(34, 197, 94, 0.15);
  color: var(--paid);
}

.bundle-offer-btn.paid svg {
  width: 14px;
  height: 14px;
}

.bundle-offer-btn-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 1px;
}

.bundle-offer-already-paid {
  display: block;
  font-family: var(--font-display);
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 0.35rem;
  text-decoration: none;
  transition: opacity 0.15s;
}

.bundle-offer-already-paid:hover {
  opacity: 0.8;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .bundle-offer {
    flex-wrap: wrap;
    padding: 1rem 1.1rem;
    gap: 0.75rem;
  }

  .bundle-offer-poster {
    width: 64px;
    height: 80px;
  }

  .bundle-offer-info {
    flex: 1;
    min-width: 0;
  }

  .bundle-offer-title {
    font-size: 0.92rem;
  }

  .bundle-offer-desc {
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
  }

  .bundle-offer-cta {
    width: 100%;
    text-align: center;
  }

  .bundle-offer-btn {
    font-size: 0.8rem;
    padding: 0.55rem 1.1rem;
    width: 100%;
    justify-content: center;
  }
}

/* VOD Carousel Section */
.vod-section {
  margin-top: 0.5rem;
  margin-bottom: 1.6rem;
  /* NOTE: do not add content-visibility/contain here — its paint containment
     clips the carousel arrows (which sit at left/right: -14px, half outside the
     box) and the carousel's negative-margin edge-fade bleed. */
}

.vod-section:last-child {
  margin-bottom: 0;
}

.vod-section-heading {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  text-wrap: balance;
}

.vod-section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.15em;
  background: var(--warm-accent);
  border-radius: 2px;
  opacity: 0.8;
}

.vod-carousel-wrapper {
  position: relative;
  margin-bottom: 0;
}

/* Animatable fade distances via @property */
@property --fade-left {
  syntax: '<length>';
  initial-value: 0px;
  inherits: false;
}

@property --fade-right {
  syntax: '<length>';
  initial-value: 40px;
  inherits: false;
}

/* Edge fade: mask the carousel content, starting at wrapper edge */
.vod-carousel {
  --fade-left: 0px;
  --fade-right: 40px;
  -webkit-mask-image: linear-gradient(to right,
    transparent var(--page-pad),
    black calc(var(--page-pad) + var(--fade-left)),
    black calc(100% - var(--page-pad) - var(--fade-right)),
    transparent calc(100% - var(--page-pad)));
  mask-image: linear-gradient(to right,
    transparent var(--page-pad),
    black calc(var(--page-pad) + var(--fade-left)),
    black calc(100% - var(--page-pad) - var(--fade-right)),
    transparent calc(100% - var(--page-pad)));
  transition: --fade-left 0.15s ease, --fade-right 0.15s ease;
}

.vod-carousel-wrapper.scrolled-left .vod-carousel {
  --fade-left: 40px;
}

.vod-carousel-wrapper.scrolled-right .vod-carousel {
  --fade-right: 0px;
}

.vod-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: clip;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 8px var(--page-pad) 1.4rem var(--page-pad);
  margin: 0 calc(-1 * var(--page-pad));
  scroll-padding-left: var(--page-pad);
}

.vod-carousel::-webkit-scrollbar {
  display: none;
}

.vod-carousel .content-card {
  flex: 0 0 195px;
  scroll-snap-align: start;
}

.carousel-arrow {
  position: absolute;
  /* Anchor to the poster's vertical centre, not the whole card strip (which
     includes the title below). 8px = carousel top padding; poster height is
     card-width * 4/3, so its centre sits at card-width * 2/3 below that. */
  top: calc(8px + 195px * 2 / 3);
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--arrow-bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (hover: hover) {
  .carousel-arrow:hover {
    background: var(--arrow-bg-hover);
    transform: translateY(-50%) scale(1.08);
  }
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.93);
}

.carousel-arrow:disabled {
  opacity: 0;
  cursor: default;
  pointer-events: none;
}

.carousel-arrow.left {
  left: -14px;
}

.carousel-arrow.right {
  right: -14px;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

/* Content Card — Netflix-Style */
.content-card {
  border-radius: var(--radius-md);
  overflow: visible;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  background: transparent;
}

@media (hover: hover) {
  .content-card:hover {
    transform: translateY(-5px);
    z-index: 1;
  }
}

.content-poster {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 8px 8px 6px 6px;
  border: 1px solid var(--edge-line-soft);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.content-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

@media (hover: hover) {
  .content-card:hover .content-poster img {
    transform: scale(1.05);
    filter: brightness(1.08);
  }

  .content-card:hover .content-poster {
    border-color: var(--edge-line);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
  }
}

/* Poster corner badge (top-left) */
.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  /* Frosted glass: slight translucency + blur so the badge samples the poster
     behind it, with a hairline top highlight for a real glass edge. */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  /* Least-frosted of the set — LIVE keeps its urgency, stays legible. */
  background: rgba(220, 38, 38, 0.85);
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Scheduled Badge / Upcoming Overlay */
.scheduled-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  padding: 10px 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-display);
  color: white;
}

.scheduled-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.scheduled-time {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.countdown-timer {
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Poster corner tags (bottom-right) — shared base for price + watch-now */
.price-tag,
.watch-now-badge,
.lock-badge,
.repris-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  color: white;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  /* line-height:1 collapses the line box to the glyphs so uppercase text
     centers optically; inline-flex centering shared by all pill badges. */
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.price-tag {
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.88rem;
}

.watch-now-badge {
  background: rgba(34, 197, 94, 0.85);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.watch-now-badge svg {
  width: 14px;
  height: 14px;
}

/* LÅS UPP — content locked behind a bundle the viewer hasn't bought (call to action). */
.lock-badge {
  background: rgba(245, 158, 11, 0.85); /* accent amber */
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* REPRIS — an aired live the viewer has access to, now a replay (informational, not a CTA). */
.repris-badge {
  background: rgba(30, 41, 59, 0.6); /* slate */
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.lock-badge svg,
.repris-badge svg {
  width: 14px;
  height: 14px;
}

/* Non-textual chrome shouldn't be selectable when drag-scrolling a carousel
   or double-tapping a card. */
.hero-cta,
.hero-badge,
.carousel-arrow,
.price-tag,
.watch-now-badge,
.lock-badge,
.repris-badge,
.live-badge,
.bundle-offer-label,
.bundle-offer-btn {
  -webkit-user-select: none;
  user-select: none;
}

/* Content Info */
.content-info {
  padding: 0.6rem 0.4rem;
}

.content-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.content-synopsis {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  text-wrap: pretty;
}

/* Reveal-on-scroll animation.
   html.js is set by an inline script, so without JS nothing is ever hidden.
   The IntersectionObserver adds .in-view to each section as it enters the
   viewport, which triggers the staggered card fade-in — below-fold sections
   animate when actually seen instead of invisibly at page load. */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.js .vod-section .content-card,
.js .bundle-offers:not(.is-cycling) .bundle-offer {
  opacity: 0;
}

.js .vod-section.in-view .content-card,
.js .bundle-offers.in-view:not(.is-cycling) .bundle-offer {
  animation: cardFadeIn 0.5s ease forwards;
}

.content-card:nth-child(1) { animation-delay: 0.05s; }
.content-card:nth-child(2) { animation-delay: 0.1s; }
.content-card:nth-child(3) { animation-delay: 0.15s; }
.content-card:nth-child(4) { animation-delay: 0.2s; }
.content-card:nth-child(5) { animation-delay: 0.25s; }
.content-card:nth-child(6) { animation-delay: 0.3s; }
.content-card:nth-child(7) { animation-delay: 0.35s; }
.content-card:nth-child(8) { animation-delay: 0.4s; }
.content-card:nth-child(9) { animation-delay: 0.45s; }
.content-card:nth-child(10) { animation-delay: 0.5s; }
.content-card:nth-child(n+11) { animation-delay: 0.55s; }

.bundle-offer:nth-child(1) { animation-delay: 0.05s; }
.bundle-offer:nth-child(2) { animation-delay: 0.15s; }
.bundle-offer:nth-child(3) { animation-delay: 0.25s; }

/* Hero + schedule are above the fold — plain load animation (works without JS) */
.hero-banner {
  opacity: 0;
  animation: cardFadeIn 0.6s ease forwards;
}

.schedule-sidebar {
  opacity: 0;
  animation: cardFadeIn 0.5s ease 0.15s forwards;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 1.1rem;
  color: var(--warm-accent);
  opacity: 0.4;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ========== CYCLING HERO ========== */
.hero-cycling {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3.5/1;
  min-height: 220px;
}
.hero-cycling .hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.hero-cycling .hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.hero-cycling .hero-slide .hero-banner {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  min-height: unset;
  border-radius: 0;
}
.hero-cycling-dots {
  position: absolute;
  bottom: 12px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.hero-cycling-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  border: none;
  padding: 0;
  position: relative;
}
.hero-cycling-dot.active {
  background: rgba(255,255,255,0.8);
  transform: scale(1.3);
}

/* ========== FEATURED CARD ACCENT ========== */
.content-card.featured {
  position: relative;
  border-radius: var(--radius-md);
}
.content-card.featured .content-poster {
  border-color: transparent;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.28),
    0 0 16px rgba(245, 197, 66, 0.28);
}
/* Gold gradient frame around the poster, painted into the 2px border ring only
   (mask exclude shows the padding band). Softer, warm-gold stops (no near-white
   peaks) so the ring reads as calm metal, not a hard glare. It stays static;
   the shimmer is a separate soft sheen (::after) that glides over it. */
.content-card.featured .content-poster::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(115deg,
    #f0d288 0%,
    #ddb156 24%,
    #c79429 46%,
    #eccb76 55%,
    #c79429 66%,
    #ad7e0c 84%,
    #f0d288 100%);
  background-size: 200% 100%;
  background-position: 65% 0;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
/* Soft sheen that sweeps across the gold ring. It fades in and out (opacity in
   the keyframes) and is a narrow, low-alpha highlight — so it glides like light
   catching metal rather than flashing a hard bright band across the border. */
.content-card.featured .content-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(115deg,
    transparent 40%,
    rgba(255, 250, 238, 0.42) 50%,
    transparent 60%);
  background-size: 250% 100%;
  background-position: 135% 0;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
}
@keyframes featuredSheen {
  0%   { background-position: 135% 0; opacity: 0; }
  30%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { background-position: -35% 0; opacity: 0; }
}
/* Glint director / featured shimmer: one soft pass when it's this card's turn */
.content-card.featured.glint .content-poster::after {
  animation: featuredSheen 2s ease-in-out 1;
}
@media (hover: hover) {
  .content-card.featured:hover .content-poster {
    border-color: transparent;
    box-shadow:
      0 18px 38px rgba(0, 0, 0, 0.32),
      0 0 26px rgba(245, 197, 66, 0.42);
  }
  .content-card.featured:hover .content-poster::after {
    animation: featuredSheen 2.6s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== TOUCH PRESS FEEDBACK ==========
   Hover lift/scale is gated to real pointers (@media hover: hover) and the grey
   iOS tap flash is suppressed, so a tap had no feedback. A JS-driven .tap-active
   class (channel.ejs) supplies a subtle press-in. We deliberately do NOT use
   :active here: it fires the instant a finger lands, so it flashes at the start
   of every carousel swipe. The class is applied on a short delay and only if the
   finger stays put, so a scroll/swipe never triggers it. NOTE: the reveal
   animation must be cleared once finished (see the animationend handler in
   channel.ejs) or its forwards-fill would lock the transform and swallow this. */
@media (hover: none) {
  .content-card,
  .hero-banner,
  .bundle-offer,
  .schedule-item {
    transition: transform 0.12s ease, filter 0.12s ease;
  }

  .content-card.tap-active {
    transform: scale(0.97);
  }

  .content-card.tap-active .content-poster img {
    filter: brightness(0.93);
    transition: filter 0.12s ease;
  }

  .hero-banner.tap-active,
  .bundle-offer.tap-active {
    transform: scale(0.988);
    filter: brightness(0.96);
  }

  .schedule-item.tap-active {
    transform: scale(0.985);
    background: var(--ink-soft);
  }

  .carousel-arrow.tap-active {
    transform: translateY(-50%) scale(0.92);
    background: var(--arrow-bg-hover);
  }
}

/* Light scheme adjustments (body.scheme-light set server-side) */
body.scheme-light .content-card:hover .content-poster {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}
body.scheme-light .price-tag {
  background: rgba(0, 0, 0, 0.6);
}

/* Vibrant scheme */
body.scheme-vibrant {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-cc) 100%);
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --page-pad: 1rem;
  }

  .channel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.5rem 0 0.6rem;
    margin-bottom: 0.65rem;
  }

  .header-divider {
    display: none;
  }

  .logo-wrapper {
    max-width: 70%;
  }

  .channel-logo {
    height: 56px;
    max-width: 100%;
  }

  .channel-title {
    font-size: 1.15rem;
  }

  .channel-description {
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .content-info {
    padding: 0.5rem 0.125rem;
  }

  .content-title {
    font-size: 0.85rem;
  }

  .content-synopsis {
    display: none;
  }

  .scheduled-overlay {
    padding: 8px 8px 18px;
  }

  .scheduled-label {
    font-size: 0.6rem;
  }

  .scheduled-time,
  .countdown-timer {
    font-size: 0.75rem;
  }

  /* Hero + Schedule stacked on mobile — schedule on top */
  .hero-schedule-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-schedule-wrapper > * {
    min-width: 0;
  }

  .hero-banner,
  .hero-cycling {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .bundle-offers {
    width: calc(100% + 2 * var(--page-pad));
    margin-left: calc(-1 * var(--page-pad));
    margin-right: calc(-1 * var(--page-pad));
  }

  /* Mobile: narrower peeking slides + edge-to-edge bleed on the scroll track;
     dots are hidden (swipe is the nav). Scroll mechanics come from the base
     .bundle-offers-track rule. */
  .bundle-offers.is-cycling .bundle-offers-track {
    gap: 0.75rem;
    scroll-padding-left: var(--page-pad);
    padding: 0 var(--page-pad) 0.35rem;
    touch-action: pan-x;
  }

  .bundle-offers.is-cycling .bundle-offers-track .bundle-offer {
    flex: 0 0 min(88vw, 420px);
  }

  .bundle-offers.is-cycling .bundle-cycling-dots {
    display: none;
  }

  .bundle-offer {
    border-radius: 0;
  }

  .schedule-sidebar {
    order: -1;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
  }

  .schedule-heading {
    margin-bottom: 0.4rem;
    font-size: 0.6rem;
  }

  .schedule-heading::before {
    height: 10px;
    width: 2px;
  }

  .schedule-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .schedule-list::-webkit-scrollbar {
    display: none;
  }

  .schedule-item {
    flex: 0 0 auto;
    min-width: 110px;
    max-width: 150px;
    grid-template-columns: 1fr;
    /* Items stretch to equal height in the flex row; pack rows to the top so
       the title/time align across items regardless of whether a price row
       is present (priceless items would otherwise center vertically). */
    align-content: start;
    text-align: center;
    padding: 0.35rem 0.6rem;
    border-left: none;
    border-radius: 8px;
  }

  .schedule-item.is-live {
    border-left: none;
    background: rgba(220, 38, 38, 0.1);
  }

  .schedule-item-title {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .schedule-item-when {
    font-size: 0.6rem;
  }

  .schedule-item-price {
    font-size: 0.6rem;
    margin-top: 0.1rem;
  }

  .hero-banner {
    /* Content-driven height on mobile. The 3.5/1 aspect box cannot coexist with
       a growing content stack here: .hero-banner is a grid item with
       overflow:hidden, so its automatic content-based minimum is ZERO and the
       badge row + a wrapped long title + CTA silently clipped at the top edge.
       Let the content set the height (with the old floor); the absolutely
       positioned cover image fills whatever height results. */
    aspect-ratio: auto;
    min-height: 130px;
  }

  /* In flow on their own row above the title (same stacking as desktop).
     The old absolute top-right placement fought long titles for space on
     the short mobile hero — a wrapping title ran straight under the pills,
     and with two (LIVE + Gratis) there was no room at all. The banner's
     aspect-ratio yields to its content, so the badge row just grows the
     hero slightly instead of colliding. */
  .hero-badges {
    margin-bottom: 0.5rem;
  }

  .hero-badge {
    font-size: 0.62rem;
    padding: 4px 9px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .hero-banner-content {
    padding: 1.25rem;
  }

  .vod-carousel .content-card {
    flex: 0 0 150px;
  }

  .carousel-arrow {
    /* Cards are 150px wide here → poster centre moves up accordingly. */
    top: calc(8px + 150px * 2 / 3);
  }

  .channel-footer {
    padding: 1rem;
    gap: 0.3rem 0.5rem;
  }

  .already-paid-link,
  .footer-contact-link {
    font-size: 0.72rem;
  }

  .ap-modal-content {
    padding: 1.5rem;
    border-radius: 14px;
  }

  .ap-modal-content h3 {
    font-size: 1.05rem;
  }

  .ap-modal-content p {
    font-size: 0.82rem;
  }
}

@media (max-width: 400px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .hero-banner {
    aspect-ratio: auto; /* same content-driven rule as the 768px block */
    min-height: 100px;
  }

  .hero-title {
    font-size: 1.1rem;
  }

  .hero-badges {
    margin-bottom: 0.4rem;
  }

  .hero-badge {
    font-size: 0.58rem;
    padding: 3px 8px;
  }

  .hero-cta {
    font-size: 0.78rem;
    padding: 0.45rem 1rem;
  }

  .carousel-arrow {
    display: none;
  }

  .vod-carousel .content-card {
    flex: 0 0 130px;
  }

  .channel-header {
    align-items: center;
    text-align: center;
  }

  .channel-description {
    text-align: center;
  }

  .channel-footer {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.9rem 1rem 1.2rem;
  }

  .footer-sep {
    display: none;
  }
}

/* Channel footer */
.channel-footer {
  text-align: center;
  padding: 1.25rem 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
  background: var(--ink-faint);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--card-border);
}

.already-paid-link,
.footer-contact-link {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: opacity 0.15s;
}

.already-paid-link:hover,
.footer-contact-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-sep {
  color: var(--text-secondary);
  opacity: 0.4;
  font-size: 0.7rem;
}

/* Already paid modal */
.ap-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ap-modal-content {
  background: #fff;
  color: #1a1a2e;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ap-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.ap-modal-close:hover {
  color: #333;
}

.ap-modal-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.ap-modal-content p {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #444;
  margin-bottom: 0.75rem;
}

.ap-contact {
  margin-top: 1.25rem;
  padding-top: 1rem;
}

.ap-contact p {
  font-size: 0.8rem;
  font-weight: 500;
  color: #666;
  margin-bottom: 0.5rem;
}

.ap-contact-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.ap-contact-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a2e;
  text-decoration: none;
}

.ap-contact-row a:hover {
  text-decoration: underline;
}

.ap-contact-row svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Help modal form (support contact) — mirrors the video page help form,
   scoped to .help-form so it can't leak onto the rest of the channel page.
   Reuses the .ap-modal shell for the dialog chrome. */
#helpModal .ap-modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

.help-form {
  margin-top: 1rem;
}

.help-form .form-group {
  margin-bottom: 1rem;
}

.help-form label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  color: #4b5563;
}

.help-form input,
.help-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-form input:focus,
.help-form textarea:focus {
  outline: none;
  border-color: var(--accent, #4f46e5);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.help-form .submit-btn {
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.help-form .submit-btn:hover {
  background: #000;
}

.help-form .form-messages {
  margin-top: 12px;
}

.help-form .loading,
.help-form .sent-message,
.help-form .error-message {
  display: none;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.help-form .loading {
  background: #f3f4f6;
  color: #4b5563;
}

.help-form .sent-message {
  background: #d1fae5;
  color: #065f46;
}

.help-form .error-message {
  background: #fee2e2;
  color: #991b1b;
}

/* Ad Banner */
.ad-banner-container.ad-position-top {
  margin-bottom: 1.5rem;
}
.ad-banner-container.ad-position-bottom {
  margin-top: 1.5rem;
}
.ad-banner-track {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}
.ad-banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ad-banner-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.ad-banner-slide a {
  display: block;
  width: 100%;
  height: 100%;
}
.ad-banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ad-banner-label {
  position: absolute;
  top: 6px;
  right: 8px;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.7);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}
@media (max-width: 768px) {
  .ad-banner-track { border-radius: 8px; }
  .ad-banner-slide img { object-fit: contain; }
  .ad-banner-label { font-size: 0.55rem; top: 4px; right: 6px; }
}

/* Dot touch targets (44px invisible hit area) */
.hero-cycling-dot::before,
.bundle-cycling-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
}

/* Bundle dots sit only 24px apart (8px dot + 16px gap) and are desktop-only
   (hidden on mobile, where swipe navigates). A full 44px-wide hit area would
   overlap the neighbouring dot's, and the later dot in the DOM paints on top —
   so clicks near a lower-index dot get stolen by the higher-index one (only
   forward worked). Cap the width to the slot so the targets tile, not overlap.
   Height stays tall for comfortable vertical clicking. */
.bundle-cycling-dot::before {
  width: 24px;
}

/* Carousel keyboard focus */
.vod-carousel:focus {
  outline: 2px solid var(--warm-accent);
  outline-offset: -2px;
}
.vod-carousel:focus:not(:focus-visible) {
  outline: none;
}

/* Schedule list mobile scroll fades */
@property --sched-fade-left {
  syntax: '<length>';
  initial-value: 0px;
  inherits: false;
}
@property --sched-fade-right {
  syntax: '<length>';
  initial-value: 30px;
  inherits: false;
}
@media (max-width: 768px) {
  .schedule-list {
    --sched-fade-left: 0px;
    --sched-fade-right: 30px;
    -webkit-mask-image: linear-gradient(to right,
      transparent 0px,
      black var(--sched-fade-left),
      black calc(100% - var(--sched-fade-right)),
      transparent 100%);
    mask-image: linear-gradient(to right,
      transparent 0px,
      black var(--sched-fade-left),
      black calc(100% - var(--sched-fade-right)),
      transparent 100%);
    transition: --sched-fade-left 0.15s ease, --sched-fade-right 0.15s ease;
  }
  .schedule-list.scrolled-left {
    --sched-fade-left: 30px;
  }
  .schedule-list.scrolled-right {
    --sched-fade-right: 0px;
  }
}

/* Swipe hint */
@keyframes swipeHint {
  0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.7; }
  50% { transform: translateY(-50%) translateX(8px); opacity: 1; }
}
.swipe-hint {
  position: absolute;
  /* Match the arrow's poster-centre anchor; 130px cards at this breakpoint. */
  top: calc(8px + 130px * 2 / 3);
  right: 8px;
  transform: translateY(-50%);
  z-index: 3;
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.swipe-hint.visible {
  display: flex;
  opacity: 1;
  animation: swipeHint 0.8s ease-in-out 2;
}
.swipe-hint svg {
  width: 28px;
  height: 28px;
  color: var(--text);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

/* Live now overlay */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.live-now-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: fadeIn 0.5s ease forwards;
  z-index: 2;
  border-radius: inherit;
}
.live-now-overlay .live-now-dot {
  width: 12px;
  height: 12px;
  background: var(--live);
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}
.live-now-overlay .live-now-text {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
