/* vod.css — Movies & Series (VodScreen.kt) and the film and series pages (MovieDetailScreen.kt,
 * SeriesDetailScreen.kt), in CSS pixels. */

/* ======================= the browse screen ======================= */
.screen.vod { display: flex; flex-direction: column; }
.vod-wide { position: absolute; inset: 0; display: flex; gap: 22px; padding: calc(var(--safe-top) + 14px) calc(var(--pad-h) + var(--safe-right)) 0 calc(var(--pad-h) + var(--safe-left)); }
.vod-sidepanel { width: 240px; flex: none; display: flex; flex-direction: column; min-height: 0; margin-bottom: calc(var(--safe-bottom) + 14px); border-radius: 16px; background: var(--sidebar); }
.vod-side { flex: 1; min-height: 0; padding: 4px 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.vod-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.vod-main .topbar { padding: 0; }
.vod-compact { position: absolute; inset: 0; display: flex; flex-direction: column; }
.vod-compact .topbar { padding-bottom: 4px; }
.vod-chips { display: flex; gap: 8px; padding: 8px 2px; }
.vod-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 0 12px; flex: none; }
/* the section's search, slid out of its button (.open) */
/* The search on the line over the titles (Matt, 21 Oct 2026), as Live TV's: a good width, the buttons at the far end;
   a phone's fills the line. */
.vod-toolbar .vod-search { flex: 0 1 420px; min-width: 0; }
.vod-compact .vod-toolbar .vod-search { flex: 1 1 auto; }
.vod-gridbox { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.vod-compact .vod-gridbox { padding: 0 calc(var(--pad-h) + var(--safe-right) - 9px) 0 calc(var(--pad-h) + var(--safe-left) - 9px); }
.vod-wide .vod-gridbox { margin: 0 -9px; }
.vod-gridbox > .state { flex: 1; }
.vod-grid { flex: 1; min-height: 0; padding-bottom: var(--safe-bottom); }
.grid-poster .poster-title { font-size: 13px; }
/* Search's results with titles through someone or a studio (screens/vod.js plainGrid): a plain grid, a heading each. */
.vod-plain { overflow-y: auto; padding: 10px 9px calc(var(--safe-bottom) + 32px); }
.vod-plaingrid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); column-gap: 18px; row-gap: 22px; }
.vod-plaingrid .grid-poster { width: auto; }
.vod-more-head { margin: 26px 0 12px; }
.vod-plain > .vod-more-head:first-child { margin-top: 2px; }

/* ======================= the film and series pages ======================= */
.detail { background: transparent; }
.dt-backdrop { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; overflow: hidden; }
.dt-backdrop.compact { height: calc(var(--lw) * 0.78); }
.dt-bd-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transition: opacity 400ms; }
.dt-bd-img.loaded { opacity: 1; }
.dt-bd-scrim { position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 95%, transparent), color-mix(in srgb, var(--bg) 80%, transparent) 35%, color-mix(in srgb, var(--bg) 20%, transparent) 70%, color-mix(in srgb, var(--bg) 5%, transparent)); }
.dt-bd-scrim2 { position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 35%, transparent), transparent 22%, color-mix(in srgb, var(--bg) 25%, transparent) 60%, var(--bg)); }
.dt-backdrop.compact .dt-bd-scrim { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 25%, transparent), color-mix(in srgb, var(--bg) 35%, transparent) 50%, var(--bg)); }
.dt-backdrop.compact .dt-bd-scrim2 { display: none; }
.dt-bd-dim { position: absolute; inset: 0; background: var(--bg); opacity: 0; transition: opacity 300ms; }
.dt-backdrop.dimmed .dt-bd-dim { opacity: 0.6; }
.detail .dt-backdrop { position: sticky; top: 0; height: var(--lh); margin-bottom: calc(var(--lh) * -1); }
.detail .dt-backdrop.compact { height: calc(var(--lw) * 0.78); margin-bottom: calc(var(--lw) * -0.78); }

/* a title page's autoplay (lib/detail-autoplay.js): the picture beneath the artwork, which fades off it, with a dark
   fade over it so the page's text reads clearly; then the page fades away into the player */
.dt-bd-video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 800ms; }
.dt-backdrop.compact .dt-bd-video { height: auto; aspect-ratio: 16 / 9; }
.dt-bd-shade { position: absolute; inset: 0; opacity: 0; transition: opacity 800ms;
  background: linear-gradient(90deg, rgba(0,0,0,0.75), rgba(0,0,0,0.55) 35%, rgba(0,0,0,0.2) 65%, transparent),
    linear-gradient(180deg, rgba(0,0,0,0.35), transparent 25%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0.8)); }
