/* The site's video player (video_player_dialog() in layout.php, assets/js/videos.js): used by the home page and by /lessons. */
/* the player: a dialog over the page with the site's own buttons; the YouTube frame inside has its own controls switched off */
.hm-player { width: min(1120px, 96vw); max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 18px; overflow: hidden; background: #0f0a26; color: #fff; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .7); }
.hm-player::backdrop { background: rgba(18, 9, 48, .88); }
html:has(.hm-player[open]) { overflow: hidden; }
.hm-player-box { display: flex; flex-direction: column; background: #0f0a26; }
.hm-player-stage { position: relative; aspect-ratio: 16 / 9; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); background: #000; }   /* on a short screen (a phone on its side) the player gets shorter, and the controls below it stay in view */
.hm-player-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hm-player-shield { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }   /* catches every click, so nothing of YouTube's own page can be pressed */
.hm-player-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; background: linear-gradient(160deg, var(--indigo) 0%, var(--indigo-deep) 100%); text-align: center; }
.hm-player-end[hidden] { display: none; }
.hm-player-end p { margin: 0; font: 700 clamp(1.4rem, 1rem + 1.6vw, 2rem)/1.2 var(--serif); }
.hm-player-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hm-player-bar { display: flex; align-items: center; gap: 8px; padding: 8px clamp(8px, 1.6vw, 16px); }
.hm-pc { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; transition: background-color .15s; }
.hm-pc[hidden] { display: none; }
.hm-pc:hover { background: rgba(255, 255, 255, .14); }
.hm-pc:focus-visible, .hm-player-shield:focus-visible, .hm-pc-seek:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hm-pc svg { width: 26px; height: 26px; fill: currentColor; }
.hm-pc .i-pause, .hm-pc .i-muted { display: none; }
.is-playing .hm-pc .i-play { display: none; }
.is-playing .hm-pc .i-pause { display: block; }
.is-muted .hm-pc .i-sound { display: none; }
.is-muted .hm-pc .i-muted { display: block; }
.hm-pc-seek { flex: 1 1 auto; min-width: 0; height: 44px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.hm-pc-time { flex: none; min-width: 5.6em; color: #e6dffb; font-size: .95rem; font-variant-numeric: tabular-nums; text-align: center; }
.hm-player.is-wide { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
.hm-player.is-wide .hm-player-box { height: 100%; justify-content: center; background: #000; }
.hm-player.is-wide .hm-player-stage { flex: 1 1 auto; aspect-ratio: auto; max-height: none; }
.hm-player-box:fullscreen { justify-content: center; background: #000; }
.hm-player-box:fullscreen .hm-player-stage { flex: 1 1 auto; aspect-ratio: auto; }
.hm-player-box:-webkit-full-screen { justify-content: center; background: #000; }
.hm-player-box:-webkit-full-screen .hm-player-stage { flex: 1 1 auto; aspect-ratio: auto; }
@media (max-width: 700px) {
  .hm-player { width: 100vw; border-radius: 0; }
  .hm-player-stage { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
  .hm-player-bar { flex-wrap: wrap; row-gap: 0; }
  .hm-pc-seek { order: -1; flex: 1 0 100%; }   /* on a phone the progress bar gets a row of its own */
  .hm-pc-time { min-width: 0; font-size: .9rem; }
  .hm-pc-mute { margin-inline-start: auto; }   /* play and the clock on one side, sound / full screen / close on the other */
}
