.gallery {
  background: #eef1ec;
}

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 58px;
}

.gallery-head > p {
  max-width: 460px;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 230px;
  gap: 14px;
}

.gallery-grid figure {
  margin: 0;
  overflow: hidden;
  background: #dfe6df;
}

.gallery-grid figure.wide {
  grid-column: span 2;
}

.gallery-grid figure.tall {
  grid-row: span 2;
}

.gallery-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease, filter .6s ease;
}

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

@media (max-width: 950px) {
  .gallery-head {
    display: block;
  }

  .gallery-head > p {
    margin-top: 25px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 260px;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-auto-rows: 180px;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-grid img {
    transition: none;
  }

  .gallery-grid figure:hover img {
    transform: none;
  }
}
