/* =====================================================================
   catalog.css: home (featured carousel, the rows under it, the hero
   skeleton). Sections, search and Mi lista rules follow below.
   Billboard first; the stacked card (≤860, portrait ≤1119) and TV override it.
   ===================================================================== */

/* ---------------------------------------------------------- hero: billboard */
/* tvOS style: the artwork runs full-bleed under the floating sidebar (--shell-x, tokens.css), anchored top right,
   and dissolves into the page's ambient colours (ambient.js, behind everything) on its left and at its foot, so
   the first row ("Continuar viendo") sits on the bottom of the picture with no edge. --hero-overlap is how far
   that row climbs over the hero; the copy and the dots stay above it. */
/* Desktop heroes (home, title page): the picture at full strength under the panel (its glass shows the real
   colours) and over the upper half (the faces); faint only in an ellipse around the copy at the bottom left, so
   lettering printed on a backdrop stays out of the title's way. The scrim follows the same shape in the artwork's
   own dark tone (--amb-2), with a light wash from the left. Both follow the copy (--content-x). */
:root {
  --hero-art-mask: linear-gradient(90deg, #000 0, #000 calc(var(--shell-x) - 56px), rgba(0, 0, 0, .14) calc(var(--shell-x) + 4px), rgba(0, 0, 0, .2) max(calc(var(--content-x) + 280px), 40%), #000 max(calc(var(--content-x) + 580px), 58%));
  --hero-scrim-copy:
    radial-gradient(640px 52% at calc(var(--content-x) + 240px) 78%, rgba(var(--amb-2), .88) 0, rgba(var(--amb-2), .72) 45%, rgba(var(--amb-2), 0) 100%),
    linear-gradient(90deg, rgba(var(--amb-2), .3) 0, rgba(var(--amb-2), .72) var(--shell-x), rgba(var(--amb-2), .64) calc(var(--content-x) + 320px), rgba(var(--amb-2), 0) calc(var(--content-x) + 740px));
}
.page--home { --hero-overlap: 128px; }
.hero {
  --hero-pad: calc(var(--hero-overlap) + 52px);
  margin-left: calc(-1 * var(--shell-x));
  position: relative; isolation: isolate; overflow: hidden;
  height: clamp(560px, 90vh, 1000px); height: clamp(560px, 90svh, 1000px);
}
.hero__slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  /* The outgoing slide waits under the incoming one, then drops: the crossfade never dips to the page colour. */
  transition: opacity 0s linear var(--dur-6);
}
.hero__slide.is-active { z-index: 1; opacity: 1; pointer-events: auto; transition: opacity var(--dur-6) var(--ease-std); }

/* The image is a link to the title page (out of the tab order: the title link is the same one). Its foot melts
   into the page: a mask, so whatever ambient colour is behind shows through (no colour to match). */
.hero__media {
  position: absolute; inset: 0; display: block; touch-action: pan-y; -webkit-tap-highlight-color: transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 50%, rgba(0, 0, 0, .62) 72%, rgba(0, 0, 0, .2) 90%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 50%, rgba(0, 0, 0, .62) 72%, rgba(0, 0, 0, .2) 90%, transparent 100%);
}
/* The picture spans the whole width, under the glass sidebar too, so the panel is frosted by real colour (5.png).
   A backdrop with black pillarbox bars printed into it (ambient.js artInfo, home.js) is scaled until they are gone. */
.hero__image {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: right top; user-select: none; -webkit-user-drag: none;
  -webkit-mask-image: var(--hero-art-mask); mask-image: var(--hero-art-mask);
}
.hero__image.is-pillarbox, .detail__backdrop.is-pillarbox { transform: scale(var(--pillar, 1.33)); transform-origin: 50% 35%; }
/* Legibility is a scrim in the artwork's own dark tone (--amb-2): lighter under the panel (which blurs whatever is
   there), dense over the copy column so lettering printed on a backdrop's left stays out of the title's way, and
   gone well before the faces on the right. A light shade at the top for the chip and the TV bar. */
.hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .3) 0, rgba(0, 0, 0, 0) 180px),
    var(--hero-scrim-copy),
    linear-gradient(0deg, rgba(var(--amb-2), .55) 0, rgba(var(--amb-2), 0) 46%);
}

.hero__body {
  position: absolute; z-index: 1; left: var(--content-x); bottom: var(--hero-pad); width: min(640px, 54%);
  transition: opacity var(--dur-2) var(--ease-in);
}
.hero__slide:not(.is-active) .hero__body { opacity: 0; }
.hero__slide.is-entering .hero__body { animation: hero-in var(--dur-5) var(--ease-calm) 200ms both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(12px); } }

/* Kicker: "PELÍCULA", "SERIE · TEMPORADA 4". */
.hero__kind {
  color: rgba(255, 255, 255, .74); font-size: 12px; font-weight: 600; letter-spacing: .12em; line-height: 1.2; text-transform: uppercase;
  text-shadow: var(--text-shadow-img);
}

/* Title (ui.js wordmark): the real title as one balanced heavy block, in its own case, up to 3 lines. The size
   follows its length and the window's width (--page-w, not the content width: hiding the sidebar does not
   reflow the copy). The padding keeps the clamp from cutting accents and descenders. One short word is drawn in
   wide tracked capitals ("L O K I"), as tvOS does. */
