body.miml-popup-open {
  overflow: hidden;
}

.miml-popup-overlay {
  display: none;
  position: fixed;
  z-index: 999999;
  inset: 0;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.miml-popup-overlay.miml-popup-is-open {
  display: flex;
}

.miml-popup-figure {
  max-width: 90vw;
  max-height: 90vh;
  margin: 0;
  text-align: center;
  cursor: default;
}

.miml-popup-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: calc(90vh - 48px);
  margin: 0 auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.miml-popup-caption {
  display: none;
  max-width: 90vw;
  margin-top: 12px;
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
}

.miml-popup-caption.miml-popup-caption-visible {
  display: block;
}

.miml-popup-close {
  position: absolute;
  top: 16px;
  right: 24px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
}

.miml-popup-close:hover,
.miml-popup-close:focus {
  background: transparent;
  box-shadow: none;
  color: #ddd;
}

.miml-popup-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 600px) {
  .miml-popup-overlay {
    padding: 16px;
  }

  .miml-popup-close {
    top: 8px;
    right: 12px;
  }
}
