/* =====================================================================
   detail.css: the title page (title.js), as a tvOS show page. The page
   has no background of its own: it sits on the artwork's colours
   (ambient.js, behind everything). The hero runs full-bleed under the
   glass sidebar (--shell-x) and dissolves into those colours; then
   Episodios with a glass season menu, the related rows, "Reparto y
   equipo", "Información" and the loading skeleton.
   Tiers: stacked (≤860, portrait ≤1119; ui.js mq.stacked) is a big
   rounded card under the glass header, as the home's phone hero, with
   the synopsis under it; the billboard takes over at ≥861 landscape or
   ≥1120, the copy at the bottom left like the home hero.
   ===================================================================== */

/* --------------------------------------------------------------- hero */
/* Desktops: the page and its artwork run under the floating sidebar to the window's edge (--shell-x,
   tokens.css); the page's padding keeps the sections beside it, the lockup's the copy (--content-x). */
.page--title { margin-left: calc(-1 * var(--shell-x)); padding-left: var(--shell-x); }
.detail__hero { position: relative; isolation: isolate; margin-left: calc(-1 * var(--shell-x)); }
.detail__media { position: absolute; z-index: -1; inset: 0; overflow: hidden; }
.detail__backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: center 18%; transition: opacity var(--dur-5) var(--ease-std);
}
/* Set by title.js only while a not yet complete image decodes. */
.detail__backdrop.is-pending { opacity: 0; }
.detail__media::after { content: ""; position: absolute; inset: 0; pointer-events: none; }

/* No backdrop: the poster beside the copy (the page's colours already come from it). */
.detail__poster {
  position: relative; flex: none; width: min(46vw, 200px); aspect-ratio: 2 / 3;
  border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .06);
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.detail__poster img { width: 100%; height: 100%; object-fit: cover; }

/* ----------------------------------------------------------- copy */
.detail__lockup { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.detail__copy { display: flex; flex-direction: column; min-width: 0; }
/* Kicker: "PELÍCULA", "SERIE · TEMPORADA 2". */
.detail__kind {
  color: rgba(255, 255, 255, .74); font-size: 12px; font-weight: 600; letter-spacing: .12em; line-height: 1.2; text-transform: uppercase;
}

/* Title (ui.js wordmark, the home hero's rules): the real title as one balanced heavy block, in its own case, up
   to 3 lines; the size follows its length. One short word is drawn in wide tracked capitals ("L O K I"). The
   padding keeps the clamp from cutting accents and descenders. */
.detail__title { max-width: 100%; margin-top: 10px; color: #fff; font-weight: 800; text-shadow: 0 4px 30px rgba(0, 0, 0, .3); }
.detail__wordmark { display: block; }
.detail__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: min(42px, 10vw); line-height: 1.02; letter-spacing: -.025em;
}
.detail__title--short .detail__mark { font-size: min(52px, 12.4vw); }
.detail__title--long .detail__mark { font-size: min(32px, 7.6vw); letter-spacing: -.02em; }
.detail__title--tracked .detail__mark {
  margin-right: -.26em; font-size: min(52px, 12vw); letter-spacing: .26em; line-height: 1.05; text-transform: uppercase; -webkit-line-clamp: 1;
}
/* The title's TMDB logo (title.js detail.logo) in place of the drawn title once it has loaded; the box rules are
   the home hero's (catalog.css .hero__logo, .detail__logo). Stacked: centred, smaller. */
.detail__title.has-logo .detail__wordmark { display: none; }
.detail__title.has-logo .detail__logo { display: block; animation: logo-in var(--dur-3) var(--ease-std) both; }
.detail__title.has-logo { text-shadow: none; }
.detail__logo { --logo-w: min(340px, 72vw); --logo-fw: 72vw; --logo-h: 120px; margin: 0 auto; object-position: center bottom; }
@media (max-width: 599px) { .detail__logo { --logo-w: min(280px, 70vw); --logo-fw: 70vw; --logo-h: 96px; } }
@media (prefers-reduced-motion: reduce) { .detail__title.has-logo .detail__logo { animation: none; } }
.detail__original { margin-top: 8px; color: rgba(255, 255, 255, .6); font-size: 14px; font-weight: 500; line-height: 1.35; }

/* "Acción · Aventura · 6 episodios · ★ 9,3", then the outlined badges: 2021, CC, Multiaudio. */
.detail__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin-top: 14px;
  color: rgba(255, 255, 255, .92); font-size: 14px; font-weight: 500; line-height: 1.3;
}
.detail__meta > span + span:not(.detail__badges)::before {
  content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 8px; border-radius: 50%;
  background: currentColor; opacity: .6; vertical-align: middle;
}
.detail__score { display: inline-flex; align-items: center; gap: 4px; }
.detail__score .icon { width: 12px; height: 12px; margin-top: -1px; }
.detail__badges { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 10px; }
.detail__meta > .detail__badges:first-child { margin-left: 0; }
.detail__badge {
  display: inline-flex; align-items: center; height: 18px; 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;
}
.detail__synopsis { max-width: 560px; margin-top: 12px; color: rgba(255, 255, 255, .72); font-size: 15px; line-height: 1.45; }
/* "Más"/"Menos": a text button with a 44px hit area; the negative margins keep it tight under the text. */
.detail__more {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; margin: -6px -10px -12px;
  border-radius: var(--radius-pill); color: #fff; font: 700 15px/1 var(--font);
}
.detail__more[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .detail__more:hover { text-decoration: underline; text-underline-offset: 3px; } }
.detail__more:focus-visible { outline: 2px solid var(--focus); outline-offset: -6px; box-shadow: none; }

