.image-viewer {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: max-content;
  height: max-content;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  padding: 3.5rem 1rem 1rem;
  border: 0;
  background: transparent;
  color: #fff;
}

.image-viewer::backdrop {
  background: rgb(5 9 19 / 92%);
}

.image-viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 4.5rem);
  object-fit: contain;
}

.image-viewer button {
  position: absolute;
  inset-block-start: .35rem;
  inset-inline-end: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #181f30;
  color: #fff;
  font: 1.75rem/1 sans-serif;
  cursor: pointer;
}

.image-viewer button:focus-visible {
  outline: 2px solid #7efaff;
  outline-offset: 2px;
}

html:has(.image-viewer[open]) {
  overflow: hidden;
}
