/* Article Listing Page */
.articles-hero {
    padding-top: 120px;
    padding-bottom: 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.articles-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.articles-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
}

.article-preview-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.article-preview-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

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

.article-preview-image-wrapper {
    overflow: hidden;
    height: 220px;
    position: relative;
}

.article-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-preview-gradient {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.article-preview-gradient .preview-icon {
    font-size: 4rem;
    opacity: 0.3;
    color: white;
}

.article-preview-body {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-preview-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.article-preview-tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.article-preview-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.article-preview-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.article-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.article-preview-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.article-preview-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.article-read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Article Detail Page */
.article-page-nav .nav-menu li:last-child .nav-link,
.article-page-nav .nav-menu li:last-child .nav-cta {
    white-space: nowrap;
}

.article-hero {
    padding-top: 120px;
    padding-bottom: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.article-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.article-breadcrumb a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.article-breadcrumb a:hover {
    opacity: 1;
}

.article-breadcrumb .separator {
    opacity: 0.5;
}

.article-hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    opacity: 0.9;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.article-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Article Body */
.article-body-section {
    background: var(--surface);
    padding: 4rem 0;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.article-content {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
}

.article-content h2 {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.article-content strong {
    color: var(--text-primary);
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: var(--secondary-color);
}

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

.article-content li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.article-content li strong {
    color: var(--text-primary);
}

/* Code Blocks */
.article-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    border: 1px solid #313244;
}

.article-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.88rem;
}

.article-content p code,
.article-content li code {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Diagram / Visual Blocks */
.article-diagram {
    background: #f8f9ff;
    border: 2px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    overflow-x: auto;
}

.article-diagram pre {
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    display: inline-block;
    text-align: left;
}

.article-diagram .diagram-caption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-style: italic;
}

/* Callout / Info Blocks */
.article-callout {
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
    position: relative;
}

.article-callout p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.article-callout p:last-child {
    margin-bottom: 0;
}

.article-callout-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout-info {
    background: rgba(59, 130, 246, 0.08);
    border-left: 4px solid #3b82f6;
}

.callout-info .article-callout-title {
    color: #3b82f6;
}

.callout-success {
    background: rgba(16, 185, 129, 0.08);
    border-left: 4px solid #10b981;
}

.callout-success .article-callout-title {
    color: #10b981;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid #f59e0b;
}

.callout-warning .article-callout-title {
    color: #f59e0b;
}

.callout-tip {
    background: rgba(99, 102, 241, 0.08);
    border-left: 4px solid var(--primary-color);
}

.callout-tip .article-callout-title {
    color: var(--primary-color);
}

/* Comparison Table */
.article-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.article-table thead {
    background: var(--gradient-primary);
    color: white;
}

.article-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.article-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.article-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}

.article-table tbody tr:last-child td {
    border-bottom: none;
}

/* Numbered Steps */
.article-steps {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
    margin: 2rem 0;
}

.article-steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.article-steps li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.article-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Sidebar */
.article-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.sidebar-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.sidebar-toc {
    list-style: none;
    padding: 0;
}

.sidebar-toc li {
    margin-bottom: 0.5rem;
}

.sidebar-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.5;
    display: block;
    padding: 0.3rem 0.75rem;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s;
}

.sidebar-toc a:hover,
.sidebar-toc a.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    border-left-color: var(--primary-color);
}

.sidebar-author {
    text-align: center;
}

.sidebar-author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 0.75rem;
}

.sidebar-author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sidebar-author-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sidebar-share h3 {
    margin-bottom: 0.75rem;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.share-btn:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Article CTA */
.article-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    color: white;
    margin-top: 3rem;
}

.article-cta h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: white;
}

.article-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.article-cta .btn {
    display: inline-block;
}

/* Responsive */
@media (max-width: 960px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

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

    .article-content {
        padding: 2rem 1.5rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .articles-hero h1 {
        font-size: 2rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .article-sidebar {
        grid-template-columns: 1fr;
    }
}
