ul.grid  {
  text-align:center; 
}
.grid li.j51gridgallery {
  display: inline-block;
  position: relative;
  box-sizing:border-box;
  -moz-box-sizing: border-box;
  text-align: center;
}

ul.grid li a, ul.grid li:first-child a {
  padding:0 !important;
  margin:0 !important;
}

.grid figure {
  margin: 0;
  position: relative;
  border-radius: 5px;
}

.grid figure img {
  max-width: 100%;
  display: block;
  position: relative;
  z-index:0;
}

.grid figcaption {
  top: 0;
  left: 0;
  padding: 20px 10px;
  background: #aaa;
  text-align: left;
  box-sizing:border-box;
  -moz-box-sizing: border-box;
  text-transform: none; 
  position: relative;
  z-index: 1;  
}

.grid figcaption h3 {
  margin: 0;
  padding: 0 10px;
  color: #323232;
  font-size: 22px;
  text-transform: uppercase;
  line-height: 1em;
  font-weight: 400;
}

.grid figcaption span {
  color: #cccccc;
  line-height: 2em;
  display: block;
  padding: 10px;
}

/* Caption Style */
.j51gridgallery figure {
  overflow: hidden;
}

.j51gridgallery figure img {
  -webkit-transition: -webkit-transform 0.4s ease-out;
  -moz-transition: -moz-transform 0.4s ease-out;
  transition: transform 0.4s ease-out;
}

.no-touch .j51gridgallery figure:hover img,
.j51gridgallery figure.cs-hover img {
  bottom:0px;
  -webkit-transform: scale(1.2) translateY(-7.5%);
  -moz-transform: scale(1.2) translateY(-7.5%);
  -ms-transform: scale(1.2) translateY(-7.5%);
  transform: scale(1.2) translateY(-7.5%);
}

.j51gridgallery figcaption {
  height:100%;
  width: 100%;
  opacity: 0.7;
  -webkit-transition: opacity 0.5s 0.2s;
  -moz-transition:    opacity 0.5s 0.2s;
  transition:         opacity 0.5s 0.2s;
}

.no-touch .j51gridgallery figure:hover figcaption,
.j51gridgallery figure.cs-hover figcaption {
  opacity: 1;
  -webkit-transition: opacity 0.5s;
  -moz-transition:    opacity 0.5s;
  transition:         opacity 0.5s;
}
