.content-image-gallery__inner {
    display: flex;
    flex-wrap: wrap;
    /* required, otherwise it won't fill the entire row if the images are too small */
    flex: 1 1 auto;
    margin-left: -6px;
    margin-right: -6px;
    margin-top: -12px;
}
.content-image-gallery__item {
    position: relative;
    /* IE 10-11 use content box model in flex-basis, even if box-sizing: border-box is applied.
    Workaround: Use auto and width instead of flex-basis.
    https://github.com/philipwalton/flexbugs#7-flex-basis-doesnt-account-for-box-sizingborder-box */
    flex: 1 1 auto;
    width: 100%;
    /* height required for Safari and IE 11.
     Otherwise images won't stretch out to full height or be faulty somehow */
    height: 120px;
    min-height: 1px;
    padding: 12px 6px 0;
    display: none;
}
.content-image-gallery__item-1,
.content-image-gallery__item-2,
.content-image-gallery__item-3 {
    display: flex;
}
.content-image-gallery__item-1 {
    height: 180px;
}
.content-image-gallery__item-2,
.content-image-gallery__item-3 {
    width: 50%;
}
.content-image-gallery__item-link {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    height: 100%;
    text-decoration: none;
    overflow: hidden;
}
.no-touchevents .content-image-gallery__item-link:hover {
    text-decoration: none;
    outline: none;
}
.content-image-gallery__item-link:not([data-more-nr="0"]):before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, .50);
    display: none;
    z-index: 3;
}
.content-image-gallery__item-link:not([data-more-nr="0"]):after {
    content: '+' attr(data-more-nr);
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    font-size: 3em;
    line-height: 1;
    text-align: center;
    /* required for IE - not working, must use span instead */
    /*text-decoration: none;*/
    transform: translateY(-50%);
    color: #fff;
    display: none;
    z-index: 3;
}
.content-image-gallery__item-3 > .content-image-gallery__item-link:before,
.content-image-gallery__item-3 > .content-image-gallery__item-link:after {
    display: block;
}
.content-image-gallery__item-img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-image-gallery__popup {
    z-index: 2005;
    cursor: pointer;
}
.content-image-gallery__popup .mfp-figure:after {
    top: 50px;
}
.content-image-gallery__popup .mfp-img {
    padding-top: 50px;
}
.content-image-gallery__popup .mfp-title {
    font-size: 1rem;
}
/* over-qualification intended */
.content-image-gallery__popup-close-btn.content-image-gallery__popup-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    text-align: center;
    cursor: auto;
}
.content-image-gallery__popup-close-btn .svg-icon {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    margin: auto;
    /* required because of insufficient event handler of magnific popup */
    pointer-events: none;
}
/* over-qualification intended */
.content-image-gallery__popup-arrow.content-image-gallery__popup-arrow {
    opacity: .35;
    width: 70px;
    height: 120px;
    margin: 0;
    transform: translateY(-50%);
}
.content-image-gallery__popup-arrow:before,
.content-image-gallery__popup-arrow:after {
    display: none;
}
.content-image-gallery__popup-arrow .svg-icon {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 25px;
    height: 25px;
    margin: auto;
    opacity: .35;
    pointer-events: none;
}
.content-image-gallery__popup-arrow--left .svg-icon {
    transform: rotate(90deg);
}
.content-image-gallery__popup-arrow--right .svg-icon {
    transform: rotate(-90deg);
}

/* ==========================================================================
   Media Queries
   ========================================================================== */
@media ( min-width: 480px ) {
    .content-image-gallery__item {
        width: 33.333%;
        height: 120px;
    }
}

@media ( min-width: 768px ) {
    .content-image-gallery__item {
        width: 25%;
    }
    .content-image-gallery__item-3 > .content-image-gallery__item-link:before,
    .content-image-gallery__item-3 > .content-image-gallery__item-link:after {
        display: none;
    }
    .content-image-gallery__item-4 {
        display: flex;
    }
    .content-image-gallery__item-4 > .content-image-gallery__item-link:before,
    .content-image-gallery__item-4 > .content-image-gallery__item-link:after {
        display: block;
    }

    /* show the 4th item when in a 50-col */
    .col-sm-6 > .content-image-gallery .content-image-gallery__item {
        width: 50%;
    }

    .content-image-gallery__popup-arrow.content-image-gallery__popup-arrow {
        width: 100px;
        height: 200px;
    }
}

@media ( min-width: 992px ) {
    .content-image-gallery__item {
        width: 25%;
        height: 150px;
    }
    .content-image-gallery__popup-arrow {
        transform: scale(1.3) translateY(-50%);
    }
}

@media ( min-width: 1200px ) {
    .content-image-gallery__item {
        height: 180px;
    }
}
