.zoom-photo { cursor: zoom-in; }
html.photo-viewer-open { overflow: hidden; }
dialog.photo-viewer {
  margin: auto;
  padding: 0;
  width: min(860px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper, #f7f3e8);
  color: var(--ink, #382e23);
  border: 1px solid var(--green, #43533e);
}
.photo-viewer::backdrop { background: rgb(28 31 23 / .84); }
.photo-viewer [hidden] { display: none !important; }
.photo-viewer__bar, .photo-viewer__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px clamp(12px, 3vw, 25px);
}
.photo-viewer__bar { border-bottom: 1px solid var(--rule, #bdb5a6); }
.photo-viewer h2 {
  margin: 0;
  font: italic 24px/1.1 var(--serif, Georgia, serif);
  letter-spacing: -.04em;
}
.photo-viewer button {
  min-height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid var(--leaf, #58664f);
  border-radius: 1px;
  background: transparent;
  color: var(--green, #43533e);
  font: 600 13px/1.2 var(--sans, Arial, sans-serif);
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease;
}
.photo-viewer button:hover, .photo-viewer__bar button {
  background: var(--green, #43533e);
  color: var(--paper, #f7f3e8);
}
.photo-viewer__bar button:hover { background: var(--ink, #382e23); }
.photo-viewer button:focus-visible { outline: 3px solid #9a4435; outline-offset: 2px; }
.photo-viewer__figure { margin: 0; }
.photo-viewer__stage {
  display: grid;
  place-items: center;
  height: min(61vh, 600px);
  height: min(61dvh, 600px);
  background: var(--ivory, #e8e5d9);
}
.photo-viewer__image { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.photo-viewer__error { margin: 12px; font-size: 15px; }
.photo-viewer__caption { display: grid; gap: 4px; padding: 12px clamp(12px, 3vw, 25px); }
.photo-viewer__label { font: 20px/1.2 var(--serif, Georgia, serif); }
.photo-viewer__credit, .photo-viewer__count { font: 13px/1.4 var(--sans, Arial, sans-serif); }
.photo-viewer__credit:empty { display: none; }
.photo-viewer__tools { border-top: 1px solid var(--rule, #bdb5a6); }
.photo-viewer__buttons { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 420px) {
  dialog.photo-viewer { width: calc(100% - 16px); }
  .photo-viewer__stage { height: min(54vh, 480px); height: min(54dvh, 480px); }
  .photo-viewer__tools button { padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-viewer button { transition: none; }
}
