/* ==========================================================================
   Salamat Life Child — استایل تایپوگرافی محتوا (نسخه ۱.۳.۳)
   محدوده اعمال: مقاله‌ها + برگه‌های محتوایی (کلاس کمکی sc-singular که در
   functions.php با فیلتر body_class برای is_singular() اضافه می‌شود)
   رنگ تأکیدی: آبی فعلی سایت #2A71B7
   تغییرهای ۱.۳.۳:
     - فهرست مطالب: حذف کامل نقطه‌گذاری آیتم‌ها (بدون نقطه و بدون شماره)
     - فهرست مطالب: آیتم‌های اصلی (H2) درشت‌تر و پررنگ‌تر
     - فهرست مطالب: زیرشاخه‌های (H3) با تورفتگی و فاصله عمودی
   تغییرهای ۱.۳.۰:
     - رفع سرریز افقی موبایل: جداول/تصاویر با عرض اینلاین قدیمی مهار می‌شوند
     - سایدبار به global.css منتقل شد (هماهنگ در همه صفحات)
   ========================================================================== */

body.sc-singular {
        --sc-accent: #2a71b7;
        --sc-accent-dark: #1f5a97;
        --sc-accent-soft: #edf4fb;
        --sc-heading-color: #22374d;
        --sc-text-color: #3c4a57;
        --sc-muted: #8a99a8;
        --sc-border: #e2ebf3;
        --sc-font: 'Vazirmatn', 'IRANSans', Tahoma, sans-serif;
}

/* --------------------------------------------------------------------------
   1) تایپوگرافی بدنه محتوا
   -------------------------------------------------------------------------- */

/* پیشوند «html» عمداً: پنل صحیفه برای body.single .entry فونت IRANSans با
   اختصاصیت مساوی و ترتیب دیرتر تعریف می‌کند؛ این پیشوند اختصاصیت را از
   (0,2,1) به (0,2,2) می‌برد تا همیشه وزیرمتن مستقیماً اعمال شود. */
html body.sc-singular .entry {
        font-family: var(--sc-font);
        font-size: 17px;
        line-height: 2.05;
        color: var(--sc-text-color);
        text-align: right;
        overflow-wrap: break-word;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
}

/* عنوان صفحه/مقاله (H1) — قبلاً 20px بود که از تیترهای داخل متن کوچک‌تر بود */
body.sc-singular h1.post-title,
body.sc-singular h1.post-title a {
        font-family: var(--sc-font);
        font-size: 27px;
        font-weight: 800;
        line-height: 1.7;
        color: #1f2d3d;
}

/* --------------------------------------------------------------------------
   2) خط متا (دسته‌بندی، تاریخ، دیدگاه) + نشان زمان مطالعه
   فلکس با قابلیت شکستن خط: دسته‌بندی‌های طولانی به خط بعد می‌روند و
   دیگر با نشان زمان مطالعه هیچ تداخل یا تورفتگی ایجاد نمی‌شود.
   -------------------------------------------------------------------------- */

/*
 * نکته: فقط متای «خود محتوا» (داخل .post-inner) فلکس می‌شود؛
 * خط‌های تاریخ مقالات پیشنهادی (p.post-meta دیگر) دست‌نخورده می‌مانند.
 */
body.sc-singular .post-inner p.post-meta {
        font-family: var(--sc-font);
        font-size: 13px;
        color: #98a4b0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px 12px;
        line-height: 2.1;
}

body.sc-singular .post-inner p.post-meta i.fa {
        color: var(--sc-accent);
        opacity: 0.75;
        margin-left: 4px;
        vertical-align: middle;
}

body.sc-singular .post-inner p.post-meta a {
        color: #7c8b99;
        transition: color 0.15s ease;
}

body.sc-singular .post-inner p.post-meta a:hover {
        color: var(--sc-accent);
}

/* نشان زمان مطالعه همیشه اولین آیتم خط متا باشد */
body.sc-singular .post-inner p.post-meta .sc-reading-time {
        order: -1;
}

/* --------------------------------------------------------------------------
   3) تیترهای داخل محتوا (H2/H3/H4)
   -------------------------------------------------------------------------- */

body.sc-singular .entry h2,
body.sc-singular .entry h3,
body.sc-singular .entry h4 {
        font-family: var(--sc-font);
        text-align: right;
        line-height: 1.75;
        color: var(--sc-heading-color);
}

body.sc-singular .entry h2 {
        font-size: 23px;
        font-weight: 800;
        margin: 2em 0 1em;
        padding-right: 14px;
        border-right: 5px solid var(--sc-accent);
}