.dt-backdrop.compact .dt-bd-shade { bottom: auto; height: auto; aspect-ratio: 16 / 9; background: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.85)); }
.ap-showing .dt-bd-video, .ap-showing .dt-bd-shade { opacity: 1; }
.ap-showing .dt-bd-img.loaded { opacity: 0; transition-duration: 800ms; }
.screen.detail .dt-page, .screen.detail > .dt-back, .dt-bd-scrim, .dt-bd-scrim2 { transition: opacity 300ms; }
/* (as specific as the rule above, or its quick transition would win) */
.screen.detail.ap-fading .dt-page, .screen.detail.ap-fading > .dt-back, .screen.detail.ap-fading .dt-bd-scrim, .screen.detail.ap-fading .dt-bd-scrim2,
.screen.detail.ap-fading .dt-bd-shade, .screen.detail.ap-fading .dt-bd-dim { opacity: 0 !important; transition: opacity 6000ms ease-in-out; }
/* with the picture behind it the page is dark whatever the theme, so its text reads on the dark fade */
:root[data-theme="light"] .screen.detail.ap-showing {
  --bg: #141416; --bg-top: #1E1E23; --surface: #222226; --surface-high: #2C2C31; --surface-highest: #38383E;
  --separator: rgba(255,255,255,0.12); --text: #F5F5F7; --text-2: #A1A1A8; --text-3: #6E6E75;
  --accent-soft: rgba(var(--accent-rgb),0.20); color-scheme: dark;
}
.dt-page { position: relative; padding: calc(var(--safe-top) + 14px) 0 calc(var(--safe-bottom) + 34px); }
.dt-hero { display: flex; align-items: flex-end; gap: 30px; min-height: calc(var(--lh) - var(--safe-top) - 14px - 64px); padding: 0 calc(var(--pad-h) + var(--safe-right)) 0 calc(var(--pad-h) + var(--safe-left)); }
.dt-page.series .dt-hero { min-height: calc(var(--lh) - var(--safe-top) - 14px - 72px); }
.dt-hero.compact { display: block; min-height: 0; padding-top: calc(var(--lw) * 0.42); }
.dt-poster { position: relative; width: 176px; flex: none; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-high); box-shadow: 0 16px 40px var(--shadow); }
.dt-poster > .rimg { position: absolute; inset: 0; }
.dt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dt-title { margin: 0 0 8px; font: 700 34px/40px var(--font); letter-spacing: -0.6px; max-width: 760px; }
.dt-hero.compact .dt-title { font: 600 28px/34px var(--font); letter-spacing: -0.4px; }
.dt-meta { display: flex; align-items: center; font: 400 14px/19px var(--font); color: var(--text-2); white-space: pre; min-width: 0; }
.dt-meta b { color: var(--text); font-weight: 500; }
.dt-star { color: var(--warning); display: inline-flex; margin-right: 3px; }
/* The UK age rating (AgeBadge): BBFC colours on a rounded square. */
.dt-age { margin-left: 10px; min-width: 24px; padding: 1px 6px; border-radius: 6px; font: 700 13px/18px var(--font); text-align: center; color: #fff; background: #1f3f99; flex-shrink: 0; }
.dt-age.u { background: #0fa344; }
.dt-age.pg { background: #f2b705; color: #1a1a1a; }
.dt-age.r12 { background: #f07800; }
.dt-age.r15 { background: #e5007e; }
.dt-age.r18 { background: #d6001c; }
.dt-badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.badge.q { background: color-mix(in srgb, var(--surface-highest) 85%, transparent); color: var(--text); }
.dt-plot { display: block; text-align: left; margin: 14px 0 0 -10px; padding: 6px 10px; border-radius: 12px; max-width: 740px; transition: background-color 120ms; }
.dt-plot.hot { background: color-mix(in srgb, var(--surface-high) 70%, transparent); }
.dt-plot-text { font: 400 15px/21px var(--font); color: color-mix(in srgb, var(--text) 92%, transparent); }
.dt-plot-more { font: 600 13px/18px var(--font); color: var(--accent); margin-top: 4px; }
.dt-plot-loading { height: 64px; display: flex; align-items: center; margin-top: 14px; }
.dt-unavail { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.dt-actions { display: flex; align-items: center; gap: 12px; margin: 16px 0 0 -8px; padding: 6px 8px; }
.dt-wl-slot { display: contents; }
.dt-credit { margin-top: 3px; font: 400 13px/18px var(--font); color: var(--text-2); max-width: 740px; white-space: pre-wrap; }
.dt-credit b { color: var(--text-3); font-weight: 600; }
.dt-actions + .dt-credit { margin-top: 8px; }
.dt-section { margin-top: 26px; }
.dt-related { display: flex; gap: 16px; padding-top: 6px; padding-bottom: 14px; }
.dt-back { position: fixed; z-index: 5; left: calc(var(--pad-h) + var(--safe-left)); top: calc(var(--safe-top) + 14px); width: 40px; height: 40px;
  background: color-mix(in srgb, var(--surface-high) 85%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.detail .dt-hero:not(.compact) { padding-top: 56px; }
.dt-unavailable { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.dt-unavailable .dt-back { position: absolute; }

/* seasons and episodes */
.dt-seasons { display: flex; gap: 8px; padding-top: 2px; padding-bottom: 12px; }
.dt-episodes { display: flex; flex-direction: column; gap: 4px; padding-left: calc(var(--pad-h) + var(--safe-left) - 10px); padding-right: calc(var(--pad-h) + var(--safe-right) - 10px); }
.ep-row { display: flex; align-items: center; gap: 16px; padding: 10px; border-radius: 16px; text-align: left; max-width: 1100px; transition: background-color 120ms, transform 140ms var(--ease); }
.ep-row.hot { background: var(--surface-high); }
.ep-thumb { position: relative; width: 160px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface-high); flex: none; }
.ep-thumb.compact { width: 124px; }
.ep-thumb > .rimg { position: absolute; inset: 0; }
.ep-new { position: absolute; left: 6px; top: 6px; }
.ep-prog { position: absolute; left: 8px; right: 8px; bottom: 6px; width: auto; }
.ep-play { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 140ms; }
.ep-row.hot .ep-play { opacity: 1; }
.ep-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-title { display: flex; align-items: center; gap: 8px; font: 600 15px/20px var(--font); min-width: 0; }
.ep-done { display: inline-flex; flex: none; }
.ep-plot { margin-top: 2px; }
.dt-eploading { height: 120px; display: flex; align-items: center; }
.dt-epfailed { display: flex; align-items: center; gap: 12px; margin-top: 26px; }

/* a series' Episodes and More like this, as tabs (SeriesTabs): the open one underlined in the accent colour */
.dt-tabs { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; }
.dt-tablist { flex: 1; min-width: 0; display: flex; gap: 8px; margin-left: -10px; overflow-x: auto; scrollbar-width: none; }
.dt-tablist::-webkit-scrollbar { display: none; }
.dt-tab { display: inline-flex; flex-direction: column; flex: none; padding: 6px 10px; border-radius: 10px; font: 600 18px/24px var(--font); letter-spacing: -0.2px;
  color: var(--text-2); white-space: nowrap; transition: color 140ms, background-color 140ms; }
.dt-tab::after { content: ''; height: 3px; margin-top: 6px; border-radius: 2px; }
.dt-tab.sel { color: var(--text); }
.dt-tab.sel::after { background: var(--accent); }
.dt-tab.hot { background: color-mix(in srgb, var(--surface-high) 70%, transparent); }
.dt-tabbed .dt-seasons { padding-top: 8px; }
.dt-tabbed .dt-epfailed { margin-top: 8px; }
.dt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--poster-w), 1fr)); gap: 22px 18px; padding-top: 10px; padding-bottom: 14px; }
.dt-grid .grid-poster { width: auto; }

/* the trailer pop-up */
.dialog.trailer-dialog { max-width: min(calc(var(--lw) * 0.92), 960px); width: 100%; }
.trailer-box { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-top: 12px; border-radius: 12px; overflow: hidden; background: #000; }
.trailer-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* A phone on its side is too short for the video with the title over it and the buttons under it: the video as tall
   as fits, the title and buttons in a column beside it. */
.lh-short .dialog.trailer-dialog { display: grid; grid-template-columns: auto 190px; grid-template-rows: auto 1fr; column-gap: 16px; width: auto; max-width: none; padding: 16px; }
.lh-short .trailer-dialog h3 { grid-column: 2; grid-row: 1; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lh-short .trailer-dialog .trailer-box { grid-column: 1; grid-row: 1 / 3; margin-top: 0; width: min(calc((var(--lh) - 80px) * 16 / 9), calc(var(--lw) - 302px)); }
.lh-short .trailer-dialog .d-btns { grid-column: 2; grid-row: 2; flex-direction: column; flex-wrap: nowrap; justify-content: flex-end; margin-top: 12px; }
