/* ============================================================
   single-blog.css — تک‌نوشته‌ی وبلاگ، مو‌به‌مو مطابق دیزاین
   ============================================================ */

/* خنثی‌سازی قواعد قدیمی blog.css که با طراحی جدید تداخل دارند */
.bm-sp { max-width: none !important; padding: 0 !important; }
.bm-sp-toc { position: static; top: auto; }

/* نوار پیشرفت مطالعه */
.bm-sp-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--bm-surface-2); z-index: 9999; }
.bm-sp-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--bm-primary), var(--bm-secondary)); box-shadow: 0 0 8px rgba(79,70,229,.5); transition: width .08s linear; }

.bm-sp { display: block; }

/* هدر مقاله */
.bm-sp-head { max-width: 760px; margin: 0 auto; padding: 48px 24px 0; text-align: center; }
.bm-sp-crumb { justify-content: center; margin-bottom: 22px; }
.bm-sp-cat { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: var(--bm-primary-soft); color: var(--bm-primary); font-size: 12.5px; font-weight: 700; margin-bottom: 20px; text-decoration: none; }
.bm-sp-cat:hover { background: var(--bm-primary); color: #fff; }
.bm-sp-cat-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bm-sp-title { margin: 0 0 20px; font-size: 42px; line-height: 1.4; font-weight: 800; letter-spacing: -1px; }
.bm-sp-excerpt { margin: 0 auto 28px; max-width: 600px; font-size: 17px; line-height: 2; color: var(--bm-text-sub); }
.bm-sp-meta { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; padding-bottom: 34px; }
.bm-sp-author { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.bm-sp-author-av { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; display: block; background: linear-gradient(135deg, var(--bm-primary), var(--bm-secondary)); }
.bm-sp-av-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.bm-sp-author-info { text-align: right; }
.bm-sp-author-name { display: block; font-size: 14px; font-weight: 700; color: var(--bm-text); }
.bm-sp-author-role { display: block; font-size: 12px; color: var(--bm-text-mute); }
.bm-sp-meta-sep { width: 1px; height: 30px; background: var(--bm-border); }
.bm-sp-meta-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--bm-text-sub); }

/* تصویر شاخص */
.bm-sp-hero-wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.bm-sp-hero { height: 420px; border-radius: 24px; background: linear-gradient(135deg, var(--bm-primary), var(--bm-primary-dark) 62%, #1E1B4B); box-shadow: var(--bm-shadow-xl); position: relative; overflow: hidden; }
.bm-sp-hero-blob1 { position: absolute; width: 340px; height: 340px; border-radius: 50%; background: rgba(255,255,255,.08); top: -120px; left: -80px; }
.bm-sp-hero-blob2 { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(14,165,233,.22); bottom: -60px; right: -40px; }
.bm-sp-hero-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bm-sp-hero-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.65); font-size: 12px; }

/* دو ستونه */
.bm-sp-layout { max-width: 1080px; margin: 0 auto; padding: 44px 24px 60px; display: grid; grid-template-columns: 1fr 290px; gap: 48px; align-items: start; }

