/* The site's audio player (decision 0028, issue #50; media/podcastmanager/js/player.js).
   Takes the page's text colour, so it suits light and dark sections alike. */
.rraudio {
  --rraudio-line: color-mix(in srgb, currentColor 30%, transparent);
  --rraudio-fill: color-mix(in srgb, currentColor 8%, transparent);
  box-sizing: border-box;
  max-width: 40rem;
  margin: 1rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rraudio-line);
  border-radius: 0.5rem;
  background: var(--rraudio-fill);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* The chapter articles put the player in a dark "Listen while you read" box (.rr-audio-bar, inline
   background #1b1b1b) that colours its own lines but not itself, so the player would take the page's
   black: give it the box's white, centred like the box's lines (staging, 2026-11-30). */
.rr-audio-bar .rraudio { color: #fff; margin-left: auto; margin-right: auto; }
.rraudio-note { padding: 0.75rem; }
.rraudio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}
.rraudio-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}
.rraudio-button:hover:not(:disabled) { background: var(--rraudio-fill); }
.rraudio-button:focus-visible,
.rraudio-seek:focus-visible,
.rraudio-reload:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.rraudio-button:disabled { opacity: 0.4; cursor: default; }
.rraudio-button svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.rraudio-play { width: 3rem; height: 3rem; border: 2px solid currentColor; }
.rraudio-play svg { width: 1.75rem; height: 1.75rem; }
.rraudio-skip {
  position: absolute;
  bottom: 0.1rem;
  font-size: 0.6rem;
  font-weight: 700;
}
.rraudio-time {
  min-width: 3.25rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  text-align: center;
}
/* The seek bar is drawn here, not by the browser: with a light text colour Chrome drew the
   unplayed part as a thick dark bar. A thin line in the text colour; the played part is solid
   up to --rraudio-done, set by player.js. */
.rraudio-seek {
  --rraudio-done: 0%;
  flex: 1 1 8rem;
  min-width: 8rem;
  height: 1.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.rraudio-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, currentColor var(--rraudio-done), var(--rraudio-line) var(--rraudio-done));
}
.rraudio-seek::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, currentColor var(--rraudio-done), var(--rraudio-line) var(--rraudio-done));
}
.rraudio-seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  -webkit-appearance: none;
  appearance: none;
}
.rraudio-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
}
.rraudio-seek:disabled { opacity: 0.4; cursor: default; }
.rraudio-speed {
  width: auto;
  min-width: 3rem;
  padding: 0 0.5rem;
  border: 1px solid var(--rraudio-line);
  border-radius: 1rem;
  height: 2rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.rraudio-waiting .rraudio-play { animation: rraudio-pulse 1s ease-in-out infinite alternate; }
@keyframes rraudio-pulse { to { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .rraudio-waiting .rraudio-play { animation: none; } }
.rraudio-msg { margin: 0.5rem 0 0; font-size: 0.9rem; }
.rraudio-note .rraudio-msg { margin: 0; }
.rraudio-msg a { color: inherit; text-decoration: underline; }
.rraudio-reload {
  margin-left: 0.25rem;
  padding: 0.15rem 0.75rem;
  border: 1px solid currentColor;
  border-radius: 1rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.rraudio-video { display: block; width: 100%; max-width: 40rem; margin: 1rem 0; }
/* Phones: buttons and speed on the first row; the times and seek bar on the second. */
@media (max-width: 30rem) {
  .rraudio-back { order: 1; }
  .rraudio-play { order: 2; }
  .rraudio-forward { order: 3; }
  .rraudio-speed { order: 4; margin-left: auto; }
  .rraudio-bar::after { content: ''; order: 5; flex-basis: 100%; height: 0; }
  .rraudio-now { order: 6; min-width: 2.75rem; text-align: left; }
  .rraudio-seek { order: 7; flex: 1 1 0; min-width: 0; }
  .rraudio-total { order: 8; min-width: 2.75rem; text-align: right; }
}