body.sc-singular .entry h3 {
        font-size: 19.5px;
        font-weight: 700;
        margin: 1.8em 0 0.9em;
}

body.sc-singular .entry h4 {
        font-size: 17.5px;
        font-weight: 700;
        margin: 1.6em 0 0.8em;
}

/* جای‌گذاری صحیح هنگام پرش از فهرست مطالب (فاصله از منوی چسبان) */
body.sc-singular .entry h2[id],
body.sc-singular .entry h3[id] {
        scroll-margin-top: 85px;
}

/* --------------------------------------------------------------------------
   4) پاراگراف‌ها و لیست‌ها — justify برای متن
   خطوطی که می‌شکنند از دو طرف تراز می‌شوند (خط آخر همان راست‌چین می‌ماند).
   -------------------------------------------------------------------------- */

body.sc-singular .entry p {
        text-align: justify;
        text-justify: inter-word;
        margin: 0 0 1.6em;
}

body.sc-singular .entry ul,
body.sc-singular .entry ol {
        padding-right: 1.5em;
        padding-left: 0;
        margin: 0 0 1.6em;
}

body.sc-singular .entry li {
        text-align: right;
        margin-bottom: 0.55em;
        line-height: 2;
}

body.sc-singular .entry ul li::marker,
body.sc-singular .entry ol li::marker {
        color: var(--sc-accent);
}

/* --------------------------------------------------------------------------
   5) لینک‌ها
   -------------------------------------------------------------------------- */

