*,
*:before,
*:after {
  box-sizing: border-box;
}

label[for] {
  cursor: pointer;
}

input[type="checkbox"] {
  display: none;
}

body {
  background-color: #000;
}

.lightbox, .grid {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

.lightbox {
  z-index: 1;
  min-height: 100%;
  overflow: auto;
  -webkit-transform: scale(0);
          transform: scale(0);
  -webkit-transition: -webkit-transform .5s ease-out;
  transition: -webkit-transform .5s ease-out;
  transition: transform .5s ease-out;
  transition: transform .5s ease-out, -webkit-transform .5s ease-out;
}
.lightbox img {
  position: fixed;
  top: 50%;
  left: 50%;
  max-width: 96%;
  max-height: 96%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

input[type="checkbox"]:checked + .lightbox {
  -webkit-transform: scale(1);
          transform: scale(1);
}

input[type="checkbox"]:checked ~ .grid {
  opacity: .125;
}

.grid {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
          flex-wrap: wrap;
  -webkit-box-align: start;
  -webkit-align-items: flex-start;
      -ms-flex-align: start;
          align-items: flex-start;
  -webkit-align-content: flex-start;
      -ms-flex-line-pack: start;
          align-content: flex-start;
  height: 100%;
  padding: 16px;
  overflow: auto;
  z-index: 0;
  background-color: #222;
  text-align: center;
  -webkit-transition: opacity .75s;
  transition: opacity .75s;
}
.grid .grid-item {
  display: block;
  width: 25%;
  padding: 16px;
  opacity: .75;
  -webkit-transition: opacity .5s;
  transition: opacity .5s;
}
.grid .grid-item:hover {
  opacity: 1;
}
@media screen and (max-width: 1280px) {
  .grid .grid-item {
    width: 33.3333%;
  }
}
@media screen and (max-width: 960px) {
  .grid .grid-item {
    width: 50%;
  }
}
@media screen and (max-width: 480px) {
  .grid .grid-item {
    width: 100%;
  }
}
.grid img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
