.image-modal-popup {
  position: fixed;
  overflow: auto;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0);
  display: none;

  align-items: center;
  justify-content: center;
  z-index: 1;

  transition: background-color 0.2s ease-out;

  @media (max-width: 840px) {
    background-color: rgba(0, 0, 0, 0.8);
  }
}

.image-modal-visible {
  display: flex;
}

.image-modal-background-full {
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
}

.image-modal-image {
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;

  transform: scale(0.8);
  opacity: 0;

  max-width: min(calc(100% - 80px), 1200px);
  max-height: min(calc(100% - 80px), 1200px);

  @media (max-width: 840px) {
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    transform: scale(1);
    opacity: 1;
  }
}

.image-modal-image-visible {
  transform: scale(1);
  opacity: 1;
}