/* بدنه مقاله */
.bm-sp-body { min-width: 0; font-size: 16.5px; line-height: 2.1; color: var(--bm-text); background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: 20px; box-shadow: var(--bm-shadow-md); padding: 36px 40px; }
.bm-sp-body > :first-child { margin-top: 0; }
.bm-sp-body > :last-child { margin-bottom: 0; }
.bm-sp-body p { margin: 0 0 22px; }
.bm-sp-body strong { color: var(--bm-text); }
.bm-sp-body h2, .bm-sp-body .bm-sp-h { margin: 38px 0 16px; font-size: 26px; font-weight: 800; letter-spacing: -.4px; scroll-margin-top: 90px; }
.bm-sp-body h3 { margin: 30px 0 14px; font-size: 20px; font-weight: 700; scroll-margin-top: 90px; }
.bm-sp-body ul, .bm-sp-body ol { margin: 0 0 22px; padding-right: 22px; display: flex; flex-direction: column; gap: 11px; }
.bm-sp-body img { max-width: 100%; height: auto; border-radius: 14px; margin: 10px 0; }
.bm-sp-body a { color: var(--bm-primary); text-decoration: underline; }
.bm-sp-body blockquote { margin: 28px 0; padding: 20px 24px; border-right: 4px solid var(--bm-primary); background: var(--bm-primary-soft); border-radius: 0 14px 14px 0; font-size: 18px; line-height: 2; font-weight: 600; color: var(--bm-text); }
.bm-sp-body pre { margin: 0 0 24px; padding: 18px 20px; background: #0F172A; color: #E2E8F0; font-family: 'SF Mono', Menlo, monospace; font-size: 13px; line-height: 1.9; direction: ltr; text-align: left; overflow-x: auto; border-radius: 14px; }
.bm-sp-body code { font-family: 'SF Mono', Menlo, monospace; font-size: .9em; background: var(--bm-surface-2); padding: 2px 6px; border-radius: 5px; }
.bm-sp-body pre code { background: none; padding: 0; }

/* برچسب‌ها */
.bm-sp-tags { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--bm-border); }
.bm-sp-tag { padding: 7px 15px; border-radius: 999px; background: var(--bm-surface-2); border: 1px solid var(--bm-border); color: var(--bm-text-sub); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.bm-sp-tag:hover { background: var(--bm-primary-soft); color: var(--bm-primary); border-color: transparent; }

/* جعبه‌ی نویسنده (گرادیانی، مو‌به‌مو با دیزاین) */
.bm-sp-authorbox { margin-top: 34px; background: linear-gradient(135deg, var(--bm-primary), var(--bm-primary-dark) 70%, #1E1B4B); border-radius: 22px; padding: 32px; color: #fff; box-shadow: var(--bm-shadow-lg); position: relative; overflow: hidden; }
.bm-sp-authorbox-blob { position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); top: -80px; left: -50px; pointer-events: none; }
.bm-sp-authorbox-row { position: relative; display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.bm-sp-authorbox-av { position: relative; width: 78px; height: 78px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; }
.bm-sp-authorbox-av .bm-sp-av-img { position: relative; z-index: 2; }
.bm-sp-authorbox-init { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: #fff; }
.bm-sp-authorbox-info { flex: 1; min-width: 220px; }
.bm-sp-authorbox-label { font-size: 12px; opacity: .8; font-weight: 600; margin-bottom: 4px; }
.bm-sp-authorbox-name { margin: 0 0 8px; font-size: 20px; font-weight: 800; color: #fff; }
.bm-sp-authorbox-bio { margin: 0 0 16px; font-size: 13.5px; line-height: 2; opacity: .92; }
.bm-sp-authorbox-socials { display: flex; gap: 10px; }
.bm-sp-authorbox-soc { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; color: #fff; transition: background .15s; }
.bm-sp-authorbox-soc:hover { background: rgba(255,255,255,.30); }
.bm-sp-authorbox-link { display: inline-block; font-size: 13px; font-weight: 700; color: #fff; text-decoration: none; opacity: .95; border-bottom: 1px solid rgba(255,255,255,.4); padding-bottom: 2px; }


/* سایدبار */
.bm-sp-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
.bm-sp-widget { background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: 18px; box-shadow: var(--bm-shadow-md); padding: 20px; }
.bm-sp-widget-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.bm-sp-widget-head h4 { margin: 0; font-size: 14px; font-weight: 700; }
.bm-sp-widget-title { margin: 0 0 14px; font-size: 14px; font-weight: 700; }
.bm-sp-toc-list { display: flex; flex-direction: column; gap: 2px; }
.bm-sp-toc-link { padding: 8px 12px; border-radius: 9px; font-size: 13px; color: var(--bm-text-sub); text-decoration: none; transition: all .15s; border-right: 2px solid transparent; }
.bm-sp-toc-link:hover, .bm-sp-toc-link.is-active { background: var(--bm-primary-soft); color: var(--bm-primary); border-right-color: var(--bm-primary); font-weight: 700; }
.bm-sp-toc-h3 { padding-right: 24px; font-size: 12.5px; }
.bm-sp-side .bm-sp-share { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bm-sp-side .bm-sp-share .bm-sp-share-btn { width: auto; height: auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--bm-border); border-radius: 11px; background: var(--bm-surface-2); color: var(--bm-text-sub); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.bm-sp-side .bm-sp-share .bm-sp-share-btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.bm-sp-side .bm-sp-share .bm-sp-share-btn:hover { background: var(--bm-primary-soft); color: var(--bm-primary); border-color: transparent; }
.bm-sp-news { background: var(--bm-primary-soft); border-color: transparent; text-align: center; }
.bm-sp-news-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--bm-text); }
.bm-sp-news p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.9; color: var(--bm-text-sub); }
.bm-sp-news-ok { color: var(--bm-success) !important; font-weight: 700; }
.bm-sp-news-err { color: var(--bm-error, #EF4444) !important; font-weight: 700; }
.bm-sp-news-form { display: block; }
.bm-sp-news-form input[type="email"] { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--bm-border); border-radius: 11px; background: var(--bm-surface); color: var(--bm-text); font-family: inherit; font-size: 13px; margin-bottom: 9px; box-sizing: border-box; outline: none; }
.bm-sp-news-form input[type="email"]:focus { border-color: var(--bm-primary); }
.bm-sp-news-form button { width: 100%; padding: 11px; border: none; border-radius: 11px; background: var(--bm-primary); color: #fff; font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: var(--bm-shadow-primary, 0 10px 24px rgba(79,70,229,.32)); transition: background .15s; }
.bm-sp-news-form button:hover { background: var(--bm-primary-hover); }

/* مقالات مرتبط */
.bm-sp-related { display: block; background: var(--bm-surface-2); border-top: 1px solid var(--bm-border); border-bottom: 1px solid var(--bm-border); }
.bm-sp-related-inner { max-width: 1080px; margin: 0 auto; padding: 54px 24px; }
.bm-sp-related-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.bm-sp-related-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.bm-sp-related-head a { font-size: 13px; font-weight: 700; color: var(--bm-primary); text-decoration: none; }
.bm-sp-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.bm-sp-related-card { background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: 18px; overflow: hidden; box-shadow: var(--bm-shadow-sm); text-decoration: none; transition: transform .18s, box-shadow .18s; display: block; min-width: 0; }
.bm-sp-related-card:hover { transform: translateY(-5px); box-shadow: var(--bm-shadow-lg); }
.bm-sp-related-img { height: 150px; position: relative; background-size: cover; background-position: center; }
.bm-sp-related-cat { position: absolute; top: 12px; right: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--bm-primary); font-size: 11px; font-weight: 700; }
.bm-sp-related-body { padding: 18px; }
.bm-sp-related-body h4 { margin: 0 0 10px; font-size: 15.5px; font-weight: 700; line-height: 1.7; color: var(--bm-text); min-height: 52px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bm-sp-related-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--bm-text-mute); }
.bm-sp-related-av { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; }
.bm-sp-related-time { margin-right: auto; }

/* نظرات */
.bm-sp-comments { max-width: 760px; margin: 0 auto; padding: 54px 24px 70px; }
.bm-sp-comments-title { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -.4px; display: flex; align-items: center; gap: 10px; }
.bm-sp-comments-count { font-size: 13px; font-weight: 700; color: var(--bm-primary); background: var(--bm-primary-soft); padding: 3px 11px; border-radius: 999px; }
.bm-sp-comments-sub { margin: 0 0 24px; font-size: 13.5px; color: var(--bm-text-mute); }

/* فرم دیدگاه (composer) */
.bm-sp-comment-form { margin: 0 0 34px; }
.bm-sp-form-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.bm-sp-comment-form .bm-sp-form-textarea { width: 100%; min-height: 84px; border: 1.5px solid var(--bm-border); border-radius: 14px; background: var(--bm-surface); padding: 13px 15px; font-family: inherit; font-size: 14px; line-height: 1.9; color: var(--bm-text); outline: none; resize: vertical; box-sizing: border-box; }
.bm-sp-comment-form .bm-sp-form-textarea:focus { border-color: var(--bm-primary); }
.bm-sp-form-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bm-sp-form-row input { flex: 1; min-width: 160px; height: 44px; border: 1.5px solid var(--bm-border); border-radius: 12px; background: var(--bm-surface); padding: 0 14px; font-family: inherit; font-size: 13.5px; color: var(--bm-text); outline: none; box-sizing: border-box; }
.bm-sp-form-row input:focus { border-color: var(--bm-primary); }
.bm-sp-comment-form .form-submit { margin: 12px 0 0; }
.bm-sp-comment-form .bm-sp-form-submit { padding: 11px 26px; border: none; border-radius: 11px; background: var(--bm-primary); color: #fff; font-family: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: var(--bm-shadow-primary, 0 10px 24px rgba(79,70,229,.32)); transition: background .15s; }
.bm-sp-comment-form .bm-sp-form-submit:hover { background: var(--bm-primary-hover); }
.bm-sp-comment-form .comment-notes, .bm-sp-comment-form .logged-in-as { font-size: 12.5px; color: var(--bm-text-mute); margin-bottom: 12px; }
.bm-sp-comment-form .comment-notes a, .bm-sp-comment-form .logged-in-as a { color: var(--bm-primary); }

/* فهرست دیدگاه‌ها */
.bm-sp-comment-list { display: flex; flex-direction: column; gap: 20px; }
.bm-sp-comment-list .children { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.bm-sp-comment { list-style: none; }
.bm-sp-comment-row { display: flex; gap: 13px; }
.bm-sp-comment-av { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 16px; }
.bm-sp-comment-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.bm-sp-comment-main { flex: 1; min-width: 0; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: 16px; padding: 16px 18px; box-shadow: var(--bm-shadow-sm); }
.bm-sp-comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.bm-sp-comment-name { font-size: 14px; font-weight: 700; color: var(--bm-text); }
.bm-sp-comment-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bm-primary-soft); color: var(--bm-primary); }
.bm-sp-comment-date { margin-right: auto; font-size: 11.5px; color: var(--bm-text-mute); }
.bm-sp-comment-mod { margin: 0 0 8px; font-size: 12px; color: var(--bm-accent); }
.bm-sp-comment-text { font-size: 13.5px; line-height: 1.95; color: var(--bm-text-sub); }
.bm-sp-comment-text p { margin: 0 0 8px; }
.bm-sp-comment-actions { margin-top: 10px; font-size: 12px; font-weight: 600; }
.bm-sp-reply a { color: var(--bm-text-mute); text-decoration: none; }
.bm-sp-reply a:hover { color: var(--bm-primary); }

/* ریسپانسیو */
@media (max-width: 980px) {
    .bm-sp-layout { grid-template-columns: 1fr; }
    .bm-sp-side { position: static; }
    .bm-sp-body { padding: 24px 20px; border-radius: 16px; }
    .bm-sp-related-grid { grid-template-columns: 1fr; }
    .bm-sp-title { font-size: 32px; }
    .bm-sp-hero { height: 280px; }
}
