.category-posts {
    width: 100%;
    padding: 40px 15px;
    background-color: var(--color-white);

    margin-bottom: 40px;
}
.category-posts.full-width {
    padding-inline: 0px;
}

.category-posts__navigation {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 25px;
}

.category-posts__title {
    display: inline-block;
    border-bottom: 5px solid #ccc;

    color: var(--color-text);
    font-family: var(--second-font);
    font-size: 28px;
    line-height: 32px;
    font-weight: 500;
    text-transform: uppercase;
}

.category-posts .container > .category-posts__more {
    display: none;
}

.category-posts.full-width .container {
    max-width: 100%;
}

.category-posts.full-width .category-posts__navigation {
    max-width: var(--max-width);
    margin-inline: auto;
}

.category-posts__wrapper {
    display: flex;
    flex-direction: column;
    row-gap: 20px;
}

.category-posts__1-1_1-2, 
.category-posts__1-2_1-1,
.category-posts__3-1,
.category-posts__4-1, 
.category-posts__1-1_2-2, 
.category-posts__3-2,
.category-posts__4-2 {
    display: grid;
    gap: 20px;
}

.category-posts__1-1_1-2, .category-posts__1-2_1-1, 
.category-posts__1-1_2-2, .category-posts__3-2,
.category-posts__4-2 {
    grid-template-rows: repeat(2, 310px);
}

.category-posts__3-1, .category-posts__4-1 {
    grid-template-rows: 310px;
}

.category-posts__1-1_1-2 {
    grid-template-columns: 1.4fr 1fr;
}
.category-posts__1-1_1-2 > .post:nth-child(1) {
    grid-row: 1/3;
}

.category-posts__1-2_1-1 {
    grid-template-columns: 1fr 1.4fr;
}

.category-posts__1-2_1-1 > .post:nth-child(1) {
    grid-column: 2/3;
    grid-row: 1/3;
}

.category-posts__3-1, .category-posts__1-1_2-2, .category-posts__3-2 {
    grid-template-columns: repeat(3, 1fr);
}

.category-posts__4-1, .category-posts__4-2 {
    grid-template-columns: repeat(4, 1fr);
}

.category-posts__1-1_2-2 > .post:nth-child(1) {
    grid-row: 1/3;
}

.post {
    position: relative;
    display: flex;
    align-items: flex-end;

    width: 100%;
    height: 100%;
}

.post__bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.post__content {
    z-index: 2;

    width: 100%;
    margin: 0px 20px 20px;
    padding: 20px;

    background-color: rgba(18, 18, 18, 0.54);
}

.post__link, .post__category-link {
    color: inherit;
}

.post__title {
    color: var(--color-white);
    font-family: var(--second-font);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.45px;
    line-height: 26px;

    margin-bottom: 10px;
}

.post__category {
    color: var(--color-white);
    font-family: var(--primary-font);
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
}

.post__link::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 2;
}

.post__category-link {
    position: relative;
    z-index: 3;
}

@media screen and (max-width: 991px) {
    .category-posts__top, .category-posts__bottom {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 400px);
    }

    .category-posts__1-1_1-2, 
    .category-posts__1-2_1-1,
    .category-posts__3-1,
    .category-posts__4-1, 
    .category-posts__1-1_2-2, 
    .category-posts__3-2,
    .category-posts__4-2 {
        grid-template-columns: 1fr;
    }

    .category-posts__1-1_1-2, .category-posts__1-2_1-1,
    .category-posts__3-1, .category-posts__1-1_2-2 {
        grid-template-rows: repeat(3, 400px);
    }

    .category-posts__4-1 {
        grid-template-rows: repeat(4, 400px);
    }
    
    .category-posts__1-1_2-2 {
        grid-template-rows: repeat(5, 400px);
    }

    .category-posts__3-2 {
        grid-template-rows: repeat(6, 400px);   
    }
    
    .category-posts__4-2 {
        grid-template-rows: repeat(8, 400px);   
    }

    .category-posts__1-1_1-2 > .post:nth-child(1), 
    .category-posts__1-1_2-2 > .post:nth-child(1) {
        grid-row: auto;
    }

    .category-posts__1-2_1-1 > .post:nth-child(1) {
        grid-column: auto;
        grid-row: auto;
    }

    .category-posts__navigation .category-posts__more {
        display: none;
    }

    .category-posts .container > .category-posts__more {
        display: block;

        width: max-content;
        margin: 20px auto 10px
    }
}