.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}
.gallery-open img { display: block; width: 100%; }
.gallery-open:focus-visible,
.gallery-viewer button:focus-visible {
  outline: 3px solid #f8cd28;
  outline-offset: 3px;
}
.gallery-viewer [hidden],
.gallery-viewer[hidden] { display: none; }
.gallery-viewer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  display: grid;
  justify-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .93);
  overscroll-behavior: contain;
}
.gallery-viewer__panel {
  width: min(1400px, 100%);
  min-height: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.gallery-viewer__viewport {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  container-type: size;
}
.gallery-viewer__stage {
  position: relative;
  max-width: 100%;
  line-height: 0;
}
.gallery-viewer__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  max-height: 100cqh;
  object-fit: contain;
  touch-action: pan-y;
}
.gallery-viewer button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #caa92d;
  background: #181b1a;
  color: #f7d039;
  cursor: pointer;
  line-height: 1;
}
.gallery-viewer__prev,
.gallery-viewer__next {
  grid-row: 1;
  justify-self: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}
.gallery-viewer__prev { grid-column: 1; }
.gallery-viewer__next { grid-column: 3; }
.gallery-viewer__prev::before,
.gallery-viewer__next::before {
  content: "";
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: translateX(-2px) rotate(45deg);
}
.gallery-viewer__prev::before { transform: translateX(2px) rotate(-135deg); }
.gallery-viewer__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 48px;
  height: 48px;
  font-size: 32px;
}
.gallery-viewer button.gallery-viewer__close { background: rgba(12, 14, 13, .88); }
.gallery-viewer button:hover { background: #f5cb2e; color: #111; }
.gallery-viewer button.gallery-viewer__close:hover { background: #f5cb2e; }
.gallery-viewer button:disabled { opacity: .35; cursor: default; }
.gallery-viewer__caption {
  grid-column: 1 / -1;
  text-align: center;
  color: #f5f3eb;
  padding: 4px 0;
  font: 16px/1.5 Arial, sans-serif;
}
.gallery-viewer__unavailable {
  box-sizing: border-box;
  width: min(450px, 55vw);
  max-width: 100%;
  min-height: 120px;
  padding: 54px 16px 12px;
  display: grid;
  place-items: center;
  background: #252826;
  color: #f5f3eb;
  font: 16px/1.4 Arial, sans-serif;
  text-align: center;
}
@media (max-width: 600px) {
  .gallery-viewer { padding: 12px; }
  .gallery-viewer__panel { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 4px; }
  .gallery-viewer__prev, .gallery-viewer__next { width: 38px; height: 44px; }
  .gallery-viewer__close { width: 44px; height: 44px; }
  .gallery-viewer__caption { font-size: 14px; }
}
