@supports (display:flex) and (margin-left: calc(100% / -4)) {
    .gallery {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

    .gallery img {
        padding: 0;
    }

    .gallery .gallery-item {
        height: 194px;
        float: left;
        margin: 0;
        position: relative;
        text-align: center;
        width: auto;
    }

    .gallery .gallery-item a {
        display: block;
    }

    .gallery .gallery-icon {
        display: inline-block;
        height: 194px;
        max-width: 100%;
        overflow: hidden;
        position: relative;
        width: 194px;
    }

    .gallery .gallery-icon::after {
        bottom: 0;
        box-shadow: 0 1px 10px 0 rgba(0,0,0,0.1) inset;
        content: '';
        left: 0;
        pointer-events: none;
        position: absolute;
        right: 0;
        top: 0;
    }

    .gallery .gallery-icon img {
        border: none;
    }

    .gallery .gallery-icon.landscape img {
        width: auto;
        height: 100%;
        margin-left: calc(100% / -4);
        max-width: none;
    }

    .gallery .gallery-icon.portrait img {
        height: auto;
        width: 100%;
    }

    .gallery .gallery-icon:hover img,
    .gallery .gallery-icon:focus img {
        transform: scale(1.05);
        transition: all .6s;
    }
}
