/* Tech Insights - Grid Layout with Article Pages */

/* News Header */
.news-header {
    text-align: center;
    padding: 25px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.news-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -1px;
}

.news-subtitle {
    font-size: 1rem;
    color: var(--text-medium);
    margin-top: 8px;
}

/* News Container */
.news-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Articles Grid - 4 per row on desktop */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* Compact grid for recommended articles */
.articles-grid.compact {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
    margin: 0 auto;
}

/* News Card */
.news-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    display: inline-block;
    color: var(--primary-blue);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.news-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 12px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.see-more-btn {
    display: inline-block;
    background: var(--primary-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
    margin-top: auto;
}

.see-more-btn:hover {
    background: var(--primary-dark);
}

/* Article Page Styles */
.article-page {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-hero-image {
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
}

.article-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.article-header {
    padding: 30px 30px 0 30px;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin: 10px 0 0 0;
}

.article-content {
    padding: 0 30px 30px 30px;
}

.article-content p {
    font-size: 1rem;
    color: var(--text-medium);
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Ad Spaces */
.ad-space {
    padding: 20px 30px;
    background: var(--bg-light);
    margin: 0;
}

.ad-space-inline {
    padding: 15px 0;
    margin: 15px 0;
    text-align: center;
}

.ad-placeholder {
    background: #e2e8f0;
    border: 2px dashed #cbd5e1;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    border-radius: 4px;
}

.ad-space-inline .ad-placeholder {
    padding: 30px 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Recommended Articles */
.recommended-articles {
    padding: 30px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.recommended-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 24px;
}

/* Navigation active state */
.nav-link.active {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .articles-grid.compact {
        grid-template-columns: 1fr;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-hero-image {
        height: 220px;
    }
}

@media (max-width: 600px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .news-title {
        font-size: 1.8rem;
    }
    
    .news-card-image {
        height: 180px;
    }
    
    .article-page {
        border-radius: 0;
        margin: 0 -20px;
        width: calc(100% + 40px);
    }
    
    .article-hero-image {
        height: 180px;
        aspect-ratio: 16 / 9;
    }
    
    .article-header {
        padding: 20px 15px 0 15px;
    }
    
    .article-content {
        padding: 0 15px 20px 15px;
    }
    
    .article-content p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .article-title {
        font-size: 1.4rem;
    }
    
    .ad-space {
        padding: 15px;
    }
    
    .recommended-articles {
        padding: 15px;
    }
}

/* Dark Mode Styles */
[data-theme="dark"] .news-card {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .article-page {
    border: 1px solid var(--border-color);
}
