.gridgallery {
    text-align: center;
}
.j51gridgallery {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    max-width: 1000px;
    list-style: none;
    text-align: center;
    overflow: hidden;
    
}

/* Common style */
.j51gridgallery figure {
    position: relative;
    float: left;
    overflow: hidden;
    margin: -1px 0;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
         -o-box-sizing: border-box;
            box-sizing: border-box;
}

.j51gridgallery figure img {
    position: relative;
    display: block;
    /*min-height: 100%;*/
    /*max-width: 100%;*/
    opacity: 0.8;
}

.j51gridgallery figure figcaption {
    padding: 2em;
    color: #fff;
    /*text-transform: uppercase;*/
    font-size: 1em;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.j51gridgallery figure figcaption::before,
.j51gridgallery figure figcaption::after {
    pointer-events: none;
}

.j51gridgallery figure figcaption,
.j51gridgallery figure figcaption > 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 */
.j51gridgallery figure figcaption > a {
    z-index: 10;
    text-indent: 200%;
    white-space: nowrap;
    font-size: 0;
    opacity: 0;
}

.j51gridgallery figure h3 {
    word-spacing: -0.15em;
    font-weight: 800;
    font-size: 22px;
    line-height: 1.3em;
}

.j51gridgallery figure h3 span {
    font-weight: 300;
}

.j51gridgallery figure h3,
.j51gridgallery figure p {
    margin: 0;
}

.j51gridgallery figure p {
    letter-spacing: 1px;
}

/* Individual effects */

/*---------------*/
/***** Lily *****/
/*---------------*/

figure.effect-lily img {
    max-width: none;
    width: -webkit-calc(100% + 50px);
    width: calc(100% + 50px);
    opacity: 0.5;
    -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
    transition: opacity 0.35s, transform 0.35s;
    -webkit-transform: translate3d(-40px,0, 0);
    transform: translate3d(-40px,0,0);
}

figure.effect-lily figcaption {
    text-align: left;
}

figure.effect-lily figcaption > div {
    position: absolute;
    bottom: 25px;
    left: 0;
    padding: 0 2em;
    height: 50%;
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
         -o-box-sizing: border-box;
            box-sizing: border-box;
}

figure.effect-lily h3,
figure.effect-lily p {
    -webkit-transform: translate3d(0,40px,0);
    transform: translate3d(0,40px,0);
}

figure.effect-lily h3 {
    -webkit-transition: -webkit-transform 0.35s;
    transition: transform 0.35s;
}

figure.effect-lily p {
    color: rgba(255,255,255,0.8);
    opacity: 0;
    -webkit-transition: opacity 0.2s, -webkit-transform 0.35s;
    transition: opacity 0.2s, transform 0.35s;
}

figure.effect-lily:hover img,
figure.effect-lily:hover p {
    opacity: 1;
}

figure.effect-lily:hover img,
figure.effect-lily:hover h3,
figure.effect-lily:hover p {
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

figure.effect-lily:hover p {
    -webkit-transition-delay: 0.05s;
    transition-delay: 0.05s;
    -webkit-transition-duration: 0.35s;
    transition-duration: 0.35s;
}