/* ==========================================================================
   Salamat Life Child — استایل مقالات (نسخه ۱.۲.۰)
   محدوده اعمال: فقط صفحات مقاله (single post)
   رنگ تأکیدی: آبی فعلی سایت #2A71B7
   نکته: سلکتورها عمداً اختصاصی (body.single.single-post) نوشته شده‌اند تا
   بر استایل‌های قالب مادر و CSS سفارشی پنل صحیفه اولویت بگیرند ولی
   هیچ صفحه دیگری (خانه، دسته، برگه و ...) را تغییر ندهند.
   ========================================================================== */

@counter-style sc-persian {
        system: numeric;
        symbols: "۰" "۱" "۲" "۳" "۴" "۵" "۶" "۷" "۸" "۹";
}

body.single-post {
        --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) تایپوگرافی بدنه مقاله
   -------------------------------------------------------------------------- */

body.single.single-post .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.single.single-post h1.post-title,
body.single.single-post 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.single.single-post .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.single.single-post .post-inner p.post-meta i.fa {
        color: var(--sc-accent);
        opacity: 0.75;
        margin-left: 4px;
        vertical-align: middle;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

body.single.single-post .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.single.single-post .entry a:hover {
        color: var(--sc-accent-dark);
        text-decoration-color: var(--sc-accent-dark);
}

/* انتخاب متن با رنگ برند */
body.single.single-post .entry ::selection,
body.single.single-post #comments ::selection {
        background: var(--sc-accent);
        color: #fff;
}

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

body.single.single-post .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.single.single-post .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.single.single-post .entry blockquote p:last-child {
        margin-bottom: 0;
}

body.single.single-post .entry table {
        width: 100%;
        border-collapse: collapse;
        margin: 1.8em 0;
        font-size: 15.5px;
        line-height: 1.9;
}

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

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

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

body.single.single-post .entry img {
        border-radius: 10px;
        height: auto;
}

body.single.single-post .entry .wp-caption {
        background: transparent;
        border: none;
        padding: 0;
        max-width: 100%;
}

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

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

body.single.single-post .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.single.single-post .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.single.single-post .entry hr {
        border: none;
        border-top: 1px dashed #d7e2ec;
        margin: 2.4em 0;
}

/* --------------------------------------------------------------------------
   7) نشان زمان مطالعه
   -------------------------------------------------------------------------- */

body.single.single-post .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.single.single-post .sc-reading-time svg {
        width: 15px;
        height: 15px;
        flex: 0 0 auto;
}

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

/* --------------------------------------------------------------------------
   8) فهرست مطالب (TOC)
   -------------------------------------------------------------------------- */

body.single.single-post 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.single.single-post .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.single.single-post .sc-toc summary::-webkit-details-marker {
        display: none;
}

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

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

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

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

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

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

body.single.single-post .sc-toc__list > li {
        counter-increment: sctoc;
        position: relative;
        padding-right: 36px;
        margin: 0;
}

body.single.single-post .sc-toc__list > li::before {
        content: counter(sctoc, sc-persian);
        position: absolute;
        right: 0;
        top: 4px;
        width: 24px;
        height: 24px;
        line-height: 24px;
        background: var(--sc-accent-soft);
        color: var(--sc-accent);
        border-radius: 7px;
        text-align: center;
        font-size: 12px;
        font-weight: 700;
}

body.single.single-post .sc-toc__list ul {
        list-style: none;
        margin: 0 0 4px;
        padding: 0 10px 0 0;
}

body.single.single-post .sc-toc__list ul li {
        position: relative;
        padding-right: 16px;
        margin: 0;
}

body.single.single-post .sc-toc__list ul li::before {
        content: '';
        position: absolute;
        right: 2px;
        top: 12px;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #c3d6e8;
}

body.single.single-post .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;
}

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

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

/* --------------------------------------------------------------------------
   9) نوار پیشرفت مطالعه
   -------------------------------------------------------------------------- */

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.single.single-post #sidebar {
        font-family: var(--sc-font);
}

body.single.single-post #sidebar .widget-top h4,
body.single.single-post #sidebar .widget-top h4 a {
        font-family: var(--sc-font);
        font-size: 15.5px;
        font-weight: 700;
        color: var(--sc-heading-color);
}

body.single.single-post #sidebar .widget-container {
        font-family: var(--sc-font);
        font-size: 13.5px;
        line-height: 1.95;
        color: #4a5b6b;
}

body.single.single-post #sidebar .widget-container ul li {
        margin: 7px 0;
}

body.single.single-post #sidebar .widget-container a {
        color: #3d4f62;
}

body.single.single-post #sidebar .widget-container a:hover {
        color: var(--sc-accent);
}

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

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

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

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

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

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

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

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

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

/* برچسب‌های مقاله (در صورت وجود) به شکل چیپ */
body.single.single-post .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.single.single-post .post-tags a:hover {
        background: var(--sc-accent);
        color: #fff;
}

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

body.single.single-post #comments {
        font-family: var(--sc-font);
}

body.single.single-post .commentlist {
        font-family: var(--sc-font);
}

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

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

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

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

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

/* دکمه پاسخ به شکل قرص کوچک */
body.single.single-post .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.single.single-post .commentlist .reply a:hover {
        background: var(--sc-accent);
        color: #fff;
}

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

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

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

body.single.single-post #respond textarea,
body.single.single-post #respond input[type="text"],
body.single.single-post #respond input[type="email"],
body.single.single-post #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.single.single-post #respond textarea:focus,
body.single.single-post #respond input[type="text"]:focus,
body.single.single-post #respond input[type="email"]:focus,
body.single.single-post #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.single.single-post #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.single.single-post #respond input[type="submit"]:hover {
        background: var(--sc-accent-dark);
}

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

@media (max-width: 768px) {

        body.single.single-post .entry {
                font-size: 16.5px;
                line-height: 2.1;
        }

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

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

        body.single.single-post .entry h3 {
                font-size: 18px;
        }

        body.single.single-post .entry h4 {
                font-size: 17px;
        }

        body.single.single-post .entry p {
                margin-bottom: 1.5em;
        }

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

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

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

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

        body.single.single-post .sc-toc a {
                font-size: 14px;
        }

        body.single.single-post #sidebar .widget-container {
                font-size: 13px;
        }

        body.single.single-post .commentlist .comment-wrap .comment-content {
                font-size: 14px;
        }
}

/* جدول‌های پهن در موبایل: اسکرول افقی به‌جای شکستن چیدمان */
@media (max-width: 600px) {

        body.single.single-post .entry table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
        }
}

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

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

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

@media print {

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