body {
  margin: 0;
  padding: 0;
}

.gallery {
  position: relative;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
}

/* Common style */
.gallery__item {
  position: relative;
  margin: 0;
  min-width: 250px;
  max-width: 360px;
  max-height: 280px;
  width: 50%;
  height: auto;
  overflow: hidden;
  background: #3085a3;
  text-align: center;
  cursor: pointer;
}

.gallery__img {
  position: relative;
  display: block;
  min-height: 100%;
  max-width: 100%;
  opacity: 0.8;
}

.gallery__summary {
  padding: 2em;
  color: #fff;
  text-transform: uppercase;
  font-size: 1.25em;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-sizing: border-box;
}

.gallery__summary:before,
.gallery__summary:after {
  pointer-events: none;
}

.gallery__summary,
.gallery__summary > a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Anchor will cover the whole item by default */
/* For some effects it will show as a button */
.gallery__summary > a {
  z-index: 1000;
  text-indent: 200%;
  white-space: nowrap;
  font-size: 0;
  opacity: 0;
}

.gallery__title {
  word-spacing: -0.15em;
  font-weight: 300;
}

.gallery__title span {
  font-weight: 800;
}

.gallery__title,
.gallery__description {
  margin: 18% 0 0 0;
}

.gallery__description {
  letter-spacing: 1px;
  font-size: 68.5%;
}

/* Individual effects */
/*---------------*/
/***** Ming *****/
/*---------------*/
.gallery__item {
  background: #030c17;
}

.gallery__img {
  opacity: 0.9;
  transition: opacity 0.35s;
}

.gallery__summary:before {
  position: absolute;
  top: 30px;
  right: 30px;
  bottom: 30px;
  left: 30px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.2);
  content: '';
  opacity: 0;
  transition: opacity 0.35s, -webkit-transform 0.35s;
  transition: opacity 0.35s, transform 0.35s;
  transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
  -webkit-transform: scale3d(1.4, 1.4, 1);
  transform: scale3d(1.4, 1.4, 1);
}

.gallery__title {
  margin: 20% 0 10px 0;
  transition: opacity 0.35s, -webkit-transform 0.35s;
  transition: transform 0.35s, opacity 0.35s;
  transition: transform 0.35s, opacity 0.35s, -webkit-transform 0.35s;
  opacity: 0;
}

.gallery__description {
  padding: 1em;
  opacity: 0;
  transition: opacity 0.35s, -webkit-transform 0.35s;
  transition: opacity 0.35s, transform 0.35s;
  transition: opacity 0.35s, transform 0.35s, -webkit-transform 0.35s;
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}

.gallery__item:hover .gallery__title {
  -webkit-transform: scale(0.9);
  transform: scale(0.9);
  opacity: 1;
}

.gallery__item:hover .gallery__summary:before,
.gallery__item:hover .gallery__description {
  opacity: 1;
  -webkit-transform: scale3d(1, 1, 1);
  transform: scale3d(1, 1, 1);
}

.gallery__item:hover .gallery__summary {
  background-color: rgba(58, 52, 42, 0);
}

.gallery__item:hover .gallery__img {
  opacity: 0.4;
}

/* Media queries */
@media screen and (max-width: 520px) {
  .gallery {
    display: block;
    flex-wrap: column;
    justify-content: center;
  }

  .gallery__item {
    width: 100%;
  }
}
