/* Redesigned Grid */
#recent-news-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    grid-auto-rows: 1fr;
    gap: 1.5rem;
    /*max-height: calc(480px * 2 + 1.5rem); !* 2 rows only *!*/
    overflow: hidden;
    padding: 0 1rem 1rem;
}

@media (max-width: 480px) {
    #recent-news-widget-grid {
        /*max-height: calc(480px * 3 + 1.5rem * 2); !* Show 3 rows if single column *!*/
    }
}

/* Redesigned News Card */
.article-widget {
    background-color: var(--light-black);
    border: 1px solid var(--primary-300);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.article-widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Headline */
.article-headline {
    font-size: 22px;
    font-weight: bold;
    color: var(--color-highlight);
    margin-bottom: 10px;
    line-height: 1.3;
}

/* Meta Row: Author + Date */
.article-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-dim);
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-author {
    color: var(--color-secondary);
}

.news-date {
    color: lightgray;
    font-style: italic;
}

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 12px;
}

.news-tag {
    background-color: var(--lighter-gray);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Markdown Preview */
.news-preview {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    overflow: hidden;
    position: relative;
    max-height: 320px;
}

.news-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5rem;
    background: linear-gradient(to bottom, transparent, var(--light-black));
}

.article-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10; /* Ensure it's on top of other elements */
    transition: color 0.3s ease; /* Smooth hover effect */
    display: none;
}

/* Show three-dots icon only on hover */
.article-widget:hover .article-menu {
    display: block;
}

.article-menu-options {
    position: absolute;
    top: 30px;
    right: 10px;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 5px;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.article-menu-options button {
    background: none;
    font-family: 'Oxanium', sans-serif;
    font-size: 11px;
    border: none;
    color: var(--color-text);
    padding: 5px 10px;
    cursor: pointer;
    text-align: left;
}

.article-menu-options button:hover {
    background-color: var(--color-hover);
}

/* Position the three-dots icon in the top-right */
.article-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: var(--color-accent);
    font-size: 16px;
}
.article-icon:hover {
    color: var(--color-hover);
}