/* Video player (player.js; every video on the site, the sales share page and the admin's Play page). From the Holarch site's
   player styles: the picture, a control bar below it (never over the captions), and the chapter list under the
   player. Uses site.css tokens; the bar is always dark (it frames the picture), with the brand's light teal as its
   accent in both themes (contrast 9.6:1 on --vp-bg). Without player.js the native <video controls> stay and only
   .vplayer's frame applies. */
:root { --vp-bg: #0c1716; --vp-fg: #ffffff; --vp-fg2: #c9dbd8; --vp-mute: #8fa6a2; --vp-acc: #4fd1c1; --vp-focus: #7fe0d3; }

.vplayer { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-lg); overflow: hidden; }
.vplayer video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; object-fit: contain; }

.vp { margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--vp-bg); color: var(--vp-fg);
  box-shadow: var(--shadow-2); }
.vp:focus { outline: none; }
.vp .vplayer.vp-frame { border-radius: 0; }
.vp-frame video { cursor: pointer; }
.vp-big { position: absolute; inset-inline-start: 50%; top: 50%; width: 76px; height: 76px; margin-block: -38px 0;
  margin-inline: -38px 0; border: 0; border-radius: 50%; background: rgba(12, 23, 22, .74); color: var(--vp-fg);
  cursor: pointer; display: grid; place-items: center; padding: 0; min-height: 0; box-shadow: none; }
.vp-big svg { width: 40px; height: 40px; fill: currentColor; margin-inline-start: 4px; }
.vp-big:hover { background: rgba(14, 113, 106, .94); border: 0; }
.vp-big[hidden] { display: none; }

.vp-bar { position: relative; padding: 6px 12px 8px; background: var(--vp-bg); }
.vp-scrub { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.vp-segs { display: flex; gap: 3px; width: 100%; height: 5px; transition: height .12s; }
.vp-scrub.vp-hover .vp-segs, .vp-scrub:focus-visible .vp-segs { height: 8px; }
.vp-seg { position: relative; flex: 1 1 0; min-width: 2px; height: 100%; background: rgba(255, 255, 255, .22); border-radius: 2px;
  overflow: hidden; transition: transform .12s; }
.vp-seg.vp-seg-hot { transform: scaleY(1.35); }
.vp-buf, .vp-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; }
.vp-buf { background: rgba(255, 255, 255, .35); }
.vp-fill { background: var(--vp-acc); }
.vp-knob { position: absolute; top: 50%; width: 14px; height: 14px; margin-block: -7px 0; margin-inline: -7px 0; border-radius: 50%;
  background: var(--vp-acc); box-shadow: 0 0 0 2px var(--vp-bg); pointer-events: none; transform: scale(0); transition: transform .12s; }
.vp-scrub.vp-hover .vp-knob, .vp-scrub:focus-visible .vp-knob, .vp.vp-started .vp-knob { transform: scale(1); }
.vp-tip { position: absolute; bottom: 26px; left: 0; transform: translateX(-50%); max-width: 260px; padding: 5px 9px; border-radius: var(--r-sm);
  background: rgba(12, 23, 22, .95); border: 1px solid rgba(255, 255, 255, .18); font-size: 13px; line-height: 1.35; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .1s; white-space: nowrap; z-index: 2; }
.vp-scrub.vp-hover .vp-tip { opacity: 1; }
.vp-tip-title { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.vp-tip-title:empty { display: none; }
.vp-tip-time { display: block; color: var(--vp-fg2); font-variant-numeric: tabular-nums; }

.vp-row { display: flex; align-items: center; gap: 4px; min-height: 40px; }
.vp-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r-sm); background: none; color: var(--vp-fg);
  cursor: pointer; display: grid; place-items: center; padding: 0; min-height: 0; box-shadow: none; }
