/* Keep the complete original inside a definite frame, including tall portraits.
   Taking the image out of intrinsic grid sizing prevents percentage-height
   images from overflowing an aspect-ratio frame and being clipped. */
.album-image:not(.deity-word),
.photo-preview:not(.deity-word) {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.album-image.deity-cover,
.deity-photo .photo-preview {
  --photo-inset: .75rem;
}
.album-image:not(.deity-word) > img,
.photo-preview:not(.deity-word) > img {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: scale-down;
  object-position: center;
  padding: var(--photo-inset, 0);
  margin: 0;
  border: 0;
}
.album-image:not(.deity-word) > .deity-group,
.photo-preview:not(.deity-word) > .deity-group {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: var(--photo-inset, 0);
}
.album-image .deity-group img,
.photo-grid .photo-preview .deity-group img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: scale-down;
  object-position: center;
  margin: 0;
  border: 0;
}
.album-card > img {
  height: auto;
  aspect-ratio: auto;
  object-fit: scale-down;
  object-position: center;
}

/* The four northern portraits have different original proportions. Equal
   4:5 frames are wider than all four originals, so complete photos share
   the same rendered height and aligned top/bottom edges. */
.photo-preview .deity-group,
.album-image .deity-group {
  grid-template-rows: auto;
  align-content: center;
  align-items: start;
}
.deity-group > span,
.deity-group > a {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
}
.album-image .deity-group img,
.photo-grid .photo-preview .deity-group img {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  padding: 0;
}
