/* Punjabi badge that pops in next to a pronunciation player while it plays.
   Markup from layouts/_shortcodes/audio.html (reveal parameter), toggled by
   static/js/audio-reveal.js adding .is-playing to .gt-audio-pair. */

.gt-audio-pair {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4em;
}

/* The player must never be squeezed by the badge beside it. Without this the
   flex default (shrink: 1) compresses the <audio> in narrow cells and the play
   button gets clipped — it showed up on exactly the rows with the longest
   badge text. Let the badge wrap underneath instead. */
.gt-audio-pair .pronunciation-audio {
  flex: 0 0 auto;
}

.gt-audio-reveal {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  white-space: nowrap;
  gap: 0.45em;
  padding: 0.15em 0.7em;
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  font-size: 0.95em;
  line-height: 1.6;

  /* Hidden until the player starts. */
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* German word, then its meaning — the pairing the reader is hearing. */
.gt-audio-de {
  color: var(--color-primary);
  font-weight: 600;
}

.gt-audio-pa {
  color: var(--color-text-secondary);
}

/* Thin divider between the two, so they read as one unit rather than two. */
.gt-audio-de::after {
  content: "·";
  margin-left: 0.45em;
  color: var(--color-text-muted);
  font-weight: 400;
}

.gt-audio-pair.is-playing .gt-audio-reveal {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .gt-audio-reveal { transition: none; transform: none; }
  .gt-audio-pair.is-playing .gt-audio-reveal { transform: none; }
}
