/* Video experiences: the Shorts reel feed (pages/video-shorts.blade.php) and the YouTube-style long-video page
   (pages/video.blade.php). Behaviour lives in news/js/video-pages.js. */

/* These set their own display, so the hidden attribute the script toggles has to be said explicitly. */
.vp-bar[hidden], .vp-big[hidden], .reel-act[hidden], .watch-more[hidden] { display: none; }

/* ───────────────────────── Shorts: full-screen reel feed ───────────────────────── */
/* Immersive like Reels: the feed covers the page (site header, footer and bottom nav stay in the DOM, underneath),
   and its own top bar is the way back out. */
body.reels-body { overflow: hidden; }
.reels { position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff; font-family: 'Noto Sans Devanagari', system-ui, sans-serif; }
.reels-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: linear-gradient(rgba(0, 0, 0, .55), transparent); pointer-events: none; }
.reels-bar > * { pointer-events: auto; }
.reels-bar h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.reels-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.reels-back i { font-size: 20px; }
.reels-back:hover, .reels-back:focus-visible { background: rgba(255, 255, 255, .14); }
.reels-sound { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 20px; cursor: pointer; }
.reels-sound:hover, .reels-sound:focus-visible { background: rgba(255, 255, 255, .28); }
.reels-sound:focus-visible, .reels-back:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.reels-track { height: 100%; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; }
.reels-track::-webkit-scrollbar { display: none; }

