/* Articles CSS with Light/Dark Theme Support */

/* Theme variables */
:root {
    --article-bg: #ffffff;
    --article-text: #212529;
    --article-text-secondary: #6c757d;
    --article-border: #dee2e6;
    --article-card-bg: #ffffff;
    --article-card-hover: #f8f9fa;
    --article-category-bg: #0d6efd;
    --article-category-text: #ffffff;
    --article-shadow: rgba(0, 0, 0, 0.1);
    --article-avatar-bg: #e9ecef;
    --article-avatar-text: #495057;
    --article-quote-bg: #f8f9fa;
    --article-quote-border: #0d6efd;
}

[data-theme="dark"] {
    --article-bg: #212529;
    --article-text: #f8f9fa;
    --article-text-secondary: #adb5bd;
    --article-border: #495057;
    --article-card-bg: #2d3238;
    --article-card-hover: #373b41;
    --article-category-bg: #0d6efd;
    --article-category-text: #ffffff;
    --article-shadow: rgba(0, 0, 0, 0.3);
    --article-avatar-bg: #495057;
    --article-avatar-text: #f8f9fa;
    --article-quote-bg: #2d3238;
    --article-quote-border: #0d6efd;
}

/* Articles Container */
.articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.articles-header {
    text-align: center;
    margin-bottom: 3rem;
}

.articles-header h1 {
    color: var(--article-text);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.articles-header .lead {
    color: var(--article-text-secondary);
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Article Card */
.article-card {
    background: var(--article-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--article-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--article-shadow);
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.article-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.article-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--article-category-bg);
    color: var(--article-category-text);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Article Content */
.article-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    color: var(--article-text);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-excerpt {
    color: var(--article-text-secondary);
    font-size: 0.938rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Article Meta */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--article-border);
    gap: 1rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--article-avatar-bg);
    color: var(--article-avatar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.author-name {
    color: var(--article-text);
    font-weight: 600;
    font-size: 0.875rem;
}

.author-title {
    color: var(--article-text-secondary);
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.article-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.813rem;
    color: var(--article-text-secondary);
}

.read-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Article Detail Page */
.article-detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.article-detail-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--article-text-secondary);
    text-decoration: none;
    font-size: 0.938rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--article-text);
}

.article-category-badge {
    display: inline-block;
    background: var(--article-category-bg);
    color: var(--article-category-text);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.article-detail-title {
    color: var(--article-text);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .article-detail-title {
        font-size: 2rem;
    }
}

.article-detail-excerpt {
    color: var(--article-text-secondary);
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Article Detail Meta */
.article-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-top: 1px solid var(--article-border);
    border-bottom: 1px solid var(--article-border);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.author-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--article-avatar-bg);
    color: var(--article-avatar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.author-name-large {
    color: var(--article-text);
    font-weight: 700;
    font-size: 1.125rem;
}

.author-title-large {
    color: var(--article-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.article-info {
    display: flex;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--article-text-secondary);
    font-size: 0.938rem;
}

/* Article Hero Image */
.article-image-hero {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 3rem;
    background: var(--article-avatar-bg);
}

.article-image-hero img {
    width: 100%;
    height: auto;
    display: block;
}

/* Article Body */
.article-body {
    color: var(--article-text);
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-body h2 {
    color: var(--article-text);
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-body h3 {
    color: var(--article-text);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.875rem;
    line-height: 1.3;
}

.article-body p {
    margin-bottom: 1.5rem;
}


.article-body a {
    color: var(--article-category-bg);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.article-body a:hover {
    opacity: 0.8;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.75rem;
}

.article-body blockquote {
    background: var(--article-quote-bg);
    border-left: 4px solid var(--article-quote-border);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.article-body blockquote p {
    margin-bottom: 0.5rem;
    font-style: italic;
    font-size: 1.125rem;
}

.article-body blockquote cite {
    color: var(--article-text-secondary);
    font-size: 0.938rem;
    font-style: normal;
}

.article-body strong {
    font-weight: 700;
    color: var(--article-text);
}

.article-body em {
    font-style: italic;
}



.article-body a:hover {
    opacity: 0.8;
}

/* Article Footer */
.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--article-border);
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-stats {
        align-items: flex-start;
    }

    .article-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}
