.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.gallery .box {
  margin: 0;
}

.gallery figure,
.box figure {
  margin: 0;
  position: relative;
}

.gallery .img,
.box .img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #f2eee9;
  background-size: cover;
  background-position: center;
}

.gallery img,
.box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery figcaption,
.box figcaption {
  margin-top: 10px;
  color: #5b5149;
  font-size: 14px;
  line-height: 1.5;
}

.gallery a[itemprop="contentUrl"],
.box a[itemprop="contentUrl"] {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.simple-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(20, 16, 12, 0.92);
  z-index: 9999;
}

.simple-lightbox.is-open {
  display: flex;
}

.simple-lightbox__dialog {
  position: relative;
  max-width: min(92vw, 1280px);
  max-height: 92vh;
}

.simple-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.simple-lightbox__caption {
  margin-top: 12px;
  color: #f6efe7;
  text-align: center;
  font-size: 14px;
}

.simple-lightbox__close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}
