/* mux-player-a11y.css
 * Accessibility overrides for Mux Player (@mux/mux-player v3).
 * Addresses three audit findings on the vendor's default theme:
 *   1. 2.4.7  no visible focus indicator on the "video player" region
 *   2. 2.4.7  invisible-but-focusable pre-play button after playback starts
 *   3. 1.4.10 playback rate control disappears below the theme's 470px breakpoint
 *
 * Pairs with mux-player-a11y.js, which sets [data-has-played].
 * Part names are vendor-defined — re-test after any mux-player upgrade.
 */

/* 1. Focus ring on the focusable player region.
      Outline is drawn outside the box; the player's absolutely positioned
      layers paint over an inset outline. The white shadow keeps the ring
      visible against both dark video frames and light posters. */
mux-player::part(controller):focus-visible {
  outline: 3px solid #A32035;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}

/* 2. Once playback has started the theme sets the centered pre-play button to
      opacity:0 + pointer-events:none, which leaves it in the tab order and the
      accessibility tree. visibility:hidden removes it from both. The delayed
      transition lets the theme's 0.3s fade finish before it disappears.
      Only applied after first play — before that it is the only visible
      play control on desktop. */
mux-player[data-has-played]::part(pre-play) {
  visibility: hidden;
  transition: visibility 0s linear .3s;
}

/* 3. The theme sets --bottom-playback-rate-menu-button: none below its "sm"
      breakpoint. This host-level variable is checked earlier in the theme's
      fallback chain, so it wins at every width.
      NOTE: if a shared stylesheet still sets --playback-rate-button: none,
      remove that rule rather than adding !important here. */
mux-player {
  --playback-rate-button: inline-flex;
}