.gallery {
    margin: 0 20px;
    padding-bottom: 20px;
    position: relative;
}

.gallery-dir {
    width: calc(25% - 20px);
    width: 171px;
    margin: 5px 10px;
    float: left;
    max-height: 128px;
    background: #414c96;
    color: #FFF;
    transition: 1s all;
    -moz-transition: 1s all;
    -webkit-transition: 1s all;
    cursor: pointer;
    position: relative;
}

.gallery-dir:nth-child(4n + 4) {
    margin-right: 0;
    margin-left: 13.25px;
}

.gallery-dir:nth-child(4n + 1) {
    margin-left: 0;
    margin-right: 13.25px;
}

.gallery-dir:nth-child(4n + 2),
.gallery-dir:nth-child(4n + 3) {
    margin: 5px 13.25px;
}

.gallery-dir-prev {
    border: 3px solid #b4b4b4;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}

.gallery-dir-prev img {
    width: 165px;
}

.gallery-title {
    text-align: center;
    padding-top: 5px;
    vertical-align: middle;
    font-size: 16px;
}

.single-gallery {
    width: 100%;
}

.single-gallery .gallery-item-overlay {
    display: inline-block;
    width: 19%;
    margin: 0;
    text-align: center;
}

.single-gallery .gallery-item {
    width: 176px;
    margin-top: 5px;
    display: inline-block;
    border: 1px solid #d8d8d8;
}

.single-gallery .gallery-item img {
    width: 165px;
    border: 5px solid #ffffff;
    max-height: 122px;
}

.empty-gallery {
    text-align: center;
    font-size: 16px;
    margin-top: 20px;
}

.gallery-overlay {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(82,82,82,0.86);
    background: -moz-radial-gradient(center, ellipse cover, rgba(82,82,82,0.86) 0%, rgba(0,0,0,0.72) 100%);
    background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(82,82,82,0.86)), color-stop(100%, rgba(0,0,0,0.72)));
    background: -webkit-radial-gradient(center, ellipse cover, rgba(82,82,82,0.86) 0%, rgba(0,0,0,0.72) 100%);
    background: -o-radial-gradient(center, ellipse cover, rgba(82,82,82,0.86) 0%, rgba(0,0,0,0.72) 100%);
    background: -ms-radial-gradient(center, ellipse cover, rgba(82,82,82,0.86) 0%, rgba(0,0,0,0.72) 100%);
    background: radial-gradient(ellipse at center, rgba(82,82,82,0.86) 0%, rgba(0,0,0,0.72) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#525252', endColorstr='#000000', GradientType=1 );
}

.gallery-dir:hover .gallery-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.underline-hover:hover {
    text-decoration: underline;
}