/* ------------------------------------------------------------ actions */
/* The white pill (with its bar and line under it), the round glass Mi lista, and the quiet
   "Desde el episodio 1" text button when there is progress: 48px. */
.detail__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-top: 22px; }
.detail__actions .btn { height: 48px; }
.detail__play-group { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; }
.detail__play { min-width: 0; padding: 0 30px; font-size: 17px; font-weight: 600; }
.detail__play .icon { width: 20px; height: 20px; }
/* "T2:E5" after "Continuar": the same weight, a little softer. */
.detail__play-ep { opacity: .58; }
.detail__list { flex: none; width: 48px; padding: 0; }
.detail__list .icon { width: 21px; height: 21px; stroke-width: 2.2; }
.detail__restart { height: 48px; padding: 0 12px; background: none; color: rgba(255, 255, 255, .78); font-size: 15px; font-weight: 600; }
.detail__restart .icon { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .detail__restart:hover { color: #fff; } }

/* The resume line: a short bar, then "Quedan 23 min". */
.detail__resume { display: flex; align-items: center; gap: 10px; min-width: 0; }
.detail__resume[hidden] { display: none; }
.detail__bar { position: relative; flex: none; display: block; width: 72px; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .3); }
.detail__bar[hidden] { display: none; }
.detail__bar > span { display: block; height: 100%; border-radius: inherit; background: #fff; transform-origin: left; }
.detail__left { min-width: 0; color: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------- stacked */
/* Phones and portrait tablets: a big rounded card under the glass header, as the home's phone hero. The hero is
   a grid and the lockup and copy "display: contents", so the card (.detail__media, rows 1-7) holds the picture,
   then the kicker, the title, the meta and the buttons over its dark foot; the synopsis follows under the card,
   on the page. The picture is anchored on its subject (most backdrops print their own title on the left). */
@media (max-width: 860px), (orientation: portrait) and (max-width: 1119px) {
  .detail__hero {
    --art-h: clamp(200px, calc((100vw - 2 * var(--gutter)) * .74), 46vh);
    --art-h: clamp(200px, calc((100vw - 2 * var(--gutter)) * .74), 46svh);
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--art-h) auto auto auto auto auto 22px auto auto;
    margin-left: 0; padding: calc(var(--header-h) + 10px) var(--gutter) 0;
  }
  .detail__hero--plain { grid-template-rows: auto auto auto auto auto auto 22px auto auto; }
  .detail__hero:not(.detail-skeleton) .detail__lockup, .detail__hero:not(.detail-skeleton) .detail__copy { display: contents; }
  .detail__hero:not(.detail-skeleton) .detail__media {
    position: relative; z-index: 0; inset: auto; grid-row: 1 / 8; grid-column: 1;
    border-radius: 20px; background: rgba(var(--amb-2), 1);
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6);
  }
  /* The picture stops a little under the art row and melts into the card's dark foot (no edge). */
  .detail__hero--media .detail__backdrop {
    bottom: auto; height: calc(var(--art-h) + 120px); object-position: 68% 20%;
    -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%); mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
  }
  .detail__hero--media .detail__media::after {
    background:
      linear-gradient(0deg, rgba(var(--amb-2), .97) 0, rgba(var(--amb-2), .94) calc(100% - var(--art-h) + 24px), rgba(var(--amb-2), .5) calc(100% - var(--art-h) * .55), rgba(var(--amb-2), 0) calc(100% - var(--art-h) * .18)),
      linear-gradient(180deg, rgba(0, 0, 0, .28) 0, rgba(0, 0, 0, 0) 90px);
    border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  }
  .detail__hero--plain .detail__media::after { border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
  .detail__poster { position: relative; z-index: 1; grid-row: 1; grid-column: 1; justify-self: center; width: min(44vw, 190px); margin: 24px 0 20px; }
  .detail__copy > * { position: relative; z-index: 1; grid-column: 1; min-width: 0; }
  .detail__kind, .detail__title, .detail__original, .detail__meta, .detail__actions { margin-left: 20px; margin-right: 20px; text-align: center; }
  .detail__kind { grid-row: 2; }
  .detail__title { grid-row: 3; margin-top: 8px; }
  .detail__original { grid-row: 4; }
  .detail__meta { grid-row: 5; justify-content: center; margin-top: 10px; }
  .detail__actions { grid-row: 6; justify-content: center; margin-top: 18px; }
  .detail__play-group { flex: 1 1 0; max-width: 300px; }
  .detail__resume { justify-content: center; }
  .detail__restart { flex: 0 0 100%; height: 44px; margin-top: -4px; }
  .detail__synopsis { grid-row: 8; max-width: 640px; margin-top: 20px; }
  .detail__more { grid-row: 9; justify-self: start; margin-top: -4px; }
}
@media (max-width: 599px) {
  .detail__kind { font-size: 11px; }
  .detail__meta { font-size: 13px; }
  .detail__badge { height: 16px; font-size: 10px; }
}
@media (min-width: 600px) and (max-width: 860px), (min-width: 600px) and (orientation: portrait) and (max-width: 1119px) {
  .detail__kind { font-size: 13px; }
  .detail__meta { font-size: 15px; }
  .detail__synopsis { font-size: 16px; }
  .detail__title .detail__mark { font-size: min(56px, 8vw); }
  .detail__title--short .detail__mark { font-size: min(68px, 9.4vw); }
  .detail__title--long .detail__mark { font-size: min(44px, 6vw); }
  .detail__title--tracked .detail__mark { font-size: min(68px, 9vw); }
  .detail__logo { --logo-w: min(400px, 60vw); --logo-fw: 60vw; --logo-h: 140px; }
  .detail__poster { width: 220px; }
}
/* Short landscape, stacked (phones on their side): a lower card. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 860px) {
  .detail__hero { --art-h: 28vh; --art-h: 28svh; }
  .detail__title .detail__mark { font-size: min(38px, 5vw); }
  .detail__title--short .detail__mark { font-size: min(44px, 5.8vw); }
  .detail__title--long .detail__mark { font-size: min(32px, 4.2vw); }
  .detail__title--tracked .detail__mark { font-size: min(40px, 5.4vw); }
  .detail__logo { --logo-h: 80px; }
  .detail__actions { margin-top: 14px; }
}

/* ---------------------------------------------------------- billboard */
/* As the home hero: full bleed under the sidebar (whose glass the picture colours), dissolving at its foot into
   the page's colours through a mask (no colour to match), with a scrim in the artwork's own dark tone (--amb-2)
   that is light under the panel and dense over the copy (lettering printed on a backdrop stays out of the
   title's way). The copy
   sits in the flow at the bottom left, so a long title or an open synopsis grows the hero instead of running
   under the header. */
@media (min-width: 861px) and (orientation: landscape), (min-width: 1120px) {
  .detail__hero {
    display: flex; flex-direction: column; justify-content: flex-end;
    min-height: clamp(600px, 88vh, 1000px); min-height: clamp(600px, 88svh, 1000px);
    padding: calc(var(--header-h) + 64px) 0 64px;
  }
  .detail__hero--plain { min-height: clamp(520px, 74vh, 860px); min-height: clamp(520px, 74svh, 860px); }
  .detail__hero--media .detail__media {
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 50%, rgba(0, 0, 0, .62) 74%, rgba(0, 0, 0, .18) 91%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0, #000 50%, rgba(0, 0, 0, .62) 74%, rgba(0, 0, 0, .18) 91%, transparent 100%);
  }
  .detail__hero--media .detail__backdrop { object-position: right top; -webkit-mask-image: var(--hero-art-mask); mask-image: var(--hero-art-mask); }
  .detail__hero--media .detail__media::after {
    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%);
  }
  .detail__lockup { flex-direction: row; align-items: flex-end; gap: 40px; padding: 0 var(--gutter) 0 var(--content-x); }
  .detail__poster { width: clamp(180px, 16vw, 250px); }
  .detail__copy { align-items: flex-start; flex: 1 1 auto; max-width: 640px; }
  .detail__kind, .detail__original, .detail__meta, .detail__synopsis, .detail__left, .detail__more { text-shadow: var(--text-shadow-img); }
  .detail__kind { font-size: 13px; }
  /* The window's width (--page-w), not the content's: hiding the sidebar does not reflow the copy. A name of more
     than 18 characters is --long (title.js): two calm lines rather than three heavy ones. */
  .detail__mark { font-size: clamp(44px, calc(var(--page-w, 100vw) * .048), 84px); line-height: 1; }
  .detail__title--short .detail__mark { font-size: clamp(50px, calc(var(--page-w, 100vw) * .055), 88px); }
  .detail__title--long .detail__mark { font-size: clamp(36px, calc(var(--page-w, 100vw) * .036), 60px); line-height: 1.04; }
  .detail__title--tracked .detail__mark { margin-right: -.3em; font-size: clamp(52px, calc(var(--page-w, 100vw) * .052), 92px); letter-spacing: .3em; }
  .detail__logo { --logo-w: min(520px, 40vw); --logo-fw: 40vw; --logo-h: 180px; margin: 0; object-position: left bottom; }
  .detail__original { margin-top: 10px; font-size: 15px; }
  .detail__meta { margin-top: 16px; font-size: 15px; }
  .detail__synopsis { margin-top: 10px; font-size: 16px; }
  .detail__actions { margin-top: 24px; }
  /* The pill keeps its own width; the resume line under it may run longer. */
  .detail__play-group { flex: none; align-items: flex-start; }
  .detail__play { min-width: 176px; }
  /* The line adds no width to the group (so Mi lista stays beside the pill); a long one runs past it. */
  .detail__resume { width: 0; min-width: 100%; }
  .detail__left { flex: none; max-width: 440px; }
  .detail__restart { padding: 0 14px; }
  /* The poster hero's copy column is narrower than the billboard's. */
  .detail__hero--plain .detail__mark { font-size: min(64px, 4.6vw); }
  .detail__hero--plain .detail__title--short .detail__mark { font-size: min(80px, 5.6vw); }
  .detail__hero--plain .detail__title--long .detail__mark { font-size: min(48px, 3.6vw); }
}
@media (min-width: 861px) and (max-width: 1279px) and (orientation: landscape) {
  .detail__copy { max-width: 560px; }
  .detail__mark { font-size: clamp(40px, calc(var(--page-w, 100vw) * .055), 68px); }
  .detail__title--long .detail__mark { font-size: clamp(34px, calc(var(--page-w, 100vw) * .038), 52px); }
  .detail__logo { --logo-w: min(440px, 40vw); --logo-h: 150px; }
}
@media (min-width: 1680px) {
  .detail__copy { max-width: 720px; }
  .detail__synopsis { max-width: 600px; font-size: 17px; }
  .detail__logo { --logo-w: min(600px, 36vw); --logo-fw: 36vw; --logo-h: 200px; }
}

