.postListCards {
    container-type: inline-size;
}

.postList.--cards {
    display: grid;
    grid-auto-rows: auto 1fr;
    gap: var(--marginMedium);
}

.--cards .postListPost {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: var(--marginSmall);
    position: relative;
    overflow: hidden;
}

.--cards .postListPost .tagsList__list {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: +1;/** tags must stay visible if image gets z-index on hover */
}

.--cards .postListPost__date {
    margin-bottom: -1rem;
}

.--cards .postListPost__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    hyphens: auto;
}

.--cards .postListPost__imageWrapper {
    order: -1;
    overflow: hidden;
    border-radius: var(--borderRadiusSmall);
}

.--cards .postListPost__image {
    aspect-ratio: 3/2;
    object-fit: cover;
}

.--cards .postListPost .tagsList {
    position: absolute;
    top: var(--marginSmall);
    left: var(--marginSmall);
}

.--cards .postListPost__readMoreText {
    font-weight: 300;
    color: var(--primaryColor800);
    text-decoration: underline;
}

@container (min-width: 568px) {
    .postList.--cards {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@container (min-width: 768px) {
    .postList.--cards {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}
