.gallery figure > button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.gallery figure > button span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 9px 13px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 14px #143d3b33;
  font-size: 11px;
  font-weight: 700;
}
.activity-gallery-modal[hidden] { display: none; }
.activity-gallery-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 56px 24px 20px;
  background: #071f1ded;
}
.activity-gallery-modal figure {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
}
.activity-gallery-modal figure img {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
}
.activity-gallery-modal figcaption { margin-top: 10px; color: #fff; font-size: 12px; }
.activity-gallery-close,
.activity-gallery-prev,
.activity-gallery-next { border: 0; background: #ffffff1f; color: #fff; cursor: pointer; }
.activity-gallery-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}
.activity-gallery-prev,
.activity-gallery-next { width: 48px; height: 64px; border-radius: 5px; font-size: 42px; }
.activity-gallery-prev { grid-column: 1; grid-row: 1; }
.activity-gallery-next { grid-column: 3; grid-row: 1; }
.activity-gallery-thumbs {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  justify-content: center;
  gap: 7px;
  overflow-x: auto;
}
.activity-gallery-thumbs button {
  flex: 0 0 82px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 2px solid transparent;
  background: #fff3;
  opacity: .55;
  cursor: pointer;
}
.activity-gallery-thumbs button.active { border-color: #fff; opacity: 1; }
.activity-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 620px) {
  .gallery figure > button span { right: 10px; bottom: 10px; }
  .activity-gallery-modal { grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 54px 8px 14px; }
  .activity-gallery-prev, .activity-gallery-next { width: 40px; height: 54px; }
  .activity-gallery-thumbs { justify-content: flex-start; }
  .activity-gallery-thumbs button { flex-basis: 68px; }
}
