.gh-viewing-photo { overflow: hidden; }
.gh-photo-viewer {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(61rem, calc(100% - 2rem));
  height: min(53rem, calc(100% - 2rem));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: clamp(.75rem, 2vw, 1.6rem);
  border: 1px solid var(--gh-line);
  background: var(--gh-paper);
  color: var(--gh-ink);
  box-shadow: 0 1rem 5rem rgb(25 7 11 / .34);
}
.gh-photo-viewer:not([open]) { display: none; }
.gh-photo-viewer[open] { display: grid; grid-template-rows: auto minmax(4rem, 1fr) auto; gap: .6rem; }
.gh-photo-viewer::backdrop { background: rgb(32 13 17 / .8); }
.gh-viewer-bar, .gh-viewer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.gh-viewer-counter { font-size: .9rem; font-variant-numeric: tabular-nums; }
.gh-viewer-figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .65rem; min-height: 0; margin: 0; }
.gh-viewer-stage { min-height: 0; background: #efe3d9; }
.gh-viewer-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gh-viewer-figure figcaption { max-height: 25vh; overflow-y: auto; font-size: 1rem; line-height: 1.4; }
.gh-viewer-figure figcaption:empty, .gh-viewer-controls [hidden] { display: none; }
.gh-viewer-enquire {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-inline: auto;
  color: var(--gh-ink);
  text-align: center;
  font-weight: 600;
  line-height: 1.25;
  text-underline-offset: .2em;
}
.gh-photo-viewer button {
  min-height: 44px;
  min-width: 44px;
  padding: .4rem .95rem;
  border: 1px solid var(--gh-line);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.gh-photo-viewer button:hover { background: #ecd8cb; }
.gh-photo-viewer :is(a, button):focus-visible { outline: 2px solid var(--gh-ink); outline-offset: 2px; }
@media (max-width: 40rem), (max-height: 29rem) {
  .gh-photo-viewer {
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: max(.7rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) max(.7rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
    border: 0;
  }
}
