.grid * {
    box-sizing:border-box;
    -moz-box-sizing: border-box;
}
ul.grid  {
    text-align:center; 
}
.grid li.j51gridgallery {
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    display: inline-block;
    position: relative;
    text-align: center;
    vertical-align: text-top;
    background: url("../css/noise-bg.png") repeat scroll 0 0 rgba(255, 255, 255, 0.1);
    padding:10px;
    box-shadow: 0 1px 3px rgba(30, 50, 70, 0.3), 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

ul.grid li a, ul.grid li:first-child a {
    padding:0 !important;
    margin:0 !important;
}

.grid figure {
    margin: 0;
    position: relative;
}

.grid .grid-image {
    position: relative;
}
.grid figure img {
    max-width: 100%;
    display: block;
    position: relative;
    z-index:0;
}

.grid figcaption {
    top: 0;
    left: 0;
    padding: 0px 10px 10px;
    background: #aaa;
    text-align: left;
    text-transform: none; 
    position: relative;
    z-index: 1;  
}

.grid h3 {
    margin: 0;
    padding: 20px 40px;
    font-size: 20px;
    font-weight: 300;
    /*text-transform: uppercase;*/
    line-height: 1em;
    position:absolute;
    bottom: 0;
    z-index: 1;
    width: 100%;
    text-align: left;
}

.grid figcaption span {
    color: #cccccc;
    line-height: 1.8em;
    display: block;
    padding: 20px 30px 15px;
}

/* 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;
  width: calc(100% + 60px);
  max-width: none;
}

.no-touch .j51gridgallery figure:hover img,
.j51gridgallery figure.cs-hover img {
  bottom:0px;
  -webkit-transform: translate3d(-50px, 0px, 0px);
     -moz-transform: translate3d(-50px, 0px, 0px);
      -ms-transform: translate3d(-50px, 0px, 0px);
          transform: translate3d(-50px, 0px, 0px);
}

.j51gridgallery figcaption {
  height:100%;
  width: 100%;
  opacity: 1;
  -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;
}


