.recent-posts {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
}

.recent-posts .container {
    display: flex;
    flex-direction: column;
    gap: var(--size-2);
    z-index: 1;
}

/* Fallback for gap in IE 11 */
@supports not (gap: 1px) {
    .recent-posts .container {
        margin: calc(var(--size-2) / -2);
    }
    .recent-posts .container > * {
        margin: calc(var(--size-2) / 2);
    }
}

.recent-posts .recent-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--size-2);
    width: 100%;
    margin-bottom: var(--size-6);
}

/* Fallback for IE 11 that doesn't support grid */
@supports not (display: grid) {
    .recent-posts .recent-posts-grid {
        display: flex;
        flex-wrap: wrap;
        margin: calc(var(--size-2) / -2);
    }
    .recent-posts .recent-posts-grid .post-card {
        width: calc(50% - var(--size-2));
        margin: calc(var(--size-2) / 2);
    }
}

@media screen and (min-width: 768px) {
    .recent-posts .recent-posts-grid {
        gap: var(--size-4);
    }
}

@media screen and (min-width: 1024px) {
    .recent-posts .recent-posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    @supports not (display: grid) {
        .recent-posts .recent-posts-grid .post-card {
            width: calc(25% - var(--size-4));
        }
    }
}

.recent-posts .recent-posts-grid .post-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    background-color: var(--color-white);
    border-radius: var(--size-4);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-std);
    height: 100%;
}

.recent-posts .recent-posts-grid .post-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.recent-posts .recent-posts-grid .post-card .image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: var(--color-white);
    overflow: hidden;
    
    /* Fallback for aspect-ratio using height/width */
    height: 200px;
    padding-bottom: 0;
}

/* aspect-ratio supported browsers: Chrome 88+, Firefox 89+, Safari 15+ */
@supports (aspect-ratio: 1) {
    .recent-posts .recent-posts-grid .post-card .image {
        aspect-ratio: 4 / 3;
        height: auto;
    }
}

.recent-posts .recent-posts-grid .post-card .image img {
    -o-object-fit: cover;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.recent-posts .recent-posts-grid .post-card .title {
    padding: var(--size-3);
    width: 100%;
}

.recent-posts .recent-posts-grid .post-card .info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0 var(--size-3) var(--size-3);
    width: 100%;
    gap: var(--size-2);
    margin-top: auto;
}

.recent-posts .recent-posts-grid .post-card .info p {
    margin: 0;
    color: var(--color-grey);
    font-size: var(--size-3);
}

.recent-posts .recent-posts-grid .post-card .info p.excerpt {
    font-size: var(--size-3);
    line-height: 1.4;
    color: var(--color-grey-dark);
}

.recent-posts .button {
    margin: 0 auto;
}