#modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 99999; /* Sit on top */
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
  top: 0px;
}

#gallery {
  margin-top: 10px;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-image-container {
  height: min(340px, 50vw);
  margin: 10px;
}

.gallery-image {
  height: 100%;
  width: auto;
  object-fit: contain;
}

#modal-content {
  object-fit: contain;
  display: block;
  max-height: 90vh;
  max-width: min(900px,80vw);
}

#modal-content-caption {
  width: max-content;
  height: max-content;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#caption {
  padding: 10px;
  width: auto;
  text-align: center;
  color: #ccc;
}

#modal-content, .caption{
  transform: scale(0);
  transition: transform .2s;
}

#caption.zoom{
  transform: scale(1);
}
#modal-content.zoom{
  transform: scale(1);
}

/* The Close Button */
#close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

#close:hover,
#close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}
