/* Homepage News Widget - Modern Design System */
:root {
    --primary-blue: #004b93;
    --secondary-blue: #0066cc;
    --accent-orange: #ee7601;
    --text-dark: #333;
    --text-gray: #666;
    --text-light: #999;
    --border-light: #e8e8e8;
    --bg-light: #f5f5f5;
    --bg-hover: #fafafa;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Widget Container */
.grid-homepage-news-widget {
    margin: 0;
}

.grid-homepage-news-widget .widget-inner {
    background: #fff;
    overflow: hidden;
}

/* Header with Orange Accent Bar */
.grid-homepage-news-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.grid-homepage-news-widget .more-link {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    padding: 8px 12px;
    border-radius: 6px;
}

.grid-homepage-news-widget .more-link:hover {
    background: rgba(238, 118, 1, 0.1);
    transform: translateX(2px);
}

/* Modern Grid Layout */
.news-articles-grid-homepage {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    padding: 15px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Source Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Article Cards */
.article-card-homepage {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Featured/Hero Article - First item spans 2 columns */
.article-card-homepage:first-child {
    grid-column: span 2;
}

.article-card-homepage:first-child .article-image-wrapper {
    padding-top: 35%;
}

/* Featured article larger title */
.article-card-homepage:first-child .article-title {
    font-size: 20px;
    -webkit-line-clamp: 3;
}

/* Featured article larger excerpt */
.article-card-homepage:first-child .article-excerpt {
    font-size: 14px;
    -webkit-line-clamp: 3;
}

.article-card-homepage:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

/* Article Images */
.article-card-homepage .article-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: var(--bg-light);
}

.article-card-homepage .article-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.article-card-homepage:hover .article-image {
    transform: scale(1.05);
}

.article-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, #e0e7ef 100%);
    color: var(--text-light);
    font-size: 36px;
}

/* Category Badges */
.article-category-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 24px);
}

.article-category-badge {
    background: rgba(0, 75, 147, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-category-badge:nth-child(n+2) {
    background: rgba(0, 75, 147, 0.8);
}

.article-card-homepage:hover .article-category-badge {
    background: rgba(0, 75, 147, 0.95);
}

/* Article Content */
.article-card-homepage .article-card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Meta Information */
.article-card-homepage .article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-gray);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.article-card-homepage .article-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.article-card-homepage .author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.article-card-homepage .author-avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-gray);
}

.article-card-homepage time.entry-date {
    color: var(--text-light);
    font-size: 13px;
}

.article-card-homepage time.entry-date::before {
    content: "•";
    margin: 0 8px;
    color: var(--text-light);
}

/* Article Title */
.article-card-homepage .article-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-homepage .article-title a {
    color: inherit;
    text-decoration: none;
}

.article-card-homepage:hover .article-title {
    color: var(--primary-blue);
}

/* Article Excerpt */
.article-card-homepage .article-excerpt {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-gray);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin: 0 0 12px 0;
}

/* Article Footer */
.article-card-homepage .article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    gap: 8px;
    min-height: 28px;
}

.article-card-homepage .article-shares {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    overflow: hidden;
    align-items: center;
    min-width: 0;
}

.article-card-homepage .share-tag {
    background: #f0f4f8;
    color: var(--text-gray);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all var(--transition-fast);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.article-card-homepage a.share-tag:hover {
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
}

.article-card-homepage .share-tag.more-shares {
    background: #e8e8e8;
    color: var(--text-gray);
    font-weight: 600;
    cursor: default;
    max-width: 30px;
    flex-shrink: 0;
}

.article-card-homepage .read-more-link {
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    white-space: nowrap;
}

.article-card-homepage .read-more-link:hover {
    gap: 5px;
    color: var(--secondary-blue);
}

.article-card-homepage .read-more-link::after {
    content: "→";
    font-size: 14px;
}

/* Widget Footer */
.grid-homepage-news-widget .widget-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid var(--border-light);
}

.grid-homepage-news-widget .btn-more-news {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-orange);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.grid-homepage-news-widget .btn-more-news:hover {
    background: #d86a01;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 118, 1, 0.25);
}


/* Mobile Responsive */
@media (max-width: 1200px) {
    .news-articles-grid-homepage {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }

    .article-card-homepage:first-child {
        grid-column: span 1;
    }

    .article-card-homepage:first-child .article-image-wrapper {
        padding-top: 56.25%;
    }

}

@media (max-width: 768px) {
    .grid-homepage-news-widget .widget-header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 0;
        margin-bottom:10px;
    }

    .grid-homepage-news-widget .widget-title::before {
        height: 20px !important;
    }

    .news-articles-grid-homepage {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 16px;
    }

    .article-card-homepage:first-child {
        grid-column: span 1;
    }

    .article-card-homepage:first-child .article-title {
        font-size: 18px;
    }

    .article-card-homepage .article-card-content {
        padding: 14px;
    }

    .article-card-homepage .article-title {
        font-size: 16px;
    }

    .article-card-homepage .article-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .grid-homepage-news-widget .widget-footer {
        padding: 16px 20px;
    }

    .grid-homepage-news-widget .btn-more-news {
        width: 100%;
        justify-content: center;
    }
    .grid-homepage-news-widget.grid-element {
        margin: 10px 0  !important;
    }
}

@media (max-width: 480px) {
    .article-card-homepage .article-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .article-card-homepage .article-shares {
        max-width: 100%;
        flex: 1 1 100%;
        order: 2;
    }

    .article-card-homepage .read-more-link {
        order: 1;
        margin-left: auto;
    }
}

/* Hover Effects (desktop only) */
@media (hover: hover) {
    .article-card-homepage {
        transition: all var(--transition-normal);
    }

    .article-card-homepage:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
    }

    .article-card-homepage:hover .article-image {
        transform: scale(1.05);
    }

    .article-card-homepage:hover .article-title {
        color: var(--secondary-blue);
    }
}

/* Print Styles */
@media print {
    .grid-homepage-news-widget .widget-header .more-link,
    .grid-homepage-news-widget .widget-footer {
        display: none !important;
    }

    .news-articles-grid-homepage {
        display: block !important;
    }

    .article-card-homepage {
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}