/* Engines without aspect-ratio would collapse the poster to 0px. */
@supports not (aspect-ratio: 2 / 3) { .detail__poster { height: 300px; } }
/* Billboard on a short screen: one screen of art, the copy at its foot. */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 861px) {
  .detail__hero, .detail__hero--plain { min-height: 100vh; min-height: 100svh; padding: calc(var(--header-h) + 16px) 0 24px; }
  .detail__mark { font-size: min(44px, 4.4vw); -webkit-line-clamp: 2; }
  .detail__title--short .detail__mark { font-size: min(56px, 5.6vw); }
  .detail__title--long .detail__mark { font-size: min(36px, 3.4vw); }
  .detail__logo { --logo-w: min(360px, 32vw); --logo-fw: 32vw; --logo-h: 96px; }
}

/* ------------------------------------------------------ body, sections */
/* All on the page's colours. Stacked: 28px under the synopsis; the billboard's own foot padding gives it there. */
.detail__body { position: relative; padding: 28px 0 40px; }
.detail__body > * + * { margin-top: 40px; }
@media (min-width: 861px) { .detail__body > * + * { margin-top: 48px; } }
@media (min-width: 861px) and (orientation: landscape), (min-width: 1120px) { .detail__body { padding-top: 4px; } }
.detail__section { padding: 0 var(--gutter); }
/* Section titles: bold and tight, as the home rows. */
.detail__heading { font-size: clamp(19px, 1.55vw, 22px); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
/* ?from=seasons lands here, clear of the fixed header. */
#episodios { scroll-margin-top: calc(var(--header-h) + 16px); }
html.is-tv .detail__heading, html.is-tv .row__head { scroll-margin-top: calc(var(--topbar-h) + 24px * var(--tvu)); }

/* "Episodios" and the season menu beside it. Raised so the open menu floats over the episodes. */
.detail__head { position: relative; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.detail__season-one { color: rgba(255, 255, 255, .6); font-size: 15px; font-weight: 600; }
.detail__head + .detail__episodes { margin-top: 2px; }
/* The track bleeds to the screen edges; its own padding keeps the cards on the gutter. */
.detail__episodes .row--episodes { margin: 0 calc(-1 * var(--gutter)); }
.detail__episodes .ep-grid { margin-top: 18px; }

/* "Temporada 2 ▾": a glass pill, 36px (44px on touch screens). */
.season-picker { position: relative; }
.season-select {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .14); color: #fff; font: 600 15px/1 var(--font); white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  transition: background-color var(--dur-2);
}
.season-select .icon { width: 16px; height: 16px; color: rgba(255, 255, 255, .7); stroke-width: 2.4; transition: transform var(--dur-3) var(--ease-calm); }
.season-select[aria-expanded="true"] .icon { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .season-select:hover { background: rgba(255, 255, 255, .22); } }
@media (pointer: coarse) { .season-select { height: 44px; border-radius: 22px; } }
.season-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-halo); }
/* The panel: a frosted rounded card under the button (the page's colours show through); long lists scroll inside it. */
.season-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 3; min-width: 240px; max-height: min(360px, 60vh);
  padding: 6px; overflow-y: auto; overscroll-behavior: contain; border-radius: 16px;
  background: rgba(30, 30, 36, .72); box-shadow: var(--glass-shadow), inset 0 0 0 1px var(--glass-line);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
}
.season-menu__list { margin: 0; padding: 0; list-style: none; }
.season-menu__item {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 40px; padding: 0 12px;
  border-radius: 10px; color: #fff; font-size: 15px; font-weight: 500; white-space: nowrap;
}
.season-menu__item[aria-current="page"] { font-weight: 700; }
.season-menu__item .icon { width: 16px; height: 16px; stroke-width: 2.6; }
@media (pointer: coarse) { .season-menu__item { min-height: 44px; } }
@media (hover: hover) and (pointer: fine) { .season-menu__item:hover { background: rgba(255, 255, 255, .1); } }
.season-menu__item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; box-shadow: none; background: rgba(255, 255, 255, .14); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .season-select { background: rgba(60, 60, 68, .92); }
  .season-menu { background: var(--glass-solid); }
}

