/* GPS Narration player bar and narrated-block highlight (narration.js). */
.gps-narration {
  position: sticky;
  top: var(--gps-narr-top, 0);
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 24px;
  padding: 10px 14px;
  border: 1px solid #d8dee4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  font-size: 14px;
  line-height: 1.3;
}
.gps-narration button {
  border: 1px solid #c9d1d9;
  border-radius: 999px;
  background: #f6f8fa;
  color: #24292f;
  padding: 5px 12px;
  font: inherit;
  cursor: pointer;
}
.gps-narration button:focus-visible { outline: 2px solid #0969da; outline-offset: 2px; }
.gps-narration .gps-narr-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: #0969da;
  background: #0969da;
  color: #fff;
  font-weight: 600;
}
.gps-narr-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
}
.gps-narration.is-playing .gps-narr-icon {
  width: 10px;
  height: 12px;
  border: 0;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
  box-sizing: border-box;
}
.gps-narr-progress {
  flex: 1 1 120px;
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: #e6eaef;
  cursor: pointer;
  touch-action: none;
}
/* A taller invisible hit area than the visible track. */
.gps-narr-progress::after { content: ""; position: absolute; inset: -10px 0; }
.gps-narr-progress:focus-visible { outline: 2px solid #0969da; outline-offset: 2px; }
.gps-narration .gps-narr-skip { padding: 5px 9px; line-height: 1; }
.gps-narr-progress-fill { display: block; width: 0; height: 100%; border-radius: 3px; background: #0969da; }
.gps-narr-time { font-variant-numeric: tabular-nums; color: #57606a; }
.gps-narration.is-error .gps-narr-play { background: #cf222e; border-color: #cf222e; }

.gps-narr-active {
  background: #fff8c5;
  box-shadow: -10px 0 0 #fff8c5, 10px 0 0 #fff8c5, -14px 0 0 #d4a72c;
  border-radius: 2px;
  transition: background-color .3s ease;
  scroll-margin-top: var(--gps-narr-offset, 150px);
}
pre.gps-narr-active, div.gps-narr-active { box-shadow: -4px 0 0 #d4a72c; }

/* Not played yet: the bar stays in the article instead of sticking. */
.gps-narration.is-idle { position: relative; top: auto; }

/* Not played yet and scrolled past: a compact Listen card on the right. */
.gps-narration.is-docked {
  position: fixed;
  z-index: 60;
  top: var(--gps-dock-top, 80px);
  right: 16px;
  width: 260px;
  margin: 0;
  flex-wrap: wrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}
/* Full-width pages have no sidebar to dock into: a small pill keeps clear of the text. */
.gps-narration.is-docked:not(.is-docked-sidebar) {
  top: auto;
  bottom: 16px;
  width: auto;
}
.gps-narration.is-docked:not(.is-docked-sidebar)::before { display: none; }

/* The copy that flies between places while the bar moves (narration.js morph()). */
.gps-narr-ghost {
  position: fixed !important;
  z-index: 70;
  margin: 0 !important;
  overflow: hidden;
  pointer-events: none;
  box-sizing: border-box;
}
.gps-narration.is-docked.is-docked-sidebar {
  left: var(--gps-dock-left);
  right: auto;
  width: var(--gps-dock-width);
}
.gps-narration.is-docked::before {
  content: attr(aria-label);
  flex-basis: 100%;
  font-weight: 600;
  color: #24292f;
}
.gps-narration.is-docked .gps-narr-skip,
.gps-narration.is-docked .gps-narr-progress,
.gps-narration.is-docked .gps-narr-speed { display: none; }

@media (prefers-reduced-motion: reduce) {
  .gps-narr-active { transition: none; }
}
@media (max-width: 767px) {
  /* The sidebar stacks below the article on small screens: dock as a bottom pill. */
  .gps-narration.is-docked,
  .gps-narration.is-docked.is-docked-sidebar {
    top: auto;
    bottom: 16px;
    left: auto;
    right: 16px;
    width: auto;
  }
  .gps-narration.is-docked::before { display: none; }
}
@media (max-width: 480px) {
  .gps-narration { padding: 8px 10px; }
  .gps-narr-progress { flex-basis: 40px; }
  .gps-narr-play-label { display: none; }
  .gps-narration .gps-narr-play { padding: 7px 12px; }
}
