/* ==========================================================
   Hover-zoom for carousel images. Load AFTER carousel.css:
   <link rel="stylesheet" href="carousel-zoom.css">
   and add the script (once, in the <head>):
   <script src="carousel-zoom.js" defer></script>

   Only used on devices with a real mouse. Phones and tablets
   keep the normal carousel.
   ========================================================== */

.zoom-preview {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 480px;               /* the popup's width; change to taste */
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  object-fit: contain;
  background: #fff;
  border: 4px solid #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  pointer-events: none;       /* never gets in the way of the mouse */
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

.zoom-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .zoom-preview,
  .zoom-preview.is-visible {
    transition: none;
    transform: none;
  }
}

/* Hint that the image does something on hover (mouse devices only) */
@media (hover: hover) and (pointer: fine) {
  .carousel-item img {
    cursor: zoom-in;
  }
}
