.gallery figure > button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery figure > button .activity-gallery-count {
  z-index: 2;
  top: 16px;
  right: auto;
  bottom: auto;
  left: 16px;
  color: #fff;
  background: rgba(10,39,45,.78);
  letter-spacing: .1em;
}
.gallery figure > button .activity-gallery-count b { margin-right: 3px; font-size: 14px; }
.gallery figure > button .activity-gallery-more { z-index: 2; right: 12px; bottom: 12px; }
.activity-gallery-preview {
  display: flex;
  gap: 8px;
  width: min(1180px,92vw);
  margin: 10px auto 0;
  overflow-x: auto;
  padding: 0 0 4px;
}
.activity-gallery-preview button {
  position: relative;
  flex: 0 0 105px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  background: #dce9e7;
  cursor: zoom-in;
  opacity: .8;
  transition: .2s;
}
.activity-gallery-preview button:first-child,
.activity-gallery-preview button:hover { border-color: var(--teal); opacity: 1; }
.activity-gallery-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.activity-gallery-preview span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7,31,29,.68);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
@media (max-width: 620px) {
  .gallery figure > button .activity-gallery-count { top: 10px; right: auto; bottom: auto; left: 10px; }
  .activity-gallery-preview { width: calc(100% - 28px); margin-top: 9px; }
  .activity-gallery-preview button { flex-basis: 82px; }
}
.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; }
}
