/* Gallery grid: every photo is a portrait (~2:3), so use even portrait tiles
   instead of the old masonry that cropped portraits into landscape frames
   and left ragged column ends. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.gallery-tile {
  aspect-ratio: 2 / 3;
}

@media (min-width: 40rem) {
  .gallery-grid {
    gap: 1rem;
  }
}

@media (min-width: 48rem) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Lightbox: keep tall photos inside the viewport width on phones. */
.gallery-lightbox-img {
  max-width: calc(100vw - 2rem);
  height: auto;
}

@media (min-width: 40rem) {
  .gallery-lightbox-img {
    max-width: calc(100vw - 5rem);
  }
}
