/* Simple two-column latest-article cards, matching letonya.net. */
.recent-post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 28px;
    margin-bottom: 48px;
}

.recent-post-card { min-width: 0; }
.recent-post-link { display: block; color: #111; text-decoration: none; }
.recent-post-media {
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}
.recent-post-media img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recent-post-title {
    margin: 12px 0 0;
    color: #111;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    max-height: 2.8em;
}
.recent-post-link:hover .recent-post-title { text-decoration: underline; text-underline-offset: 3px; }
.recent-post-link:focus-visible { outline: 2px solid var(--primary, #651a21); outline-offset: 5px; }

@media (max-width: 640px) {
    .recent-post-grid { column-gap: 12px; row-gap: 22px; }
    .recent-post-title { font-size: 17px; margin-top: 10px; }
}
@media (max-width: 480px) {
    .recent-post-title { font-size: 15px; line-height: 1.4; }
}


/* Five compact popular-article banners in the sidebar. */
.popular-banner-list {
    display: grid;
    gap: 12px;
}
.popular-banner {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, #263850, #111827 70%, #0f172a);
    color: #fff;
    text-decoration: none;
}
.popular-banner img {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #172033;
    transition: transform .35s ease;
}
.popular-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(0deg, rgba(8,15,28,.88), rgba(8,15,28,.12) 78%);
}
.popular-banner-title {
    position: absolute;
    z-index: 1;
    right: 14px;
    bottom: 12px;
    left: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    text-shadow: 0 1px 8px rgba(0,0,0,.45);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.popular-banner:hover img { transform: scale(1.04); }
.popular-banner:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 640px) {
    .popular-banner { min-height: 0; }
    .popular-banner-title { font-size: 14px; }
}


/* Compact category article-count labels in every public category list. */
.category-count-badge {
    padding: 2px 7px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    font-weight: 500 !important;
    white-space: nowrap;
}
