/* TBP Video — the watch page, the hub, a playlist's page and the reels viewer.
   Colours, fonts and radii are the theme's tokens (tokens.css), so the light and
   dark editions and Studio's design choices carry through. Logical properties
   throughout: right-to-left first, left-to-right correct too. */

.tbpv { --tbpv-gap: 24px; color: var(--ink-900); }
.tbpv a { color: inherit; text-decoration: none; }
.tbpv svg { width: 1em; height: 1em; flex: none; }

/* ── The player ─────────────────────────────────────────────────────────── */
.tbpv-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.tbpv-player video, .tbpv-player iframe, .tbpv-player .tbpv-facade, .tbpv-player .tbpv-facade img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.tbpv-player video { object-fit: contain; background: #000; }
.tbpv-player--embed > * { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
.tbpv-facade { padding: 0; margin: 0; background: #000; cursor: pointer; }
.tbpv-facade img { object-fit: cover; }
.tbpv-bigplay { position: absolute; inset: 0; margin: auto; width: 76px; height: 54px; border-radius: 16px; background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center; font-size: 30px; transition: background .15s; }
.tbpv-facade:hover .tbpv-bigplay, .tbpv-facade:focus-visible .tbpv-bigplay, .tbpv-lead-main:hover .tbpv-bigplay { background: var(--red); }

/* ── Watch page ─────────────────────────────────────────────────────────── */
.tbpv-watch { padding-block-end: 24px; }
.tbpv-theater { background: #000; }
.tbpv-stage { max-width: min(1280px, calc((100dvh - 150px) * 16 / 9)); min-width: min(100%, 640px); margin-inline: auto; }
.tbpv-grid { max-width: var(--maxw, 1280px); margin-inline: auto; padding: 18px var(--gutter, 16px) 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--tbpv-gap); align-items: start; }
.tbpv-crumb { display: flex; gap: 8px; font-size: 13px; color: var(--ink-500); margin-block-end: 6px; }
.tbpv-crumb a:hover { color: var(--red); }
.tbpv-title { font-family: var(--font-urdu); font-size: clamp(20px, 2.4vw, 28px); line-height: 1.6; font-weight: 700; margin: 0 0 10px; }
.tbpv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-block-end: 14px; }
.tbpv-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-500); }
.tbpv-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.tbpv-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tbpv-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-pill, 999px); background: var(--paper-sunken); color: var(--ink-900); border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.tbpv-chip:hover { background: var(--hairline-strong, var(--ink-200)); }
.tbpv-desc { position: relative; background: var(--paper-sunken); border-radius: var(--r-card, 12px); padding: 14px 16px 12px; }
.tbpv-desc .byline { margin: 0 0 8px; }
.tbpv-desc .art-body { margin: 0; font-size: 17px; }
.tbpv-desc .art-body > :first-child { margin-top: 0; }
.tbpv-desc.is-long:not(.is-open) .tbpv-desc-in { max-height: 9.5em; overflow: hidden; mask-image: linear-gradient(#000 55%, transparent); }
.tbpv-more { display: none; margin-block-start: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-900); cursor: pointer; }
.tbpv-desc.is-long .tbpv-more { display: inline-block; }

/* Up next */
.tbpv-next { display: grid; gap: 14px; }
.tbpv-next-head { display: flex; align-items: center; justify-content: space-between; }
.tbpv-next-head h2 { font-size: 17px; margin: 0; font-family: var(--font-urdu); }
.tbpv-auto { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-500); cursor: pointer; }
.tbpv-auto input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tbpv-auto i { width: 34px; height: 20px; border-radius: 10px; background: var(--ink-300); position: relative; transition: background .15s; }
.tbpv-auto i::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-end: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: inset-inline-end .15s; }
.tbpv-auto input:checked + i { background: var(--red); }
.tbpv-auto input:checked + i::after { inset-inline-end: 17px; }
.tbpv-auto input:focus-visible + i { outline: 2px solid var(--red); outline-offset: 2px; }
.tbpv-pl { border: 1px solid var(--hairline); border-radius: var(--r-card, 12px); overflow: hidden; }
.tbpv-pl-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--paper-sunken); font-size: 14px; }
.tbpv-pl-list { max-height: 360px; overflow-y: auto; padding: 6px; display: grid; gap: 4px; }
.tbpv-next-list { display: grid; gap: 10px; }