.hero__title { margin-top: 10px; color: #fff; font-weight: 800; text-shadow: 0 4px 30px rgba(0, 0, 0, .3); }
.hero__title a, .hero__title-text { display: block; width: fit-content; max-width: 100%; border-radius: 10px; color: inherit; }
.hero__title a:focus-visible { outline: 2px solid var(--focus); outline-offset: 8px; box-shadow: none; }
.hero__wordmark { display: block; }
.hero__mark {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  padding: .06em 0; margin-block: -.06em; text-wrap: balance; overflow-wrap: break-word;
  font-size: clamp(44px, calc(var(--page-w, 100vw) * .048), 84px); line-height: 1; letter-spacing: -.025em;
}
.hero__title--short .hero__mark { font-size: clamp(50px, calc(var(--page-w, 100vw) * .055), 88px); }
.hero__title--long .hero__mark { font-size: clamp(36px, calc(var(--page-w, 100vw) * .034), 60px); letter-spacing: -.02em; }
.hero__title--tracked .hero__mark {
  margin-right: -.3em; font-size: clamp(52px, calc(var(--page-w, 100vw) * .052), 92px); font-weight: 800;
  letter-spacing: .3em; line-height: 1.05; text-transform: uppercase; -webkit-line-clamp: 1;
}
/* The title's TMDB logo in place of the drawn title (home.js showLogo, Apple TV), once it has loaded; the heading
   keeps the real title for screen readers. Its box: at most --logo-w wide and --logo-h tall, by its own ratio
   (--logo-ratio, set inline). Engines without min() fall back to max-width/max-height on the image's own size. */
.hero__logo, .detail__logo {
  --logo-w: min(520px, 40vw); --logo-fw: 40vw; --logo-h: 180px;
  display: none; width: auto; height: auto; max-width: var(--logo-fw); max-height: var(--logo-h);
  object-fit: contain; object-position: left bottom; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 2px 16px rgba(0, 0, 0, .35));
}
@supports (width: min(1px, 2px)) {
  .hero__logo, .detail__logo { width: min(var(--logo-w), calc(var(--logo-h) * var(--logo-ratio, 3))); max-width: 100%; max-height: var(--logo-h); }
}
.hero__title.has-logo .hero__wordmark { display: none; }
.hero__title.has-logo .hero__logo { display: block; animation: logo-in var(--dur-3) var(--ease-std) both; }
.hero__title.has-logo { text-shadow: none; }
@keyframes logo-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero__title.has-logo .hero__logo { animation: none; } }
/* Under a logo in another language ("THE BUCKET LIST"): our title, small (home.js showLogo). */
.hero__alt-title { display: none; }
.hero__title.has-logo .hero__alt-title {
  display: block; margin-top: 10px; color: rgba(255, 255, 255, .8); font-size: 16px; font-weight: 600; letter-spacing: 0; line-height: 1.3;
  text-shadow: var(--text-shadow-img);
}
html.is-tv .hero__title.has-logo .hero__alt-title { margin-top: calc(12px * var(--tvu)); font-size: var(--fs-callout); }

/* "Drama · Romance · 1 h 41 min" and the year in a small outlined badge. */
.hero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: 16px;
  color: rgba(255, 255, 255, .92); font-size: 15px; font-weight: 500; line-height: 1.3; text-shadow: var(--text-shadow-img);
}
.hero__meta > span + span::before {
  content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 8px; border-radius: 50%;
  background: currentColor; opacity: .6; vertical-align: middle;
}
.hero__meta > .hero__badge::before { display: none; }
.hero__badge {
  display: inline-flex; align-items: center; height: 18px; margin-left: 10px; padding: 0 5px; border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); color: rgba(255, 255, 255, .9);
  font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1; text-shadow: none;
}
.hero__meta > .hero__badge:first-child { margin-left: 0; }
.hero__synopsis {
  max-width: 520px; margin-top: 10px; color: rgba(255, 255, 255, .7);
  font-size: 16px; line-height: 1.45; text-shadow: var(--text-shadow-img);
}
/* The bold line: "Continúa: T1:E3 · Quedan 23 min", "Lo más visto en mipalco", "Estreno 2026". */
.hero__tagline { margin-top: 12px; color: #fff; font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; text-shadow: var(--text-shadow-img); }
.hero__tagline[hidden] { display: none; }

/* A white pill (Reproducir or Continuar), round glass Mi lista and (i), then a bare › for the next slide. */
.hero__actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.hero__actions .btn { height: 48px; }
.hero__actions .btn--icon { width: 44px; height: 44px; }
.hero__actions .btn--primary { min-width: 168px; padding: 0 30px; font-size: 17px; font-weight: 600; }
.hero__actions .btn .icon { width: 20px; height: 20px; }
.hero__actions .btn--icon .icon { width: 21px; height: 21px; stroke-width: 2.2; }
.hero__next {
  display: grid; place-items: center; width: 36px; height: 44px; margin-left: -2px; border-radius: 22px;
  color: rgba(255, 255, 255, .86); transition: color var(--dur-2), transform var(--dur-1) var(--ease-std);
}
.hero__next .icon { width: 26px; height: 26px; stroke-width: 2.4; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .4)); }
@media (hover: hover) and (pointer: fine) { .hero__next:hover { color: #fff; transform: translateX(2px); } }
.hero__next:active { transform: scale(.94); }
.hero__next:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-halo); color: #fff; }

/* ------------------------------------------------------- hero: controls */
/* ‹ › at the edges, in the picture's upper part (clear of the copy at the bottom left): fine pointers see them
   while the hero is hovered or when one has keyboard focus; touch screens swipe (stacked card, below). */
.hero__arrow {
  position: absolute; z-index: 2; top: 30%; display: grid; place-items: center; width: 44px; height: 72px; margin-top: -36px;
  border-radius: 12px; color: #fff; opacity: .9; transition: opacity var(--dur-3) var(--ease-std), transform var(--dur-1) var(--ease-std);
}
.hero__arrow--prev { left: calc(var(--shell-x) + max(8px, calc(var(--gutter) / 2 - 22px))); }
.hero__arrow--next { right: max(4px, calc(var(--gutter) / 2 - 22px)); }
.hero__arrow .icon { width: 32px; height: 32px; stroke-width: 1.8; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .6)); }
.hero__arrow:active { transform: scale(.94); }
.hero__arrow:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; box-shadow: 0 0 0 2px var(--focus-halo); }
@media (hover: hover) and (pointer: fine) {
  .hero__arrow { opacity: 0; }
  .hero:hover .hero__arrow, .hero__arrow:focus-visible { opacity: .85; }
  .hero__arrow:hover { opacity: 1; }
}
@media (hover: none), (pointer: coarse) { .hero__arrow { display: none; } }