/* Long seasons (telenovelas): ranges of 40 (1–40 · 41–80 …) as glass pills, the current one white. */
.page--title .ranges { margin: 18px 0 0; }
.page--title .ranges .segmented { height: auto; gap: 8px; padding: 6px; margin: -6px; background: none; }
.page--title .ranges .segmented button {
  height: 36px; padding: 0 16px; border-radius: 18px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.page--title .ranges .segmented button[aria-pressed="true"] { background: var(--inverse); color: var(--on-inverse); box-shadow: none; }
@media (pointer: coarse) { .page--title .ranges .segmented button { height: 44px; border-radius: 22px; } }
@media (hover: hover) and (pointer: fine) { .page--title .ranges .segmented button:not([aria-pressed="true"]):hover { color: #fff; background: rgba(255, 255, 255, .18); } }
.page--title .ranges .segmented button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-halo); }

/* The numbered grid: calm glass tiles on the page's colours (the number over "Visto", what is left or the
   length); the resume one lighter, with a white ring and its bar. */
.page--title .ep--num { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); border-radius: 14px; }
.page--title .ep--num .ep__meta { color: rgba(255, 255, 255, .55); }
.page--title .ep--num.is-watched .ep__n { color: rgba(255, 255, 255, .45); }
.page--title .ep--num.is-resume { background: rgba(255, 255, 255, .2); box-shadow: 0 0 0 2px rgba(var(--amb-2), 1), 0 0 0 4px #fff; }
.page--title .ep--num.is-resume .ep__meta { color: rgba(255, 255, 255, .85); }
@media (hover: hover) and (pointer: fine) { .page--title .ep--num:hover { background: rgba(255, 255, 255, .16); } }
.page--title .ep--num:focus-visible { background: rgba(255, 255, 255, .18); }
html.is-tv .page--title .ep--num:focus-visible { background: var(--inverse); }

/* Episode lockups (ui.js episodeList track): an episode without a still is a calm glass plate with the big number,
   tinted by the page's colours, instead of the same backdrop repeated. */
.page--title .ep__art { background: rgba(255, 255, 255, .06); }
.page--title .ep__art::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.page--title .ep__plate {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(var(--amb-1), .55) 0, rgba(var(--amb-1), 0) 70%),
    linear-gradient(160deg, rgba(255, 255, 255, .13) 0, rgba(255, 255, 255, .05) 55%, rgba(255, 255, 255, .03) 100%);
}
.page--title .ep__numeral { color: rgba(255, 255, 255, .92); font-weight: 700; }
.page--title .ep--card.is-watched .ep__numeral { color: rgba(255, 255, 255, .4); }
.page--title .ep--card .ep__meta, .page--title .ep__desc { color: rgba(255, 255, 255, .58); }
.page--title .ep--card:focus-visible .ep__art { box-shadow: 0 0 0 2px rgba(var(--amb-2), 1), 0 0 0 4px var(--focus); }

