.gallery-grid.masonry-gallery {
  display: block;
  position: relative;
  width: calc(100% - 48px);
  max-width: 1360px;
  padding: 0;
  margin: 0 auto 80px;
}

.masonry-gallery .gallery-item {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 8px;
  outline: none;
  background: var(--mint);
}

.masonry-gallery .gallery-trigger {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.masonry-gallery .gallery-trigger img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  user-select: none;
  transition: transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.masonry-gallery .gallery-item:hover img,
.masonry-gallery .gallery-trigger:focus-visible img {
  transform: scale(1.07);
}

.masonry-gallery figcaption {
  inset: auto 0 0;
  margin: 0;
  padding: 44px 18px 18px;
  background: linear-gradient(transparent, rgba(10, 40, 24, 0.8));
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 350ms ease, transform 500ms ease;
}

.masonry-gallery .gallery-item:hover figcaption,
.masonry-gallery .gallery-item:focus-within figcaption {
  opacity: 1;
  transform: none;
}

.masonry-gallery .gallery-item:focus-within {
  outline: 3px solid var(--brand-green);
  outline-offset: 3px;
}

.masonry-gallery .is-dragging {
  z-index: 5;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.masonry-gallery .is-dragging .gallery-trigger {
  cursor: grabbing;
}

@media (hover: none) {
  .masonry-gallery figcaption {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 600px) {
  .gallery-grid.masonry-gallery {
    width: calc(100% - 36px);
    margin-bottom: 48px;
  }
}

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