.similar-articles .articles {
    display: flex;
    gap: 24px; 
    flex-wrap: wrap;
}

.similar-articles .big-image {
    position: relative;
    background-size: cover;
    background-position: center;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: calc(50% - 12px);
}

.similar-articles .article-category-right {
    display: flex;
    justify-content: flex-end;
}

.similar-articles .article-category-right p {
    color: white;
    background-color: var(--wp--preset--color--red);
    margin: 10px;
    padding: 2px 12px;
}

.similar-articles .article-category-left {
    display: flex;
    align-items: flex-end;
    height: 100%;
}

.similar-articles .article-category-left p {
    color: white;
    background-color: var(--wp--preset--color--red);
    margin: 10px;
    padding: 2px 12px;
}

.similar-articles .article-info-big {
    background: white;
    padding: 10px;
    width: 80%;
}

.similar-articles .article-info-big p{
    color: var(--wp--preset--color--base);
}

.similar-articles .article-info-small {
    width: 70%;
    padding-left: 24px;
}

.similar-articles .article-info-small p{
    color: var(--wp--preset--color--base);
}

.similar-articles .article-info-big h4,
.similar-articles .article-info-small h4 {
    transition: all .2s ease-in-out;
}

.similar-articles .small-article {
    display: flex;
}

.similar-articles .small-image {
    background-size: cover;
    background-position: center;
    width: 30%;
}

.similar-articles .small-articles-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: calc(50% - 12px);
}

.similar-articles .article-info-big h4, 
.similar-articles .article-info-small h4,
.similar-articles .article-info-big p, 
.similar-articles .article-info-small p {
    margin-block-start: 0.2em;
    margin-block-end: 0.2em;
}

.similar-articles .date {
    color: #888888 !important;
}

.similar-articles .truncate-title {
    display: block;
    width: 100%;           /* Ensure the title takes the full width of its container */
    white-space: nowrap;    /* Ensure single-line display */
    overflow: hidden;       /* Hide overflow text */
    text-overflow: ellipsis; /* Show ellipsis for truncated text */
    max-width: 100%;        /* Ensure the title does not overflow its parent container */
    box-sizing: border-box; /* Ensure padding and borders are considered in the width calculation */
}

.similar-articles .truncate-excerpt {
    display: -webkit-box;        /* Use a box model that supports line clamping */
    -webkit-line-clamp: 3;       /* Display only the first 3 lines */
    -webkit-box-orient: vertical;/* Set the box orientation to vertical */
    overflow: hidden;            /* Hide the overflowing text */
    text-overflow: ellipsis;     /* Show ellipsis for truncated text */
    max-height: calc(1.5em * 3); /* Limit the maximum height to 3 lines (line height of 1.5em) */
}

.similar-articles a:not(.wp-element-button) {
    text-decoration: none !important;
}

.similar-articles .small-articles-container a:not(.wp-element-button) {
    text-decoration: none !important;
    height: calc(50% - 12px);
}

.similar-articles a:not(.wp-element-button):hover h4{
    color: var(--wp--preset--color--red);
}

/* Media Query for responsive design */
@media (max-width: 782px) {
    .wp-block-columns {
        flex-wrap: wrap !important; /* Stack the columns */
    }

    .similar-articles .big-image,
    .similar-articles .small-articles-container {
        flex-basis: 100%; /* Full width when stacked */
    }

    .similar-articles .small-article {
        flex-direction: column;
    }

    .similar-articles .small-image {
        width: 100%;
        height: 200px;
    }

    .similar-articles .article-info-small {
        width: 100%; 
        padding-left: 0px;
    }
}
