.has-video-preview .contents-image {
  isolation: isolate;
  background: #060708;
}

.has-video-preview .contents-image > .video-poster,
.has-video-preview .contents-image > .contents-video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  transform-origin: center;
  transition: opacity 220ms ease, filter 300ms ease, transform 300ms ease;
}

.has-video-preview .contents-image > .video-poster {
  opacity: .68;
  filter: saturate(.5);
}

.has-video-preview .contents-image > .contents-video {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.has-video-preview .contents-image::after {
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgb(199 207 215 / .12);
}

.has-video-preview:is(:hover, :focus-visible, .is-previewing) .contents-image > .video-poster {
  opacity: 1;
  filter: saturate(1);
  transform: scale(1.02);
}

.has-video-preview:is(:hover, :focus-visible, .is-previewing) .contents-image::after {
  box-shadow: inset 0 0 0 1px var(--accent, #F07855);
}

.has-video-preview.is-video-playing .contents-image > .contents-video {
  opacity: 1;
  transform: scale(1.02);
}

.video-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .has-video-preview .contents-image > .video-poster,
  .has-video-preview .contents-image > .contents-video {
    transition: none;
    transform: none !important;
  }
}
