/* https://codepen.io/JonAnderDev/pen/wBBjRa */

.popup {
  position: fixed;
  top: -100vh;
  left: 0;
  z-index: 9999999;
  background: rgba(0, 0, 0, 0.75);
  width: 100vw;
  height: 100vh;
  opacity: 0;

  -webkit-transition: opacity 0.35s ease;
  -moz-transition: opacity 0.35s ease;
  -o-transition: opacity 0.35s ease;
  transition: opacity 0.35s ease;
}

.popup .popUpContainer {
  width: 100%;
  max-width: 50px;
  position: fixed;
  /* To avoid scroll to target */
  left: 50%;
  top: -100vh;
  -webkit-transition: top 0.35s ease;
  -moz-transition: top 0.35s ease;
  -o-transition: top 0.35s ease;
  transition: top 0.35s ease;

  /* Trick to properly center the element by using negative 
  1/2 length of element as margin left and top */
  margin-left: -250px;
  /* background-color: #ffffff; */
  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  z-index: 9999999;
}

.popup h2 {
  padding: 0.5em;
  text-align: center;
  color: #444444;
  margin: 0;
}

.popup img {
  width: 85%;
  display: block;
}

.popup article {
  height: 300px;
  background-color: #e67e22;
}

/* The cancel button on popup dialog */
.popup a.closePopUp {
  font-family: verdana;
  color: #e74c3c;
  position: absolute;
  top: 0.2em;
  right: 0.375em;
  margin: 0;
  padding: 5px;
  font-weight: bold;
  font-size: 1.5em;
  text-decoration: none;
}

/* The cancel button on popup dialog */
.popup a:hover {
  color: #c0392b;
}

/* When popup is targeted, by clicking on link with #popup in HTML */
.popup:target {
  opacity: 1;
  top: 0;
}

.popup .closePopUpOutSide {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999991;
}

.popup:target .popUpContainer {
  top: 50px;
  -webkit-transition: top 0.35s ease;
  -moz-transition: top 0.35s ease;
  -o-transition: top 0.35s ease;
  transition: top 0.35s ease;
}

@media (max-width: 796px) {
  .popup .popUpContainer {
    width: 90%;
    max-width: none;
    left: 5%;
    margin-left: 0;
  }

  .popup ul {
    padding: 0 1em 0 1em;
  }

  .popup:target .popUpContainer {
    top: 25px;
    -webkit-transition: top 0.35s ease;
    -moz-transition: top 0.35s ease;
    -o-transition: top 0.35s ease;
    transition: top 0.35s ease;
  }
}