/* Consistent photographic frames; page text retains its reading margins. */
#main :is(.art img, .photo-open > img, .story-image img, .split-picture img, .guji-portrait img) {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  margin: 0;
  padding: 0;
  border: 0;
  transform: none;
}
#main :is(.photo-open, .story-image, .split-picture, .guji-portrait) {
  display: block;
  width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
}
#main .hero-slot img,
#main .page-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center !important;
  padding: 0;
  margin: 0;
  border: 0;
}
#main .hero-slot::before { content: none; }
#main :is(.grounds-images, .grounds-history-photos, .ritual-grid, .gallery-grid, .stone-photo-grid) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 32px;
  align-items: start;
  max-width: none;
}
#main .grounds-history-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#main :is(.grounds-images, .grounds-history-photos, .ritual-grid, .gallery-grid, .stone-photo-grid) > figure {
  margin: 0;
  padding: 0;
  min-width: 0;
  grid-column: auto;
  grid-row: auto;
}
#main .story-pair { align-items: start; }
#main .story-pair > article { margin-top: 0; padding-top: 0; }
#main .intro-shrine .art img { aspect-ratio: 3 / 2; }
.lightbox {
  width: min(900px, calc(100vw - 32px), calc((100dvh - 200px) * var(--photo-ratio, .75)));
  height: fit-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 24px);
  padding: 44px 0 12px;
  overflow: auto;
}
.lightbox figure { height: auto; margin: 0; flex: none; }
.lightbox figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: cover;
  margin: 0;
  padding: 0;
}
.lightbox figcaption { margin: 12px 16px 0; }
.lightbox-controls { min-height: 40px; flex: none; }
.lightbox-controls > button { padding: 5px 18px; }
@media (max-width: 600px) {
  #main :is(.grounds-images, .grounds-history-photos, .ritual-grid, .gallery-grid, .stone-photo-grid) {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }
}