body.sc-singular .entry a {
        color: var(--sc-accent);
        text-decoration: underline;
        text-decoration-color: rgba(42, 113, 183, 0.35);
        text-decoration-thickness: 1px;
        text-underline-offset: 5px;
        transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

body.sc-singular .entry a:hover {
        color: var(--sc-accent-dark);
        text-decoration-color: var(--sc-accent-dark);
}

/* --------------------------------------------------------------------------
   6) نقل‌قول، جدول، تصاویر و کپشن، کد
   -------------------------------------------------------------------------- */

body.sc-singular .entry blockquote {
        position: relative;
        background: #f7fafd;
        border: none;
        border-right: 4px solid var(--sc-accent);
        border-radius: 10px;
        margin: 1.8em 0;
        padding: 16px 20px;
        color: #45586b;
        font-style: normal;
        font-size: 16px;
        text-align: right;
}

/* گیومه تزئینی بالای نقل‌قول */
body.sc-singular .entry blockquote::before {
        content: '"';
        position: absolute;
        top: -4px;
        left: 14px;
        font-size: 52px;
        line-height: 1;
        color: var(--sc-accent);
        opacity: 0.18;
        font-family: var(--sc-font);
        pointer-events: none;
}

body.sc-singular .entry blockquote p:last-child {
        margin-bottom: 0;
}

/*
 * ★ جدول‌ها: بعضی مقالات قدیمی جدول با «استایل اینلاین» عرض ثابت دارند
 *   (مثلاً width:617px) که در موبایل کل صفحه را سرریز می‌کرد. max-width
 *   با !important استایل اینلاین را مهار می‌کند و در موبایل جدول داخل
 *   قاب اسکرول‌پذیر خودش قرار می‌گیرد (بخش ۱۴).
 */
body.sc-singular .entry table {
        width: 100%;
        max-width: 100% !important;
        border-collapse: collapse;
        margin: 1.8em 0;
        font-size: 15.5px;
        line-height: 1.9;
}

body.sc-singular .entry table th {
        background: #f2f7fc;
        color: #24425f;
        font-weight: 700;
}

body.sc-singular .entry table tbody tr:nth-child(even) {
        background: #fafcfe;
}

body.sc-singular .entry table th,
body.sc-singular .entry table td {
        border: 1px solid var(--sc-border);
        padding: 10px 14px;
        text-align: right;
}

/*
 * ★ تصاویر: تصاویر با عرض ثابت (attribute یا استایل اینلاین) هرگز
 *   از کادر محتوا بیرون نزنند — رفع اسکرول افقی موبایل.
 */
body.sc-singular .entry img {
        max-width: 100% !important;
        height: auto;
        border-radius: 10px;
}

body.sc-singular .entry .wp-caption {
        background: transparent;
        border: none;
        padding: 0;
        max-width: 100% !important;
}

body.sc-singular .entry iframe,
body.sc-singular .entry video,
body.sc-singular .entry .wp-video {
        max-width: 100%;
}

body.sc-singular .entry .wp-caption-text {
        font-size: 13px;
        color: #9aa7b3;
        text-align: center;
        padding: 8px 4px 0;
        margin: 0;
        line-height: 1.8;
}

body.sc-singular .entry code {
        background: #f4f7fa;
        border-radius: 6px;
        padding: 2px 7px;
        font-size: 0.88em;
        color: #3d5468;
        direction: ltr;
        unicode-bidi: embed;
}

body.sc-singular .entry pre {
        background: #f4f7fa;
        border: 1px solid var(--sc-border);
        border-radius: 10px;
        padding: 16px 18px;
        overflow-x: auto;
        direction: ltr;
        text-align: left;
        line-height: 1.7;
}

body.sc-singular .entry kbd {
        background: #f4f7fa;
        border: 1px solid #d5e0ea;
        border-bottom-width: 2px;
        border-radius: 5px;
        padding: 1px 6px;
        font-size: 0.85em;
        color: #33475a;
}

body.sc-singular .entry hr {
        border: none;
        border-top: 1px dashed #d7e2ec;
        margin: 2.4em 0;
}

/* --------------------------------------------------------------------------
   7) نشان زمان مطالعه (فقط مقاله‌ها — در برگه‌ها تزریق نمی‌شود)
   -------------------------------------------------------------------------- */

body.sc-singular .sc-reading-time {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        background: var(--sc-accent-soft);
        color: var(--sc-accent-dark);
        border-radius: 999px;
        padding: 5px 14px;
        font-size: 13px;
        font-weight: 700;
        font-family: var(--sc-font);
        line-height: 1.6;
        margin: 0 0 14px;
}

body.sc-singular .sc-reading-time svg {
        width: 15px;
        height: 15px;
        flex: 0 0 auto;
}

/* حالت قرارگیری در خط متا (بعد از انتقال توسط جاوااسکریپت) */
body.sc-singular .post-inner p.post-meta .sc-reading-time {
        padding: 2px 11px;
        font-size: 12px;
        font-weight: 600;
        margin: 0;
}

/* --------------------------------------------------------------------------
   8) فهرست مطالب (TOC) — بدون شماره‌گذاری (۱.۳.۰)
   شماره‌گذاری فهرست ارزش سئویی ندارد؛ لینک‌های لنگری و id تیترها پابرجا هستند.
   -------------------------------------------------------------------------- */

body.sc-singular details.sc-toc {
        background: linear-gradient(180deg, #f8fbfe, #f4f9fd);
        border: 1px solid #dfeaf4;
        border-radius: 12px;
        padding: 14px 18px 16px;
        margin: 8px 0 30px;
        box-shadow: 0 1px 3px rgba(23, 58, 94, 0.05);
        font-family: var(--sc-font);
}

body.sc-singular .sc-toc summary {
        display: flex;
        align-items: center;
        cursor: pointer;
        list-style: none;
        font-size: 15.5px;
        font-weight: 800;
        color: #24425f;
        padding: 2px 0;
}

body.sc-singular .sc-toc summary::-webkit-details-marker {
        display: none;
}

body.sc-singular .sc-toc summary:hover {
        color: var(--sc-accent);
}

body.sc-singular .sc-toc__heading {
        display: inline-flex;
        align-items: center;
        gap: 9px;
}

body.sc-singular .sc-toc__icon {
        color: var(--sc-accent);
        flex: 0 0 auto;
}

body.sc-singular .sc-toc__chev {
        margin-right: auto;
        color: #7f94a7;
        transition: transform 0.25s ease;
        flex: 0 0 auto;
}

body.sc-singular details.sc-toc[open] .sc-toc__chev {
        transform: rotate(180deg);
}

body.sc-singular .sc-toc__list {
        margin: 14px 2px 0;
        padding: 12px 0 0;
        list-style: none;
        border-top: 1px dashed #dbe7f1;
}

/*
 * بدون نقطه و بدون شماره (۱.۳.۳): هیچ ::before و هیچ marker روی آیتم‌ها
 * تعریف نمی‌شود؛ سلسله‌مراتب فقط با اندازه/وزن فونت و تورفتگی نشان داده می‌شود.
 */
body.sc-singular .sc-toc__list > li {
        margin: 0;
}

/* زیرشاخه‌ها: تورفتگی از راست + فاصله عمودی ملایم بین آیتم‌ها */
body.sc-singular .sc-toc__list ul {
        list-style: none;
        margin: 0 0 4px;
        padding-right: 22px;
}

body.sc-singular .sc-toc__list ul li {
        margin: 0 0 3px;
}

body.sc-singular .sc-toc__list ul li:last-child {
        margin-bottom: 0;
}

body.sc-singular .sc-toc a {
        color: #35506a;
        text-decoration: none;
        font-size: 14.5px;
        line-height: 2;
        display: inline-block;
        padding: 3px 0;
        transition: color 0.15s ease;
}

/* آیتم‌های اصلی (H2): کمی درشت‌تر و پررنگ‌تر */
body.sc-singular .sc-toc__list > li > a {
        font-size: 15.5px;
        font-weight: 700;
        color: #24425f;
}

/* زیرشاخه‌های (H3): متن روشن‌تر — تورفتگی از قوانین ul بالاست */
body.sc-singular .sc-toc__list ul li a {
        color: #51667c;
}

body.sc-singular .sc-toc a:hover {
        color: var(--sc-accent);
}

body.sc-singular .sc-toc a.is-active {
        color: var(--sc-accent);
        font-weight: 700;
}

/* --------------------------------------------------------------------------
   9) نوار پیشرفت مطالعه (فقط مقاله‌ها — article.js فقط در single-post می‌سازدش)
   -------------------------------------------------------------------------- */

body.single-post .sc-progress {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        height: 3px;
        z-index: 99999;
        pointer-events: none;
        background: transparent;
}

body.single-post .sc-progress span {
        position: absolute;
        top: 0;
        right: 0; /* در RTL از راست پر می‌شود */
        display: block;
        height: 100%;
        width: 0;
        background: linear-gradient(270deg, #2a71b7, #6fb1f0);
        box-shadow: 0 0 6px rgba(42, 113, 183, 0.55);
        border-radius: 0 0 0 2px;
}

/* --------------------------------------------------------------------------
   10) عناوین بخش‌های پایین محتوا (دیدگاه‌ها / مقالات پیشنهادی)
   -------------------------------------------------------------------------- */

body.sc-singular #comments-box .block-head h3,
body.sc-singular #related_posts .block-head h3 {
        font-family: var(--sc-font);
        font-size: 17px;
        font-weight: 800;
        color: var(--sc-heading-color);
}

/* --------------------------------------------------------------------------
   11) مقالات پیشنهادی و ردیف اشتراک‌گذاری
   -------------------------------------------------------------------------- */

body.sc-singular #related_posts .related-item h3 {
        font-family: var(--sc-font);
        font-size: 14px;
        font-weight: 600;
        line-height: 1.9;
}

body.sc-singular #related_posts .related-item h3 a {
        color: #33475a;
        transition: color 0.15s ease;
}

