html.image-preview-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.image-preview {
  box-sizing: border-box;
  width: min(1400px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 56px 20px 20px;
  border: 1px solid #ffffff40;
  border-radius: 8px;
  background: #191719;
  color: #fff;
  overflow: auto;
}

.image-preview::backdrop {
  background: #000d;
}

.image-preview figure {
  display: grid;
  gap: 14px;
  margin: 0;
}

.image-preview .image-preview-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 180px);
  object-fit: contain;
}

.image-preview figcaption {
  padding: 0;
  color: #e4dee1;
  font: 14px/1.5 Arial, sans-serif;
  text-align: center;
}

.image-preview .image-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #ffffff80;
  border-radius: 4px;
  background: #292529;
  color: #fff;
  font: 20px/1 Arial, sans-serif;
  cursor: pointer;
}

.image-preview .image-preview-close:hover {
  background: #51434b;
}

.image-preview .image-preview-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
