/* ============================================================= */
/* Gallery Grid
/* ============================================================= */

.wrapper-gallery-grid .dp-wrapper-col {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.gallery-grid-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.gallery-grid {
    margin-top: 40px;
    margin-bottom: 5px;
}

.gallery-grid-inner,
.gallery-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-flex: 0;
    -ms-flex: 0 1 100%;
    flex: 0 1 100%;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.gallery-grid-inner .box,
.gallery-grid-inner .hover-box {
    display: block;
    position: relative;
    flex: 0 1 100%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    height: 100%;
    transition: all 0.5s ease-in-out;
}

.gallery-grid-inner .hover-box .hover-overlay {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 78, 158, 0.4);
}

.gallery-grid-inner .hover-box .content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    border: solid 2px transparent;
    padding: 2rem;
    opacity: 0;
    transition: all 0.5s ease-in-out;
}

.gallery-grid-inner .hover-box .content img {
    cursor: pointer;
}

.gallery-grid-inner .hover-box:hover {
    transform: scale(1.05);
    overflow: hidden;
    transition: all 0.5s ease-in-out 0.15s;
}


/* Markup for further lines of the gallery grid
/* ------------------------------------------------------------- */

.gallery-row:nth-of-type(3n+1) .box:nth-of-type(1),
.gallery-row:nth-of-type(3n+1) .box:nth-of-type(2),
.gallery-row:nth-of-type(3n+1) .box:nth-of-type(3),
.gallery-row:nth-of-type(3n+2) .box:nth-of-type(1),
.gallery-row:nth-of-type(3n+2) .box:nth-of-type(2),
.gallery-row:nth-of-type(3n+2) .box:nth-of-type(3),
.gallery-row:nth-of-type(3n+3) .box:nth-of-type(1),
.gallery-row:nth-of-type(3n+3) .box:nth-of-type(2),
.gallery-row:nth-of-type(3n+3) .box:nth-of-type(3) {
    -webkit-box-flex: 1;
    margin: 5px;
    height: 175px;
    width: 100%;
    background-position: 50% 50%;
}

.gallery-row:nth-of-type(2n+1) .box:nth-of-type(1) {
    -ms-flex: 0 1 calc(40% - 10px);
    flex: 0 1 calc(40% - 10px);
}

.gallery-row:nth-of-type(2n+1) .box:nth-of-type(2) {
    -ms-flex: 0 1 calc(60% - 10px);
    flex: 0 1 calc(60% - 10px);
}

.gallery-row:nth-of-type(2n+1) .box:nth-of-type(3) {
    -ms-flex: 0 1 calc(100% - 10px);
    flex: 0 1 calc(100% - 10px);
}

.gallery-row:nth-of-type(2n+2) .box:nth-of-type(1) {
    -ms-flex: 0 1 calc(60% - 10px);
    flex: 0 1 calc(60% - 10px);
}

.gallery-row:nth-of-type(2n+2) .box:nth-of-type(2) {
    -ms-flex: 0 1 calc(40% - 10px);
    flex: 0 1 calc(40% - 10px);
}

.gallery-row:nth-of-type(2n+2) .box:nth-of-type(3) {
    -ms-flex: 1 1 calc(100% - 10px);
    flex: 1 1 calc(100% - 10px);
}


/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {

    .gallery-row:nth-of-type(3n+1) .box:nth-of-type(1),
    .gallery-row:nth-of-type(3n+2) .box:nth-of-type(2),
    .gallery-row:nth-of-type(3n+3) .box:nth-of-type(3) {
        -webkit-box-flex: 0;
        -ms-flex: 1 1 calc(50% - 10px);
        flex: 1 1 calc(50% - 10px);
        margin: 5px;
        height: 250px;
    }

    .gallery-row:nth-of-type(3n+1) .box:nth-of-type(2),
    .gallery-row:nth-of-type(3n+1) .box:nth-of-type(3),
    .gallery-row:nth-of-type(3n+2) .box:nth-of-type(1),
    .gallery-row:nth-of-type(3n+2) .box:nth-of-type(3),
    .gallery-row:nth-of-type(3n+3) .box:nth-of-type(1),
    .gallery-row:nth-of-type(3n+3) .box:nth-of-type(2) {
        -webkit-box-flex: 0;
        -ms-flex: 0 1 calc(25% - 10px);
        flex: 0 1 calc(25% - 10px);
        margin: 5px;
        height: 250px;
    }

}


/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {

    .gallery-row:nth-of-type(3n+1) .box:nth-of-type(1),
    .gallery-row:nth-of-type(3n+1) .box:nth-of-type(3) {
        -webkit-box-flex: 0;
        -ms-flex: 0 2 calc(35% - 10px);
        flex: 0 2 calc(35% - 10px);
        margin: 5px;
        height: 400px;
    }

    .gallery-row:nth-of-type(3n+2) .box:nth-of-type(3),
    .gallery-row:nth-of-type(3n+3) .box:nth-of-type(1) {
        -webkit-box-flex: 0;
        -ms-flex: 0 2 calc(40% - 10px);
        flex: 0 2 calc(40% - 10px);
        margin: 5px;
        height: 400px;
    }

    .gallery-row:nth-of-type(3n+1) .box:nth-of-type(2){
        -webkit-box-flex: 1;
        -ms-flex: 1 1 calc(30% - 10px);
        flex: 1 1 calc(30% - 10px);
        margin: 5px;
        height: 400px;
    }

    .gallery-row:nth-of-type(3n+3) .box:nth-of-type(2),
    .gallery-row:nth-of-type(3n+3) .box:nth-of-type(3),
    .gallery-row:nth-of-type(3n+2) .box:nth-of-type(1),
    .gallery-row:nth-of-type(3n+2) .box:nth-of-type(2) {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 calc(20% - 10px);
        flex: 1 1 calc(20% - 10px);
        margin: 5px;
        height: 400px;
    }

}