/* Centred under the copy, above the first row (in the content area beside the sidebar): a small dark glass
   capsule with the dots (6px, the current one an 18px white pill that fills over the 9 s) and a tiny pause. */
.hero__controls {
  position: absolute; z-index: 2; left: var(--shell-x); right: 0; bottom: calc(var(--hero-overlap) + 18px);
  display: flex; justify-content: center; pointer-events: none;
}
.hero__capsule {
  display: flex; align-items: center; gap: 10px; height: 24px; padding: 0 5px 0 11px; border-radius: 12px; pointer-events: auto;
  background: rgba(16, 16, 20, .36); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .hero__capsule { background: rgba(16, 16, 20, .72); } }
.hero__dots { display: flex; align-items: center; gap: 7px; }
.hero__dot {
  position: relative; flex: none; width: 6px; height: 6px; padding: 0; border-radius: 3px;
  background: rgba(255, 255, 255, .38); transition: width 300ms var(--ease-calm), background-color var(--dur-2);
}
/* A bigger hit area than the 6px dot: 24px tall, as wide as the gap allows. */
.hero__dot::after { content: ""; position: absolute; inset: -9px -3px; }
@media (hover: hover) and (pointer: fine) { .hero__dot:not(.is-active):hover { background: rgba(255, 255, 255, .75); } }
.hero__dot.is-active { width: 18px; background: rgba(255, 255, 255, .45); }
.hero__fill { position: absolute; inset: 0; border-radius: inherit; background: #fff; transform-origin: left; }
.hero.is-rotating .hero__fill { transform: scaleX(0); animation: hero-fill var(--dur-rotate) linear forwards; }
.hero.is-paused .hero__fill { animation-play-state: paused; }
@keyframes hero-fill { to { transform: scaleX(1); } }
/* A 16px disc at the capsule's end; touch screens get a 40px hit area around it. */
.hero__pause {
  position: relative; display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .86); transition: background-color var(--dur-2), color var(--dur-2);
}
.hero__pause::after { content: ""; position: absolute; inset: -8px -6px; }
@media (pointer: coarse) { .hero__pause::after { inset: -12px; } }
.hero__pause .icon { width: 8px; height: 8px; }
@media (hover: hover) and (pointer: fine) { .hero__pause:hover { background: rgba(255, 255, 255, .3); color: #fff; } }
.hero__pause:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-halo); }

/* ------------------------------------------------- hero: rows, skeleton */
/* The first row climbs over the bottom of the hero, so its artwork starts above the fold (1.webp). */
.hero + .rows, .skeleton-hero + .rows { margin-top: calc(-1 * var(--hero-overlap)); }
.skeleton-hero + .rows--top { padding-top: 0; }
/* The placeholder has the hero's shape, on the ambient colour instead of a grey block. */
.page--home .skeleton-hero { height: clamp(560px, 90vh, 1000px); height: clamp(560px, 90svh, 1000px); }
.page--home .skeleton-hero__media { background: rgba(255, 255, 255, .04); -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent); mask-image: linear-gradient(180deg, #000 50%, transparent); }
.page--home .skeleton-hero__body { bottom: calc(var(--hero-overlap) + 52px); }

/* ------------------------------------------------------------ hero: tiers */
@media (min-width: 861px) and (max-width: 1279px) {
  .page--home { --hero-overlap: 112px; }
  .hero__body { width: min(560px, 60%); }
  .hero__mark { font-size: clamp(40px, calc(var(--page-w, 100vw) * .055), 68px); }
  .hero__logo { --logo-w: min(440px, 40vw); --logo-h: 150px; }
}
@media (min-width: 1680px) {
  .page--home { --hero-overlap: 148px; }
  .hero__body { width: min(720px, 50%); }
  .hero__synopsis { max-width: 580px; font-size: 17px; }
  .hero__logo { --logo-w: min(600px, 36vw); --logo-fw: 36vw; --logo-h: 200px; }
}
/* Short landscape billboard (wide phones on their side): one screen tall, no synopsis. */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 861px) {
  .page--home { --hero-overlap: 56px; }
  .hero, .page--home .skeleton-hero { min-height: 0; height: 100vh; height: 100svh; }
  .hero__title .hero__mark { font-size: min(44px, 4.4vw); -webkit-line-clamp: 2; }
  .hero__title--short .hero__mark { font-size: min(56px, 5.6vw); }
  .hero__title--long .hero__mark { font-size: min(36px, 3.4vw); }
  .hero__logo { --logo-w: min(360px, 32vw); --logo-fw: 32vw; --logo-h: 96px; }
  .hero__synopsis { display: none; }
}

