html {
  overflow-y: scroll;
}

.has-overlay {
  overflow: hidden;
}
.has-overlay > body {
  height: 100%;
  overflow-y: scroll;
}

.modal-container {
  -webkit-transform: translate(0, 100%);
  -moz-transform: translate(0, 100%);
  -o-transform: translate(0, 100%);
  -ms-transform: translate(0, 100%);
  transform: translate(0, 100%);
  -webkit-transform: translate3d(0, 100%, 0);
  transform: translate3d(0, 100%, 0);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000999;
  opacity: 0;
  color: #222;
  line-height: 1.3;
  display: none\9;
}
.modal-container:target {
  -webkit-transform: translate(0, 0);
  -moz-transform: translate(0, 0);
  -o-transform: translate(0, 0);
  -ms-transform: translate(0, 0);
  transform: translate(0, 0);
  opacity: 1;
}
.is-active.modal-container {
  display: block\9;
}
.modal-container:target {
  display: block\9;
}
.modal-container .modal-inner {
  position: absolute;
  top: 50px;
  left: 50%;
  z-index: 10000002; 
  width: 500px;
  margin-left: -250px;
  overflow-x: hidden;
  background: #fff;
  -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}
.modal-container .modal-inner > img,
.modal-container .modal-inner > video,
.modal-container .modal-inner > iframe {
  width: 100%;
  height: auto;
  min-height: 300px;
}
.modal-container .modal-inner > img {
  width: auto;
  max-width: 100%;
}
.modal-container header {
  border-bottom: 1px solid #dddddd;
  padding: 0 1.2em;
}
.modal-container header > h2 {
  margin: 0.5em 0;
}
.modal-container .modal-content {
  max-height: 400px;
  max-height: 70vh;
  border-bottom: 1px solid #dddddd;
  padding: 15px 1.2em;
  overflow-x: hidden;
  overflow-y: auto;
}
.modal-container .modal-content > * {
  max-width: 100%;
}
.modal-container footer {
  border-top: 1px solid white;
  padding: 0 1.2em 18px;
}
.modal-container .modal-close {
  display: block;
  text-indent: -100px;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
}
.modal-container .modal-close:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000001;
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAEElEQVR42gEFAPr/AAAAAMwA0QDNTiUx4gAAAABJRU5ErkJggg==");
}
.modal-container .modal-close:after {
  content: '\00d7';
  position: absolute;
  top: 55px;
  left: 50%;
  z-index: 10000002;
  margin-left: 220px;
  background: #FFF;
  padding: 2px 8px;
  font-size: 1.5em;
  text-decoration: none;
  text-indent: 0;
}
@media screen and (max-width: 690px) {
  .modal-container .modal-inner {
    width: auto;
    left: 20px;
    right: 20px;
    margin-left: 0;
  }
  .modal-container .modal-close {
    left: auto;
    right: 33px;
    margin-left: 0;
  }
  .modal-container .modal-close:after {
    margin-left: 40%;
  }
}
@media screen and (max-width: 30em) {
  .modal-container {
    -webkit-transform: translate(0, 400px);
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
    -webkit-transition: -webkit-transform .25s ease-in-out, opacity 1ms .25s;
    -moz-transition: -moz-transform .25s ease-in-out, opacity 1ms .25s;
    -o-transition: -o-transform .25s ease-in-out, opacity 1ms .25s;
    -ms-transition: -ms-transform .25s ease-in-out, opacity 1ms .25s;
    transition: transform .25s ease-in-out, opacity 1ms .25s;
    display: block;
    height: 100%;
    bottom: auto;
  }
  .modal-container:target {
    -webkit-transition: -webkit-transform .25s ease-in-out;
    -moz-transition: -moz-transform .25s ease-in-out;
    -o-transition: -o-transform .25s ease-in-out;
    -ms-transition: -ms-transform .25s ease-in-out;
    transition: transform .25s ease-in-out;
  }
  .modal-container:before {
    background-color: #3995c4;
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000003;
    height: 3em;
    -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.6);
  }
  .modal-container .modal-inner {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    top: 0;
    left: 0;
    right: 0;
    padding-top: 3em;
    height: 100%;
    overflow: scroll;
    -webkit-box-shadow: none;
    box-shadow: none;
  }
  .modal-container .modal-content {
    max-height: none;
  }
  .modal-container .modal-close {
    right: auto;
    text-decoration: none;
  }
  .modal-container .modal-close:before {
    display: none;
  }
  .modal-container .modal-close:after {
    content: attr(data-close);
    top: 0.4em;
    left: 1em;
    z-index: 10000004;
    margin-left: 0;
    font-size: 1em;
    padding: 0.5em 1em;
  }
}
@media screen and (max-height: 46em) and (min-width: 30em) {
  .modal-container .modal-content {
    max-height: 340px;
    max-height: 50vh;
  }
}
@media screen and (max-height: 36em) and (min-width: 30em) {
  .modal-container .modal-content {
    max-height: 265px;
    max-height: 40vh;
  }
}

@media screen and (min-width: 30em) {
  .modal-container {
    -webkit-transition: opacity 0.4s;
    -o-transition: opacity 0.4s;
    transition: opacity 0.4s;
  }
}
