/* ============================================================
   MOTION TOGGLE — components/motion-toggle.css
   Pause button for anything that moves for more than 5 s
   (WCAG 2.2.2 Pause, Stop, Hide). Logic in motion-toggle.js.
   aria-pressed="true" = paused → shows the play icon.
   ============================================================ */

.motion-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(22, 18, 13, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  z-index: 5;
}
.motion-toggle:hover {
  background: rgba(22, 18, 13, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
}
.motion-toggle:active { transform: scale(0.94); }
.motion-toggle:focus-visible {
  outline: 2px solid var(--primary-on-dark);
  outline-offset: 3px;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle-play { display: none; }
.motion-toggle[aria-pressed="true"] .motion-toggle-pause { display: none; }
.motion-toggle[aria-pressed="true"] .motion-toggle-play  { display: block; }

/* Light background variant */
.motion-toggle--on-light {
  color: var(--text-primary);
  background: var(--surface);
  border-color: var(--border-strong);
}
.motion-toggle--on-light:hover {
  background: var(--surface-subtle);
  border-color: rgba(0, 0, 0, 0.28);
}
.motion-toggle--on-light:focus-visible { outline-color: var(--primary-solid); }

/* ── Positions ──
   --hero / --video: bottom-right corner of a full-width section,
   aligned with the container edge.
   --corner: bottom-right corner of a box with position: relative
   (video players, mockups). */
.motion-toggle--hero,
.motion-toggle--video {
  position: absolute;
  right: max(var(--sp-3), calc((100vw - var(--max-w)) / 2 + var(--sp-3)));
  bottom: var(--sp-3);
}
.motion-toggle--corner {
  position: absolute;
  right: var(--sp-2);
  bottom: var(--sp-2);
}

/* ── Paused state ──
   Freezes all the block's CSS animations. Videos and JS animations
   are stopped by motion-toggle.js. */
.is-paused,
.is-paused *,
.is-paused *::before,
.is-paused *::after {
  animation-play-state: paused !important;
}