/* --------------------------------------------------------- hero: stacked */
/* Phones and portrait tablets: a big rounded card under the glass header, on the ambient colour, the picture
   anchored on its subject, the copy centred over a dark foot: title, a white Reproducir pill and the round
   Mi lista; the dots below the card. No edge arrows (a swipe changes slide); for a keyboard they appear on
   focus, as small discs on the card's sides. */
@media (max-width: 860px), (orientation: portrait) and (max-width: 1119px) {
  .page--home { --hero-overlap: 0px; --hero-card-h: min(calc((100vw - 2 * var(--gutter)) * 1.22), 64vh); --hero-card-h: min(calc((100vw - 2 * var(--gutter)) * 1.22), 64svh); }
  .hero {
    --hero-top: calc(var(--header-h) + 10px);
    margin-left: 0; overflow: visible; height: calc(var(--hero-top) + max(400px, var(--hero-card-h)) + 40px);
  }
  .hero__slide {
    top: var(--hero-top); left: var(--gutter); right: var(--gutter); bottom: 40px;
    border-radius: 20px; overflow: hidden; background: rgba(var(--amb-2), 1);
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .06);
  }
  .hero__media { -webkit-mask-image: none; mask-image: none; border-radius: inherit; }
  /* Anchored on the subject (most backdrops print their own title on the left), the copy half of the card on an
     almost solid tint, so that lettering never competes with the title. */
  .hero__image { object-position: 72% center; -webkit-mask-image: none; mask-image: none; }
  .hero__media::after {
    background:
      linear-gradient(0deg, rgba(var(--amb-2), .97) 0, rgba(var(--amb-2), .94) 34%, rgba(var(--amb-2), .62) 52%, rgba(var(--amb-2), 0) 72%),
      linear-gradient(0deg, rgba(0, 0, 0, .3) 0, rgba(0, 0, 0, 0) 40%);
  }
  .hero__body { left: 20px; right: 20px; bottom: 22px; width: auto; max-width: 560px; margin: 0 auto; text-align: center; }
  .hero__title { margin-top: 8px; }
  .hero__title a { margin: 0 auto; }
  .hero__title .hero__mark { font-size: min(42px, 10vw); line-height: 1.04; -webkit-line-clamp: 2; }
  .hero__title--short .hero__mark { font-size: min(52px, 12.4vw); }
  .hero__title--long .hero__mark { font-size: min(32px, 7.6vw); }
  .hero__title--tracked .hero__mark { margin-right: -.24em; letter-spacing: .24em; font-size: min(52px, 12vw); }
  .hero__logo { --logo-w: min(340px, 72vw); --logo-fw: 72vw; --logo-h: 120px; margin: 0 auto; object-position: center bottom; }
  .hero__meta { justify-content: center; margin-top: 10px; font-size: 14px; }
  .hero__synopsis { margin: 8px auto 0; font-size: 15px; line-height: 1.45; }
  .hero__tagline { margin-top: 8px; font-size: 14px; }
  .hero__actions { justify-content: center; margin-top: 18px; }
  .hero__actions .btn--primary { flex: 1; max-width: 300px; min-width: 0; padding: 0 16px; }
  .hero__info, .hero__next { display: none; }
  .hero__controls { left: 0; right: 0; bottom: 8px; }
  .hero__capsule { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hero__dot { background: rgba(255, 255, 255, .3); }
  /* Keyboard only: off screen until focused, then a small glass disc on the card's side. */
  .hero__arrow, .hero:hover .hero__arrow {
    display: grid; top: calc(var(--hero-top) + max(400px, var(--hero-card-h)) / 2); width: 40px; height: 40px; margin-top: -20px; border-radius: 50%;
    background: rgba(30, 30, 34, .7); opacity: 1; clip-path: inset(50%);
  }
  .hero__arrow:focus-visible { clip-path: none; }
  .hero__arrow--prev { left: calc(var(--gutter) + 8px); }
  .hero__arrow--next { right: calc(var(--gutter) + 8px); }
  .hero__arrow .icon { width: 18px; height: 18px; stroke-width: 2.4; filter: none; }
  .hero + .rows, .skeleton-hero + .rows { margin-top: 20px; }
  .page--home .skeleton-hero { height: calc(var(--header-h) + 10px + max(400px, var(--hero-card-h)) + 40px); }
  .page--home .skeleton-hero__media { top: calc(var(--header-h) + 10px); left: var(--gutter); right: var(--gutter); bottom: 40px; border-radius: 20px; -webkit-mask-image: none; mask-image: none; }
  .page--home .skeleton-hero__body { bottom: 64px; }
}
@media (max-width: 599px) {
  .hero__kind { font-size: 11px; }
  .hero__logo { --logo-w: min(280px, 70vw); --logo-fw: 70vw; --logo-h: 96px; }
  .hero__meta { font-size: 13px; }
  .hero__badge { height: 16px; font-size: 10px; }
  .hero__synopsis { display: none; }
  .hero__actions { margin-top: 16px; }
}
/* Stacked and short (phones in landscape): the card fills the screen under the bar. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 860px) {
  /* The card is exactly what is left under the bar (no 400px floor), and the copy moves to the left over a side
     scrim, as on a wide screen, so the title and Reproducir are on the first screen. */
  .page--home { --hero-card-h: max(220px, calc(100vh - var(--header-h) - 56px)); --hero-card-h: max(220px, calc(100svh - var(--header-h) - 56px)); }
  .hero { height: calc(var(--hero-top) + var(--hero-card-h) + 40px); }
  .page--home .skeleton-hero { height: calc(var(--header-h) + 10px + var(--hero-card-h) + 40px); }
  .hero__arrow, .hero:hover .hero__arrow { top: calc(var(--hero-top) + var(--hero-card-h) / 2); }
  .hero__media::after {
    background:
      linear-gradient(90deg, rgba(var(--amb-2), .95) 0, rgba(var(--amb-2), .82) 34%, rgba(var(--amb-2), 0) 64%),
      linear-gradient(0deg, rgba(0, 0, 0, .3) 0, rgba(0, 0, 0, 0) 40%);
  }
  .hero__body { left: 24px; right: auto; bottom: 20px; width: min(52%, 420px); margin: 0; text-align: left; }
  .hero__title a { margin: 0; }
  .hero__meta, .hero__actions { justify-content: flex-start; }
  .hero__title .hero__mark { font-size: min(34px, 4.6vw); }
  .hero__title--short .hero__mark { font-size: min(40px, 5.4vw); }
  .hero__title--long .hero__mark { font-size: min(28px, 3.8vw); }
  .hero__title--tracked .hero__mark { margin-right: 0; font-size: min(36px, 5vw); }
  .hero__logo { --logo-w: min(300px, 34vw); --logo-fw: 34vw; --logo-h: 80px; margin: 0; object-position: left bottom; }
  .hero__actions { margin-top: 12px; }
  .hero__actions .btn--primary { flex: none; max-width: none; padding: 0 22px; }
  .hero__synopsis, .hero__tagline { display: none; }
}