body.sc-singular #related_posts .related-item h3 a:hover {
        color: var(--sc-accent);
}

body.sc-singular #related_posts .related-item img {
        border-radius: 8px;
}

body.sc-singular .share-post .share-text {
        font-family: var(--sc-font);
        font-weight: 700;
}

body.sc-singular .share-post .flat-social a {
        font-family: var(--sc-font);
        font-size: 12.5px;
        border-radius: 6px;
}

/* برچسب‌های محتوا (در صورت وجود) به شکل چیپ */
body.sc-singular .post-tags a {
        display: inline-block;
        background: var(--sc-accent-soft);
        color: var(--sc-accent-dark);
        border-radius: 999px;
        padding: 3px 12px;
        font-size: 12.5px;
        font-family: var(--sc-font);
        margin: 0 0 4px 6px;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
}

body.sc-singular .post-tags a:hover {
        background: var(--sc-accent);
        color: #fff;
}

/* --------------------------------------------------------------------------
   12) دیدگاه‌ها و فرم پاسخ — فونت وزیرمتن و خوانایی بهتر
   -------------------------------------------------------------------------- */

body.sc-singular #comments,
body.sc-singular .commentlist {
        font-family: var(--sc-font);
}

/* هماهنگی فونت خط تاریخ مقالات پیشنهادی */
body.sc-singular #related_posts p.post-meta {
        font-family: var(--sc-font);
        font-size: 12.5px;
}

body.sc-singular .commentlist .comment-wrap .comment-content {
        font-size: 14.5px;
        line-height: 1.95;
        color: #3f4f5e;
        overflow-wrap: break-word; /* شکستن آدرس‌های خیلی طولانی در دیدگاه */
}

body.sc-singular .commentlist .comment-avatar img {
        border-radius: 50%;
        border: 2px solid #e7eef5;
}

body.sc-singular .commentlist .author-comment cite.fn {
        font-family: var(--sc-font);
        font-size: 14px;
        font-weight: 700;
        color: var(--sc-heading-color);
}

body.sc-singular .commentlist .comment-meta,
body.sc-singular .commentlist .comment-meta a {
        font-size: 12.5px;
        color: var(--sc-muted);
}

