/* Our video player (videos/_player, video_player_controller.js): the full video's own colours, MALF's
   mint on navy, around a plain <video>. */
.video-player {
  --video-player-accent: #1ceb91;
  --video-player-ground: #031e3f;
  container-type: inline-size; /* the bar fits the player's own width (a short on a phone is narrow) */
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  outline: none;
}
.video-player-upright {
  aspect-ratio: 9 / 16;
  max-width: 420px;
}
.video-player:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--video-player-accent) 60%, transparent);
}
.video-player-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}
.video-player.idle,
.video-player.idle .video-player-video {
  cursor: none;
}

/* The big play button, until it plays. */
.video-player-big-play {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--video-player-accent);
  color: var(--video-player-ground);
  font-size: 3.5rem;
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.45);
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.video-player-big-play i {
  margin-left: 0.3rem; /* the triangle's weight sits left of its box */
}
.video-player-big-play:hover {
  transform: scale(1.06);
}
.video-player.playing .video-player-big-play {
  opacity: 0;
  pointer-events: none;
}

/* The bar: over the bottom of the picture, on a fade to navy; it leaves while it plays and the mouse rests. */
.video-player-bar {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 0.75rem 0.5rem;
  background: linear-gradient(to top, color-mix(in srgb, var(--video-player-ground) 92%, transparent), transparent);
  color: #fff;
  transition: opacity 0.25s ease;
}
.video-player.idle .video-player-bar {
  opacity: 0;
}
.video-player-button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
}
.video-player-button:hover {
  color: var(--video-player-accent);
}
.video-player-time {
  color: rgb(255 255 255 / 0.85);
  white-space: nowrap;
}
/* A narrow player keeps play, sound, download and fullscreen: the volume slider goes first (the mute
   button stays), then the time (the scrubber still shows how far along it is). */
@container (max-width: 420px) {
  .video-player-volume {
    display: none;
  }
}
@container (max-width: 260px) {
  .video-player-time {
    display: none;
  }
}

/* The scrubber: played in the accent, loaded in white, the rest faint. */
.video-player-scrubber,
.video-player-volume {
  appearance: none;
  height: 0.3rem;
  border-radius: 999px;
  cursor: pointer;
  accent-color: var(--video-player-accent);
}
.video-player-scrubber {
  display: block;
  width: 100%;
  margin-bottom: 0.4rem;
  background: linear-gradient(
    to right,
    var(--video-player-accent) var(--played, 0%),
    rgb(255 255 255 / 0.45) var(--played, 0%) var(--loaded, 0%),
    rgb(255 255 255 / 0.2) var(--loaded, 0%)
  );
}
.video-player-volume {
  width: 5rem;
  background: rgb(255 255 255 / 0.3);
}
.video-player-scrubber::-webkit-slider-thumb,
.video-player-volume::-webkit-slider-thumb {
  appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--video-player-accent);
  border: 0;
}
.video-player-scrubber::-moz-range-thumb,
.video-player-volume::-moz-range-thumb {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--video-player-accent);
  border: 0;
}
.video-player:fullscreen {
  border-radius: 0 !important;
  aspect-ratio: auto;
}
