.gallery article {
  position: relative;
}

.gallery .caption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  align-items: flex-end;
  margin: 0;
  padding: 70px 18px 17px;
  border: 0;
  background: linear-gradient(transparent, rgba(8, 8, 7, .9));
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease, visibility .28s ease;
}

.gallery article:hover .caption,
.gallery article:focus-within .caption {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gallery .caption h3 {
  color: #fff;
}

.gallery .caption span {
  color: #d7ae5c;
}

.gallery .zoom {
  top: 12px;
  right: 12px;
  bottom: auto;
}

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