/* Read-aloud: one bare icon button. The play icon turns into a pause icon while reading (data-state, set by post-speech.js). */

.post-speech {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 1rem 0 1.25rem;
}

.post-speech .vps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem; /* Invisible: a comfortable tap target around the bare icon. */
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--color-heading, #0a4b95);
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
}

.vps-btn svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vps-btn .vps-pause {
  display: none;
}

.vps-btn[data-state="playing"] .vps-play {
  display: none;
}

.vps-btn[data-state="playing"] .vps-pause {
  display: block;
}

/* Green while it is reading. */
.vps-btn[data-state="playing"] {
  color: var(--color-accent, #1da64a);
}

.vps-btn:hover:not(:disabled) {
  color: var(--color-accent, #1da64a);
  transform: translateY(-1px);
}

.vps-btn:focus-visible {
  outline: 2px solid var(--color-brand-blue, #0f82cb);
  outline-offset: 2px;
}

.vps-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* The status ("Reading…", "Paused.") is for screen readers only: the icon already shows the state. */
.post-speech-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .post-speech .vps-btn {
    transition: none;
    transform: none;
  }
}
