/*
 * Real device photos.
 *
 * The device boxes were designed for the CSS device art, whose size is set in --art-size units. A photo dropped into
 * them sized itself from its own width (height: 100% does not resolve inside these centred grid boxes), so a square
 * photo spilled out of the 10rem card box over the title and specs, and was cropped top and bottom in the 4:3 product
 * stage. Each photo now fills its box absolutely and is scaled to fit inside it.
 *
 * object-fit: scale-down = "contain, but never enlarge": a photo smaller than its box stays at its own size instead of
 * being stretched (stretching a 360px photo to 550px is what made it soft on the device page).
 */
.device-card__media,
.comparison-table__thumb,
.device-slot__media,
.product-media__stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.device-card__media > img.device-art-img,
.comparison-table__thumb > img.device-art-img,
.device-slot__media > img.device-art-img,
.product-media__stage > img.product-media__img {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: var(--space-2, 0.5rem);
  object-fit: scale-down;
}

.product-media__stage > img.product-media__img {
  padding: var(--space-6, 1.5rem);
}

.gallery__img,
.lightbox__img {
  object-fit: scale-down;
}
