.mfp-with-zoom .mfp-title, .touch .gallery-image figcaption, html:not(.touch) .gallery-image figcaption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: rgba(255, 255, 255, 0);
  padding: 1em;
  transition: all 0.2s ease;
  font-weight: 600;
  max-width: calc(100% - 9em);
  line-height: 1.25;
  text-align: center;
  box-sizing: border-box;
}
.mfp-with-zoom .mfp-title:before, .touch .gallery-image figcaption:before, html:not(.touch) .gallery-image figcaption:before, .mfp-with-zoom .mfp-title:after, .touch .gallery-image figcaption:after, html:not(.touch) .gallery-image figcaption:after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 1em;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  z-index: -1;
}
.mfp-with-zoom .mfp-title:before, .touch .gallery-image figcaption:before, html:not(.touch) .gallery-image figcaption:before, .mfp-with-zoom .mfp-title:after, .touch .gallery-image figcaption:after, html:not(.touch) .gallery-image figcaption:after {
  right: 100%;
  bottom: 100%;
}
.mfp-with-zoom .mfp-title:after, .touch .gallery-image figcaption:after, html:not(.touch) .gallery-image figcaption:after {
  left: 100%;
  top: 100%;
}

.mfp-with-zoom.mfp-ready .mfp-title, .touch .gallery-image figcaption, html:not(.touch) .gallery-image:hover figcaption {
  color: white;
  font-size: 20px;
  text-shadow: 0 0 5px black;
  transition: all 0.1s ease 0.2s;
}
.mfp-with-zoom.mfp-ready .mfp-title:before, .touch .gallery-image figcaption:before, html:not(.touch) .gallery-image:hover figcaption:before, .mfp-with-zoom.mfp-ready .mfp-title:after, .touch .gallery-image figcaption:after, html:not(.touch) .gallery-image:hover figcaption:after {
  opacity: 1;
}
.mfp-with-zoom.mfp-ready .mfp-title:before, .touch .gallery-image figcaption:before, html:not(.touch) .gallery-image:hover figcaption:before {
  right: -1.5em;
  bottom: -1.5em;
}
.mfp-with-zoom.mfp-ready .mfp-title:after, .touch .gallery-image figcaption:after, html:not(.touch) .gallery-image:hover figcaption:after {
  left: -1.5em;
  top: -1.5em;
}

.gallery {
  -moz-column-gap: 0;
       column-gap: 0;
       margin-top: -5em;
       padding:10px;
}

@media (min-width: 480px) {
  .gallery {
    -moz-column-count: 2;
         column-count: 2;
  }
}
@media (min-width: 1260px) {
  .gallery {
    -moz-column-count: 3;
         column-count: 3;
  }
}

.gallery-image {
  position: relative;
  margin: 0;
  padding: 0;
}
.gallery-image:before, .gallery-image:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 16px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  will-change: border;
}
.gallery-image:after {
  border-width: 0;
}
.gallery-image img {
  display: block;
  max-width: 100%;
  height: auto;
}
html:not(.touch) .gallery-image {
  overflow: hidden;
}
html:not(.touch) .gallery-image:hover:before {
  border-width: 16px;
}
html:not(.touch) .gallery-image:hover:after {
  border-width: 32px;
}
.touch .gallery-image figcaption {
  top: auto;
  bottom: 2em;
}
@media screen and (max-width: 992px){
  .gallery {
    margin-top: -3em;
}
}