ul.gallery{
    margin: 0 auto;
    padding: 0;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    -webkit-align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    -webkit-flex-flow: row wrap;
    flex-flow: row wrap;
}

ul.gallery li{
    width: 350px;
    height: 370px;
    overflow: hidden;
    margin: 15px;
    display: block;
}

ul.gallery li figure{
    width: 100%;
    height: 100%;
    margin: 0 auto;
    display: block;
    position: relative;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}


ul.gallery li figure img{
    display: none;
}


ul.gallery li figure span{
    display: block;
    height: 40px;
    width: 100%;
    padding: 7px 10px 10px;
    font-size: 12px;
    line-height: 14px;
    font-style: normal;
    position: absolute;
    bottom: 0;
    left: 0;
    background: #fff;
    border-bottom: 1px solid #bfbebe;
}


ul.gallery li figure a{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;

}