/* D-pad moves (focus.js scrollIntoView "nearest") keep the target clear of the fixed header and tab bar. */
.detail__actions .btn, .detail__more, .season-select, .season-menu__item, .page--title .ranges button, .page--title .ep, .person {
  scroll-margin-top: calc(var(--header-h) + 16px); scroll-margin-bottom: calc(var(--tabbar-total) + 16px);
}

/* ---------------------------------------------------- Reparto y equipo */
/* Round 88px glass avatars with the initials (there are no photos), the name (2 lines at most, always 2 lines
   tall, so the role labels line up across the row) and the role under them. */
.row--people { contain-intrinsic-size: 1px 200px; contain-intrinsic-size: auto 200px; }
.row--people .row__track { grid-auto-columns: 112px; gap: 16px; }
.person { display: flex; flex-direction: column; align-items: center; min-width: 0; color: #fff; text-align: center; -webkit-tap-highlight-color: transparent; }
.person__avatar {
  display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 255, 255, .18) 0, rgba(255, 255, 255, .07) 100%); color: #fff;
  font-size: 28px; font-weight: 600; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform 200ms var(--ease-calm), background-color 200ms;
}
.person__avatar { position: relative; overflow: hidden; }
.person__avatar > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; border-radius: 50%; }
.person__avatar.has-photo { color: transparent; }
.person__name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  max-width: 100%; min-height: 2.6em; margin-top: 10px; font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.person__role { margin-top: 2px; color: rgba(255, 255, 255, .55); font-size: 13px; line-height: 1.3; }
@media (hover: hover) and (pointer: fine) { html:not(.is-tv) .person:hover .person__avatar { transform: scale(1.04); background: rgba(255, 255, 255, .22); } }
.person:focus-visible { outline: none; box-shadow: none; }
.person:focus-visible .person__avatar { outline: 2px solid transparent; outline-offset: 2px; box-shadow: 0 0 0 2px rgba(var(--amb-2), 1), 0 0 0 4px var(--focus); }
/* The paddles sit on the avatars' middle. */
@media (hover: hover) and (pointer: fine) { .row--people .row__arrow { top: calc(var(--track-pad-top) + 24px); } }
@media (max-width: 599px) {
  .row--people .row__track { grid-auto-columns: 92px; gap: 12px; }
  .person__avatar { width: 72px; height: 72px; font-size: 24px; }
  .person__name { font-size: 13px; }
  .person__role { font-size: 12px; }
}

