/* One row height, irrespective of the source image's aspect ratio.
 * Row-major source order is retained (no dense packing/reordering).
 * Full, uncropped originals remain available through the lightbox/PDF. */
.mm-model-page .mm-gallery-shell { container-type: inline-size; min-width: 0; }
.mm-model-page .mm-gallery {
  grid-auto-flow: row;
  grid-auto-rows: calc((100cqw - 36px) / 3);
  align-items: stretch;
}
.mm-model-page .mm-gallery .mm-gallery-item {
  min-width: 0;
  min-height: 0;
  height: 100% !important;
  aspect-ratio: auto !important;
  padding: 0;
  margin: 0;
  overflow: hidden;
  text-decoration: none;
  border: 0;
  background: none;
  grid-column: span 1;
}
.mm-model-page .mm-gallery .mm-gallery-item.mm-span-2 { grid-column: span 2; }
.mm-model-page .mm-gallery .mm-gallery-item img,
.mm-model-page .mm-gallery .mm-gallery-item video {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
@media (max-width: 760px) {
  .mm-model-page .mm-gallery { grid-auto-rows: calc((100cqw - 8px) / 3 * 1.32); }
  .mm-model-page .mm-gallery .mm-gallery-item.mm-span-2 { grid-column: span 1; }
}
