﻿.masonry {
    display: flex;
}

.masonry--h {
    flex-flow: row wrap;
}

.masonry--v {
    flex-flow: column wrap;
    max-height: 1080px;
}

.masonry--h,
.masonry--v {
    margin-left: -8px; /* Adjustment for the gutter */
    counter-reset: brick;
}

.masonry-brick {
    overflow: hidden;
    border-radius: 5px;
    margin: 0 0 8px 8px; /* Some Gutter */
    position: relative;
}

.masonry-brick--h {
    flex: auto;
    /*height: 250px;*/
    min-width: 350px;
}

.masonry-brick:after {
    /*position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5000;
    transform: translate(-50%, -50%);  
    content: attr(data-descr);
    transition: font-size .25s, opacity .25s ease-in-out;
    font-weight: 700;
    opacity: .5;
    font-size: 1.25em;
    color: white;*/ 
    /*counter-increment: brick;
    content: counter(brick);*/
}

.masonry-brick:hover:after {
    font-size: 2.25em;
    opacity: 1;
}

@media only screen and (min-width: 1024px) {
    /* Horizontal masonry bricks on desktop-sized screen */
    .masonry-brick--h:nth-child(4n+1) {
        width: 250px;
    }

    .masonry-brick--h:nth-child(4n+2) {
        width: 325px;
        width: 250px;
    }

    .masonry-brick--h:nth-child(4n+3) {
        width: 180px;
        width: 250px;
    }

    .masonry-brick--h:nth-child(4n+4) {
        width: 380px;
        width: 250px;
    }

    /* Adjusting vertical masonry height on desktop-sized screen */
    .masonry--v {
        max-height: 1600px;
    }

    /* Vertical masonry bricks on desktop-sized screen */
    .masonry-brick--v {
        width: 33.33333%;
    }
}

@media only screen and (max-width: 1023px) and (min-width: 768px) {
    /* Horizontal masonry bricks on tabled-sized screen */
    .masonry-brick--h:nth-child(4n+1) {
        width: 200px;
        width: 250px;
    }

    .masonry-brick--h:nth-child(4n+2) {
        width: 250px;
    }

    .masonry-brick--h:nth-child(4n+3) {
        width: 120px;
        width: 250px;
    }

    .masonry-brick--h:nth-child(4n+4) {
        width: 280px;
        width: 250px;
    }

    /* Adjusting vertical masonry height on tablet-sized screen */
    .masonry--v {
        max-height: 2000px;
    }

    /* Vertical masonry bricks on tablet-sized screen */
    .masonry-brick--v {
        width: 50%;
    }
}

.masonry-img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    filter: brightness(50%);
}