/* --------------------------------------------------------- Información */
/* Three columns of facts (two on tablets, one on phones), under a hairline. */
.detail__section.detail__facts { margin-left: var(--gutter); margin-right: var(--gutter); padding: 32px 0 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; max-width: 1100px; margin: 20px 0 0; }
.facts dt { color: rgba(255, 255, 255, .55); font-size: 13px; font-weight: 600; line-height: 1.35; }
.facts dd { margin: 4px 0 0; color: #fff; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* ----------------------------------------------------------- skeleton */
/* title.js renders it with the hero classes: the loaded page's geometry in every tier, on the page's colours. */
.detail-skeleton { display: flex; flex-direction: column; justify-content: flex-end; }
.detail-skeleton .detail__media { background: rgba(255, 255, 255, .05); }
.detail-skeleton .skeleton:not(.detail__media) { background: rgba(255, 255, 255, .1); }
.detail-skeleton .detail__copy { width: 100%; }
.detail-skeleton .detail__copy > * + * { margin-top: 14px; }
.detail-skeleton__line { width: 40%; height: 14px; border-radius: var(--radius-xs); }
.detail-skeleton__line--kind { width: 160px; height: 12px; }
.detail-skeleton__title { width: 70%; height: 56px; border-radius: var(--radius-sm); }
.detail-skeleton .detail__actions .skeleton--pill { flex: 1; height: 48px; }
.detail-skeleton .detail__actions .skeleton--pill + .skeleton--pill { flex: none; width: 48px; }
@media (max-width: 860px), (orientation: portrait) and (max-width: 1119px) {
  .detail-skeleton { display: flex; min-height: calc(var(--header-h) + 10px + var(--art-h) + 200px); padding-bottom: 24px; }
  .detail-skeleton .detail__media { top: calc(var(--header-h) + 10px); left: var(--gutter); right: var(--gutter); bottom: 0; border-radius: 20px; }
  .detail-skeleton .detail__copy { align-items: center; padding: 0 20px; }
  .detail-skeleton .detail__actions { justify-content: center; width: 100%; }
}
@media (min-width: 861px) and (orientation: landscape), (min-width: 1120px) {
  .detail-skeleton .detail__media { -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent); mask-image: linear-gradient(180deg, #000 50%, transparent); }
  .detail-skeleton__title { width: 60%; height: 88px; }
  .detail-skeleton .detail__actions .skeleton--pill { flex: none; width: 176px; }
}

/* ----------------------------------------------------------------- TV */
/* Same look at 10-foot sizes; no blur filters (gradients and solid fills only). */
html.is-tv .detail__hero, html.is-tv .detail__hero--plain {
  min-height: 86vh; min-height: 86svh; padding: calc(var(--header-h) + 40px * var(--tvu)) 0 calc(56px * var(--tvu));
}
html.is-tv .detail__hero--media .detail__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 .detail__copy { max-width: calc(860px * var(--tvu)); }
html.is-tv .detail__poster { width: calc(300px * var(--tvu)); }
html.is-tv .detail__kind { font-size: var(--fs-overline); }
html.is-tv .detail__title { margin-top: calc(14px * var(--tvu)); }
html.is-tv .detail__mark { font-size: calc(80px * var(--tvu)); }
html.is-tv .detail__title--short .detail__mark { font-size: calc(92px * var(--tvu)); }
html.is-tv .detail__title--long .detail__mark { font-size: calc(58px * var(--tvu)); }
html.is-tv .detail__title--tracked .detail__mark { font-size: calc(100px * var(--tvu)); }
/* TV: no shadow filter and no fade on the logo (light on TV hardware). */
html.is-tv .detail__logo { --logo-w: calc(620px * var(--tvu)); --logo-fw: calc(620px * var(--tvu)); --logo-h: calc(200px * var(--tvu)); filter: none; }
html.is-tv .detail__title.has-logo .detail__logo { animation: none; }
html.is-tv .detail__original, html.is-tv .detail__meta { font-size: var(--fs-callout); }
html.is-tv .detail__meta { margin-top: calc(18px * var(--tvu)); }
html.is-tv .detail__score .icon { width: calc(16px * var(--tvu)); height: calc(16px * var(--tvu)); }
html.is-tv .detail__badges { gap: calc(8px * var(--tvu)); margin-left: calc(14px * var(--tvu)); }
html.is-tv .detail__badge { height: calc(26px * var(--tvu)); padding: 0 calc(7px * var(--tvu)); border-radius: calc(5px * var(--tvu)); font-size: calc(16px * var(--tvu)); }
html.is-tv .detail__synopsis { max-width: calc(760px * var(--tvu)); margin-top: calc(12px * var(--tvu)); font-size: var(--fs-body); }
html.is-tv .detail__more { min-height: var(--control); font-size: var(--fs-callout); }
html.is-tv .detail__actions { gap: calc(18px * var(--tvu)); margin-top: calc(30px * var(--tvu)); }
html.is-tv .detail__actions .btn { height: var(--control-lg); }
html.is-tv .detail__play { min-width: calc(240px * var(--tvu)); font-size: var(--fs-headline); }
html.is-tv .detail__list { width: var(--control-lg); }
html.is-tv .detail__list .icon { width: calc(30px * var(--tvu)); height: calc(30px * var(--tvu)); }
html.is-tv .detail__restart { font-size: var(--fs-callout); padding: 0 calc(22px * var(--tvu)); }
html.is-tv .detail__left { max-width: calc(640px * var(--tvu)); font-size: var(--fs-caption); }
html.is-tv .detail__bar { width: calc(96px * var(--tvu)); height: calc(5px * var(--tvu)); }
html.is-tv .detail__body { padding-top: calc(8px * var(--tvu)); }
html.is-tv .detail__body > * + * { margin-top: calc(64px * var(--tvu)); }
html.is-tv .detail__heading { font-size: var(--fs-title-2); font-weight: 600; }
html.is-tv .detail__head { gap: calc(10px * var(--tvu)) calc(24px * var(--tvu)); }
/* Room for the focused card's lift and ring under the heading. */
html.is-tv .detail__head + .detail__episodes { margin-top: calc(20px * var(--tvu)); }
html.is-tv .detail__season-one { font-size: var(--fs-callout); }
html.is-tv .season-select {
  height: var(--control); padding: 0 calc(16px * var(--tvu)) 0 calc(22px * var(--tvu)); border-radius: calc(var(--control) / 2); font-size: var(--fs-callout);
  background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: none; backdrop-filter: none;
}
html.is-tv .season-select .icon { width: calc(22px * var(--tvu)); height: calc(22px * var(--tvu)); }
html.is-tv .season-select:focus-visible { background: var(--inverse); color: var(--on-inverse); outline-offset: 3px; transform: scale(1.04); }
html.is-tv .season-select:focus-visible .icon { color: var(--on-inverse); }
html.is-tv .season-menu {
  min-width: calc(340px * var(--tvu)); padding: calc(8px * var(--tvu)); border-radius: calc(18px * var(--tvu));
  background: rgba(28, 28, 34, .98); -webkit-backdrop-filter: none; backdrop-filter: none;
}
html.is-tv .season-menu__item { min-height: var(--control); padding: 0 calc(18px * var(--tvu)); border-radius: calc(12px * var(--tvu)); font-size: var(--fs-callout); }
html.is-tv .season-menu__item:focus-visible { background: var(--inverse); color: var(--on-inverse); outline: none; }
/* The focused pill grows a little (as the chips), so its ring needs more room. */
html.is-tv .page--title .ranges .segmented { padding: 10px; margin: -10px; gap: calc(10px * var(--tvu)); }
html.is-tv .page--title .ranges .segmented button { height: var(--control); padding: 0 calc(20px * var(--tvu)); border-radius: calc(var(--control) / 2); font-size: var(--fs-callout); }
html.is-tv .page--title .ranges .segmented button:focus-visible { background: var(--inverse); color: var(--on-inverse); outline-offset: 3px; transform: scale(1.06); }
html.is-tv .page--title .ep__numeral { font-size: calc(72px * var(--tvu)); }
html.is-tv .row--people .row__track { grid-auto-columns: calc(150px * var(--tvu)); gap: calc(24px * var(--tvu)); }
html.is-tv .person__avatar { width: calc(120px * var(--tvu)); height: calc(120px * var(--tvu)); font-size: calc(38px * var(--tvu)); transition: transform var(--dur-3) var(--ease-calm); }
html.is-tv .person__name { margin-top: calc(14px * var(--tvu)); font-size: var(--fs-callout); }
html.is-tv .person__role { font-size: var(--fs-caption); }
html.is-tv .person:focus-visible .person__avatar { transform: scale(1.08); background: var(--inverse); color: var(--on-inverse); box-shadow: 0 0 0 4px var(--focus-halo), 0 0 0 8px var(--focus); }
html.is-tv .detail__section.detail__facts { padding-top: calc(40px * var(--tvu)); }
html.is-tv .facts { max-width: none; gap: calc(32px * var(--tvu)) calc(48px * var(--tvu)); margin-top: calc(24px * var(--tvu)); }
html.is-tv .facts dt { font-size: var(--fs-caption); }
html.is-tv .facts dd { font-size: var(--fs-body); }
@media (prefers-reduced-motion: reduce) {
  html.is-tv .person:focus-visible .person__avatar, html.is-tv .season-select:focus-visible { transform: none; }
}