.vp-btn svg { width: 24px; height: 24px; fill: currentColor; }
.vp-btn:hover { background: rgba(255, 255, 255, .12); border: 0; }
.vp-cc[aria-pressed="false"] { opacity: .65; }
.vp-cc[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--vp-acc); }
.vp-vol { width: 80px; min-height: 0; padding: 0; margin: 0; border: 0; background: none; accent-color: var(--vp-acc); }
.vp-time { margin-inline-start: 8px; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-cur { margin-inline-start: 10px; font-size: 14px; color: var(--vp-fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vp-cur:not(:empty)::before { content: "· "; color: var(--vp-mute); }
.vp-grow { flex: 1 1 0; min-width: 0; }
.vp-lang { width: auto; min-width: 40px; padding: 0 6px; display: flex; align-items: center; gap: 4px; font: inherit; font-size: 12px;
  font-weight: 600; letter-spacing: .02em; }
.vp-lang svg { width: 20px; height: 20px; }
.vp-lang[hidden], .vp-langs[hidden], .vp-btn[hidden], .vp-lang-field[hidden] { display: none; }
.vp-lang[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
.vp-langs { position: absolute; inset-inline-end: 8px; bottom: 100%; z-index: 5; display: grid; gap: 10px; min-width: 220px; margin-bottom: 6px;
  padding: 12px; border-radius: var(--r); background: rgba(12, 23, 22, .97); border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.vp-lang-field { display: grid; gap: 4px; margin: 0; font-size: 13px; font-weight: 400; color: var(--vp-fg2); }
.vp-langs select, .vp-speed { width: auto; min-height: 0; height: 34px; border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--r-sm);
  background: var(--vp-bg); color: var(--vp-fg); font: inherit; font-size: 14px; padding: 0 6px; cursor: pointer; margin: 0; }
.vp-speed { height: 32px; font-size: 13px; }
.vp-live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.vp :focus-visible { outline: 2px solid var(--vp-focus); outline-offset: 2px; }
.vp-scrub:focus-visible { outline-offset: 0; border-radius: 4px; }

/* full screen: the picture fills the screen (whole, letterboxed); the controls overlay it and hide when idle (player.js) */
.vp.vp-fs { position: relative; display: block; width: 100%; height: 100%; border-radius: 0; margin: 0; background: #000; box-shadow: none; }
.vp.vp-fs .vplayer.vp-frame { position: absolute; inset: 0; aspect-ratio: auto !important; height: 100%; }
.vp.vp-fs .vp-bar { position: absolute; inset-inline: 0; bottom: 0; z-index: 4; background: linear-gradient(transparent, rgba(12, 23, 22, .92) 30%);
  padding-top: 28px; transition: opacity .25s; }
.vp.vp-fs.vp-idle .vp-bar { opacity: 0; pointer-events: none; }
.vp.vp-fs.vp-idle, .vp.vp-fs.vp-idle video { cursor: none; }

/* the chapter list under the player: a disclosure (open on wide screens), the current chapter marked */
.vp-chapters { margin: var(--s3) 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.vp-chapters summary { padding-block: 12px; padding-inline: 14px 40px; }
.vp-chapters summary::after { inset-inline-end: 16px; }
.vp-chapters ol { margin: 0; padding: 0 6px 8px; list-style: none; }
.vp-chapters li { margin: 0; }
.vp-ch { display: flex; gap: 12px; width: 100%; min-height: 0; padding: 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--fg);
  font: inherit; font-size: 16px; font-weight: 400; line-height: 1.4; text-align: start; cursor: pointer; box-shadow: none; justify-content: flex-start; }
.vp-ch:hover { background: var(--surface-2); border: 0; color: var(--fg); }
.vp-ch:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.vp-ch[aria-current="true"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.vp-ch-t { flex: none; min-width: 52px; font-variant-numeric: tabular-nums; color: var(--muted); }
.vp-ch[aria-current="true"] .vp-ch-t { color: var(--brand-strong); }

@media (max-width: 640px) {
  .vp-langs { inset-inline-start: 8px; inset-inline-end: 8px; min-width: 0; }
  .vp-lang { padding: 0 4px; }
  .vp-vol, .vp-cur { display: none; }
  .vp-time { margin-inline-start: 2px; font-size: 13px; }
  .vp-btn { width: 36px; height: 40px; }
  .vp-row { gap: 0; }
  .vp-scrub { height: 30px; }
  .vp-segs { height: 6px; }
  .vp-speed { max-width: 64px; }
}
/* narrow phones: with the Language button the row is one button too wide, so picture in picture goes (phones offer it
   from their own full-screen player) and the speed menu narrows */
@media (max-width: 420px) { .vp-pip { display: none; } .vp-speed { max-width: 54px; padding: 0 2px; } .vp-btn { width: 34px; } }
@media (prefers-reduced-motion: reduce) { .vp-segs, .vp-seg, .vp-knob, .vp-tip, .vp-bar { transition: none; } }
