/* ============================================================
   TV — content: hero carousel, rails, cards
   ============================================================ */

/* ---------------- Hero carousel ---------------- */
.hero {
  position: relative;
  width: 100%;
  min-height: clamp(430px, 63vh, 640px);
  overflow: hidden;
  background: #000;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1050ms ease, visibility 0s linear 1050ms;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1050ms ease;
  z-index: 1;
}
.hero-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  transition: transform 8s linear;
}
.hero-slide.is-active .hero-art { transform: scale(1.12); }
.hero-slide.is-active .hero-art.no-kenburns { transform: scale(1.05); }

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(6,6,8,0.94) 0%, rgba(6,6,8,0.55) 32%, rgba(6,6,8,0.06) 66%, rgba(6,6,8,0.18) 100%),
    linear-gradient(to right, rgba(6,6,8,0.72) 0%, rgba(6,6,8,0.22) 46%, rgba(6,6,8,0) 70%);
}

.hero-content {
  position: absolute;
  left: 44px;
  right: 30%;
  bottom: clamp(30px, 5.5vh, 52px);
  z-index: 2;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(235,235,245,0.72);
  margin-bottom: 12px;
}
.hero-eyebrow .eyebrow-tag {
  padding: 3px 8px 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}
.hero-title {
  font-size: clamp(34px, 4.2vw, 54px);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.04;
  margin-bottom: 12px;
  text-shadow: 0 2px 26px rgba(0,0,0,0.5);
}
.hero-tagline {
  font-size: 16.5px;
  line-height: 1.42;
  color: rgba(235,235,245,0.86);
  max-width: 46ch;
  margin-bottom: 22px;
  text-shadow: 0 1px 14px rgba(0,0,0,0.45);
}
.hero-actions { display: flex; align-items: center; gap: 12px; }
.hero-meta {
  margin-top: 16px;
  font-size: 12.5px;
  color: rgba(235,235,245,0.55);
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
}

/* Carousel pagination dots */
.hero-dots {
  position: absolute;
  right: 26px;
  bottom: 26px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.hero-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.32);
  transition: background 200ms, transform 200ms;
}
.hero-dot:hover { background: rgba(255,255,255,0.6); }
.hero-dot.is-active { background: #fff; transform: scale(1.18); }

/* ---------------- Rails ---------------- */
.rail {
  margin: 0 0 44px;
}
.rail-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 13px;
  padding-right: 8px;
}
.rail-header .rail-see-all {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.rail:hover .rail-header .rail-see-all,
.rail-header .rail-see-all:focus-visible { opacity: 1; transform: translateX(0); }

.rail-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Scroll strip with edge affordances */
.rail-strip-wrap { position: relative; }
.rail-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  padding: 10px 44px 18px;
  margin: -10px 0 -8px;
  scrollbar-width: none;
}
.rail-strip::-webkit-scrollbar { display: none; }

.rail-strip-wrap.edge-left::before,
.rail-strip-wrap.edge-right::after {
  content: "";
  position: absolute;
  top: 0; bottom: 8px;
  width: 54px;
  z-index: 5;
  pointer-events: none;
  opacity: 1;
  transition: opacity 220ms;
}
.rail-strip-wrap.edge-left::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-content) 12%, transparent);
}
.rail-strip-wrap.edge-right::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-content) 12%, transparent);
}

/* Page arrows */
.rail-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  z-index: 6;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(34, 34, 40, 0.82);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 4px 18px rgba(0,0,0,0.5), inset 0 0 0 0.5px rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), background 130ms;
  pointer-events: none;
}
.rail-arrow svg { width: 15px; height: 15px; }
.rail-strip-wrap:hover .rail-arrow.is-enabled { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; }
.rail-arrow.is-enabled:focus-visible { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; }
.rail-arrow:hover { background: rgba(52, 52, 60, 0.92); }
.rail-arrow:active { transform: translateY(-50%) scale(0.92); }
.rail-arrow.rail-arrow-left { left: 12px; }
.rail-arrow.rail-arrow-right { right: 12px; }

