.amagansett-gallery {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: clamp(.7rem, 1.4vw, 1.4rem);
}

.amagansett-gallery .photo { aspect-ratio: 3 / 4; }
.amagansett-gallery .amagansett-closet { grid-column: 1 / 3; aspect-ratio: 16 / 10; }
.amagansett-gallery .amagansett-laundry { grid-column: 3; grid-row: 1 / 3; aspect-ratio: auto; }
.amagansett-gallery .photo:nth-child(4) { align-self: end; aspect-ratio: 4 / 3; }

@media (max-width: 820px) {
  .amagansett-gallery { grid-template-columns: 1fr; }
  .amagansett-gallery .photo,
  .amagansett-gallery .amagansett-closet,
  .amagansett-gallery .amagansett-laundry,
  .amagansett-gallery .photo:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
}

.shutter-gallery .photo-wide img,
.shutter-gallery .photo:nth-child(2) img,
.shutter-gallery .photo:nth-child(3) img {
  object-position: center;
}

.cherry-gallery {
  grid-template-columns: repeat(3, 1fr);
}

.cherry-gallery .photo-wide,
.cherry-gallery .photo:nth-child(2),
.cherry-gallery .photo:nth-child(3),
.cherry-gallery .photo:nth-child(4),
.cherry-gallery .photo:nth-child(5),
.cherry-gallery .photo:nth-child(6) {
  grid-column: auto;
  aspect-ratio: 4 / 3;
}

@media (max-width: 820px) {
  .cherry-gallery { grid-template-columns: repeat(2, 1fr); }
  .cherry-gallery .photo-wide,
  .cherry-gallery .photo:nth-child(2),
  .cherry-gallery .photo:nth-child(3),
  .cherry-gallery .photo:nth-child(4),
  .cherry-gallery .photo:nth-child(5),
  .cherry-gallery .photo:nth-child(6) {
    grid-column: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 520px) {
  .cherry-gallery { grid-template-columns: 1fr; }
}

/* Unified portfolio grid: consistent proportions and balanced rows. */
.gallery-feature {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-feature .photo-wide,
.gallery-feature .photo:not(.photo-wide),
.gallery-pair .photo:first-child,
.gallery-pair .photo:last-child,
.gallery-three .photo:first-child,
.gallery-three .photo:nth-child(2),
.gallery-three .photo:nth-child(3) {
  grid-column: auto;
  aspect-ratio: 4 / 3;
  align-self: stretch;
}

.gallery-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.amagansett-gallery {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.amagansett-gallery .photo,
.amagansett-gallery .amagansett-closet,
.amagansett-gallery .amagansett-laundry,
.amagansett-gallery .photo:nth-child(4) {
  grid-row: auto;
  aspect-ratio: 4 / 3;
  align-self: stretch;
}

.amagansett-gallery .photo:nth-child(1),
.amagansett-gallery .photo:nth-child(2),
.amagansett-gallery .photo:nth-child(3) {
  grid-column: span 2;
}

.amagansett-gallery .photo:nth-child(4),
.amagansett-gallery .photo:nth-child(5) {
  grid-column: span 3;
}

.story-gallery .photo img {
  object-position: center;
}

@media (max-width: 820px) {
  .gallery-feature,
  .gallery-pair,
  .gallery-three,
  .amagansett-gallery,
  .cherry-gallery {
    grid-template-columns: 1fr;
  }

  .gallery-feature .photo-wide,
  .gallery-feature .photo:not(.photo-wide),
  .gallery-pair .photo,
  .gallery-three .photo,
  .amagansett-gallery .photo,
  .amagansett-gallery .amagansett-closet,
  .amagansett-gallery .amagansett-laundry,
  .cherry-gallery .photo {
    grid-column: 1;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
}

.watermill-gallery .photo:not(.photo-wide) { aspect-ratio: 3 / 4; }
