/* ---------- A title's page (js/detail.js): buttons, rating, trailer, credits, badges, seasons; tokens from app.css :root ---------- */
/* Round 4 (S2): Play names what it plays and says how long, a dub-first film offers "Orijinal ses"
   beside it, a series' episodes are a list of big numbers and air dates with a panel for the episode
   under the remote. On a TV the page is one fixed screen (1920 x 1080, inside x 96..1824, y 54..1026). */

/* ---- buttons: what to watch first, the rest on a quieter row ---- */
.detail .row-btns .btn { min-height: var(--h-btn); padding: 6px 1.25em; border-radius: 999px; font-size: var(--fs-button); }
.detail .row-btns.more { margin-top: 12px; }
.detail .row-btns.more .btn { min-height: 44px; padding: 4px 1.1em; font-size: var(--fs-detail); background: rgba(244, 239, 230, .1); }
.detail .row-btns.more .btn:focus-visible { background: rgba(244, 239, 230, .28); }
.btn-l { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.2; }
.btn-sub { margin-top: 2px; font-size: .78em; font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.detail .detail-body { max-width: 780px; }
.detail .detail-body > .overview, .detail .detail-body > .meta-strip { max-width: 640px; }
/* A new episode out this week, not started: above the title, in the "new" colour (its only use here). */
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: var(--fs-detail); font-weight: 700; color: var(--ink-2); }
.eyebrow.new { color: var(--new); }
.eyebrow.new::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }

/* A detail page's rating choices (app.js): wraps like .row-btns, every choice a full target. */
.rate-group { display: flex; flex-wrap: wrap; gap: 12px; }
.rate-group > * { min-height: 44px; min-width: 44px; }
/* Trailer: YouTube's player at 16:9, as large as the screen allows (a phone on its side too). */
.trailer-dialog { width: min(1100px, 94vw, calc(78vh * 16 / 9)); margin: auto; border: 0; padding: 12px; color: var(--ink); background: #000; border-radius: 16px; }
.trailer-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.trailer-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.trailer-dialog .row-btns { justify-content: center; margin-top: 12px; }
/* Cast, director and genres under the buttons: links, so a remote reaches them on its way down. */
.credits { display: grid; gap: 8px; margin-top: 18px; }
/* The labels sit in a gutter, so every line's chips start at one edge: Down from a chip, or from the
   buttons, reaches the chip right below it instead of skipping a line whose label pushed it aside. */
.credit-line { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-left: 7rem; }
.credit-label { position: absolute; left: 0; top: 0; height: 36px; display: flex; align-items: center; color: var(--muted); font-weight: 600; font-size: .92rem; }
.credits .chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; color: var(--ink); text-decoration: none; }
/* Height reserved: the language badges arrive after PlaybackInfo, without pushing the text down. */
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; min-height: 28px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(244, 239, 230, .12); font-size: .85rem; font-weight: 700; }
.badge .icon { width: 16px; height: 16px; }
.badge.good { background: rgba(60, 207, 142, .18); color: #9ff0c9; }
.badge.warn { background: rgba(245, 184, 65, .18); color: #ffd98a; }
@media (hover: hover) {
  .episode:hover { background: rgba(244, 239, 230, .08); }
  .episode:hover p { display: block; }
}
/* One row of buttons on a TV, so Play to Benzerleri stays two or three presses: the buttons take the
   screen's width, and only the text keeps a reading width. In rem, so html.tv's 125% scales it with the labels. */
html.tv .detail-body { max-width: none; }
html.tv .detail-body > :not(.row-btns) { max-width: 52rem; }
@supports not (aspect-ratio: 1) {
  .trailer-frame { height: calc((min(1100px, 94vw, 78vh * 16 / 9) - 24px) * 9 / 16); }
}
.btn.seen .icon { opacity: .45; }
.btn.seen[aria-pressed="true"] .icon { opacity: 1; color: var(--good); stroke-width: 2.5; }

/* ---------- seasons and episodes ---------- */
.seasons { padding: 0 var(--gutter); }
.seasons-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.seasons-head h2 { margin: 0 10px 0 0; font-family: var(--serif); font-size: var(--fs-row); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.seasons-label { color: var(--ink-2); font-weight: 600; font-size: var(--fs-detail); }
.season-tabs { flex: 0 1 auto; min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: var(--ring-out); margin: calc(-1 * var(--ring-out)); scrollbar-width: none; }
.tab { min-height: 40px; padding: 8px 16px; border: 2px solid transparent; border-radius: 999px; background: rgba(244, 239, 230, .1); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tab.num { min-width: 44px; padding: 0 12px; }
/* The open season: an edge, not the cream fill (cream means focus). */
.tab.active { border-color: var(--ink-2); background: var(--panel-3); color: var(--ink); }
.tab:focus-visible { background: var(--focus-c); color: var(--ink-inv); }
.season-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 14px 0 10px; border-bottom: 1px solid var(--rule); }
.season-sum { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; font-size: var(--fs-detail); font-variant-numeric: tabular-nums; }
.season-sum b { font-weight: 700; }
.season-sum span { color: var(--ink-2); font-weight: 600; }
.season-sum .season-count { margin-left: auto; }
/* One button size and one baseline: "Sezonu indir" next to Geri al. */
.season-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.episodes { display: grid; }
.ep-earlier { margin: 12px 0 4px; color: var(--ink); }
.seasons .episode-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--rule); -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* A row: the number large (Newsreader), the date or name with its length, and on the right what is
   true now. No still in the row: 34 two-hour episodes read as a list, the picture is the panel's. */
.episode { position: relative; flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 18px; padding: 12px 14px; text-align: left; border-radius: var(--radius); background: none; }
.episode:focus { background: rgba(244, 239, 230, .1); }
.ep-n { flex: none; min-width: 2em; font-family: var(--serif); font-size: calc(var(--fs-row) * 1.15); font-weight: 500; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.ep-t { flex: 1 1 auto; min-width: 0; }
.ep-t b { display: block; font-size: var(--fs-body); font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-sub { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-detail); line-height: 1.3; font-variant-numeric: tabular-nums; }
.ep-s { grid-column: 3; text-align: right; color: var(--ink-2); font-size: var(--fs-detail); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ep-s .bar { position: static; display: block; width: 6.5em; height: 4px; margin: 8px 0 0 auto; background: rgba(244, 239, 230, .22); }
.ep-s .bar > span { background: var(--ink); }
.new-tag { display: inline-block; padding: 2px 10px; border-radius: 6px; background: var(--new); color: var(--ink-inv); font-weight: 700; }
.episode.seen .ep-n { color: var(--ink-3); }
.episode.seen .ep-t b, .episode.soon .ep-n, .episode.soon .ep-t b { color: var(--ink-2); }
.episode p { grid-column: 2 / -1; margin: 6px 0 0; color: var(--muted); font-size: var(--t-callout-size); line-height: var(--t-callout-lh); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* An episode shows its whole text where the remote or the keyboard rests (a tap plays it, so touch
   screens show it in full; a mouse gets it on hover, above). Where the panel stands beside the list
   (a TV, a wide screen) the panel has it whole instead. */
.episode:focus p { display: block; }
@media (hover: none) { .episode p { display: block; } }
/* İzlendi, one Right from its episode: an outline until watched, then filled. */
.seasons .ep-seen { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: none; color: var(--ink-3); box-shadow: inset 0 0 0 2px rgba(244, 239, 230, .28); }
.seasons .ep-seen[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); box-shadow: none; }
.seasons .ep-seen:focus-visible { box-shadow: var(--focus); }
/* Not out yet: nothing to mark (the place stays, so the rows keep one edge). */
.seasons .episode.soon + .ep-seen { visibility: hidden; }
/* A long press on an episode (detail.js) shows it is being held from 150 ms: a slow press-in, transform only. */
.episode { transition: transform 200ms var(--ease-out); }   /* let go, it eases back from the hold */
.episode.holding { transform: scale(.97); transition: transform 450ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .episode.holding { transform: none; opacity: .7; } }

/* ---- the episode panel: the episode under the remote or the mouse, large ---- */
.ep-panel { display: none; pointer-events: none; }
.ep-art { position: relative; height: 0; padding-top: 56.25%; overflow: hidden; border-radius: var(--r2); background: var(--panel-1); }
.ep-art img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-art .ep-still:not([src]) { visibility: hidden; }
/* No still: a crop of the series' picture, its logo bottom-left on a shade (the crop point is D1's to give). */
.ep-panel.crop .ep-still { object-position: var(--crop, 50% 25%); }
.ep-panel.crop .ep-art::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(20deg, rgba(18, 16, 14, .8), rgba(18, 16, 14, 0) 55%); }
.ep-art .ep-logo { top: auto; right: auto; bottom: 6%; left: 5%; z-index: 1; width: 42%; height: 32%; object-fit: contain; object-position: left bottom; }
.ep-kicker { margin: 18px 0 0; color: var(--ink-2); font-size: var(--fs-detail); font-weight: 600; font-variant-numeric: tabular-nums; }
.ep-panel h3 { margin: 6px 0 8px; font-family: var(--serif); font-size: calc(var(--fs-row) * 1.15); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.ep-text { margin: 0; color: var(--ink-2); font-size: var(--fs-body); line-height: 1.45; }
/* A wide screen: the panel stands beside the list and stays as it scrolls (the right column was empty). */
@media (min-width: 1000px) {
  html:not(.tv) .seasons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); column-gap: 48px; align-items: start; }
  html:not(.tv) .seasons > :not(.ep-panel) { grid-column: 1; }
  html:not(.tv) .ep-panel { display: block; grid-column: 2; grid-row: 1 / span 3; position: -webkit-sticky; position: sticky; top: 96px; margin-top: 12px; }
  html:not(.tv) .seasons .episode p, html:not(.tv) .seasons .episode:focus p, html:not(.tv) .seasons .episode:hover p { display: none; }
}
@media (max-width: 720px) {
  /* No remote here: the label leads its line. */
  .credit-line { padding-left: 0; }
  .credit-label { position: static; height: auto; margin-right: 4px; }
  .tab { min-height: 44px; }
  .episode { column-gap: 12px; padding: 12px 4px; }
  .ep-n { min-width: 1.6em; }
  .ep-t b { white-space: normal; }   /* a date never ends in "…" on a phone: it wraps (1.3 clears İ and ğ) */
  .detail .row-btns:not(.more) > .btn { flex: 1 1 100%; justify-content: center; }
  .detail .row-btns:not(.more) .btn-l { align-items: center; text-align: center; }
}

/* ---------- the TV: one fixed screen ---------- */
/* A series: the title and its buttons on the left (x 96..1050), the episodes in a column on the right
   (x 1120..1824). The backdrop ends where the list begins and fades into it, so no half-face shows at
   the list's edge; its crop puts the picture's middle in the band the text leaves (D1 can set --crop
   per title). While the list has focus (.ep-mode) the panel takes the left column at once: no fade,
   one change per press. */
/* --inset: a lifted card's or a button's ring stays inside x 96 (the overscan) at the page's left edge. */
html.tv main.page { --inset: calc(var(--m) + var(--ring-out) + 8px); }
html.tv .detail.series { display: block; min-height: 1080px; padding: 150px 0 0 var(--inset); }
html.tv .detail.series .detail-body { width: 892px; }
html.tv .detail.series .hero-bg { right: auto; width: 1040px; bottom: auto; height: 1080px; background-position: var(--crop, 20% 25%); }
html.tv .detail.series .hero-bg::after { background: linear-gradient(90deg, var(--bg) 0%, rgba(18, 16, 14, .86) 34%, rgba(18, 16, 14, .42) 64%, rgba(18, 16, 14, .3) 84%, var(--bg) 100%); }
html.tv .detail.ep-mode .detail-body, html.tv .detail.ep-mode .hero-bg { opacity: 0; }
html.tv .detail.series .seasons { position: absolute; top: 0; right: 0; width: 880px; height: 1080px; padding: 136px var(--m) 0 36px; background: var(--bg); }
html.tv .seasons-head { margin-top: 0; gap: 0 18px; }
html.tv .seasons-head h2 { font-size: var(--fs-row); }
html.tv .seasons-label { font-size: var(--fs-detail); }
html.tv .tab { min-height: 64px; padding: 0 22px; font-size: var(--fs-detail); }
html.tv .tab.num { min-width: 64px; padding: 0; }
html.tv .season-bar { padding: 16px 0 10px; min-height: 76px; }
html.tv .season-sum { font-size: var(--fs-detail); }
/* Seven whole rows (96 + 8): the last ends at y 1000 and a focused row is filled, never ringed, so
   nothing reaches the overscan. The list moves under the window by whole rows (detail.js place). */
html.tv .ep-window { height: 720px; overflow: hidden; margin: 8px 0 0; }
html.tv .episodes { display: flex; flex-direction: column; gap: 8px; will-change: transform; }
html.tv .seasons .episode-row { flex: none; height: 96px; gap: 12px; border: 0; }
html.tv .episode { height: 96px; padding: 0 20px; column-gap: 18px; transition: none; }
html.tv .ep-n { min-width: 104px; font-size: 54px; }
html.tv .ep-t b { font-size: var(--fs-body); }
html.tv .ep-sub, html.tv .ep-s { font-size: 26px; }
html.tv .seasons .episode p { display: none; }
html.tv .seasons .ep-seen { width: 64px; height: 64px; }
html.tv .seasons .ep-seen .icon { width: 28px; height: 28px; }
/* Focus is the cream fill with dark text (the guide's cells do the same); rows never scale. */
html.tv .seasons .episode:focus { background: var(--focus-c); color: var(--ink-inv); box-shadow: none; }
html.tv .seasons .episode:focus .ep-n, html.tv .seasons .episode:focus .ep-t b, html.tv .seasons .episode:focus .ep-sub, html.tv .seasons .episode:focus .ep-s { color: var(--ink-inv); }
html.tv .seasons .episode:focus .bar { background: rgba(21, 18, 15, .22); }
html.tv .seasons .episode:focus .bar > span { background: var(--ink-inv); }
html.tv .ep-panel { display: block; position: absolute; top: 150px; left: calc(var(--inset) - 1040px); width: 800px; opacity: 0; }
html.tv .detail.ep-mode .ep-panel:not(.ep-next) { opacity: 1; }
html.tv .episode-row.out { visibility: hidden; }
/* Under the buttons, where the column leaves room (detail.js fitNext, NEXT_TOP): the episode Play
   plays, small: its still, then its date and synopsis beside it. */
html.tv .ep-panel.ep-next { top: 736px; width: 892px; display: grid; grid-template-columns: 480px minmax(0, 1fr); column-gap: 32px; align-items: start; }
html.tv .detail.with-next:not(.ep-mode) .ep-next { opacity: 1; }
html.tv .ep-next .ep-art { grid-row: 1 / span 3; }
html.tv .ep-next h3 { display: none; }
html.tv .ep-next .ep-kicker { margin-top: 0; }
html.tv .ep-next .ep-text { margin-top: 8px; font-size: var(--fs-detail); -webkit-line-clamp: 4; }
html.tv .ep-kicker { margin-top: 26px; }
html.tv .ep-panel h3 { font-size: 52px; }
/* Six lines at most: the text ends above y 1026. */
html.tv .ep-text { font-size: var(--fs-body); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

/* A film: the title and buttons over its picture, Benzerleri peeking at y 790 (detail.js similarCover).
   With focus the row rises in one transform so a focused poster's ring stays above 1026, the buttons
   give way to the focused title's facts, name and "OK Filmi aç", and its picture takes the cover after
   the keys rest. */
html.tv .detail.movie { display: block; min-height: 764px; padding: 150px var(--m) 0 var(--inset); }
html.tv .detail.movie .hero-bg { left: auto; width: 1500px; bottom: auto; height: 844px; background-position: var(--crop, 50% 25%); }
html.tv .detail.movie .hero-bg::after { background: linear-gradient(90deg, var(--bg) 0%, rgba(18, 16, 14, .72) 26%, rgba(18, 16, 14, .22) 56%, rgba(18, 16, 14, 0) 76%); }
html.tv .detail .row-btns .btn { padding: 6px 30px; }
/* The TV's column is anchored at the top, so an İndir slot that may never fill keeps no room there. */
html.tv .detail-body > .gather[hidden] { display: none !important; }
html.tv .detail .row-btns.more .btn { min-height: 60px; padding: 4px 26px; }
html.tv .sim-page > .row { --card: 254px; position: relative; z-index: 1; transition: transform 160ms var(--ease-out); }
/* Rows under a title keep to the safe area: x 96..1824, a lifted card's ring included. */
/* The track's clip is the safe area's edge (a peeking card is cut at 1824) and its padding holds a
   lifted card's ring. */
html.tv .detail ~ .row h2 { margin-left: var(--inset); margin-right: var(--inset); }
html.tv .detail ~ .row .track { gap: var(--card-gap); margin-left: var(--m); margin-right: var(--m);
  padding-left: calc(var(--inset) - var(--m)); padding-right: calc(var(--inset) - var(--m)); scroll-padding: 0 calc(var(--inset) - var(--m)); }
html.tv .sim-page.sim-mode > .row { transform: translateY(var(--lift, 0px)); }
html.tv .sim-page.sim-mode .detail-body, html.tv .sim-page.sim-mode .seasons { opacity: 0; }
html.tv .sim-page > .row .card:not(.broken) .card-title { opacity: 0; }
.sim-cover, .hero-bg.alt { display: none; }
html.tv .hero-bg.alt { display: block; opacity: 0; background-color: var(--bg); transition: opacity 200ms var(--ease-out); }
html.tv .hero-bg.alt.on { opacity: 1; }
/* A series' takeover: the focused title's picture as wide as a film's, its own picture and column gone. */
html.tv .detail.series .hero-bg.alt { left: auto; right: 0; width: 1500px; height: 844px; background-position: var(--crop, 50% 25%); }
html.tv .detail.series .hero-bg.alt::after { background: linear-gradient(90deg, var(--bg) 0%, rgba(18, 16, 14, .72) 26%, rgba(18, 16, 14, .22) 56%, rgba(18, 16, 14, 0) 76%); }
html.tv .sim-page.sim-mode .detail.series .hero-bg:not(.alt) { opacity: 0; }
html.tv .sim-cover { display: block; position: absolute; top: 150px; left: var(--inset); width: 1300px; opacity: 0; pointer-events: none; }
html.tv .sim-page.sim-mode .sim-cover { opacity: 1; }
.sim-kicker { margin: 0; color: var(--ink-2); font-size: var(--fs-detail); font-weight: 600; font-variant-numeric: tabular-nums; }
.sim-title { margin: 8px 0 18px; font-family: var(--serif); font-size: var(--fs-title); font-weight: 500; line-height: 1.15; letter-spacing: -.02em; }
.sim-ok { display: flex; align-items: center; gap: 14px; margin: 0; font-size: var(--fs-detail); font-weight: 600; color: var(--ink); }
.sim-ok kbd { padding: 2px 12px; border-radius: var(--r1); box-shadow: inset 0 0 0 2px var(--ink-2); font: inherit; font-weight: 700; }
html.tier-lite .hero-bg.alt, html.tier-lite .sim-page > .row { transition: none; }
/* Each mode switch (the list's panel, the takeover) is an opacity or a transform on its own layer:
   the compositor flips it, nothing under it repaints (software compositing measured 40-48 ms a switch
   without). About 20 MB of layers on the 1920 x 1080 canvas. */
html.tv .detail .detail-body, html.tv .detail .seasons, html.tv .ep-panel, html.tv .sim-cover, html.tv .detail .hero-bg { will-change: opacity; }
html.tv .sim-page > .row { will-change: transform; }
