/* ============================================
   Articles Styles - Unified Design System
   ============================================ */

/* Article Container */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

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

.article-meta {
    color: var(--color-text-secondary, #718096);
    font-size: 1rem;
}

/* Featured Image */
.article-featured-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg, 0.75rem);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
}

/* Article Body - Base Styles */
.article-body {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--color-text, #2d3748);
}

/* Typography - Headings Hierarchy */
.article-body h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-text, #1a202c);
    margin: 3rem 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--color-primary, #2563eb);
    line-height: 1.2;
}

.article-body h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-text, #1a202c);
    margin: 2.5rem 0 1.25rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border, #e2e8f0);
    line-height: 1.3;
}

.article-body h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text, #1a202c);
    margin: 2rem 0 1rem 0;
    line-height: 1.4;
}

.article-body h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    margin: 1.5rem 0 0.75rem 0;
    line-height: 1.4;
}

.article-body h5 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    margin: 1.25rem 0 0.5rem 0;
}

.article-body h6 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    margin: 1rem 0 0.5rem 0;
}

/* Paragraphs */
.article-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
    line-height: 1.7;
}

/* Links */
.article-body a {
    color: var(--color-primary, #3182ce);
    text-decoration: underline;
    transition: color 0.2s;
}

.article-body a:hover {
    color: var(--color-primary-dark, #2c5aa0);
    text-decoration: underline;
}

/* Lists */
.article-body ul,
.article-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
    line-height: 1.8;
}

.article-body ul li,
.article-body ol li {
    margin: 0.75rem 0;
    line-height: 1.8;
}

.article-body ul {
    list-style-type: disc;
}

.article-body ol {
    list-style-type: decimal;
}

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

/* Blockquotes */
.article-body blockquote {
    border-left: 4px solid var(--color-primary, #2563eb);
    padding-left: 1.5rem;
    padding-right: 1rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--color-text-secondary, #64748b);
    background: var(--color-bg-secondary, #f8fafc);
    border-radius: var(--radius-md, 0.5rem);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

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

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

/* Strong and Emphasis */
.article-body strong {
    font-weight: 700;
    color: var(--color-text, #1a202c);
}

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

.article-body strong em,
.article-body em strong {
    font-weight: 700;
    font-style: italic;
}

/* Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95em;
}

.article-body table th,
.article-body table td {
    padding: 0.75rem;
    border: 1px solid var(--color-border, #e2e8f0);
    text-align: left;
}

.article-body table th {
    background: var(--color-bg-secondary, #f8fafc);
    font-weight: 600;
    color: var(--color-text, #1a202c);
}

.article-body table tr:nth-child(even) {
    background: var(--color-bg-secondary, #f8fafc);
}

.article-body table tr:hover {
    background: var(--color-border-light, #f1f5f9);
}

/* Code */
.article-body code {
    background: var(--color-bg-secondary, #f8fafc);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm, 0.375rem);
    font-family: var(--font-family-mono, 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace);
    font-size: 0.9em;
    color: var(--color-primary, #2563eb);
}

.article-body pre {
    background: var(--color-bg-dark, #1e293b);
    color: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-md, 0.5rem);
    overflow-x: auto;
    margin: 2rem 0;
    line-height: 1.6;
}

.article-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.9em;
}

/* Horizontal Rules */
.article-body hr {
    border: none;
    border-top: 2px solid var(--color-border, #e2e8f0);
    margin: 3rem 0;
}

/* Images - Unified Styles */
.article-body img,
.article-body div img,
.article-body center img,
.article-body p img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md, 0.5rem);
    margin: 2rem auto;
    display: block;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1));
}

/* Centered Content */
.article-body center,
.article-body div[style*="text-align: center"],
.article-body div[style*="text-align:center"],
.article-body div[style*="text-align: center;"] {
    text-align: center;
    margin: 2rem 0;
}

/* Images in Links */
.article-body a img {
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-body a:hover img {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1));
}

/* Special Blocks */
.article-body div[class*="highlight"],
.article-body div[class*="warning"],
.article-body div[class*="info"],
.article-body div[class*="note"] {
    padding: 1.5rem;
    border-radius: var(--radius-md, 0.5rem);
    margin: 2rem 0;
    border-left: 4px solid var(--color-warning, #f59e0b);
    background: var(--color-bg-secondary, #f8fafc);
}

/* Article Navigation */
.article-navigation {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--color-border, #e2e8f0);
}

.nav-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text, #1a202c);
    margin-bottom: 1.5rem;
    text-align: center;
}

.nav-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.nav-links-list li {
    margin: 0;
    padding: 1rem;
    background: var(--color-bg-secondary, #f8fafc);
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid var(--color-border, #e2e8f0);
    transition: var(--transition, all 0.2s ease-in-out);
}

.nav-links-list li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1));
    border-color: var(--color-primary, #2563eb);
}

.nav-links-list a {
    color: var(--color-text, #1a202c);
    text-decoration: none;
    font-weight: 500;
    display: block;
    line-height: 1.5;
}

.nav-links-list a:hover {
    color: var(--color-primary, #2563eb);
    text-decoration: none;
}

/* RTL Support for Hebrew */
[dir="rtl"] .article-content {
    text-align: right;
}

[dir="rtl"] .article-header {
    text-align: right;
}

[dir="rtl"] .article-body {
    text-align: right;
}

[dir="rtl"] .article-body p {
    text-align: right;
}

[dir="rtl"] .article-body ul,
[dir="rtl"] .article-body ol {
    padding-right: 2rem;
    padding-left: 0;
}

[dir="rtl"] .article-body blockquote {
    border-right: 4px solid var(--color-primary, #2563eb);
    border-left: none;
    padding-right: 1.5rem;
    padding-left: 1rem;
}

[dir="rtl"] .article-body table th,
[dir="rtl"] .article-body table td {
    text-align: right;
}

[dir="rtl"] .nav-links-list {
    direction: rtl;
}

[dir="rtl"] .nav-title {
    text-align: right;
}

[dir="rtl"] .article-body center,
[dir="rtl"] .article-body div[style*="text-align: center"] {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-content {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    .article-body h1 {
        font-size: 1.75rem;
        margin: 2rem 0 1rem 0;
    }
    
    .article-body h2 {
        font-size: 1.5rem;
        margin: 2rem 0 1rem 0;
    }
    
    .article-body h3 {
        font-size: 1.25rem;
        margin: 1.5rem 0 0.75rem 0;
    }
    
    .article-body h4 {
        font-size: 1.125rem;
    }
    
    .article-body p {
        margin-bottom: 1.25rem;
    }
    
    .article-body img,
    .article-body div img,
    .article-body center img {
        margin: 1.5rem auto;
    }
    
    .article-navigation {
        margin-top: 3rem;
        padding-top: 2rem;
    }
    
    .nav-links-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .nav-links-list li {
        padding: 0.875rem;
    }
    
    .nav-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .article-content {
        padding: 1rem 0.5rem;
    }
    
    .article-title {
        font-size: 1.75rem;
    }
    
    .article-body {
        font-size: 0.95rem;
    }
    
    .article-body h1 {
        font-size: 1.5rem;
    }
    
    .article-body h2 {
        font-size: 1.25rem;
    }
    
    .article-body h3 {
        font-size: 1.125rem;
    }
    
    .article-body p {
        text-align: left;
        margin-bottom: 1rem;
    }
    
    [dir="rtl"] .article-body p {
        text-align: right;
    }
    
    .article-body ul,
    .article-body ol {
        padding-left: 1.5rem;
        margin: 1rem 0;
    }
    
    [dir="rtl"] .article-body ul,
    [dir="rtl"] .article-body ol {
        padding-right: 1.5rem;
        padding-left: 0;
    }
    
    .article-body img {
        margin: 1rem auto;
        border-radius: var(--radius-sm, 0.375rem);
    }
    
    .article-navigation {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .nav-links-list {
        gap: 0.5rem;
    }
    
    .nav-links-list li {
        padding: 0.75rem;
    }
    
    .nav-title {
        font-size: 1.125rem;
    }
    
    .article-body blockquote {
        padding-left: 1rem;
        padding-right: 0.75rem;
    }
    
    [dir="rtl"] .article-body blockquote {
        padding-right: 1rem;
        padding-left: 0.75rem;
    }
    
    .article-body table {
        font-size: 0.85em;
    }
    
    .article-body table th,
    .article-body table td {
        padding: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .article-content {
        max-width: 100%;
        padding: 0;
    }
    
    .article-navigation {
        display: none;
    }
    
    .article-body {
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .article-body img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    .article-body a {
        color: #000;
        text-decoration: underline;
    }
    
    .article-body a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

