/* ==========================================================================
   Home page - hero spotlight, channel tabs, showcasing rail
   Markup contract: index.html (hero, #channelTabs, #posterRail)
   ========================================================================== */

.section { margin-bottom: var(--space-9); }

/* ---- Hero spotlight ------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-7);
  overflow: hidden;
  min-height: 360px;
  /* Inline padding structurally clears the arrow column:
     24px inset + 44px target + 16px breathing room. */
  padding: clamp(var(--space-6), 4vw, var(--space-9))
           max(var(--space-7), 5vw, calc(var(--touch-target) + var(--space-6) + var(--space-4)));
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  isolation: isolate;
}

/* Ambient backdrop: blurred, darkened copy of the cover art */
.hero__bg {
  position: absolute;
  inset: -12%;
  z-index: -1;
  background-size: cover;
  background-position: center 20%;
  filter: blur(52px) brightness(0.38) saturate(1.15);
  transform: scale(1.15);
  transition: opacity var(--dur-slow) var(--ease-out);
}

/* Readability scrim over the ambient art */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--bg) 88%, transparent) 0%,
    color-mix(in srgb, var(--bg) 45%, transparent) 62%,
    color-mix(in srgb, var(--bg) 30%, transparent) 100%);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
}

.hero__title {
  font-size: var(--text-hero);
  line-height: 0.98;
}

.hero__desc {
  max-width: 56ch;
  color: var(--text-muted);
  font-size: var(--text-md);
}

.hero__genres {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Sharp cover on the right, fading into the ambient backdrop */
.hero__art {
  width: clamp(180px, 22vw, 264px);
  aspect-ratio: var(--cover-ratio);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--surface-2);
}

.hero__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__art.is-locked img,
.hero__art.is-blurred img {
  filter: blur(18px) saturate(0.7);
  transform: scale(1.08);
}

.hero__art-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg,
    hsl(var(--cover-hue, 265) 45% 30%) 0%,
    var(--surface-1) 85%);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: color-mix(in srgb, var(--text) 55%, transparent);
}

/* Carousel arrows (injected by js) */
.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: var(--surface-glass);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
}

.hero__arrow--prev { left: var(--space-6); }
.hero__arrow--next { right: var(--space-6); }

/* Dots: large, clickable pills */
.hero__dots {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.hero-dot {
  width: 26px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 0;
  transition: background var(--dur-fast) var(--ease-out),
              width var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.hero-dot:hover { background: var(--border-strong); }

.hero-dot.is-active {
  width: 40px;
  background: var(--purple-500);
  border-color: var(--purple-500);
}

/* ---- Channel tabs ----------------------------------------------------------- */

.tabs-block { margin-block: var(--space-7) var(--space-6); }

.tab .badge { margin-left: var(--space-2); }

/* ---- Showcasing rail ----------------------------------------------------------- */

.rail {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px;
  margin: -4px;                /* keep card shadows visible */
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }

.rail .media-card {
  width: clamp(148px, 17vw, 180px);
  flex: none;
  scroll-snap-align: start;
}

.rail-empty {
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.rail-error {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.skeleton--rail {
  width: clamp(148px, 17vw, 180px);
  aspect-ratio: var(--cover-ratio);
  flex: none;
  border-radius: var(--radius-md);
}

/* ---- Responsive ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    /* Arrows are hidden here: back to a compact inset. */
    padding-inline: clamp(var(--space-5), 4vw, var(--space-7));
  }

  .hero__art { display: none; }

  .hero__arrow { display: none; }
}

@media (max-width: 480px) {
  .hero { padding: var(--space-5); }

  .hero__title { font-size: var(--text-3xl); }

  .rail .media-card { width: 140px; }
}