/* ---------------- Cards: poster ---------------- */
.card {
  position: relative;
  flex: none;
  width: var(--card-w, 168px);
  cursor: pointer;
  border-radius: var(--radius-card);
  text-align: left;
  transition: transform 230ms var(--ease-spring), z-index 0s;
  will-change: transform;
}
.card .card-art {
  position: relative;
  aspect-ratio: 2 / 3;
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #16161a;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
  transition: box-shadow 230ms var(--ease-out);
  z-index: 1;
}
.card:hover,
.card.is-focused {
  transform: translateY(-9px) scale(1.075);
  z-index: 20;
}
.card:hover .card-art,
.card.is-focused .card-art { box-shadow: var(--shadow-card-hover); }
.card.shift-l { transform: translateX(-11px); }
.card.shift-r { transform: translateX(11px); }
.card.shift-l:hover, .card.shift-r:hover { transform: translateY(-9px) scale(1.075); }

.card .card-hover-scrim {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 38%);
  opacity: 0;
  transition: opacity 200ms;
  z-index: 2;
  pointer-events: none;
}
.card:hover .card-hover-scrim,
.card.is-focused .card-hover-scrim { opacity: 1; }

/* Overflow (…) button, visible on card hover */
.card .card-overflow {
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 3;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.62);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 170ms var(--ease-out), transform 170ms var(--ease-out), background 130ms;
}
.card .card-overflow svg { width: 15px; height: 15px; }
.card:hover .card-overflow,
.card.is-focused .card-overflow { opacity: 1; transform: scale(1); }
.card .card-overflow:hover { background: rgba(60, 60, 68, 0.85); }

.card .card-progress {
  position: absolute;
  left: 10px; right: 10px; bottom: 7px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.28);
  z-index: 3;
  overflow: hidden;
}
.card .card-progress .bar { height: 100%; background: #fff; border-radius: 2px; }

.card .card-caption { padding: 8px 2px 0; }
.card .card-caption .card-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.006em;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .card-caption .card-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .card-caption .card-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* "Apple TV+" channel tag under card names */
.card .card-caption .card-channel { color: var(--text-tertiary); }

/* ---------------- Cards: wide (Up Next / promo) ---------------- */
.card-wide { --card-w: 316px; }
.card-wide .card-art { aspect-ratio: 16 / 9; }
.card-wide .card-caption .card-name { font-size: 14px; }
.card-wide .card-caption .card-sub { font-size: 12.5px; color: var(--text-secondary); }
.card-wide:hover, .card-wide.is-focused { transform: translateY(-8px) scale(1.045); }
.card-wide.shift-l { transform: translateX(-9px); }
.card-wide.shift-r { transform: translateX(9px); }

/* ---------------- Top 10 numbered cards ---------------- */
.card-top10 {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  --card-w: 252px;
}
.card-top10 .top10-numeral {
  flex: none;
  width: 84px;
  margin-bottom: -8px;
  text-align: center;
  font-size: 118px;
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.06em;
  background: linear-gradient(to bottom, #fff 8%, rgba(255,255,255,0.25) 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.45));
  user-select: none;
  transform: translateX(6px);
}
.card-top10 .card { --card-w: 158px; }

/* ---------------- Live badge / new badges ---------------- */
.badge-live {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: 5px;
  background: #ff2733;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.badge-live .live-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.badge-new {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 3;
  height: 19px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: rgba(20,20,24,0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.25);
}

/* ---------------- Section banner (Apple TV+ / MLS / Store headers) ---------- */
.channel-hero {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 44px 34px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.channel-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,6,8,0.92), rgba(6,6,8,0.18) 62%);
}
.channel-hero > * { position: relative; z-index: 1; }
.channel-hero .channel-eyebrow {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(235,235,245,0.66);
  margin-bottom: 10px;
}
.channel-hero h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 800;
  letter-spacing: -0.024em;
  margin-bottom: 10px;
}
.channel-hero .channel-desc {
  font-size: 15.5px;
  color: rgba(235,235,245,0.8);
  max-width: 60ch;
  margin-bottom: 20px;
}

/* ---------------- Grid (search results, store category) ---------------- */
.grid-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 26px 16px;
}
.grid-rail .card { width: auto; }

/* ---------------- Empty state ---------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 84px 24px 60px;
  text-align: center;
}
.empty-state .empty-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}
.empty-state .empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text-secondary); max-width: 44ch; margin-bottom: 20px; }
.empty-state .chip-row { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }
.chip {
  height: 32px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(120,120,128,0.24);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  transition: background 130ms, transform 130ms;
}
.chip:hover { background: rgba(120,120,128,0.4); }
.chip:active { transform: scale(0.96); }
