.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 260px;
  gap: 1rem;
  height: auto;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.gallery-grid img:hover {
  filter: saturate(1.05);
  transform: scale(1.015);
}

.gallery-grid img:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-grid img:nth-child(7n + 5),
.gallery-grid img:nth-child(7n + 9) {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 300px;
  }

  .gallery-grid img:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 300px;
  }

  .gallery-grid img,
  .gallery-grid img:first-child,
  .gallery-grid img:nth-child(7n + 5),
  .gallery-grid img:nth-child(7n + 9) {
    grid-column: auto;
    height: 100%;
    margin-bottom: 0;
  }
}
