.image-gallery {
    list-style: none;
    padding: 10px;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    text-align: center;
    justify-content: center;
    -webkit-justify-content: center;
}

.image-gallery li {
    margin: 10px 12px !important;
    display: inline-block;
    max-width: 220px;
}

.image-gallery a {
    display: block;
    text-align: center;
    min-width: 150px;
    margin-bottom: 12px;
}

.image-gallery li span,
figcaption {
    color: #999;
    font-size: 14px;
    display: block;
    float: none;
    text-align: center;
}

.image-gallery span {
    font-size: 14px;
    color: #333;
}

.image-gallery img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    vertical-align: top;
    /*margin: 0 auto;*/
}

div[class="*+image-gallery"] {
    overflow: hidden;
}

/* popup */
.popup-image-gallery .previews ul li:first-of-type {
    display: none;
}


.main-image {
    text-align: center;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
}

.image-caption {
    padding: 20px;
    text-align: center;
    color: #999;
}

.previews {
    text-align: center;
}

.previews ul {
    list-style: none;
    text-align: center;
}

.previews ul li {
    display: inline-block;
    box-sizing: border-box;
    /*float: left;*/
    height: 60px;
    border: 1px solid #aaa;
    border-right: none;
    padding: 5px;
    overflow: hidden;
    margin: 0;
}

.previews ul li:last-of-type {
    border-right: 1px solid #aaa;

}

.previews ul li a img {
    height: 50px;
    opacity: .5;
}

.previews ul li a:hover img,
.previews ul li a.active img {
    opacity: 1;
}


.main-image .middle {
    display: table-cell;
    max-height: 100%;
    vertical-align: middle;
}

#gallery-fullview {
    cursor: pointer;
}

.gallery-single-image #gallery-fullview {
    cursor: default;
}

.series-img {
    position: relative;
    margin-bottom: 12px;
}

.series-img img {
    width: 100%;
}