/* Lesson player: floating glass bar over the picture, docked under it on a narrow player.
   Shared by the Vimeo and archive adapters. Controls come from billy-portal-controls.js.
   Reference: 137 Launch/design/player-and-key-points-2026-11-23/player-final.html */
.student-player-surface.pg { --pg-gold:#f9a72b; --pg-ink:#1a0d22; }
.pg .vp-stage { border-radius:10px; }
.pg.pg-narrow .vp-stage { border-radius:10px 10px 0 0; }
.pg-hit { position:absolute; inset:0; z-index:2; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
.pg-ripple { position:absolute; top:50%; z-index:4; translate:0 -50%; width:18%; aspect-ratio:1; border-radius:50%; display:grid; place-items:center; background:#ffffff30; color:#fff; font:600 clamp(12px,3.4vw,20px) Montserrat,system-ui,sans-serif; opacity:0; pointer-events:none; }
.pg-ripple.pg-left { left:4%; } .pg-ripple.pg-right { right:4%; }
.pg-ripple.on { animation:pg-rip .6s ease-out; }
@keyframes pg-rip { 0% { opacity:0; scale:.8; } 25% { opacity:1; } 100% { opacity:0; scale:1.15; } }
.pg-btn { position:relative; display:inline-grid; place-items:center; flex:none; width:40px; height:40px; padding:0; margin:0; border:0; border-radius:10px; background:none; color:#fff; cursor:pointer; transition:background .15s; }
.pg-btn:hover { background:#ffffff1f; }
.pg-btn svg { width:26px; height:26px; fill:currentColor; }
.pg-btn[aria-pressed="true"]::after { content:""; position:absolute; left:9px; right:9px; bottom:4px; height:3px; border-radius:2px; background:var(--pg-gold); }
.pg :focus-visible { outline:2px solid #8fe0ff; outline-offset:2px; }
.pg-centre { position:absolute; left:50%; top:50%; z-index:3; translate:-50% -50%; width:clamp(52px,9%,84px); height:auto; aspect-ratio:1; border-radius:50%; background:#ffffff26; border:1px solid #ffffff55; -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); transition:opacity .2s; }
.pg-centre svg { width:28px; height:28px; margin-left:3px; }
@media (min-width:561px) { .pg-centre svg { width:38px; height:38px; margin-left:4px; } }
.pg-centre:hover { background:#ffffff3a; }
.pg-playing .pg-centre { opacity:0; pointer-events:none; }

/* the bar, wide: floating over the picture */
.pg-glass { position:absolute; left:50%; bottom:14px; z-index:5; translate:-50% 0; width:min(94%,760px); box-sizing:border-box; display:flex; align-items:center; gap:4px; padding:6px 12px 6px 6px; border-radius:999px; background:#140a1ccc; -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); border:1px solid #ffffff26; transition:opacity .25s; color:#fff; font:13px/1.2 Montserrat,system-ui,sans-serif; }
.pg-idle:not(.pg-narrow) .pg-glass { opacity:0; pointer-events:none; }
.pg-time { font-variant-numeric:tabular-nums; font-size:13px; color:#fff; white-space:nowrap; }
.pg-track { --pos:calc(7px + (100% - 14px) * var(--f,0) / 100); flex:1; position:relative; min-width:60px; height:34px; margin-left:10px; display:flex; align-items:center; }
.pg-track::before { content:""; position:absolute; left:0; right:0; top:50%; height:4px; translate:0 -50%; border-radius:4px; background:linear-gradient(90deg,var(--pg-gold) var(--pos),#ffffff40 var(--pos)); }
.pg-track::after { content:""; position:absolute; left:var(--pos); top:50%; width:14px; height:14px; translate:-50% -50%; box-sizing:border-box; border-radius:50%; background:var(--pg-gold); border:2px solid var(--pg-ink); box-shadow:0 0 0 1px #ffffff40; pointer-events:none; z-index:3; }
.pg-seek { -webkit-appearance:none; appearance:none; position:relative; z-index:1; width:100%; height:34px; margin:0; background:none; cursor:pointer; }
.pg-seek::-webkit-slider-runnable-track { height:34px; background:none; border:0; }
.pg-seek::-moz-range-track { height:34px; background:none; border:0; }
.pg-seek::-webkit-slider-thumb { -webkit-appearance:none; box-sizing:border-box; width:14px; height:14px; margin-top:10px; border:0; border-radius:50%; background:transparent; }
.pg-seek::-moz-range-thumb { box-sizing:border-box; width:14px; height:14px; border:0; border-radius:50%; background:transparent; }
.pg-marks { position:absolute; inset:0; z-index:2; pointer-events:none; }

/* settings menu */
.pg-menu { position:absolute; right:12px; bottom:74px; z-index:20; box-sizing:border-box; width:min(280px,calc(100% - 20px)); display:flex; flex-direction:column; gap:10px; padding:10px; border:1px solid #ffffff2e; border-radius:14px; background:#26112f; box-shadow:0 16px 44px #000a; color:#fff; font:14px/1.4 Montserrat,system-ui,sans-serif; }
.pg-menu[hidden] { display:none; }
.pg-menu h4 { margin:0 0 6px; padding:0 4px; font:600 12px/1 Montserrat,system-ui,sans-serif; letter-spacing:.08em; text-transform:uppercase; color:#a99ab5; }
.pg-chips { display:flex; flex-wrap:wrap; gap:6px; }
.pg-chip { min-height:34px; padding:6px 12px; border:1px solid #4a3158; border-radius:999px; background:#331f3d; color:#cabdd3; font:inherit; font-size:13px; cursor:pointer; margin:0; }
.pg-chip[aria-pressed="true"] { color:#8fe0ff; border-color:#8fe0ff; }

/* resume chip */
.pg-resume { position:absolute; top:10px; left:50%; z-index:6; translate:-50% 0; display:flex; align-items:center; gap:6px; padding:3px 6px 3px 14px; border:1px solid #806d89; border-radius:999px; background:#26112ff2; color:#fff; font:13px/1.3 Montserrat,system-ui,sans-serif; white-space:nowrap; max-width:calc(100% - 16px); }
.pg-resume button { min-height:32px; padding:6px 8px; margin:0; border:0; background:none; color:#8fe0ff; font:inherit; cursor:pointer; }

/* narrow: the bar sits under the picture in one row, always visible */
.pg-narrow .pg-glass { position:static; translate:none; width:auto; flex-wrap:wrap; gap:2px; padding:8px 8px 10px; border-radius:0 0 10px 10px; border:0; border-top:1px solid #3a2646; background:linear-gradient(180deg,#26112F,#1D0B27); -webkit-backdrop-filter:none; backdrop-filter:none; }
.pg-narrow .pg-track { order:-2; flex:1 0 100%; margin:0 4px; }
.pg-narrow .pg-time { order:-1; flex:1 0 100%; text-align:right; font-size:12px; color:#cabdd3; margin:0 6px 2px; }
.pg-narrow .pg-glass .pg-btn { flex:1 1 0; min-width:0; width:auto; height:48px; border-radius:12px; }
.pg-narrow .pg-glass .pg-btn svg { width:28px; height:28px; }
.pg-narrow .pg-glass .pg-play { background:var(--pg-gold); color:var(--pg-ink); }
.pg-narrow .pg-glass .pg-play:hover { background:#ffb84a; }
.pg-narrow .pg-menu { left:0; right:0; bottom:0; width:auto; border-radius:16px 16px 10px 10px; padding:12px 14px; max-height:100%; overflow:auto; }
.pg-narrow .pg-chip { min-height:44px; }
.pg-narrow .pg-ripple { font-size:clamp(12px,5vw,20px); }

/* fullscreen: picture, bar and menu fill the screen together */
.student-player-surface.pg:fullscreen { display:flex; flex-direction:column; width:100vw; height:100vh; margin:0; border-radius:0; background:#000; }
.student-player-surface.pg:fullscreen .vp-stage { flex:1; min-height:0; aspect-ratio:auto; border-radius:0; }
@media (prefers-reduced-motion:reduce) { .pg-glass, .pg-centre, .pg-btn { transition:none; } .pg-ripple.on { animation:none; } }

.podcast-vimeo { position: relative; }
.podcast-vimeo .vp-stage { position: relative; }
.podcast-vimeo .vp-stage iframe { position: absolute; inset: 0; }
.podcast-vimeo .pg-menu { bottom: 74px; }
.podcast-vimeo.pg-narrow .pg-menu { bottom: 0; }
.podcast-vimeo.pg-playing .pg-centre:focus-visible { opacity: 1; pointer-events: auto; }
.podcast-vimeo:fullscreen .vp-stage iframe { object-fit: contain; }
.podcast-playback-status { margin: .5rem 0 0; }
.podcast-playback-status:empty { display: none; }

.podcast-vimeo .pg-caption-strip {
  display: grid;
  place-items: center;
  min-height: 3.5rem;
  padding: .5rem .75rem;
  background: #100815;
  color: #fff;
  text-align: center;
  white-space: pre-line;
  font: 500 clamp(.875rem, 2vw, 1.125rem)/1.4 general-sans, sans-serif;
}
.podcast-vimeo .pg-caption-strip[hidden] { display: none; }
