.photo-link {
  display: block;
  min-width: 0;
  cursor: zoom-in;
}

.photo-link:focus-visible,
.caption:focus-visible {
  outline: 3px solid white;
  outline-offset: -5px;
}

body:has(.photo-viewer[open]) {
  overflow: hidden;
}

.photo-viewer {
  box-sizing: border-box;
  max-width: calc(100% - 1rem);
  max-height: calc(100dvh - 1rem);
  padding: .65rem;
  border: 1px solid #4a534d;
  border-radius: .85rem;
  background: #151916;
  color: #f1f4ee;
}

.photo-viewer::backdrop {
  background: rgb(0 0 0 / .85);
}

.photo-viewer .photo-viewer-close {
  display: block;
  min-height: 2.75rem;
  margin: 0 0 .5rem auto;
  padding: .35rem .85rem;
  border: 1px solid #69756d;
  border-radius: .5rem;
  color: inherit;
  background: #222923;
  font: inherit;
  cursor: pointer;
}

.photo-viewer-close:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.photo-viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 5.75rem);
  object-fit: contain;
}
