.gallery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
}

.gallery figure {
  aspect-ratio: 4 / 5;
  border-radius: 4px;
}

.gallery figure.gallery-wide {
  grid-column: auto;
  aspect-ratio: 4 / 5;
}

.gallery img {
  display: block;
  transition: transform .45s ease;
}

.gallery figure:hover img {
  transform: scale(1.025);
}

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

  .gallery figure.gallery-wide {
    aspect-ratio: 4 / 5;
  }
}
