/* The microphone beside the To-do add box (ATLAS-3503): tap, speak, and the words fill the box.
 *
 * Listening is shown three ways, so it never rests on colour alone: the glyph becomes a stop
 * square, a ring is drawn round the button, and the button is pressed for assistive tooling. */
.dw-todos .dw-todo-mic {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  color: var(--dw-cyan);
  cursor: pointer;
}
.dw-todo-mic-glyph {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.dw-todo-mic-glyph[data-glyph='stop'] {
  fill: currentColor;
}
.dw-todo-mic[aria-pressed='false'] .dw-todo-mic-glyph[data-glyph='stop'],
.dw-todo-mic[aria-pressed='true'] .dw-todo-mic-glyph[data-glyph='mic'] {
  display: none;
}
.dw-todos .dw-todo-mic[aria-pressed='true'] {
  border-color: var(--dw-gold);
  color: var(--dw-gold);
}
/* The ring breathes outward from the button's own edge while the microphone is open. */
.dw-todos .dw-todo-mic[aria-pressed='true']::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid var(--dw-gold);
  border-radius: inherit;
  pointer-events: none;
  animation: dw-todo-mic-listening 1.4s ease-out infinite;
}
@keyframes dw-todo-mic-listening {
  from {
    opacity: 0.9;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.18);
  }
}
/* Without motion the solid ring and the stop square still say it. */
@media (prefers-reduced-motion: reduce) {
  .dw-todos .dw-todo-mic[aria-pressed='true']::after {
    animation: none;
    opacity: 0;
  }
}