/* ---------------------------------------------------------------- hero: TV */
/* No auto-advance on TV or with reduced motion: no pause button; the current dot stays full. Left and Right on
   the buttons change slide (home.js), and › too, so the edge arrows are not drawn. No blur filters on TV. */
@media (prefers-reduced-motion: reduce) {
  .hero__pause { display: none; }
  .hero__slide.is-entering .hero__body { animation: none; }
  .hero__dot { transition: none; }
  .hero__capsule { padding-right: 11px; }
}
html.is-tv .hero__pause, html.is-tv .hero__arrow { display: none; }
html.is-tv .page--home { --hero-overlap: calc(156px * var(--tvu)); }
html.is-tv .hero { --hero-pad: calc(var(--hero-overlap) + 76px * var(--tvu)); height: 88vh; height: 88svh; min-height: calc(560px * var(--tvu)); }
html.is-tv .page--home .skeleton-hero { height: 88vh; height: 88svh; }
html.is-tv .hero__media::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, 0) calc(200px * var(--tvu))),
    linear-gradient(90deg, rgb(var(--amb-2)) 0, rgba(var(--amb-2), .92) calc(var(--gutter) + 700px * var(--tvu)), rgba(var(--amb-2), .5) calc(var(--gutter) + 1040px * var(--tvu)), rgba(var(--amb-2), 0) calc(var(--gutter) + 1360px * var(--tvu))),
    linear-gradient(0deg, rgba(var(--amb-2), .6) 0, rgba(var(--amb-2), 0) 46%);
}
html.is-tv .hero__body { width: calc(820px * var(--tvu)); }
html.is-tv .hero__kind { font-size: var(--fs-overline); }
html.is-tv .hero__title { margin-top: calc(14px * var(--tvu)); }
html.is-tv .hero__title .hero__mark { font-size: calc(80px * var(--tvu)); }
html.is-tv .hero__title--short .hero__mark { font-size: calc(92px * var(--tvu)); }
html.is-tv .hero__title--long .hero__mark { font-size: calc(62px * var(--tvu)); }
html.is-tv .hero__title--tracked .hero__mark { font-size: calc(100px * var(--tvu)); }
/* TV: no shadow filter and no fade on the logo (light on TV hardware). */
html.is-tv .hero__logo { --logo-w: calc(620px * var(--tvu)); --logo-fw: calc(620px * var(--tvu)); --logo-h: calc(200px * var(--tvu)); filter: none; }
html.is-tv .hero__title.has-logo .hero__logo { animation: none; }
html.is-tv .hero__title a:focus-visible { outline-width: 4px; }
html.is-tv .hero__meta { margin-top: calc(18px * var(--tvu)); font-size: var(--fs-callout); }
html.is-tv .hero__badge { height: calc(26px * var(--tvu)); margin-left: calc(14px * var(--tvu)); padding: 0 calc(7px * var(--tvu)); border-radius: calc(5px * var(--tvu)); font-size: calc(16px * var(--tvu)); }
html.is-tv .hero__synopsis { max-width: calc(760px * var(--tvu)); margin-top: calc(12px * var(--tvu)); font-size: var(--fs-body); }
html.is-tv .hero__tagline { margin-top: calc(14px * var(--tvu)); font-size: var(--fs-callout); }
html.is-tv .hero__actions { gap: calc(18px * var(--tvu)); margin-top: calc(30px * var(--tvu)); }
html.is-tv .hero__actions .btn { height: var(--control-lg); }
html.is-tv .hero__actions .btn--icon { width: var(--control-lg); height: var(--control-lg); }
html.is-tv .hero__actions .btn--primary { min-width: calc(240px * var(--tvu)); font-size: var(--fs-headline); }
html.is-tv .hero__actions .btn--icon .icon { width: calc(30px * var(--tvu)); height: calc(30px * var(--tvu)); }
/* The bare › becomes a white disc under the focus, as the round buttons do (components.css). */
html.is-tv .hero__next { width: var(--control-lg); height: var(--control-lg); border-radius: 50%; transition: background-color var(--dur-2), color var(--dur-2), transform var(--dur-2) var(--ease-calm); }
html.is-tv .hero__next .icon { width: calc(36px * var(--tvu)); height: calc(36px * var(--tvu)); filter: none; }
html.is-tv .hero__next:focus-visible { background: var(--inverse); color: var(--on-inverse); transform: scale(1.04); outline-width: 4px; outline-offset: 4px; }
html.is-tv .hero__controls { bottom: calc(var(--hero-overlap) + 24px * var(--tvu)); }
html.is-tv .hero__capsule {
  height: calc(30px * var(--tvu)); gap: 0; padding: 0 calc(14px * var(--tvu)); border-radius: calc(15px * var(--tvu));
  background: rgba(10, 10, 14, .55); -webkit-backdrop-filter: none; backdrop-filter: none;
}
html.is-tv .hero__dots { gap: calc(10px * var(--tvu)); }
html.is-tv .hero__dot { width: calc(8px * var(--tvu)); height: calc(8px * var(--tvu)); border-radius: calc(4px * var(--tvu)); }
html.is-tv .hero__dot.is-active { width: calc(26px * var(--tvu)); background: #fff; }

/* =====================================================================
   List pages: sections and collections (browse.js), search (search.js)
   and Mi lista (mylist.js).
   ===================================================================== */

/* ---------------------------------------------------------- page head */
/* h1, count and (≥1120) the filters share one line; the filters wrap below on narrower screens. */
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 0; margin-bottom: 20px; }
.page-head h1 {
  min-width: 0; font-size: var(--fs-title-1); line-height: var(--lh-title-1); letter-spacing: var(--ls-title-1);
  font-weight: 700; overflow-wrap: anywhere;
}
.page-head__eyebrow { flex: 0 0 100%; margin-bottom: -4px; color: var(--text-3); }
.page-head__count { margin-left: 12px; color: var(--text-2); font-size: 15px; line-height: 1.3; }
html.is-tv .page-head__count { font-size: var(--fs-callout); }

