* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* css-masonry-1 */
img {
    max-width: 100%;
    display: block;
}

figure {
    margin: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    margin-bottom: 10px;
    break-inside: avoid;
}

figure>img {
    grid-row: 1 / -1;
    grid-column: 1;
}

figure a {
    color: black;
    text-decoration: none;
}

figcaption {
    grid-row: 2;
    grid-column: 1;
    background-color: rgba(255, 255, 255, .5);
    padding: .2em .5em;
    justify-self: start;
}

.gallery-container {
    column-count: 4;
    column-gap: 10px;
}


@media screen and (max-width: 480px) {

    img {
        max-width: 100%;
        display: block;
    }
    
    figure {
        margin: 0;
        display: grid;
        grid-template-rows: 1fr auto;
        margin-bottom: 10px;
        break-inside: avoid;
    }
    
    figure>img {
        grid-row: 1 / -1;
        grid-column: 1;
    }
    
    figure a {
        color: black;
        text-decoration: none;
    }
    
    figcaption {
        grid-row: 2;
        grid-column: 1;
        background-color: rgba(255, 255, 255, .5);
        padding: .2em .5em;
        justify-self: start;
    }
    
    .gallery-container {
        column-count: 2;
        column-gap: 10px;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {

    img {
        max-width: 100%;
        display: block;
    }
    
    figure {
        margin: 0;
        display: grid;
        grid-template-rows: 1fr auto;
        margin-bottom: 10px;
        break-inside: avoid;
    }
    
    figure>img {
        grid-row: 1 / -1;
        grid-column: 1;
    }
    
    figure a {
        color: black;
        text-decoration: none;
    }
    
    figcaption {
        grid-row: 2;
        grid-column: 1;
        background-color: rgba(255, 255, 255, .5);
        padding: .2em .5em;
        justify-self: start;
    }
    
    .gallery-container {
        column-count: 4;
        column-gap: 10px;
    }
}
