/* Uniform thumbnail grid for the PhotoSwipe gallery shortcode.
   Overrides the theme's grid-wXX utility classes (used for the old
   Packery masonry layout) with a responsive CSS grid of square tiles. */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

@media (min-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .photo-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.photo-grid > a {
  display: block;
  position: relative;
  width: 100% !important;
  aspect-ratio: 1 / 1;
  margin: 0 !important;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.photo-grid > a img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.photo-grid > a:hover img {
  transform: scale(1.08);
}

/* One thumbnail per year on the galleries index page */
.gallery-year-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0 2rem;
}

@media (min-width: 640px) {
  .gallery-year-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-year-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-year-item {
  display: block;
  text-decoration: none;
}

.gallery-year-item > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
}

.gallery-year-item:hover > img {
  transform: scale(1.05);
}

.gallery-year-label {
  display: block;
  margin-top: 0.5rem;
  text-align: center;
  font-weight: 600;
  color: rgb(var(--color-neutral-700));
}

.dark .gallery-year-label {
  color: rgb(var(--color-neutral-300));
}
