/* ==========================================================================
   media-player.css — shared pieces of the custom players (.mpl):
   icon buttons, play / pause and volume icon swaps, timeline + volume
   ranges, skip buttons, speed label, buffering spinner, error message.
   Each player sits on a dark surface (video picture / blue audio panel),
   so its buttons use the site's "on dark" hover: cream fill, navy ink.
   Layout of each player: video-page.css and audio-page.css.
   ========================================================================== */

/* The player controls run left-to-right in both page directions, so the LTR
   build (src/build.js → rtlcss) leaves this whole file as it is. */
/*rtl:begin:ignore*/

.mpl {
  --mpl-ink: var(--color-white);
  --mpl-track: rgba(255, 255, 255, .22);
  --mpl-buffer: rgba(255, 255, 255, .42);
  --mpl-fill: var(--color-white);
  --mpl-gold: var(--color-gold-500);
  --mpl-gold-hover: var(--color-gold-300);
  --mpl-navy: var(--color-navy-700);
  position: relative;
  color: var(--mpl-ink);
}

.mpl:focus {
  outline: none;
}

.mpl svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* solid icons (play, pause, previous, next) */
.mpl svg.mpl__fill,
.apm svg.mpl__fill {
  fill: currentColor;
  stroke: none;
}

.mpl__media {
  display: block;
}

/* --------------------------------------------------------------------------
   Icon swaps driven by the root state classes (media-player.js)
   -------------------------------------------------------------------------- */
.mpl__i-pause,
.mpl__i-mute,
.mpl__i-fsx,
.is-playing .mpl__i-play,
.is-muted .mpl__i-vol,
.is-fs .mpl__i-fs {
  display: none !important;
}

.is-playing .mpl__i-pause,
.is-muted .mpl__i-mute,
.is-fs .mpl__i-fsx {
  display: block !important;
}

/* --------------------------------------------------------------------------
   Round icon buttons
   -------------------------------------------------------------------------- */
.mpl__btn {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}

@media (hover: hover) {
  .mpl__btn:hover {
    background: var(--hover-cream);
    border-color: var(--hover-cream-border);
    color: var(--hover-cream-ink);
  }
}

.mpl__btn:focus-visible,
.mpl__play:focus-visible,
.mpl__big:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .85);
}

.mpl__btn:disabled {
  opacity: .35;
  cursor: default;
  background: transparent;
  border-color: transparent;
  color: inherit;
}

/* "10" inside the circular-arrow icons */
.mpl__skipn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

/* playback speed: a pill with the rate as text */
.mpl__speed {
  width: auto;
  min-width: 52px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, .3);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Volume: mute button + short range (pointer devices only)
   -------------------------------------------------------------------------- */
.mpl__vol {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   Ranges (timeline + volume). --p = played / level, --b = buffered (0–100%),
   set by media-player.js. The controls run left-to-right (dir="ltr").
   -------------------------------------------------------------------------- */
.mpl__seek,
.mpl__volr {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  margin: 0;
  padding: 0;
  height: 22px;
  background: transparent;
  cursor: pointer;
  --p: 0%;
  --b: 0%;
}

.mpl__seek {
  width: 100%;
}

.mpl__volr {
  width: 84px;
}

.mpl__seek:focus,
.mpl__volr:focus {
  outline: none;
}

.mpl__seek::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(to right,
    var(--mpl-fill) 0 var(--p),
    var(--mpl-buffer) var(--p) var(--b),
    var(--mpl-track) var(--b) 100%);
}

.mpl__volr::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--mpl-fill) 0 var(--p), var(--mpl-track) var(--p) 100%);
}

.mpl__seek::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(to right,
    var(--mpl-fill) 0 var(--p),
    var(--mpl-buffer) var(--p) var(--b),
    var(--mpl-track) var(--b) 100%);
}

.mpl__volr::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--mpl-fill) 0 var(--p), var(--mpl-track) var(--p) 100%);
}

.mpl__seek::-webkit-slider-thumb,
.mpl__volr::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: var(--mpl-fill);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  transition: box-shadow .2s ease;
}

.mpl__volr::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
}

.mpl__seek::-moz-range-thumb,
.mpl__volr::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--mpl-fill);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.mpl__seek:focus-visible::-webkit-slider-thumb,
.mpl__volr:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .35);
}

.mpl__seek:focus-visible::-moz-range-thumb,
.mpl__volr:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .35);
}

/* --------------------------------------------------------------------------
   Time read-out, buffering spinner, error message
   -------------------------------------------------------------------------- */
.mpl__time,
.mpl__t {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mpl__spin {
  display: none;
  pointer-events: none;
}

.is-waiting .mpl__spin {
  display: block;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: var(--color-white);
  animation: mpl-spin .8s linear infinite;
}

@keyframes mpl-spin {
  to {
    transform: rotate(360deg);
  }
}

.mpl__err {
  margin: 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(180, 35, 42, .92);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.mpl__err[hidden] {
  display: none;
}

/* Touch screens: the device buttons set the volume */
@media (hover: none) {
  .mpl__volr {
    display: none;
  }
}

/* Touch screens: a taller hit area and a bigger handle on the timeline
   (the visible track stays 5px) so it can be dragged with a finger */
@media (pointer: coarse) {
  .mpl__seek {
    height: 32px;
  }

  .mpl__seek::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6.5px;
  }

  .mpl__seek::-moz-range-thumb {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-waiting .mpl__spin {
    animation-duration: 2s;
  }
}
/*rtl:end:ignore*/
