.gallery-groups {
  padding-block: clamp(24px, 5vw, 60px);
}
.gallery-page .gallery-group {
  padding: 0 !important;
  border: 0;
  overflow: visible;
}
.gallery-group + .gallery-group {
  margin-top: clamp(26px, 5vw, 52px);
}
.gallery-group h2 {
  margin: 0 0 16px;
  color: #23262d;
  font-size: clamp(19px, 2.5vw, 25px);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
}
.gallery-photo {
  min-width: 0;
  margin: 0;
  border: 1px solid #ebdfe0;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(65, 20, 25, .07);
}
.gallery-photo a {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2f3f5;
}
.gallery-photo a:focus-visible {
  outline: 3px solid #d71920;
  outline-offset: -4px;
}
.gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-photo a span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #a90f19;
}
.gallery-photo figcaption {
  padding: 12px 15px;
  color: #30343b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
@media (max-width: 800px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
}

.gallery-modal {
  width: min(1000px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid #49444a;
  border-radius: 16px;
  background: #201e23;
  color: #fff;
}
.gallery-modal::backdrop { background: rgba(12, 10, 14, .82); }
.gallery-modal-panel { padding: 10px clamp(10px, 2vw, 20px); }
.gallery-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gallery-modal-count { padding-inline: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.gallery-modal button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid #6b626b;
  border-radius: 50%;
  background: #332f36;
  color: #fff;
  font: 26px/1 system-ui, sans-serif;
  cursor: pointer;
}
.gallery-modal button:hover { background: #4b424c; }
.gallery-modal button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gallery-modal-image {
  display: block;
  width: 100%;
  height: min(68dvh, 680px);
  margin-block: 8px;
  object-fit: contain;
}
.gallery-modal-caption { margin: 0; text-align: center; font-size: 14px; line-height: 1.5; }
