/* ========================== Community Gallery ========================== */

figure {
    margin: 0;
}

.community-gallery {
    padding: 64px 40px;
    display: flex;
    justify-content: center;
}

.community-gallery__container {
    width: 100%;
    max-width: 1280px;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.community-gallery__title {
    margin: 0;
    font-family: var(--font-family-primary);
    font-size: var(--text-h2);
    font-weight: var(--font-bold);
    line-height: var(--leading-h2);
    color: var(--grey-950);
}

.community-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 12px;
}

/* Images */

.gallery-item {
    overflow: hidden;
    border-radius: 20px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Layout */

.gallery-item--small {
    grid-row: span 1;
}

.gallery-item--tall {
    grid-row: span 2;
}

.gallery-item--large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item--wide {
    grid-column: span 2;
    grid-row: span 1;
}




/* ========================== Responsive ========================== */

/* Tablet */

@media (max-width: 992px) {

    .community-gallery {
        padding: 80px 24px;
    }

    .community-gallery__container {
        gap: 56px;
    }

    .community-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
        gap: 20px;
    }

}

/* Mobile */

@media (max-width: 768px) {

    .community-gallery {
        padding: 64px 20px;
    }

    .community-gallery__container {
        gap: 48px;
    }

    .community-gallery__title {
        font-size: var(--text-h4);
        line-height: var(--leading-h4);
    }

    .community-gallery__grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .gallery-item,
    .gallery-item--small,
    .gallery-item--tall,
    .gallery-item--large,
    .gallery-item--wide {
        width: 100%;
        margin: 0;
        flex: none;
    }

    .gallery-item img {
        display: block;
        width: 100%;
        aspect-ratio: 4 / 3;
        height: auto;
        object-fit: cover;
    }

}
