/* G2 Motion (add-on `motion`). Classes only: the CSP allows no inline style.
   The stage is as tall as its still, whose width and height attributes reserve
   the box before the image arrives, so nothing shifts (CLS) when a canvas or a
   video is added over it. A site that wants a taller runway sets its own height
   on the stage; the still, the canvas and the video then fill it. */
[data-g2-motion="scene"],
[data-g2-motion="video-scrub"] {
  position: relative;
  overflow: hidden;
}

[data-g2-motion="scene"] > img:first-child,
[data-g2-motion="video-scrub"] > img:first-child {
  display: block;
  width: 100%;
  height: auto;
}

/* A stage the site made taller than its still: the still covers it. */
[data-g2-motion].g2-motion-fill > img:first-child {
  height: 100%;
  object-fit: cover;
}

.g2-motion-canvas,
.g2-motion-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.g2-motion-video {
  object-fit: cover;
  opacity: 0;
}

.g2-motion-video.is-on {
  opacity: 1;
}

/* The music button: the site styles its look; these are the states. */
[data-g2-motion="music"] {
  cursor: pointer;
}

[data-g2-motion="music"][hidden] {
  display: none;
}

[data-g2-motion="music"]:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

[data-g2-motion="music"][aria-pressed="true"] {
  opacity: 1;
}

[data-g2-motion="music"][aria-pressed="false"] {
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .g2-motion-canvas,
  .g2-motion-video {
    display: none;
  }
}