/* ------------------------------------------------------------ filters */
.filters { flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters__clear .icon { width: 16px; height: 16px; stroke-width: 2.2; }
/* Género and Año before their lists arrive: same shape, not usable yet. */
.picker-wrap.is-pending { opacity: .5; }
@media (min-width: 1120px) {
  .page-head .filters { flex: 0 0 auto; align-self: center; max-width: 100%; margin-left: auto; padding-left: 24px; justify-content: flex-end; }
}

/* Colecciones: one scrolling track of link chips under the head (24+ of them would wrap into
   several lines). The 6px padding keeps the 3px focus ring and its 3px offset unclipped; the
   negative margin gives the space back. */
/* The right end fades out over 40px instead of slicing a chip; the matching end padding lets the last chip
   scroll clear of the fade. */
.collections {
  display: flex; align-items: center; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 6px 40px 6px 6px; margin: -6px -6px 22px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent 100%); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent 100%);
}
.collections::-webkit-scrollbar { display: none; }
/* A mouse wheel alone does not scroll sideways: mouse users keep a thin scrollbar. */
@media (hover: hover) and (pointer: fine) { .collections { scrollbar-width: thin; } }
.collections__label { margin-right: 4px; color: var(--text-3); white-space: nowrap; }
html.is-tv .collections { margin-bottom: calc(40px * var(--tvu) - 6px); }

