/* modal styles */
/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 99; /* Sit on top */
  padding-top: 100px; /* Location of the box */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content */
.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 1%;
  border: 1px solid #888;
  width: 98%;
  position: absolute;
  top: 0;
  padding-top: 100px;
}

/* The Close Button */
.modal-content .close {
  color: #506639;
  float: left;
  font-size: 18px;
  font-weight: normal;
  animation: modalRightSlide 0.6s forwards; 
  font-style: italic;
  position: relative;
  z-index: 999999999999999999999;
}

.modal-content .close span:hover{
  display: block;
  animation: modalLeftSlide 0.6s forwards; 
}

.modal-green-headline{
  color: #6D9D34;
  text-align: center;
  position: relative;
  top: -250px;
  animation: modalSlideDown 2.5s forwards;
}


.modal-photos .curved-header{
  margin: -130px auto 0;
  padding-top: 75px;
}

li figure{
  position: relative;
}

.green-image-overlay{
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  transition: .5s ease;
  background-color: #6D9D34;
  border-radius: 30px;
}

.overlay-text{
  color: white;
  font-size: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  text-align: center;
}

figure:hover .green-image-overlay{
  opacity: .9;
}

#bigPhoto{
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  z-index: 9999;
  text-align: center;
  display: none;
  animation: modalFadeIn 0.5s forwards;
}

#bigPhoto figure{
  margin: auto;
  width: 75%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#bigPhoto figure img{
  display: inline-block;
  position: relative;
  width: 75%;
  height: auto;
  z-index: 999999;
}

#bigPhoto::after{
  content: "";
  display: block;
  background-color: rgba(0, 0, 0, 0.6);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  z-index: 9998;
}





@keyframes modalLeftSlide{
  0% {
    margin-left: 0px;
  }
  20% {
    margin-left: 2px;
  }
  100% {
   margin-left: -10px;
  }
}

@keyframes modalRightSlide{
  0% {
    margin-left: -500px;
  }
  80% {
    margin-left: 8px;
  }
  100% {
    margin-left: 0px;
  }
}

@keyframes modalSlideDown{
  0% {
    top: -250px;
  }
  50% {
    top: -250px;
  }
  100% {
    top: -80px;
  }
}

@keyframes modalFadeIn{
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1.0;;
  }
}

.modal-content .close:hover,
.modal-content .close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

/* modal and photo masonary css */


.modal-photos{
  margin: -20px 0 24px;
}

.modal-photos a {
  color: inherit;
}

.modal-photos h1 {
  text-align: center;
  padding: 0 15px;
  margin-bottom: 24px;
}

.grid {
  display: grid;
  grid-gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 30vw;
  list-style: none;
}

.grid li:nth-child(11n + 9) {
  grid-column: 1 / -1;
  grid-row: span 2;
}

.grid figure,
.grid img {
  width: 100%;
  height: 100%;
  border-radius: 30px;
}

.grid img {
  object-fit: cover;
  background: #f5f3f4;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
}

.grid img:hover{
  box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.6);
}

@media (min-width: 850px) {
  .grid {
    grid-gap: 24px;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 12vw;
    margin: -85px 45px 100px -85px;
  }

  .grid li {
    --row-step: calc(4 * var(--n));
  }

  .grid li:nth-child(11n + 1) {
    grid-column: 1;
    grid-row: calc(1 + var(--row-step)) / span 2;
  }

  .grid li:nth-child(11n + 2) {
    grid-column: 2 / span 2;
    grid-row: calc(1 + var(--row-step)) / span 2;
  }

  .grid li:nth-child(11n + 3) {
    grid-column: 4;
    grid-row: calc(1 + var(--row-step));
  }

  .grid li:nth-child(11n + 4) {
    grid-column: 5;
    grid-row: calc(1 + var(--row-step));
  }

  .grid li:nth-child(11n + 5) {
    grid-column: 4;
    grid-row: calc(2 + var(--row-step));
  }

  .grid li:nth-child(11n + 6) {
    grid-column: 5;
    grid-row: calc(2 + var(--row-step)) / span 2;
  }

  .grid li:nth-child(11n + 7) {
    grid-column: 2;
    grid-row: calc(3 + var(--row-step));
  }

  .grid li:nth-child(11n + 8) {
    grid-column: 1;
    grid-row: calc(3 + var(--row-step));
  }

  .grid li:nth-child(11n + 9) {
    grid-column: 3 / span 2;
    grid-row: calc(3 + var(--row-step)) / span 2;
  }

  .grid li:nth-child(11n + 10) {
    grid-column: 1 / span 2;
    grid-row: calc(4 + var(--row-step));
  }

  .grid li:nth-child(11n + 11) {
    grid-column: 5;
    grid-row: calc(4 + var(--row-step));
  }

  .single_box{
    grid-row: calc(4 + var(--row-step));
  }

  .grid  li.double_box{
    grid-row: calc(3 + var(--row-step)) / span 2;
  }

  .grid  li.square_box{
    grid-row: calc(1 + var(--row-step)) / span 2;
  }

  .grid  li.vertical_box{
    grid-row: calc(2 + var(--row-step)) / span 2;
  }

  .grid  li.first_column{
    grid-column: 1;
  }

  .grid  li.second_column{
    grid-column: 2;
  }

  .grid  li.third_column{
    grid-column: 3;
  }

  .grid  li.fourth_column{
    grid-column: 4;
  }

  .grid  li.fifth_column{
    grid-column: 5;
  }

  .grid  li.double_box.second_column{
    grid-column: 2 / span 2;
  }

  .grid  li.double_box.fourth_column{
    grid-column: 4 / span 2;
  }

}

@media only screen and (max-width: 600px) {
  .modal-content .close{
    position: relative;
    top: 50px;
    left: 20px;
  }

  .grid{
    width: 100%;
    padding: 0;
    margin-top: 30px;
  }

  .grid figure, .grid img{
    margin: 0;
  }

  .modal-green-headline h2{
    position: relative;
    top: 28px;
  }

  .modal-photos .curved-header{
    margin: -135px auto 0;
    padding-top: 30px;
  }

@keyframes modalSlideDown{
  0% {
    top: -250px;
  }
  70% {
    top: -250px;
  }
  100% {
    top: -65px;
  }
}

}

@media only screen and (min-width: 601px) and (max-width: 900px){
  .grid{
    width: 100%;
    padding: 0;
    margin-top: 40px;
  }

  .grid figure, .grid img{
    margin: 0;
  }


}

@media only screen and (min-width: 901px) and (max-width: 1500px){
  .grid{
    width: 100%;
    margin-top: 40px;
  }
}
