a[data-photo-expand] {
  position: relative;
  display: block;
  cursor: zoom-in;
}
a[data-photo-expand]:focus-visible {
  outline: 3px solid #f0ede6;
  outline-offset: -3px;
}
/* The same ring again on a layer of its own. A photograph the page is moving has a transform,
   and is painted over the inset outline of the link around it. */
a[data-photo-expand]:focus-visible::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 3px solid #f0ede6;
  pointer-events: none;
}
a[data-photo-cue]::after {
  content: '⤢';
  content: '⤢' / ''; /* the mark is for the eye: a screen reader reads the photograph's description alone */
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: #faf9f5;
  background: #121310cf;
  border: 1px solid #eeeeea65;
  border-radius: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font:
    600 19px/1 Arial,
    sans-serif;
  pointer-events: none;
}
html.is-viewing-photo {
  overflow: hidden;
}
dialog.photo-viewer {
  position: fixed;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  color: #f4f3ef;
  color-scheme: dark;
}
dialog.photo-viewer:not([open]),
.photo-viewer [hidden] {
  display: none;
}
.photo-viewer::backdrop {
  background: transparent;
}
.photo-viewer__mask,
.photo-viewer__stage {
  position: absolute;
  inset: 0;
}
.photo-viewer__mask {
  overflow: hidden;
}
.photo-viewer__mask::before {
  position: absolute;
  inset: 0;
  content: '';
  background: #141414;
}
.photo-viewer__stage {
  display: grid;
  place-items: center;
  container-type: size;
  padding: max(64px, calc(env(safe-area-inset-top) + 54px)) max(14px, env(safe-area-inset-right))
    max(76px, calc(env(safe-area-inset-bottom) + 66px)) max(14px, env(safe-area-inset-left));
  touch-action: pan-y pinch-zoom;
  box-sizing: border-box;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
.photo-viewer__image {
  grid-area: 1 / 1;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: top left;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-viewer button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #f4f3ef52;
  border-radius: 50%;
  background: #1e1f1ce8;
  color: #f4f3ef;
  cursor: pointer;
  touch-action: manipulation;
}
.photo-viewer button:hover {
  background: #383936;
}
.photo-viewer button:focus-visible {
  outline: 2px solid #e8cda3;
  outline-offset: 2px;
}
.photo-viewer button:disabled {
  opacity: 0.34;
  cursor: default;
}
.photo-viewer__close {
  position: absolute;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
.photo-viewer__close::before,
.photo-viewer__close::after {
  grid-area: 1 / 1;
  content: '';
  width: 17px;
  height: 1.6px;
  background: currentColor;
  transform: rotate(45deg);
}
.photo-viewer__close::after {
  transform: rotate(-45deg);
}
.photo-viewer__nav {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: fit-content;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}
.photo-viewer__nav output {
  font: 500 12px/1 var(--mono, monospace);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.photo-viewer__nav button::after {
  content: '';
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
.photo-viewer__nav button:first-child::after {
  transform: rotate(135deg);
}
@supports (width: 1cqw) {
  .photo-viewer__image {
    width: min(100cqw, calc(100cqh * var(--photo-ratio, 1)));
  }
}
@media (prefers-reduced-motion: no-preference) {
  .photo-viewer[open] .photo-viewer__mask::before {
    animation: photo-dim 0.28s ease-out;
  }
  .photo-viewer.is-closing .photo-viewer__mask::before {
    animation: none;
    opacity: 0;
    transition: opacity 0.25s ease-in;
  }
  .photo-viewer.is-closing :is(.photo-viewer__close, .photo-viewer__nav, .photo-viewer__feedback) {
    opacity: 0;
    transition: opacity 0.12s ease-out;
  }
}
@keyframes photo-dim {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.photo-viewer__feedback {
  position: absolute;
  z-index: 2;
  top: max(11px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(76px, calc(env(safe-area-inset-right) + 65px));
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.photo-viewer__message:not(:empty) {
  padding: 8px 12px;
  border-radius: 7px;
  background: #121310ed;
  color: #faf9f5;
  font: 500 14px/1.35 var(--sans, sans-serif);
}
.photo-viewer .photo-viewer__retry {
  flex: none;
  width: auto;
  padding-inline: 12px;
  border-radius: 23px;
  pointer-events: auto;
}