/* Phones: one scrolling row each, bleeding to the screen edges (same 6px ring padding). */
@media (max-width: 599px) {
  /* Section routes only: their subnav carries the title. Collections keep the padded page's spacing. */
  .page--browse:not(.page--collection) { padding-top: calc(var(--header-h) + 12px); }
  .page-head__title--section { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .page--browse .page-head { gap: 8px 0; margin-bottom: 12px; }
  /* Under the filters, with its line kept while it is empty so the grid does not jump. */
  .page--browse .page-head__count { order: 3; flex: 0 0 100%; min-height: 16px; margin-left: 0; font-size: 13px; line-height: 16px; }
  .filters, .collections {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    padding: 6px var(--gutter);
  }
  .filters::-webkit-scrollbar, .collections::-webkit-scrollbar { display: none; }
  .filters { order: 2; flex: 0 0 auto; width: calc(100% + 2 * var(--gutter)); margin: -6px calc(-1 * var(--gutter)); }
  .collections { padding-right: 40px; margin: -6px calc(-1 * var(--gutter)) 6px; }
}

/* --------------------------------------------------------------- grid */
/* Empty and error states span the whole grid instead of one card cell. */
.grid > .empty { grid-column: 1 / -1; }
.load-more { display: flex; justify-content: center; padding: 40px 0 8px; min-height: 80px; }

/* ------------------------------------------------------------- search */
.search-page__title {
  margin-bottom: 20px; font-size: var(--fs-title-1); line-height: var(--lh-title-1); letter-spacing: var(--ls-title-1); font-weight: 700;
}
@media (max-width: 599px) { .search-page__title { margin-bottom: 16px; font-size: 28px; } }
.search-page__field { max-width: 720px; margin-bottom: 24px; }
.search-page__field .spinner { flex: none; }
/* At ≥1280 the sidebar field is the search input; TVs and the icon rail keep this one (ui.js topbarSearch). */
/* The sidebar's field takes the typing while it is shown (ui.js topbarSearch). */
@media (min-width: 1280px) { html:not(.is-tv):not(.is-nav-hidden) .search-page__field { display: none; } }
html.is-tv .search-page__field { max-width: calc(960px * var(--tvu)); }

.search-page__summary { margin-bottom: 16px; color: var(--text-2); font-size: 15px; overflow-wrap: anywhere; }
html.is-tv .search-page__summary { font-size: var(--fs-callout); }
.search-page__kinds { margin-bottom: 24px; }
.search-page__kinds:empty { display: none; }

/* Empty query: recent searches, Explorar, Géneros. A flex gap skips hidden sections. */
.search-page__discover { display: flex; flex-direction: column; gap: 32px; }
html.is-tv .search-page__discover { gap: calc(48px * var(--tvu)); }
.search-page__heading {
  margin-bottom: 14px; font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); font-weight: 600;
}
html.is-tv .search-page__heading { margin-bottom: calc(20px * var(--tvu)); }
.search-page__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-page__forget { margin-left: 4px; }

/* A recent search: the chip runs the query; the X on its right end removes it. */
.recent { position: relative; display: inline-flex; flex: none; max-width: 100%; }
.recent > .chip { max-width: 100%; padding-right: 44px; }
.recent__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.recent__remove {
  position: absolute; top: 50%; right: 0; width: 44px; height: 44px; margin-top: -22px;
  display: grid; place-items: center; border-radius: 50%; color: var(--text-3);
  transition: color var(--dur-2);
}
.recent__remove .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.recent__remove:focus-visible { outline: 2px solid var(--focus); outline-offset: -6px; box-shadow: none; color: var(--text); }
@media (hover: hover) and (pointer: fine) { .recent__remove:hover { color: var(--text); } }
html.is-tv .recent > .chip { padding-right: var(--control); }
html.is-tv .recent__remove { width: var(--control); height: var(--control); margin-top: calc(var(--control) / -2); }

/* ------------------------------------------------------------ Mi lista */
.page-section { padding-left: var(--gutter); padding-right: var(--gutter); }
.mylist__head { padding-top: calc(var(--header-h) + 24px); margin-bottom: 24px; }
@media (min-width: 861px) { .mylist__head { padding-top: calc(var(--header-h) + 40px); margin-bottom: 32px; } }
html.is-tv .mylist__head { padding-top: calc(var(--header-h) + 56px * var(--tvu)); }
.mylist__continue { margin-bottom: var(--rows-gap); }
.mylist__title {
  margin-bottom: 16px; font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); font-weight: 600;
}
html.is-tv .mylist__title { margin-bottom: calc(20px * var(--tvu)); }

/* ------------------------------------------------------------ historial (#/historial) */
.mylist__history { margin-left: auto; align-self: center; }
.history__head { margin-bottom: 4px; }
.history__clear { margin-left: auto; align-self: center; }
.history__clear.is-armed { background: var(--danger); color: #000; }
.history__note { margin-bottom: 24px; color: var(--text-2); font-size: 15px; }
.history__group + .history__group { margin-top: 32px; }
.history__title {
  margin-bottom: 16px; font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); font-weight: 600;
}
html.is-tv .history__note { font-size: var(--fs-callout); margin-bottom: calc(24px * var(--tvu)); }
html.is-tv .history__title { margin-bottom: calc(20px * var(--tvu)); }

/* ------------------------------------------------------------ Mi cuenta (#/cuenta) */
/* Base rules in auth.css (loaded later, so these carry .page--settings). On the content gutter like every
   other page, left-aligned, 760px at most; each section a calm translucent group (the page's colours show through), radius 12. */
.page--settings .settings { max-width: 760px; margin: 0; }
html.is-tv .page--settings .settings { max-width: calc(1040px * var(--tvu)); }
.page--settings .settings__section { border-radius: 12px; background: rgba(28, 28, 34, .62); box-shadow: inset 0 0 0 1px var(--glass-line); }
/* Lines inside a group (plan facts) are split by hairlines, as a grouped list. */
.page--settings .plan { gap: 0; }
.page--settings .plan__line { padding: 12px 0; }
.page--settings .plan__line + .plan__line { box-shadow: 0 -1px 0 var(--line); }
.page--settings .plan__line:first-child { padding-top: 4px; }
.page--settings .plan__line:last-child { padding-bottom: 0; }

/* ------------------------------------------------- section groups (browse.js) */
/* Plataformas (brand pills), Colecciones and Géneros (glass pills): a labelled line each under the page head,
   every line one scrolling track (.collections above). */