/* One reel per screen. Desktop: a centred 9:16 stage with the actions in a column beside it; info overlays the stage. */
.reel { position: relative; display: grid; grid-template-columns: auto auto; grid-template-rows: minmax(0, 1fr); justify-content: center; align-items: end; column-gap: 16px; height: 100%; padding: 64px 16px 20px; box-sizing: border-box; scroll-snap-align: start; scroll-snap-stop: always; }
.reel-stage { grid-area: 1 / 1; position: relative; height: 100%; max-width: calc(100vw - 96px); overflow: hidden; border-radius: 14px; background: #111; }
.reel-stage :is(video, iframe, .reel-poster) { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: #000; }
.reel-stage iframe { pointer-events: none; } /* our tap layer handles play/pause */
/* A paused YouTube embed shows YouTube's "More videos" panel (embeds cannot turn it off), so while a YouTube short
   is not playing its frame is hidden and the cover image underneath shows with our play button instead. */
.reel[data-kind="youtube"]:not(.is-playing) .reel-stage iframe { opacity: 0; }
/* Facebook reels (SDK player): fill the 9:16 stage; hidden while paused so its "More in Video" panel never shows. */
.reel-stage .fb-video, .reel-stage .fb-video > span, .reel-stage .fb-video iframe { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
.reel[data-kind="facebook"]:not(.is-playing) .reel-stage .fb-video { opacity: 0; }
/* While a Facebook reel plays, taps go to Facebook's own controls: browsers allow sound in Facebook's frame only after
   a tap inside it (its speaker button). Paused, our tap layer and cover image are back on top. */
.reel[data-kind="facebook"].is-playing .reel-stage .fb-video iframe { pointer-events: auto; }
.reel[data-kind="facebook"].is-playing [data-reel-tap] { pointer-events: none; }
.reel-tap { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: #fff; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.reel-tap:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.reel-tap-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(0, 0, 0, .45); font-size: 40px; opacity: 1; transition: opacity .2s, transform .2s; }
.reel.is-playing .reel-tap-icon { opacity: 0; transform: scale(.85); }
.reel-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: rgba(255, 255, 255, .25); }
.reel-progress span { display: block; width: 0; height: 100%; background: #fff; }

/* width:0 + min-width:100% fills the stage's column without widening it: otherwise a long description sets the
   column's width and the actions drift away from the video. */
.reel-info { grid-area: 1 / 1; align-self: end; z-index: 3; width: 0; min-width: 100%; box-sizing: border-box; padding: 72px 16px 18px; border-radius: 0 0 14px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .55) 35%, rgba(0, 0, 0, .88)); pointer-events: none; }
.reel-info a { pointer-events: auto; }
.reel-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; font: 600 12px/1.4 system-ui, sans-serif; color: rgba(255, 255, 255, .82); }
.reel-cat { padding: 2px 8px; border-radius: 999px; background: var(--red, #d52a31); color: #fff; font-weight: 800; }
.reel-title { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 800; }
.reel-title a { color: #fff; text-decoration: none; }
.reel-title a:hover { text-decoration: underline; }
.reel-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: rgba(255, 255, 255, .86); }

.reel-actions { grid-area: 1 / 2; align-self: end; z-index: 3; display: grid; gap: 16px; padding-bottom: 8px; }
.reel-act { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; color: #fff; font: 700 11px/1.2 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.reel-act i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .14); font-size: 21px; transition: background .15s; }
.reel-act:hover i, .reel-act:focus-visible i { background: rgba(255, 255, 255, .28); }
.reel-act:focus-visible { outline: none; }
.reel-act:focus-visible i { outline: 2px solid #fff; outline-offset: 2px; }
.reel-act.is-whatsapp i { background: #1f9d55; }
.reel-act[data-copied="1"] i { background: #16a34a; }

.reels-more { display: block; margin: 24px auto; padding: 10px 20px; width: max-content; border-radius: 999px; background: #fff; color: #000; font-weight: 800; text-decoration: none; }
.reels.is-enhanced .reels-more { display: none; }
.reels-empty { display: grid; place-items: center; align-content: center; gap: 6px; height: 100%; padding: 24px; text-align: center; color: rgba(255, 255, 255, .8); }
.reels-empty i { font-size: 40px; }
.reels-empty h2 { margin: 0; font-size: 20px; color: #fff; }
.reels-empty a { color: #fff; }

/* Phones: edge to edge, everything overlaid on the video like Reels/Shorts. */
@media (max-width: 760px) {
  .reel { grid-template-columns: minmax(0, 1fr); padding: 0; column-gap: 0; }
  .reel-stage { width: 100%; max-width: none; aspect-ratio: auto !important; border-radius: 0; }
  .reel-info { padding: 90px 72px calc(22px + env(safe-area-inset-bottom)) 16px; border-radius: 0; }
  .reel-actions { grid-area: 1 / 1; justify-self: end; padding: 0 10px calc(26px + env(safe-area-inset-bottom)); }
  .reel-act { text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
  .reel-act i { width: 44px; height: 44px; background: rgba(0, 0, 0, .35); }
}
@media (prefers-reduced-motion: reduce) {
  .reels-track { scroll-behavior: auto; }
  .reel-tap-icon, .reel-act i { transition: none; }
}

/* ───────────────────────── Long video: YouTube-style watch page ───────────────────────── */
.watch { padding-top: 20px; padding-bottom: 40px; }
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.watch-main { min-width: 0; }

/* Player */
.vp { position: relative; overflow: hidden; border-radius: 14px; background: #000; color: #fff; }
.vp-frame { position: relative; width: 100%; }
.vp-frame :is(video, iframe, .vp-poster) { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.vp-frame .vp-poster { object-fit: cover; }
.vp.is-custom .vp-frame iframe { pointer-events: none; } /* clicks go to our layer, which drives the player */
.vp-click { position: absolute; inset: 0 0 52px; z-index: 1; cursor: pointer; }
.vp-big { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; margin: auto; width: 76px; height: 76px; border: 0; border-radius: 50%; background: var(--red, #d52a31); color: #fff; font-size: 40px; cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); transition: transform .15s; }
.vp-big:hover { transform: scale(1.06); }
.vp-big:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.vp-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 26px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); transition: opacity .25s; }
.vp.is-playing.is-idle .vp-bar { opacity: 0; }
.vp.is-playing.is-idle { cursor: none; }
.vp-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 20px; cursor: pointer; }
.vp-btn:hover, .vp-btn:focus-visible { background: rgba(255, 255, 255, .16); }
.vp-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.vp-time { flex: none; font: 600 12.5px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-seek, .vp-vol { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .3); accent-color: var(--red, #d52a31); cursor: pointer; }
.vp-seek { flex: 1; min-width: 60px; background: linear-gradient(var(--red, #d52a31), var(--red, #d52a31)) 0 / var(--vp-fill, 0%) 100% no-repeat, rgba(255, 255, 255, .3); }
.vp-vol { width: 80px; flex: none; }
.vp-seek::-webkit-slider-thumb, .vp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--red, #d52a31); }
.vp-seek::-moz-range-thumb, .vp-vol::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--red, #d52a31); }
.vp-seek:focus-visible, .vp-vol:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vp:fullscreen { border-radius: 0; display: grid; align-content: center; }
.vp:fullscreen .vp-frame { height: 100vh; aspect-ratio: auto !important; }

/* Title, byline/share, description */
.watch-title { margin: 14px 0 0; font-size: calc(21px * var(--reading-scale, 1)); line-height: 1.4; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.watch .md-share-follow .story-byline { margin-top: 10px; padding-top: 0; border-top: 0; }
.watch .md-share-follow { margin-top: 2px; }
.watch-desc { position: relative; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--ink); }
.watch-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 6px; font: 700 13px/1.5 system-ui, sans-serif; }
.watch-chip { padding: 1px 9px; border-radius: 999px; background: var(--card-bg); color: var(--red-text); text-decoration: none; }
.watch-chip:hover { text-decoration: underline; }
.watch-desc-body { font-size: 14px; line-height: 1.75; }
.watch-text { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.watch-credit, .watch-related { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.watch-related span { font-weight: 700; color: var(--ink); }
.watch-related a { color: var(--red-text); }
.watch-sub { margin: 14px 0 6px; font-size: 15px; font-weight: 800; }
.watch-desc.is-collapsed .watch-desc-body { max-height: 5.25em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.watch-more { margin-top: 2px; padding: 0; border: 0; background: none; color: var(--ink); font: 800 13px/1.4 system-ui, sans-serif; cursor: pointer; }
.watch-more:hover { text-decoration: underline; }
.watch-more:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Up next */
.watch-next { display: grid; gap: 10px; min-width: 0; }
.watch-next h2 { margin: 0 0 2px; font-size: 16px; font-weight: 800; color: var(--ink); }
.next-card { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; align-items: start; color: var(--ink); text-decoration: none; border-radius: 10px; }
.next-card:hover strong { color: var(--red-text); }
.next-card:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.next-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 26px; }
.next-thumb img { width: 100%; height: 100%; object-fit: cover; }
.next-dur { position: absolute; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .8); color: #fff; font: 700 11px/1.4 system-ui, sans-serif; }
.next-text { display: grid; gap: 3px; min-width: 0; }
.next-text strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; line-height: 1.45; font-weight: 700; }
.next-text small { font: 12px/1.4 system-ui, sans-serif; color: var(--muted); }
.next-empty { margin: 0; font-size: 13px; color: var(--muted); }
.next-all { justify-self: start; margin-top: 4px; color: var(--red-text); font-weight: 800; font-size: 13px; text-decoration: none; }
.next-all:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .watch-grid { grid-template-columns: minmax(0, 1fr); }
  .next-card { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  /* Phones: the player runs edge to edge like the YouTube app. */
  .watch { padding-top: 0; }
  .watch-main > .vp { margin: 0 calc(-1 * var(--shell-gutter, 16px)); border-radius: 0; }
  .watch-title { font-size: calc(18px * var(--reading-scale, 1)); }
  .vp-vol { display: none; }
  .next-card { grid-template-columns: 150px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .vp-bar, .vp-big { transition: none; }
}
