.photo-viewer {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #17241f;
}

.photo-viewer::backdrop {
  background: rgba(0, 0, 0, .85);
}

.photo-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.photo-viewer-toolbar button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #6f8278;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font: 26px/1 sans-serif;
  cursor: pointer;
}

.photo-viewer-toolbar button:hover,
.photo-viewer-toolbar button:focus-visible {
  background: #365245;
  outline: 2px solid #dfc680;
  outline-offset: 2px;
}

.photo-viewer-toolbar [data-photo-close] {
  margin-left: auto;
}

[data-photo-count] {
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.photo-viewer figure {
  margin: 0;
}

[data-full-photo] {
  display: block;
  width: 100%;
  height: min(72dvh, 850px);
  object-fit: contain;
}

[data-photo-caption] {
  padding-top: 12px;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

body.photo-viewer-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  [data-full-photo] { height: 64dvh; }
}