.cgroups { display: flex; flex-direction: column; gap: 6px; margin-bottom: 26px; }
.cgroups[hidden] { display: none; }
.cgroup { display: flex; align-items: center; min-width: 0; }
.cgroup__label { flex: none; width: 118px; color: var(--text-3); white-space: nowrap; }
.cgroups .cgroup__items { flex: 1; min-width: 0; margin-bottom: -6px; }
html.is-tv .cgroups { gap: calc(14px * var(--tvu)); margin-bottom: calc(44px * var(--tvu)); }
html.is-tv .cgroup__label { width: calc(190px * var(--tvu)); }
html.is-tv .cgroups .cgroup__items { margin-bottom: -6px; }
@media (max-width: 860px) {
  .cgroup { flex-direction: column; align-items: stretch; gap: 2px; }
  .cgroup__label { width: auto; padding-top: 6px; }
}
@media (max-width: 599px) {
  .cgroups { gap: 2px; margin-bottom: 14px; }
  .cgroups .cgroup__items { margin: -6px calc(-1 * var(--gutter)) 0; }
  /* Three lines and the filters above the grid: smaller labels and pills, so the first posters show on load. */
  .cgroup__label { padding-top: 4px; font-size: 11px; line-height: 14px; }
  .cgroups .chip { height: 36px; padding: 0 14px; font-size: 14px; }
}

/* ------------------------------------------------------ platform page */
/* #/platform/<slug> (platform.js): a band in the brand's colour (--p-face / --p-deep, ui.js brandStyle) that runs
   under the sidebar and melts into the page's tint (the brand colour too, ambient.js), a title of the platform
   faint in it; the big name, the count and the glass "Películas | Series"; then the 16:9 grid. */
.platform-hero {
  position: relative; isolation: isolate; display: flex; align-items: flex-end;
  margin-left: calc(-1 * var(--shell-x)); min-height: clamp(320px, 46vh, 460px);
  padding: calc(var(--header-h) + 64px) var(--gutter) 36px var(--content-x);
}
.platform-hero__bg {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(70% 130% at 88% 0%, rgba(var(--p-face), .95) 0, rgba(var(--p-face), 0) 72%),
    radial-gradient(60% 100% at 0% 0%, rgba(var(--p-face), .55) 0, rgba(var(--p-face), 0) 70%),
    linear-gradient(180deg, rgba(var(--p-deep), .9) 0, rgba(var(--p-deep), .5) 62%, rgba(var(--p-deep), 0) 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 58%, transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 58%, transparent 100%);
}
.platform-hero__art {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: right 30%;
  opacity: .34; mix-blend-mode: luminosity;
  -webkit-mask-image: linear-gradient(90deg, transparent 18%, #000 72%); mask-image: linear-gradient(90deg, transparent 18%, #000 72%);
}
.platform-hero__art[hidden] { display: none; }
/* Glass sheen across the top of the band. */
.platform-hero__bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1) 0, rgba(255, 255, 255, 0) 40%);
}
.platform-hero__body { min-width: 0; max-width: 900px; }
.platform-hero__kicker { color: rgba(255, 255, 255, .72); }
.platform-hero__name {
  margin-top: 8px; color: #fff; font-size: clamp(48px, 5.6vw, 92px); font-weight: 800; line-height: 1; letter-spacing: -.04em;
  text-shadow: 0 6px 40px rgba(0, 0, 0, .25); overflow-wrap: anywhere;
}
.platform-hero__count { min-height: 1.3em; margin-top: 10px; color: rgba(255, 255, 255, .8); font-size: 16px; font-weight: 500; line-height: 1.3; }
.platform-hero__kinds { margin-top: 22px; }
.platform-body { padding: 8px var(--gutter) 0; }
html.is-tv .platform-hero { min-height: calc(420px * var(--tvu)); padding: calc(var(--header-h) + 72px * var(--tvu)) var(--gutter) calc(40px * var(--tvu)); }
html.is-tv .platform-hero__art { mix-blend-mode: normal; opacity: .2; }
html.is-tv .platform-hero__name { font-size: calc(96px * var(--tvu)); }
html.is-tv .platform-hero__count { margin-top: calc(14px * var(--tvu)); font-size: var(--fs-callout); }
html.is-tv .platform-hero__kinds { margin-top: calc(30px * var(--tvu)); }
html.is-tv .platform-body { padding-top: calc(16px * var(--tvu)); }
@media (max-width: 860px) {
  .platform-hero { min-height: 0; padding-top: calc(var(--header-h) + 56px); padding-bottom: 24px; }
  .platform-hero__art { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 60%); mask-image: linear-gradient(90deg, transparent 0, #000 60%); }
}
@media (max-width: 599px) {
  .platform-hero { padding-top: calc(var(--header-h) + 40px); }
  .platform-hero__name { font-size: 44px; }
  .platform-hero__count { font-size: 14px; }
  .platform-hero__kinds { margin-top: 18px; }
}

/* 16:9 lockups in a grid (platform page): about 4 across a desktop, 2 on phones. */
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.grid--wide > :not(.empty) { max-width: none; }
.grid--wide .skeleton--poster { aspect-ratio: 16 / 9; }
@media (min-width: 1680px) { .grid--wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
@media (max-width: 599px) { .grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; } }
html.is-tv .grid--wide { grid-template-columns: repeat(auto-fill, minmax(calc(400px * var(--tvu)), 1fr)); }
