html.is-viewing-photo { overflow: hidden; }
.photo-viewer[open] {
  align-items: center;
  background: transparent;
  border: 0;
  box-sizing: border-box;
  color: var(--wp--preset--color--contrast, black);
  display: flex;
  height: 100%;
  inset: 0;
  justify-content: center;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: 0;
  width: 100%;
}
.photo-viewer::backdrop {
  background: var(--wp--preset--color--base, white);
  opacity: .9;
}
.photo-viewer img {
  height: auto;
  max-height: calc(100dvh - 160px);
  max-width: 100%;
  object-fit: contain;
  width: auto;
}
.photo-viewer button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  fill: currentColor;
  height: 40px;
  justify-content: center;
  padding: 0;
  position: absolute;
  width: 44px;
}
.photo-viewer button[hidden] { display: none; }
.photo-viewer .viewer-close {
  right: calc(16px + env(safe-area-inset-right));
  top: calc(16px + env(safe-area-inset-top));
  width: 40px;
}
.viewer-prev { bottom: 16px; left: calc(16px + env(safe-area-inset-left)); }
.viewer-next { bottom: 16px; right: calc(16px + env(safe-area-inset-right)); }
@media (min-width: 481px) {
  .photo-viewer img { max-width: calc(100% - 80px); }
}
@media (min-width: 961px) {
  .photo-viewer img { max-height: calc(100dvh - 80px); }
  .photo-viewer.has-navigation img { max-width: calc(100% - 320px); }
  .viewer-prev, .viewer-next { bottom: 50%; transform: translateY(-50%); }
}
#search-results article { margin-block: var(--wp--preset--spacing--50); }
#search-results h2 { margin-block-end: 0; }
