/* A clip over its poster: the product gallery's panel and a banner draw the
   poster as their picture, and the <video> lies on top of it, see-through
   until it plays (the script adds .is-playing once the browser says it can
   play to the end without stalling). On a slow line it never does, and the
   poster simply stays. The box it lies in is the panel's or the banner's,
   which both position their children. */
.clip-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.clip-video.is-playing {
  opacity: 1;
}

/* The one control a clip has (WCAG 2.2.2: moving content that starts by
   itself must be stoppable). Like the strip's pause it shows what a press
   does: pause while the clip plays, play once it stands
   (aria-pressed="true"). Drawn hidden; the script shows it with the clip. */
.clip-toggle {
  position: absolute;
  inset-inline-end: var(--space-3);
  inset-block-end: var(--space-3);
  z-index: 2;
  /* It floats over a picture, which is dark in both themes as far as a
     control is concerned: the scrim's ground and the hero's ink, never the
     theme's secondary button, which vanished on a light theme's photo. */
  background: var(--scrim-strong);
  border-color: transparent;
  color: var(--hero-ink);
}

.clip-toggle:hover {
  background: var(--scrim-ink);
  color: var(--hero-ink);
}

.clip-toggle .icon + .icon,
.clip-toggle[aria-pressed="true"] .icon:first-child {
  display: none;
}

.clip-toggle[aria-pressed="true"] .icon + .icon {
  display: inline-block;
}

/* The mark on a gallery thumb that is a clip: a play sign over the poster,
   on a disc so it reads on any picture. */
.clip-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.clip-badge .icon {
  padding: var(--space-2);
  border-radius: 50%;
  background: var(--scrim-strong);
  color: var(--hero-ink);
}
