body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #111;
}

h1 {
  color: #eee;
  text-align: center;
}

.gallery-container {
  display: flex;
  flex-wrap: wrap;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-item {
  box-sizing: border-box;
  width: calc(50% - 2em);
  overflow: hidden;
  border: 2px solid rgba(#fff, .7);
  position: relative;
  cursor: pointer;
  @media screen and (min-width: 800px) {
    width: calc(33.33% - 2em);
  }
  @media screen and (min-width: 1000px) {
    width: calc(25% - 2em);
  }
  margin: 1em;
  img {
    width: 100%;
    display: block;
    transition: all .4s;
  }
  &:hover {
    border-color: yellow;
    img {
      transform: scale(1.3);
    }
    &:after {
      opacity: 1;
      transform: scale(1);
    }
  }
  &:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(img/gallery.png) center center / 3em 3em no-repeat rgba(#000, .8);
    opacity: 0;
    transform: scale(0.1);
    transition: all .4s;
  }
}