/* body no scrolling
-------------------------------------------------------------*/

body.noscroll {
  overflow: hidden;
}

body.noscroll .overlay {
  overflow-y: auto;
}

/* modal
-------------------------------------------------------------*/

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1000;

  background: #000;
  background: rgba(0,0,0,0.8);
  background: -webkit-radial-gradient(50% 50%, ellipse closest-corner, rgba(0,0,0,0.55) 1%, rgba(0,0,0,0.8) 100%);
  background: -moz-radial-gradient(50% 50%, ellipse closest-corner, rgba(0,0,0,0.55) 1%, rgba(0,0,0,0.8) 100%);
  background: -ms-radial-gradient(50% 50%, ellipse closest-corner, rgba(0,0,0,0.55) 1%, rgba(0,0,0,0.8) 100%);
  background: radial-gradient(50% 50%, ellipse closest-corner, rgba(0,0,0,0.55) 1%, rgba(0,0,0,0.8) 100%);

  opacity: 0; /* Hide for now */
/*  pointer-events: none; */
}

.overlay.below {
  z-index: -1000;
  visibility: hidden !important;
}

.overlay:target,
.overlay.active {
  opacity: 1;
  z-index: 2000;
  visibility: visible;
  /*  pointer-events: auto; */
}

.overlay > div {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 400px;
  padding: 20px;

  margin-left: -220px;
  margin-top: -150px;

  box-shadow: 0 3px 20px rgba(0,0,0,0.7);
  background: #fff;
}

.fluid.overlay > div {
  width: auto;
  width: 90%;
  padding: 0;
  left: 5% !important;
  margin-left: 0 !important;
}

.wide.overlay > div{
  width: 800px;
  margin-left: -420px;
}

/* close button
-------------------------------------------------------------*/

.overlay a[href="#close"] {
  position: absolute;
  right: 0px;
  top: -25px;
  color: transparent;
  z-index: 100;
}

.overlay a[href="#close"]:focus {
  outline: none;
}

.overlay a[href="#close"]:after {
  content: '\00d7';
  display: block;

  height: 32px;
  width: 32px;
  font-size: 30px;
  padding: 2px 3px 0 3px;

  color: #666;

  font-family: Arial, Helvetica, sans-serif;
  text-decoration: none;
  text-shadow: none;
  text-align: center;
  font-weight: bolder;
}

.overlay a[href="#close"]:hover:after {
  color: #000;
}

/* animation definitions
-------------------------------------------------------------*/

.fade.overlay,
.bounce.overlay {
  -webkit-transition: opacity 200ms ease-in;
  -moz-transition: opacity 200ms ease-in;
  transition: opacity 200ms ease-in;
}


/* minimize on close */
.bounce.overlay > div {
  -webkit-animation: minimise 200ms ease-in;
  -moz-animation: minimise 200ms ease-in;
  animation: minimise 200ms ease-in;
}

/* bounce animation on open */
.bounce.overlay:target > div,
.bounce.overlay.active > div {
  -webkit-animation-name: bounce;
  -moz-animation-name: bounce;
}


/* animations
-------------------------------------------------------------*/

@-webkit-keyframes bounce {
  0% {
  	-webkit-transform: scale3d(0.1,0.1,1);
  	box-shadow: 0 3px 20px rgba(0,0,0,0.9);
  }
  55% {
  	-webkit-transform: scale3d(1.08,1.08,1);
  	box-shadow: 0 10px 20px rgba(0,0,0,0);
  }
  75% {
  	-webkit-transform: scale3d(0.95,0.95,1);
  	box-shadow: 0 0 20px rgba(0,0,0,0.9);
  }
  100% {
  	-webkit-transform: scale3d(1,1,1);
  	box-shadow: 0 3px 20px rgba(0,0,0,0.9);
  }
}

@-webkit-keyframes minimise {
  0% {
  	-webkit-transform: scale3d(1,1,1);
  }
  100% {
  	-webkit-transform: scale3d(0.8,0.8,8);
  }
}

@-moz-keyframes bounce {
  0% {
  	-moz-transform: scale3d(0.1,0.1,1);
  	box-shadow: 0 3px 20px rgba(0,0,0,0.9);
  }
  55% {
  	-moz-transform: scale3d(1.08,1.08,1);
  	box-shadow: 0 10px 20px rgba(0,0,0,0);
  }
  75% {
  	-moz-transform: scale3d(0.95,0.95,1);
  	box-shadow: 0 0 20px rgba(0,0,0,0.9);
  }
  100% {
  	-moz-transform: scale3d(1,1,1);
  	box-shadow: 0 3px 20px rgba(0,0,0,0.9);
  }
}

@-moz-keyframes minimise {
  0% {
  	-moz-transform: scale3d(1,1,1);
  }
  100% {
  	-moz-transform: scale3d(0.1,0.1,1);
  }
}

/* media
-------------------------------------------------------------*/

@media (max-width: 840px) {

  .wide.overlay > div {
    width: 400px;
    margin-left: -220px;
    margin-top: -300px;
  }

}

@media (max-width: 480px) {

  .overlay {
    /* background: #ccc; */
  }

  .overlay > div {
    width: auto !important;
    margin-left: 0 !important;
    left: 0 !important;
    box-shadow: none;
    -webkit-animation: none;
    -moz-animation: none;
    border-top: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
  }

  .fluid.overlay > div {
    left: 0 !important;
  }

}
