/* Hover-scrub video thumbnails (see assets/js/thumb-scrub.js).
   The <picture> poster sets the size; the video sits on top and fades in
   once it has seeked to the same frame, so the swap is invisible. */

.thumb-scrub {
  position: relative;
  overflow: hidden;
  background: #1e1e1e;
  aspect-ratio: 16 / 9;
  /* keeps the rounded clip on the video in Safari while transformed */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  transform: scale3d(1, 1, 1);
}
.thumb-scrub picture { display: block; height: 100%; }
.thumb-scrub img,
.thumb-scrub video {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}
.thumb-scrub video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .25s ease-out;
  pointer-events: none;
}
.thumb-scrub.is-ready video { opacity: 1; }

@media screen and (min-width: 56.25em) {
  .thumb-scrub { border-radius: 8px; }
}

/* Same hover lift as the image thumbs, but on the wrapper so the video
   and the poster scale together. */
html.no-touch .thumb-scrub { transition: transform .2s ease-in-out; }
html.no-touch .thumb-scrub:hover { transform: scale3d(1.025, 1.025, 1); }
html.no-touch .thumb-image .thumb-scrub img,
html.no-touch .thumb-image .thumb-scrub img:hover { transform: none; transition: none; }
