/* ==========================================================================
   Sound toggle (added to the header by assets/js/fa-sound.js)
   A round outline button like the menu button beside it: a speaker with waves while sound is on, a
   crossed-out speaker while it is off. It takes the header's colour (light text over dark sections,
   navy over light ones).
   ========================================================================== */
.sound-toggle { position: relative; flex-shrink: 0; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); transition: border-color 0.3s, background-color 0.3s; -webkit-tap-highlight-color: transparent; }
.site-header.is-light .sound-toggle { border-color: rgba(14, 49, 121, 0.25); }
/* (only where there is hover: on a touch screen the tint would stay after the tap) */
@media (hover: hover) {
  .sound-toggle:hover { background-color: rgba(226, 231, 234, 0.08); }
  .site-header.is-light .sound-toggle:hover { background-color: rgba(14, 49, 121, 0.05); }
  .menu-open .site-header .sound-toggle:hover { background-color: rgba(226, 231, 234, 0.08); }
}
.sound-toggle:focus-visible { border-radius: 50%; }
/* two drawings in one cell, the far wave's over the speaker's (see fa-sound.js) */
.sound-toggle svg { grid-area: 1 / 1; width: 22px; height: 22px; overflow: visible; }

/* the waves grow out of the speaker; the cross turns away */
.sound-toggle__waves { transition: opacity 0.4s; }
.sound-toggle__waves path, .sound-toggle__mute { transform-box: fill-box; transition: opacity 0.35s var(--ease), transform 0.55s var(--ease); }
.sound-toggle__waves path { transform-origin: 0 50%; }
.sound-toggle__far path { transition-delay: 0.06s; }
.sound-toggle__mute { transform-origin: 50% 50%; }
.sound-toggle[aria-pressed="false"] .sound-toggle__waves path { opacity: 0; transform: scale(0.4); }
.sound-toggle[aria-pressed="true"] .sound-toggle__mute { opacity: 0; transform: scale(0.4) rotate(45deg); }
/* on, but this page has not been pressed yet, so the browser does not let it play: the waves wait, dim */
.sound-toggle[aria-pressed="true"]:not(.is-live) .sound-toggle__waves { opacity: 0.45; }
/* playing: the outer wave breathes, slowly (its whole drawing, so the compositor runs it; reduced motion:
   fa.css's global rule stops it) */
.sound-toggle.is-live .sound-toggle__far { animation: sound-breathe 3.2s ease-in-out infinite; }
@keyframes sound-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Narrow phones: three controls beside the logo. A slightly smaller button and closer spacing keep the
   menu button inside the screen down to 320px. */
@media (max-width: 420px) {
  .sound-toggle { width: 44px; height: 44px; }
  .site-header .header-tools { gap: 8px; }
  .site-header .bar { gap: 12px; }
}
@media (max-width: 350px) {
  .sound-toggle { width: 40px; height: 40px; }
  .sound-toggle svg { width: 20px; height: 20px; }
  .site-header .header-tools { gap: 6px; }
  .site-header .bar { gap: 8px; }
}
@media (max-width: 340px) {
  .sound-toggle { width: 38px; height: 38px; }
  .site-header .header-tools { gap: 5px; }
  .site-header .bar { gap: 6px; }
  .site-header .lang { padding-inline: 8px; }
}
