/* Container for the entire widget */
.rwrant-widget-container {
    padding: 5px;
    background-color: #f9f9f9;
    margin: 5px 0;
    font-size: 15px;
    box-sizing: border-box;
}

/* Widget title */
.rwrant-widget-container h2 {
    text-align: center;
    color: #000;
    margin: 5px 0 10px !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

/* Grid for the posts */
.rwrant-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Desktop: 4 per row */
    gap: 20px;
}

/* Individual post item styling */
.rwrant-post-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    background-color: #fff;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.2s ease;
    height: 100%;
    font-size: 15px;
}

.rwrant-post-item:hover {
    transform: translateY(-4px);
}

/* Post thumbnail image */
.rwrant-post-thumbnail {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}

/* Post title */
.rwrant-post-item h3 {
    font-size: 15px;
    margin: 6px 8px 4px;
    color: #000; /* Force black */
    font-weight: 600;
    line-height: 1.3;
    min-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------ Responsive adjustments ------------------ */

/* Tablet: 2 columns */
@media (max-width: 992px) {
    .rwrant-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Smaller tablets / large phones */
@media (max-width: 768px) {
    .rwrant-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Mobile: 1 column */
@media (max-width: 576px) {
    .rwrant-posts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .rwrant-widget-container {
        padding: 6px;
        margin: 6px 0;
    }
}
