.modal {
  top: 0;
  left: 0;
  display: none;
  overflow: scroll;
  position: fixed;
  z-index: 1;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  display: grid;
  min-height: 100vh;
  width: 100%;
  margin: 0;
}

.modal-content img {
  margin: auto;
  max-width:  1000px;
  max-height: 900px;
  transition: 0.2s;
  opacity: 0;
}

.modal-content.placeholder {
  background-image: url(/assets/spin.gif);
  background-repeat: no-repeat;
  background-position: center;
}

.modal-content.zoomed img {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  cursor: zoom-out !important;
  padding: 10px;
  z-index: 3;
}

.modal-close,
.modal-prev,
.modal-next {
  position: absolute;
  color: #555;
  font-size: 50px;
  transition: 0.3s;
  cursor: pointer;
  user-select: none;
  z-index: 2;
}

.modal-prev,
.modal-next {
  top: 50%;
  font-size: 80px;
  visibility: hidden;
}

.modal-close {
  top: 1%;
  right: 12%;
}

.modal-prev {
  left: 2.5%;
}

.modal-next {
  right: 12%;
}

.modal-close:hover,
.modal-prev:hover,
.modal-next:hover {
  color: white;
}

.gallery-modal {
  cursor: pointer;
}

.modal-telescope {
  display: grid;
  overflow-y: scroll;
  overflow-x: hidden;
  margin-left: 10px;
  padding-right: 20px;
  background-color: #333;
}

.modal-telescope .gallery-container:has(.gallery[aria-hidden="false"]) {
  padding-bottom: 10px;
}

@media (max-width: 1200px) {
  .modal-telescope {
    display: none;
  }

  .modal-content img {
    max-width: 400px;
    max-height: 800px;
  }

  .modal-content.zoomed img {
    max-width: 900px;
  }

  .modal-prev,
  .modal-next {
    top: 85%;
  }
}
