.is-media-open { overflow: hidden; }

.image-viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(12px, 3vw, 34px);
  position: fixed;
  inset: 0;
  z-index: 1000;
  border: 0;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(97, 43, 22, .18), transparent 42rem),
    repeating-linear-gradient(0deg, rgba(255, 225, 205, .012) 0 1px, transparent 1px 4px),
    rgba(3, 2, 1, .94);
  color: #cbb8ac;
  overflow: hidden;
}

.image-viewer::backdrop { background: rgba(0, 0, 0, .86); }

.image-viewer[open] {
  display: grid;
  place-items: center;
  animation: image-viewer-in .16s ease-out;
}

.image-viewer-panel {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
}

.image-viewer-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.image-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  border: 1px solid #3f291f;
  border-radius: 3px;
  background: #030201;
  box-shadow: 0 16px 48px #000;
  touch-action: pinch-zoom;
}

.image-viewer.is-loading .image-viewer-stage img,
.image-viewer.has-error .image-viewer-stage img { opacity: 0; }

.image-viewer-status {
  margin: 0;
  position: absolute;
  color: #98715d;
  font: 11px/1.3 "WarHelios", "Arial Narrow", sans-serif;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.image-viewer.has-error .image-viewer-status { color: #c46b56; }

.image-viewer-close {
  width: 42px;
  height: 42px;
  padding: 0 0 3px;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  color: #d5b7a5;
  border: 1px solid #704029;
  border-radius: 50%;
  background: linear-gradient(#472719, #170c07);
  box-shadow: 0 4px 15px rgba(0, 0, 0, .7), inset 0 1px rgba(255, 198, 158, .1);
  font: 27px/1 Arial, sans-serif;
  cursor: pointer;
}

.image-viewer-close:hover,
.image-viewer-close:focus-visible {
  color: #fff0e6;
  border-color: #bc693e;
  outline: none;
}

@keyframes image-viewer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .image-viewer[open] { animation: none; }
}

