/* Correct the sideways hens in display only; original and WebP files stay intact. */
.artwork:has(img[data-display-rotation="-90"]) {
  position: relative;
  aspect-ratio: 2048 / 1192;
}

.gallery-item .artwork img[data-display-rotation="-90"] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58.203125%;
  max-width: none;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.gallery-item:hover .artwork img[data-display-rotation="-90"] {
  transform: translate(-50%, -50%) rotate(-90deg) scale(1.018);
}

/* A correctly sized frame keeps quarter-turn detail images inside the viewport. */
.lightbox-image-frame {
  position: relative;
  margin: 0 auto;
}

.lightbox-image-frame img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  height: auto;
}

.lightbox .lightbox-nav,
.lightbox .lightbox-close {
  z-index: 2;
}
