/* Enlarged hover preview for the Wagtail image chooser modal.
   Driven by image_chooser_hover_preview.js.

   The image sits in a fixed-size frame and is scaled to fit inside it
   (object-fit: contain), so the preview looks the same regardless of the
   source image resolution or aspect ratio. The source resolution is shown
   in a caption below the image. JS positions the popup next to the cursor
   via `transform`. */
.image-chooser-hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: 460px;
  padding: 4px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 44px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
  z-index: 100000;
}

.image-chooser-hover-preview--visible {
  opacity: 1;
}

.image-chooser-hover-preview__img {
  display: block;
  width: 100%;
  height: 452px;
  object-fit: contain;
  border-radius: 4px;
}

.image-chooser-hover-preview__meta {
  margin-top: 4px;
  padding: 4px 2px 2px;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: #333;
}

.image-chooser-hover-preview__meta:empty {
  display: none;
}
