@keyframes image-viewer-zoom-in {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.image-viewer__summary {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.image-viewer__dialog,
[data-mount-modal].image-viewer__dialog {
  --modal-animation-name: image-viewer-zoom-in;
}

[data-mount-modal].image-viewer__dialog > summary + .image-viewer__content,
theme-modal > details.image-viewer__dialog > summary + .image-viewer__content {
  --modal-animation-name: image-viewer-zoom-in;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.92);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform-origin: center center;
}

@media (max-width: 959px) {
  [data-mount-modal].image-viewer__dialog > summary + .image-viewer__content,
  theme-modal > details.image-viewer__dialog > summary + .image-viewer__content {
    --modal-animation-name: image-viewer-zoom-in;
    inset: 0;
    width: 100vw;
    height: 100vh;
  }
}

.image-viewer__content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.image-viewer__close {
  color: #ffffff;
  border-color: #ffffff;
}

.image-viewer__viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.image-viewer__viewport:active {
  cursor: grabbing;
}

.image-viewer__img {
  max-width: 92vw;
  max-height: calc(100vh - 96px);
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.image-viewer__img:not([src]),
.image-viewer__img[src=""] {
  opacity: 0;
}

.image-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px 20px;
}

.image-viewer__btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  cursor: pointer;
}

.image-viewer__btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