/* دکمه پاسخ به شکل قرص کوچک */
body.sc-singular .commentlist .reply a {
        display: inline-block;
        background: var(--sc-accent-soft);
        color: var(--sc-accent-dark);
        border-radius: 999px;
        padding: 3px 13px;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
        transition: background 0.15s ease, color 0.15s ease;
}

body.sc-singular .commentlist .reply a:hover {
        background: var(--sc-accent);
        color: #fff;
}

/* فرم دیدگاه */
body.sc-singular #respond {
        font-family: var(--sc-font);
        font-size: 14px;
        color: var(--sc-text-color);
}

body.sc-singular #respond h3#reply-title {
        font-size: 16px;
        font-weight: 800;
        color: var(--sc-heading-color);
}

body.sc-singular #respond .must-log-in {
        background: #f7fafd;
        border: 1px solid var(--sc-border);
        border-radius: 10px;
        padding: 12px 16px;
        font-size: 13.5px;
}

body.sc-singular #respond textarea,
body.sc-singular #respond input[type="text"],
body.sc-singular #respond input[type="email"],
body.sc-singular #respond input[type="url"] {
        font-family: var(--sc-font);
        font-size: 14px;
        color: var(--sc-text-color);
        border: 1px solid #d5e0ea;
        border-radius: 8px;
        padding: 9px 12px;
        line-height: 1.8;
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.sc-singular #respond textarea:focus,
body.sc-singular #respond input[type="text"]:focus,
body.sc-singular #respond input[type="email"]:focus,
body.sc-singular #respond input[type="url"]:focus {
        border-color: var(--sc-accent);
        box-shadow: 0 0 0 3px rgba(42, 113, 183, 0.12);
        outline: none;
}

body.sc-singular #respond input[type="submit"] {
        font-family: var(--sc-font);
        font-size: 14px;
        font-weight: 700;
        color: #fff;
        background: var(--sc-accent);
        border: none;
        border-radius: 8px;
        padding: 10px 26px;
        cursor: pointer;
        transition: background 0.15s ease;
}

body.sc-singular #respond input[type="submit"]:hover {
        background: var(--sc-accent-dark);
}

/* --------------------------------------------------------------------------
   13) موبایل و تبلت
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {

        body.sc-singular .entry {
                font-size: 16.5px;
                line-height: 2.1;
        }

        body.sc-singular h1.post-title,
        body.sc-singular h1.post-title a {
                font-size: 23px;
        }

        body.sc-singular .entry h2 {
                font-size: 20.5px;
                padding-right: 11px;
                border-right-width: 4px;
                margin: 1.8em 0 0.9em;
        }

        body.sc-singular .entry h3 {
                font-size: 18px;
        }

        body.sc-singular .entry h4 {
                font-size: 17px;
        }

        body.sc-singular .entry p {
                margin-bottom: 1.5em;
        }

        body.sc-singular .post-inner p.post-meta {
                gap: 4px 9px;
                font-size: 12.5px;
        }

        body.sc-singular .post-inner p.post-meta .sc-reading-time {
                font-size: 11.5px;
                padding: 2px 9px;
        }

        body.sc-singular details.sc-toc {
                padding: 12px 14px 14px;
                margin: 6px 0 24px;
        }

        body.sc-singular .sc-toc summary {
                font-size: 15px;
        }

        /* حفظ سلسله‌مراتب در موبایل: H2 درشت‌تر از H3 می‌ماند */
        body.sc-singular .sc-toc__list > li > a {
                font-size: 15px;
        }

        body.sc-singular .sc-toc__list ul li a {
                font-size: 13.5px;
        }

        body.sc-singular .commentlist .comment-wrap .comment-content {
                font-size: 14px;
        }

        /* ★ جدول‌های پهن در موبایل/تبلت: قاب اسکرول افقی به‌جای شکستن چیدمان
           (قبلاً فقط ≤۶۰۰px بود؛ دامنه برای پوشش تبلت‌های کوچک گسترده شد) */
        body.sc-singular .entry table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
        }
}

/* --------------------------------------------------------------------------
   14) دسترس‌پذیری و چاپ
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

        body.sc-singular .sc-toc__chev,
        body.sc-singular .entry a,
        body.sc-singular .post-tags a,
        body.sc-singular .commentlist .reply a {
                transition: none;
        }
}

@media print {

        body.single-post .sc-progress,
        body.sc-singular details.sc-toc,
        body.sc-singular .sc-reading-time,
        body.sc-singular .share-post,
        body.sc-singular #related_posts,
        body.sc-singular #comments {
                display: none !important;
        }
}
