/* =============================================================================
   post-body.css — استایل «متن مطلب»
   هم در سایت (داخل .post-body-content) و هم داخل ادیتور پنل (content_css) لود می‌شود،
   پس آنچه در ادیتور می‌بینید همان است که در سایت منتشر می‌شود.
   فقط تایپوگرافی و المان‌های محتوا؛ چیدمان صفحه (padding و ...) در post.css است.
   ============================================================================= */
:root {
    --brand-purple: #6a5ce2;
    --brand-purple-dark: #4f46e5;
    --brand-green: #10b981;
    --brand-orange: #f97316;
    --text-main: #334155;
    --text-heading: #0f172a;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
    font-family: 'Yekan Bakh FaNum';
    font-style: normal;
    src: url('../fonts/YekanBakhFaNum-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Yekan Bakh FaNum';
    font-style: normal;
    font-weight: 900;
    src: url('../fonts/YekanBakhFaNum-Black.woff2') format('woff2');
}

.post-body-content {
    direction: rtl;
    text-align: right;
    font-family: 'Yekan Bakh FaNum', Tahoma, sans-serif;
    font-size: 1rem;
    line-height: 1.85;
    color: #475569;
    overflow-wrap: anywhere;
}
.post-body-content > :first-child { margin-top: 0; }
.post-body-content *, .post-body-content *::before, .post-body-content *::after { box-sizing: border-box; }

/* ---------- متن و تیترها ---------- */
.post-body-content p { font-size: 1rem; line-height: 1.85; color: #475569; margin: 0 0 16px; }
.post-body-content h2 { font-size: 1.5rem; font-weight: 900; color: var(--text-heading); margin: 32px 0 16px; line-height: 1.6; scroll-margin-top: 100px; }
.post-body-content h3 { font-size: 1.15rem; font-weight: 900; color: var(--text-heading); margin: 24px 0 12px; line-height: 1.7; scroll-margin-top: 100px; }
.post-body-content h4 { font-size: 1.05rem; font-weight: 900; color: var(--text-heading); margin: 20px 0 10px; scroll-margin-top: 100px; }
.post-body-content strong, .post-body-content b { font-weight: bold; color: var(--text-heading); }
.post-body-content small { font-size: .85em; color: #64748b; }
.post-body-content hr { border: 0; border-top: 1px solid #e2e8f0; margin: 32px 0; }

.post-body-content a { color: var(--brand-purple); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: var(--transition); }
.post-body-content a:hover { color: var(--brand-purple-dark); text-decoration-thickness: 2px; }
.post-body-content a.btn-cta {
    display: inline-flex; align-items: center; justify-content: center; padding: 10px 24px; border-radius: 12px;
    background: var(--brand-purple); color: #fff; text-decoration: none; font-weight: 700; line-height: 1.7;
}
.post-body-content a.btn-cta:hover { background: var(--brand-purple-dark); color: #fff; transform: translateY(-2px); }

/* style.css از reset سراسری (padding: 0) استفاده می‌کند؛ لیست‌ها را برمی‌گردانیم */
.post-body-content ul, .post-body-content ol { margin: 0 0 16px; padding-inline-start: 1.7em; }
.post-body-content ul { list-style: disc; }
.post-body-content ol { list-style: decimal; }
.post-body-content li { margin-bottom: 6px; line-height: 1.85; }
.post-body-content li > ul, .post-body-content li > ol { margin: 6px 0 0; }

/* ---------- پاراگراف شاخص ---------- */
.post-body-content .post-lead {
    font-size: 1.15rem; font-weight: 500; color: #334155; line-height: 1.8;
    border-right: 4px solid var(--brand-purple); padding-right: 20px; margin-bottom: 32px;
}

/* ---------- هایلایت (mark) ---------- */
.post-body-content mark { background: #fef08a; color: inherit; padding: .05em .35em; border-radius: 6px; }
.post-body-content mark.mark-yellow { background: #fef08a; }
.post-body-content mark.mark-green { background: #bbf7d0; }
.post-body-content mark.mark-blue { background: #bfdbfe; }
.post-body-content mark.mark-pink { background: #fbcfe8; }
.post-body-content mark.mark-purple { background: #ddd6fe; }
.post-body-content mark.mark-orange { background: #fed7aa; }
.post-body-content mark.mark-underline { background: none; text-decoration: underline wavy var(--brand-purple); text-underline-offset: 6px; }

/* ---------- نقل‌قول (blockquote) ---------- */
.post-body-content blockquote {
    margin: 28px 0; padding: 20px 24px; border-radius: 16px; line-height: 1.8; font-size: .98rem;
    background: #f8fafc; border-right: 4px solid #cbd5e1; color: #334155;
}
.post-body-content blockquote > :last-child { margin-bottom: 0; }
.post-body-content blockquote.quote-accent { background: #f5f3ff; border-right-color: var(--brand-purple); color: #4c1d95; }
.post-body-content blockquote.quote-info { background: #eff6ff; border-right-color: #3b82f6; color: #1e3a8a; }
.post-body-content blockquote.quote-success { background: #f0fdf4; border-right-color: var(--brand-green); color: #064e3b; }
.post-body-content blockquote.quote-warning { background: #fffbeb; border-right-color: #f59e0b; color: #78350f; }
.post-body-content blockquote.quote-danger { background: #fef2f2; border-right-color: #ef4444; color: #7f1d1d; }
.post-body-content blockquote.quote-pull {
    background: none; border: 0; text-align: center; font-size: 1.4rem; font-weight: 800; line-height: 1.7;
    color: var(--brand-purple); padding: 24px 12px;
}
.post-body-content blockquote.quote-pull::before, .post-body-content blockquote.quote-pull::after {
    content: ""; display: block; width: 56px; height: 3px; border-radius: 2px; background: currentColor; margin: 0 auto 14px;
}
.post-body-content blockquote.quote-pull::after { margin: 14px auto 0; }

/* ---------- کادر نکته (callout) ---------- */
.post-body-content .post-callout { border-radius: 16px; padding: 20px 24px; margin: 28px 0; font-size: .95rem; line-height: 1.7; }
.post-body-content .post-callout > :last-child { margin-bottom: 0; }
.post-body-content .post-callout p { color: inherit; }
.post-body-content .callout-purple { background: #f5f3ff; border-right: 4px solid var(--brand-purple); color: #4c1d95; }
.post-body-content .callout-green { background: #f0fdf4; border-right: 4px solid var(--brand-green); color: #064e3b; }
.post-body-content .callout-amber { background: #fffbeb; border-right: 4px solid #f59e0b; color: #78350f; }
.post-body-content .callout-red { background: #fef2f2; border-right: 4px solid #ef4444; color: #7f1d1d; }
.post-body-content .callout-blue { background: #eff6ff; border-right: 4px solid #3b82f6; color: #1e3a8a; }

/* ---------- تصویر ---------- */
.post-body-content img { max-width: 100%; height: auto; border-radius: 12px; }
.post-body-content figure { margin: 28px 0; text-align: center; }
.post-body-content figure img { display: block; margin: 0 auto; }
.post-body-content figcaption { margin-top: 10px; font-size: .85rem; color: #64748b; line-height: 1.7; }
.post-body-content img.img-rounded { border-radius: 24px; }
.post-body-content img.img-shadow { box-shadow: 0 14px 34px rgba(15, 23, 42, .15); }
.post-body-content .img-full, .post-body-content figure.img-full img { width: 100%; }

/* ---------- جدول ---------- */
.post-body-content .table-wrap { overflow-x: auto; margin: 28px 0; border: 1px solid #e2e8f0; border-radius: 14px; }
.post-body-content table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.8; margin: 0; }
.post-body-content :not(.table-wrap) > table { margin: 28px 0; }
.post-body-content th, .post-body-content td { padding: 10px 14px; text-align: right; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.post-body-content th { background: #f8fafc; color: var(--text-heading); font-weight: 900; }
.post-body-content tr:last-child td { border-bottom: 0; }
.post-body-content table.table-striped tbody tr:nth-child(even) { background: #f8fafc; }
.post-body-content table.table-bordered th, .post-body-content table.table-bordered td { border: 1px solid #e2e8f0; }
.post-body-content table.table-compact th, .post-body-content table.table-compact td { padding: 5px 9px; }

/* ---------- کد ---------- */
.post-body-content code, .post-body-content kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; direction: ltr; unicode-bidi: embed;
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: .1em .45em; color: #be185d;
}
.post-body-content kbd { color: var(--text-heading); border-bottom-width: 2px; }
.post-body-content pre {
    direction: ltr; text-align: left; margin: 28px 0; padding: 18px 22px; border-radius: 16px; overflow-x: auto;
    background: var(--text-heading); color: #e2e8f0; font-size: 14px; line-height: 1.75; tab-size: 4;
}
.post-body-content pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* ---------- آکاردئون / جزئیات ---------- */
.post-body-content details { margin: 14px 0; border: 1px solid #e2e8f0; border-radius: 14px; padding: 0 18px; background: #fff; }
.post-body-content details[open] { padding-bottom: 10px; }
.post-body-content summary { cursor: pointer; font-weight: 900; color: var(--text-heading); padding: 14px 0; }
.post-body-content summary:focus-visible { outline: 2px solid var(--brand-purple); outline-offset: 3px; }

/* ---------- ویدیو ---------- */
.post-body-content iframe { max-width: 100%; border: 0; border-radius: 16px; }
.post-body-content iframe[src*="youtube"], .post-body-content iframe[src*="vimeo"], .post-body-content iframe[src*="aparat"] { width: 100%; aspect-ratio: 16 / 9; height: auto; }

@media (max-width: 640px) {
    .post-body-content h2 { font-size: 1.3rem; }
    .post-body-content blockquote.quote-pull { font-size: 1.15rem; }
}

/* =============================================================================
   بلوک‌های صفحه‌ساز (hb-*) — در سایت، ادیتور و کَنوَس صفحه‌ساز یکسان دیده می‌شوند
   ============================================================================= */
.post-body-content .hb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 28px 0; }
.post-body-content .hb-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 22px; transition: var(--transition); }
.post-body-content .hb-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .07); }
.post-body-content .hb-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.post-body-content .hb-card p { margin: 0; font-size: .92rem; color: #64748b; line-height: 1.8; }
.post-body-content .hb-icon { width: 44px; height: 44px; border-radius: 12px; background: #ede9fe; color: var(--brand-purple); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 12px; }

.post-body-content .hb-cta { background: linear-gradient(135deg, #4f46e5, #6a5ce2); color: #fff; border-radius: 24px; padding: 32px; margin: 32px 0; text-align: center; }
.post-body-content .hb-cta h3 { color: #fff; margin: 0 0 8px; font-size: 1.4rem; }
.post-body-content .hb-cta p { color: rgba(255, 255, 255, .88); margin: 0 0 18px; }
.post-body-content .hb-btn, .post-body-content a.hb-btn { display: inline-block; padding: 11px 28px; border-radius: 12px; background: #fff; color: var(--brand-purple-dark); font-weight: 900; text-decoration: none; transition: var(--transition); }
.post-body-content .hb-btn:hover { transform: translateY(-2px); color: var(--brand-purple-dark); }
.post-body-content .hb-btn.hb-btn-primary, .post-body-content a.hb-btn-primary { background: var(--brand-purple); color: #fff; }
.post-body-content .hb-btn.hb-btn-primary:hover { background: var(--brand-purple-dark); color: #fff; }

.post-body-content .hb-steps { list-style: none; padding: 0; margin: 28px 0; counter-reset: step; }
.post-body-content .hb-steps li { counter-increment: step; position: relative; padding: 4px 56px 18px 0; margin: 0; }
.post-body-content .hb-steps li::before { content: counter(step); position: absolute; right: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-purple); color: #fff; display: grid; place-items: center; font-weight: 900; }
.post-body-content .hb-steps li strong { display: block; color: var(--text-heading); margin-bottom: 2px; }

.post-body-content .hb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 28px 0; text-align: center; }
.post-body-content .hb-stat { background: #f5f3ff; border-radius: 18px; padding: 20px 10px; }
.post-body-content .hb-stat b { display: block; font-size: 1.9rem; color: var(--brand-purple); line-height: 1.3; }
.post-body-content .hb-stat span { font-size: .88rem; color: #475569; }

.post-body-content .hb-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; margin: 28px 0; }
.post-body-content .hb-split img { width: 100%; border-radius: 18px; }
@media (max-width: 640px) { .post-body-content .hb-split { grid-template-columns: 1fr; } }

.post-body-content .hb-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.post-body-content .hb-compare > div { border-radius: 18px; padding: 20px 22px; }
.post-body-content .hb-compare .hb-pro { background: #f0fdf4; border: 1px solid #bbf7d0; }
.post-body-content .hb-compare .hb-con { background: #fef2f2; border: 1px solid #fecaca; }
.post-body-content .hb-compare h4 { margin: 0 0 8px; }
@media (max-width: 640px) { .post-body-content .hb-compare { grid-template-columns: 1fr; } }

.post-body-content p {
    text-align: justify;
}
