#gallery .container {
  margin-bottom: 0;
  padding: 0 10px;
}
#gallery img {
  max-width: 100%;
  height: auto;
}
#gallery .photo {
  position: relative;
}
#gallery .photo img {
  width: 100%;
  cursor: pointer;
}
#gallery .photo:hover {
  cursor: pointer;
}

#gallery .overlay {
  display: none;
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0,0,0,.7);
}
#gallery .overlay span {
  display: inline-block;
  width: 49%;
  padding: 10px 0;
  text-align: center;
}
#gallery .photo:hover .overlay {
  display: flex;
  justify-content: center;
}
#gallery .overlay i {
  color: #ffffff;
  font-size: 20px;
  opacity: .8;
}
#gallery .overlay span:hover i {
  color: #ffcc00;
  opacity: 1;
}

#modal.modal {
  display: none;
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}
.admin-bar #modal.modal {
  top: 32px;
}

#modal .modal-content {
  margin: auto;
  display: block;
  width: initial;
  /*max-width: 700px;*/
  max-height: 80vh;
  top: 50%;
  transform: translate(0%, -50%);
}

#modal .close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 4;
}
#modal .close:hover,
#modal .close:focus {
  color: #fc0;
  text-decoration: none;
  cursor: pointer;
}
#modal .prev,
#modal .next {
  cursor: pointer;
  position: absolute;
  top: 55%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  user-select: none;
}
#modal .prev:hover,
#modal .next:hover {
  text-decoration: none;
  background: none;
  color: #fc0;
}
#modal .next {
  right: 5%;
  border-radius: 0 3px 3px 0;
  width: 40px;
}
#modal .prev {
  left: 5%;
  border-radius: 3px 0 0 3px;
}

#download-modal {
  display: block;
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translate(-50%);
  padding: 10px 20px;
  background: rgba(0,0,0,.5);
  color: #fff;  
}
#download-modal:hover{
  color: #fc0;
  text-decoration: none;
}
#download-modal i {
  margin-right: 10px;
}

@media screen and (max-width: 770px) {
  #modal .modal-content {
    max-width: 400px;
  }
  #modal .next {
    left: 77%;
  }
}
@media screen and (max-width: 400px) {
  #modal .modal-content {
    max-width: 300px;
  }
}
