.lightbox{
  position:relative;
  width:240px;
  height:180px;
  display:inline-block;
}
.lightbox input[type=checkbox]{
  display:none;
}
.lightbox label{
  display:block;
  cursor:pointer;
  background-color:rgba(0,0,0,0);
  transition:background-color 0.3s;
  -webkit-transition:background-color 0.3s;
}
.lightbox img{
  display:block;
  width:100%;
}

.lightbox input:not(:checked)+label{
  width:100%;
  height:100%;
  position:absolute;
  top:0;
  left:0;
  z-index:2;
}
.lightbox input:not(:checked)+label+div{
  position:relative;
  z-index:1;
}

.lightbox input:checked+label{
  position:fixed;
  top:0;
  left:0;
  width:100vw;
  height:100vh;
  background-color:rgba(0,0,0,0.7);
  z-index:9998;
}
.lightbox input:checked+label+div{
  position:fixed;
  top:50%;
  left:50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  
  border:20px solid white;
  border-radius:10px;
  width:600px;
  max-width:90vw;
  box-shadow:0px 0px 50px 3px #222;
  opacity:0;
  animation:fadein 0.3s 0.1s forwards;
  -webkit-animation:fadein 0.3s 0.1s forwards;
  z-index:9999;
}
@keyframes fadein{
  from{ opacity:0; } to{   opacity:1; }
}
@-webkit-keyframes fadein{
  from{ opacity:0; } to{   opacity:1; }
}