/* Cards */
.tbpv-card { display: grid; gap: 8px; color: inherit; }
.tbpv-card-cover { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-thumb, 10px); overflow: hidden; background: #111; }
.tbpv-card-cover img, .tbpv-card-cover video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.tbpv-card:hover .tbpv-card-cover img { transform: scale(1.04); }
.tbpv-card-play { position: absolute; inset-block-end: 8px; inset-inline-start: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; font-size: 14px; opacity: 0; transition: opacity .15s; }
.tbpv-card:hover .tbpv-card-play, .tbpv-card--tall .tbpv-card-play { opacity: 1; }
.tbpv-card-dur { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .8); color: #fff; font: 600 12px/1.6 var(--font-mono, monospace); }
.tbpv-card-body { display: grid; gap: 3px; min-width: 0; }
.tbpv-card-title { font-family: var(--font-urdu); font-weight: 700; font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbpv-card:hover .tbpv-card-title { color: var(--red); }
.tbpv-card-meta { font-size: 12px; color: var(--ink-500); }
/* Up next and playlist cards: picture beside the text */
.tbpv-next-list .tbpv-card, .tbpv-pllist .tbpv-card { grid-template-columns: 168px minmax(0, 1fr); align-items: start; gap: 10px; }
.tbpv-pl-list .tbpv-card { grid-template-columns: 22px 100px minmax(0, 1fr); align-items: center; padding: 6px; border-radius: 8px; }
.tbpv-pl-list .tbpv-card.is-now { background: var(--paper-sunken); }
.tbpv-pl-list .tbpv-card-title { font-size: 13px; }
.tbpv-card-n { font: 600 12px var(--font-mono, monospace); color: var(--ink-500); text-align: center; display: grid; place-items: center; }
.tbpv-card.is-now .tbpv-card-n { color: var(--red); }
.tbpv-pllist .tbpv-card { grid-template-columns: 28px 220px minmax(0, 1fr); align-items: center; padding: 8px; border-radius: 10px; }
.tbpv-pllist .tbpv-card:hover { background: var(--paper-sunken); }
.tbpv-pllist .tbpv-card--tall { grid-template-columns: 28px 90px minmax(0, 1fr); }
.tbpv-card--tall .tbpv-card-cover { aspect-ratio: 9 / 16; }

/* Autoplay countdown */
.tbpv-count { position: fixed; inset: 0; z-index: 9990; display: grid; place-items: center; background: rgba(0, 0, 0, .55); }
.tbpv-count[hidden] { display: none; }
.tbpv-count-in { background: #111; color: #fff; padding: 22px 26px; border-radius: 14px; display: grid; gap: 12px; text-align: center; min-width: 240px; }
.tbpv-count-in p { margin: 0; font-size: 16px; }
.tbpv-count-go { display: inline-flex; justify-content: center; align-items: center; gap: 8px; height: 42px; border: 0; border-radius: var(--r-pill, 999px); background: var(--red); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.tbpv-count-no { border: 0; background: none; color: #ccc; font: inherit; cursor: pointer; }

@media (max-width: 1000px) {
	.tbpv-grid { grid-template-columns: minmax(0, 1fr); }
	.tbpv-stage { min-width: 0; }
	.tbpv-next-list .tbpv-card { grid-template-columns: 150px minmax(0, 1fr); }
}
@media (max-width: 640px) {
	.tbpv-theater { position: sticky; inset-block-start: 0; z-index: 30; } /* the player stays while the list scrolls, as on YouTube */
	.tbpv-grid { padding-inline: 12px; }
	.tbpv-pllist .tbpv-card { grid-template-columns: 22px 140px minmax(0, 1fr); }
	.tbpv-next-list .tbpv-card { grid-template-columns: 136px minmax(0, 1fr); }
}

/* ── Hub ────────────────────────────────────────────────────────────────── */
.tbpv-hub { max-width: var(--maxw, 1280px); margin-inline: auto; padding: 22px var(--gutter, 16px) 40px; display: grid; gap: 34px; }
.tbpv-hub-head h1, .tbpv-plhead h1 { font-family: var(--font-urdu); font-size: clamp(26px, 3vw, 36px); margin: 0; }
.tbpv-kicker { margin: 0 0 2px; font-size: 13px; color: var(--red); font-weight: 700; }
.tbpv-lead { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: var(--tbpv-gap); }
.tbpv-lead-main { display: grid; gap: 12px; }
.tbpv-lead-cover { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-card, 12px); overflow: hidden; background: #000; }
.tbpv-lead-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbpv-lead-text { display: grid; gap: 6px; }
.tbpv-lead-title { font-family: var(--font-urdu); font-weight: 700; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.6; }
.tbpv-lead-main:hover .tbpv-lead-title { color: var(--red); }
.tbpv-lead-deck { color: var(--ink-600); font-size: 15px; line-height: 1.8; }
.tbpv-lead-side { display: grid; gap: 14px; align-content: start; }
.tbpv-lead-side .tbpv-card { grid-template-columns: 150px minmax(0, 1fr); gap: 10px; }
.tbpv-row { display: grid; gap: 12px; }
.tbpv-row-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; border-block-end: 2px solid var(--hairline); padding-block-end: 8px; }
.tbpv-row-head h2 { margin: 0; font-family: var(--font-urdu); font-size: 21px; }
.tbpv-row-head p { margin: 0; font-size: 12px; color: var(--ink-500); }
.tbpv-row-more { font-size: 14px; color: var(--red) !important; font-weight: 700; white-space: nowrap; }
.tbpv-row-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-block-end: 6px; scrollbar-width: thin; }
.tbpv-row-track > * { scroll-snap-align: start; }
.tbpv-row--wide .tbpv-row-track { grid-auto-columns: minmax(250px, calc((100% - 48px) / 4)); }
.tbpv-row--tall .tbpv-row-track { grid-auto-columns: minmax(150px, calc((100% - 80px) / 6)); }
.tbpv-row--tall .tbpv-card-title { font-size: 14px; }
.tbpv-grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 16px; }
.tbpv-latest { display: grid; gap: 14px; }
@media (max-width: 900px) {
	.tbpv-lead { grid-template-columns: minmax(0, 1fr); }
	.tbpv-row--wide .tbpv-row-track { grid-auto-columns: 72%; }
	.tbpv-row--tall .tbpv-row-track { grid-auto-columns: 40%; }
}

/* Playlist page */
.tbpv-plpage { max-width: 1100px; margin-inline: auto; padding: 22px var(--gutter, 16px) 40px; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--tbpv-gap); align-items: start; }
.tbpv-plhead { position: sticky; inset-block-start: 16px; display: grid; gap: 14px; padding: 16px; border-radius: 16px; background: var(--surface-inverse, #111); color: var(--on-inverse, #fff); }
.tbpv-plhead-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; display: block; }
.tbpv-plhead .tbpv-card-meta { color: var(--on-inverse-dim, #bbb); }
.tbpv-pldesc { font-size: 14px; line-height: 1.8; margin: 6px 0; }
.tbpv-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; margin-block-start: 8px; border-radius: var(--r-pill, 999px); background: #fff; color: #000 !important; font-weight: 700; }
.tbpv-pllist { display: grid; gap: 4px; }
@media (max-width: 800px) {
	.tbpv-plpage { grid-template-columns: minmax(0, 1fr); }
	.tbpv-plhead { position: static; }
}

/* ── Reels viewer ───────────────────────────────────────────────────────── */
body.tbpr-on { margin: 0; background: #000; overflow: hidden; }
.tbpr { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; font-family: var(--font-urdu, sans-serif); }
.tbpr a { color: inherit; text-decoration: none; }
.tbpr svg { width: 1em; height: 1em; }
.tbpr-top { position: absolute; inset-inline: 0; inset-block-start: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); pointer-events: none; }
.tbpr-top > * { pointer-events: auto; }
.tbpr-h { margin: 0; font-size: 18px; font-weight: 700; }
.tbpr-x, .tbpr-top-gap { width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; border-radius: 50%; }
.tbpr-x:hover { background: rgba(255, 255, 255, .15); }
.tbpr-feed { height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; outline: none; }
.tbpr-feed::-webkit-scrollbar { display: none; }
.tbpr-s { position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.tbpr-media { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100vw; background: #111; overflow: hidden; }
.tbpr-media img, .tbpr-media video, .tbpr-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.tbpr-media iframe { pointer-events: none; } /* taps belong to the viewer (play/pause), as with a file */
.tbpr-media video { object-fit: contain; background: #000; }
@media (min-width: 700px) {
	.tbpr-media { height: calc(100% - 24px); border-radius: 14px; }
}
@media (max-width: 699px) { /* a phone: the reel fills the screen edge to edge, as on TikTok */
	.tbpr-media { width: 100%; height: 100%; aspect-ratio: auto; max-width: none; }
	.tbpr-media video { object-fit: cover; }
}
.tbpr-shade { position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .75)); pointer-events: none; }
.tbpr-cap { position: absolute; inset-inline: 0; inset-block-end: 0; z-index: 2; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); padding-inline-end: 72px; display: grid; gap: 6px; max-width: min(100vw, calc((100dvh - 24px) * 9 / 16)); margin-inline: auto; }
.tbpr-meta { font-size: 12px; opacity: .85; display: flex; gap: 6px; flex-wrap: wrap; }
.tbpr-t { margin: 0; font-size: 17px; line-height: 1.6; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.tbpr-d { margin: 0; font-size: 14px; line-height: 1.8; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.tbpr-s.is-open .tbpr-d { -webkit-line-clamp: unset; max-height: 45dvh; overflow-y: auto; }
.tbpr-dmore { justify-self: start; border: 0; background: none; color: #fff; font: inherit; font-weight: 700; font-size: 13px; padding: 0; cursor: pointer; }
.tbpr-acts { position: absolute; inset-inline-end: 10px; inset-block-end: max(90px, calc(env(safe-area-inset-bottom) + 80px)); z-index: 3; display: grid; gap: 14px; justify-items: center; }
@media (min-width: 700px) {
	.tbpr-acts { inset-inline-end: calc(50% - (100dvh - 24px) * 9 / 32 - 70px); }
}
.tbpr-btn { display: grid; justify-items: center; gap: 3px; border: 0; background: none; color: #fff; font: inherit; font-size: 11px; cursor: pointer; padding: 0; }
.tbpr-btn > span:first-child { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-size: 22px; backdrop-filter: blur(6px); }
.tbpr-btn:hover > span:first-child { background: rgba(255, 255, 255, .28); }
.tbpr-btn.is-on > span:first-child { background: var(--red, #c00); }
.tbpr-bar { position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px; background: rgba(255, 255, 255, .2); z-index: 4; }
.tbpr-bar i { display: block; height: 100%; width: 0; background: #fff; }
.tbpr-paused { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 64px; opacity: 0; transition: opacity .15s; z-index: 2; }
.tbpr-s.is-paused .tbpr-paused { opacity: .85; }
.tbpr-nav { position: absolute; inset-inline-start: 18px; inset-block-start: 50%; translate: 0 -50%; display: none; gap: 12px; z-index: 5; }
@media (min-width: 900px) and (hover: hover) { .tbpr-nav { display: grid; } }
.tbpr-nav button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; display: grid; place-items: center; cursor: pointer; }
.tbpr-nav button:hover { background: rgba(255, 255, 255, .26); }
.tbpr-nav button:disabled { opacity: .3; cursor: default; }
.tbpr-hint { position: absolute; inset-inline: 0; inset-block-end: 30%; z-index: 6; text-align: center; font-size: 15px; pointer-events: none; animation: tbpr-hint 2.6s ease-out forwards; }
@keyframes tbpr-hint { 0% { opacity: 0; translate: 0 20px; } 20%, 70% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -20px; } }
.tbpr-end { height: 40dvh; display: grid; place-items: center; scroll-snap-align: end; color: #aaa; font-size: 14px; }
.tbpr-toast { position: absolute; inset-block-start: 70px; inset-inline: 0; margin-inline: auto; width: max-content; z-index: 7; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #000; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .tbpr-feed { scroll-behavior: auto; } .tbpr-hint { animation: none; opacity: 0; } }
