/*
 * ظاهر متن مقاله‌ها — هم در صفحه‌ی سایت و هم داخل ویرایشگر مدیریت (پیش‌نمایش یکسان).
 *
 * اصل کار: نویسنده فقط «نقش» هر بخش را مشخص می‌کند (متن اصلی، تیتر بخش، زیرتیتر، تصویر، فهرست...)
 * و اندازه، فونت، فاصله و تراز را این فایل برای موبایل و دسکتاپ تعیین می‌کند.
 * هر استایل دستی (اندازه، فونت، رنگ، تراز) که از Word یا جای دیگر وارد شده باشد، نادیده گرفته می‌شود.
 */

.article-content {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    unicode-bidi: embed;
    color: #1f2937;
    /* اندازه‌ی پایه: موبایل ۱۶، تبلت ۱۷، دسکتاپ ۱۸ پیکسل — بقیه‌ی اندازه‌ها نسبت به همین هستند */
    font-size: 16px;
    line-height: 2;
    text-align: justify;          /* خطوط تا انتها کشیده می‌شوند (تراز دوطرفه) */
    text-justify: inter-word;
    overflow-wrap: break-word;
    hyphens: none;
}

@media (min-width: 640px)  { .article-content { font-size: 17px; } }
@media (min-width: 1024px) { .article-content { font-size: 18px; line-height: 2.1; } }

/* ---- متن اصلی ---- */
.article-content p,
.article-content li,
.article-content blockquote,
.article-content div {
    font-size: 1em !important;
    font-family: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    text-align: justify !important;
    text-justify: inter-word;
    background: transparent !important;
}

.article-content p { margin: 0 0 1.25em; }

/* استایل‌های دستی داخل متن (فونت، اندازه، رنگ) تاثیری ندارند */
.article-content span,
.article-content font,
.article-content strong,
.article-content b,
.article-content em,
.article-content i,
.article-content u {
    font-size: inherit !important;
    font-family: inherit !important;
    line-height: inherit !important;
    background: transparent !important;
}
.article-content span, .article-content font { color: inherit !important; }
.article-content strong, .article-content b { font-weight: 700; }
.article-content em, .article-content i { font-style: italic; }

/* ---- تیترها ---- */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-family: inherit !important;
    color: #2c1810 !important;
    text-align: right !important;     /* تیتر همیشه راست‌چین، نه کشیده */
    line-height: 1.6 !important;
    margin: 2em 0 0.8em;
    font-weight: 800;
    background: transparent !important;
}
/* تیتر بخش (H2) و H1 قدیمی که داخل متن مانده */
.article-content h1,
.article-content h2 {
    font-size: 1.4em !important;
    padding-right: 0.6em;
    border-right: 4px solid #c6ba82;
}
/* زیرتیتر (H3) */
.article-content h3 { font-size: 1.2em !important; }
.article-content h4 { font-size: 1.05em !important; }

@media (min-width: 768px) {
    .article-content h1,
    .article-content h2 { font-size: 1.55em !important; }
    .article-content h3 { font-size: 1.3em !important; }
}
.article-content > :first-child { margin-top: 0; }

/* ---- فهرست‌ها ---- */
.article-content ul,
.article-content ol {
    margin: 0 0 1.25em;
    padding: 0 1.6em 0 0;
}
.article-content ul { list-style: disc outside; }
.article-content ol { list-style: decimal outside; }
.article-content li { margin-bottom: 0.5em; }

/* ---- نقل‌قول ---- */
.article-content blockquote {
    margin: 1.5em 0;
    padding: 0.8em 1.2em 0.8em 0.8em;
    border-right: 4px solid #c6ba82;
    background: #faf7ef !important;
    border-radius: 8px;
    color: #4b5563 !important;
}
.article-content blockquote p:last-child { margin-bottom: 0; }

/* ---- لینک ---- */
.article-content a { color: #b45309 !important; text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { color: #92400e !important; }

/* ---- تصویرها: همیشه به عرض صفحه می‌خوانند، بدون کشیدگی و بدون نیاز به تنظیم اندازه ---- */
.article-content img {
    display: block;
    float: none !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 1.75em auto !important;
    border-radius: 12px;
    object-fit: contain;
}
@media (min-width: 769px) { .article-content img { max-height: 520px; } }

/* ---- جدول (در موبایل افقی اسکرول می‌شود) ---- */
.article-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.5em 0;
}
.article-content td, .article-content th { border: 1px solid #e5e7eb; padding: 0.5em 0.8em; }

.article-content hr { border: 0; border-top: 1px solid #e5e7eb; margin: 2em 0; }

/* ---- داخل ویرایشگر (iframe): کمی فاصله از لبه‌ها ---- */
body.cke_editable.article-content { padding: 16px 20px; background: #fff; }
