/* ====================================
   تنسيق محتوى المقالات المنشورة
   ==================================== */

/* Container للمحتوى */
.article-body,
.article-content,
.article-formatted-content {
    font-family: 'Tajawal', Arial, sans-serif !important;
    font-size: 1.125rem !important;
    line-height: 1.9 !important;
    color: #1e293b !important;
    text-align: right !important;
    direction: rtl !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

.article-body *,
.article-content *,
.article-formatted-content * {
    font-family: inherit !important;
    direction: rtl !important;
}

/* العناوين */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #C08B2D !important;
    font-weight: 700 !important;
    margin-top: 2em !important;
    margin-bottom: 1em !important;
    line-height: 1.4 !important;
    display: block !important;
}

.article-body h1,
.article-content h1 {
    font-size: 2.25rem;
    border-bottom: 3px solid #C08B2D;
    padding-bottom: 0.5em;
}

.article-body h2,
.article-content h2 {
    font-size: 1.875rem;
    position: relative;
    padding-right: 1.25rem;
}

.article-body h2::before,
.article-content h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.25em;
    width: 4px;
    height: 1.2em;
    background: linear-gradient(to bottom, #C08B2D, #B22B2B);
    border-radius: 2px;
}

.article-body h3,
.article-content h3 {
    font-size: 1.5rem;
}

.article-body h4,
.article-content h4 {
    font-size: 1.25rem;
    color: #475569;
}

/* الفقرات */
.article-body p,
.article-content p {
    margin-bottom: 1.5em !important;
    text-align: justify !important;
    line-height: 1.9 !important;
    font-size: 1.125rem !important;
}

.article-body p:first-of-type::first-letter,
.article-content p:first-of-type::first-letter {
    font-size: 3em;
    font-weight: 700;
    color: #C08B2D;
    float: right;
    line-height: 0.9;
    margin-left: 0.1em;
    margin-top: 0.1em;
}

/* القوائم */
.article-body ul,
.article-body ol,
.article-content ul,
.article-content ol {
    margin: 1.5em 0 !important;
    padding-right: 2em !important;
    display: block !important;
}

.article-body ul li,
.article-content ul li {
    margin-bottom: 0.75em !important;
    position: relative;
    display: list-item !important;
    list-style-position: inside !important;
}

.article-body ul li::before,
.article-content ul li::before {
    content: '◆';
    color: #C08B2D;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: 0.5em;
}

.article-body ol li,
.article-content ol li {
    margin-bottom: 0.75em !important;
    counter-increment: item;
    display: list-item !important;
    list-style-position: inside !important;
}

.article-body ol,
.article-content ol {
    counter-reset: item;
}

.article-body ol li::marker,
.article-content ol li::marker {
    color: #C08B2D;
    font-weight: 700;
}

/* الاقتباسات */
.article-body blockquote,
.article-content blockquote {
    border-right: 5px solid #C08B2D;
    background: linear-gradient(to left, rgba(192, 139, 45, 0.05), transparent);
    padding: 1.5em 2em;
    margin: 2em 0;
    color: #475569;
    font-style: italic;
    font-size: 1.125rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.article-body blockquote::before,
.article-content blockquote::before {
    content: '"';
    font-size: 4em;
    color: rgba(192, 139, 45, 0.2);
    position: absolute;
    margin-right: -0.5em;
    margin-top: -0.3em;
}

/* الروابط */
.article-body a,
.article-content a {
    color: #C08B2D;
    text-decoration: underline;
    transition: all 0.3s ease;
    font-weight: 600;
}

.article-body a:hover,
.article-content a:hover {
    color: #B22B2B;
    text-decoration: none;
}

/* الصور */
.article-body img,
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2em auto;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.article-body figure,
.article-content figure {
    margin: 2em 0;
}

.article-body figcaption,
.article-content figcaption {
    text-align: center;
    color: #64748b;
    font-size: 0.9375rem;
    margin-top: 0.75em;
    font-style: italic;
}

/* الجداول */
.article-body table,
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.article-body table th,
.article-body table td,
.article-content table th,
.article-content table td {
    border: 1px solid #e2e8f0;
    padding: 1em;
    text-align: right;
}

.article-body table th,
.article-content table th {
    background: linear-gradient(135deg, #C08B2D, #D4A843);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.0625rem;
}

.article-body table tr:nth-child(even),
.article-content table tr:nth-child(even) {
    background: #f8fafc;
}

.article-body table tr:hover,
.article-content table tr:hover {
    background: rgba(192, 139, 45, 0.05);
}

/* النص الغامق والمائل */
.article-body strong,
.article-body b,
.article-content strong,
.article-content b {
    font-weight: 700 !important;
    color: #0f172a !important;
}

.article-body em,
.article-body i,
.article-content em,
.article-content i {
    font-style: italic !important;
    color: #475569 !important;
}

/* الأكواد */
.article-body code,
.article-content code {
    background: #f1f5f9;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #B22B2B;
    font-size: 0.9em;
}

.article-body pre,
.article-content pre {
    background: #1e293b;
    color: #f1f5f9;
    padding: 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2em 0;
    direction: ltr;
    text-align: left;
}

.article-body pre code,
.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* الخطوط الأفقية */
.article-body hr,
.article-content hr {
    border: none;
    height: 3px;
    background: linear-gradient(to left, #C08B2D, #D4A843, #C08B2D);
    margin: 3em 0;
    border-radius: 2px;
}

/* مربعات التنبيه */
.article-body .alert,
.article-content .alert {
    padding: 1.25em 1.5em;
    border-radius: 8px;
    margin: 1.5em 0;
    border-right: 4px solid;
}

.article-body .alert-info,
.article-content .alert-info {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #075985;
}

.article-body .alert-warning,
.article-content .alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.article-body .alert-success,
.article-content .alert-success {
    background: #dcfce7;
    border-color: #22c55e;
    color: #14532d;
}

.article-body .alert-danger,
.article-content .alert-danger {
    background: #fee2e2;
    border-color: #ef4444;
    color: #7f1d1d;
}

/* Responsive */
@media (max-width: 768px) {
    .article-body,
    .article-content {
        font-size: 1rem;
    }
    
    .article-body h1,
    .article-content h1 {
        font-size: 1.75rem;
    }
    
    .article-body h2,
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-body h3,
    .article-content h3 {
        font-size: 1.25rem;
    }
    
    .article-body table,
    .article-content table {
        font-size: 0.875rem;
    }
    
    .article-body table th,
    .article-body table td,
    .article-content table th,
    .article-content table td {
        padding: 0.75em 0.5em;
    }
}

/* تحسين الطباعة */
@media print {
    .article-body,
    .article-content {
        font-size: 12pt;
        color: #000;
    }
    
    .article-body h1,
    .article-body h2,
    .article-body h3,
    .article-content h1,
    .article-content h2,
    .article-content h3 {
        page-break-after: avoid;
    }
    
    .article-body img,
    .article-content img {
        page-break-inside: avoid;
        max-width: 100%;
    }
}

