/* استایل مقالات سهرابی — همه چیز زیر .article-body محدود شده تا با قالب سایت تداخل نکند.
   فونت و رنگ متن از قالب سایت به ارث می‌رسد. */
.article-body{
  --a-ink:#1f2937; --a-muted:#64748b; --a-line:#e2e8f0; --a-soft:#f8fafc; --a-accent:#2563eb;
  --c-tip:#0f766e;      --c-tip-bg:#f0fdfa;
  --c-warn:#b45309;     --c-warn-bg:#fffbeb;
  --c-example:#6d28d9;  --c-example-bg:#f5f3ff;
  --c-check:#15803d;    --c-check-bg:#f0fdf4;
  --c-key:#1d4ed8;      --c-key-bg:#eff6ff;
  --c-note:#475569;     --c-note-bg:#f1f5f9;
  direction:rtl; text-align:right;
  max-width:760px; margin-inline:auto;
  font-size:1.0625rem; line-height:2; overflow-wrap:break-word;
}
.article-body *{box-sizing:border-box}
.article-body p{margin:0 0 1.1em}
.article-body h2{margin:2.2em 0 .7em; padding-bottom:.35em; font-size:1.55em; line-height:1.5; border-bottom:2px solid var(--a-line)}
.article-body h3{margin:1.8em 0 .5em; font-size:1.25em; line-height:1.6}
.article-body ul,.article-body ol{margin:0 0 1.2em; padding-inline-start:1.6em}
.article-body li{margin-bottom:.5em}
.article-body a{color:var(--a-accent); text-underline-offset:3px}
.article-body img{max-width:100%; height:auto; border-radius:10px}
.article-body strong{font-weight:700}
.article-body :not(pre)>code{direction:ltr; unicode-bidi:isolate; padding:.1em .4em; font-size:.9em; background:var(--a-note-bg,#f1f5f9); border:1px solid var(--a-line); border-radius:6px}

/* کادرها */
.article-callout{
  --cc:var(--c-note); --cb:var(--c-note-bg);
  position:relative; margin:1.6em 0; padding:1em 1.2em 1em 1.2em;
  background:var(--cb); color:var(--a-ink);
  border:1px solid color-mix(in srgb,var(--cc) 25%,transparent);
  border-inline-start:5px solid var(--cc); border-radius:12px;
}
.article-callout>:last-child{margin-bottom:0}
.article-callout>:first-child{margin-top:0}
.article-callout::before{display:block; margin-bottom:.3em; font-weight:700; color:var(--cc)}
.article-callout--tip{--cc:var(--c-tip); --cb:var(--c-tip-bg)}
.article-callout--tip::before{content:"💡 نکته"}
.article-callout--warning{--cc:var(--c-warn); --cb:var(--c-warn-bg)}
.article-callout--warning::before{content:"⚠️ هشدار"}
.article-callout--example{--cc:var(--c-example); --cb:var(--c-example-bg)}
.article-callout--example::before{content:"📌 مثال"}
.article-callout--checklist{--cc:var(--c-check); --cb:var(--c-check-bg)}
.article-callout--checklist::before{content:"✅ چک‌لیست"}
.article-callout--important{--cc:var(--c-key); --cb:var(--c-key-bg)}
.article-callout--important::before{content:none; display:none}
.article-callout--note{--cc:var(--c-note); --cb:var(--c-note-bg)}
.article-callout--note::before{content:"ℹ️ یادداشت"}
.article-callout--checklist ul{list-style:none; padding-inline-start:0}
.article-callout--checklist li{position:relative; padding-inline-start:1.7em}
.article-callout--checklist li::before{content:"☐"; position:absolute; inset-inline-start:0; color:var(--c-check)}

/* باکس کد با دکمه کپی */
.article-code{margin:1.5em 0; direction:ltr; text-align:left; overflow:hidden; background:#0f172a; border-radius:12px; border:1px solid #1e293b}
.article-code__bar{display:flex; align-items:center; justify-content:space-between; gap:.75em; padding:.45em .6em .45em 1em; background:#1e293b; color:#cbd5e1; font:600 .8rem/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:.04em}
.article-code__lang{text-transform:uppercase}
.article-code__copy{display:inline-block; cursor:pointer; user-select:none; -webkit-user-select:none; padding:.35em .9em; color:#e2e8f0; background:#334155; border:1px solid #475569; border-radius:8px; font-family:inherit; font-size:.8rem; font-weight:600; line-height:1.4; direction:rtl; transition:background .15s}
.article-code__copy:hover{background:#475569}
.article-code__copy:focus-visible{outline:2px solid #93c5fd; outline-offset:2px}
.article-code__copy.is-copied{background:#15803d; border-color:#16a34a; color:#fff}
.article-code pre{margin:0; padding:1em 1.1em; overflow-x:auto; background:transparent; color:#e2e8f0; font:.9rem/1.75 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; tab-size:2; white-space:pre}
.article-code pre code{padding:0; background:none; border:0; color:inherit; font:inherit}

/* جدول */
.article-table-wrap{margin:1.5em 0; overflow-x:auto; border:1px solid var(--a-line); border-radius:12px}
.article-table-wrap table{width:100%; min-width:520px; border-collapse:collapse; font-size:.95em; line-height:1.8}
.article-table-wrap th{padding:.7em 1em; text-align:right; background:var(--a-soft); border-bottom:2px solid var(--a-line)}
.article-table-wrap td{padding:.7em 1em; border-bottom:1px solid var(--a-line); vertical-align:top}
.article-table-wrap tr:last-child td{border-bottom:0}

/* مراحل شماره‌دار */
.article-steps{list-style:none; counter-reset:step; padding:0}
.article-steps>li{position:relative; counter-increment:step; margin-bottom:1em; padding-inline-start:3em}
.article-steps>li::before{content:counter(step); position:absolute; inset-inline-start:0; top:.1em; width:2em; height:2em; display:grid; place-items:center; color:#fff; background:var(--a-accent); border-radius:50%; font-weight:700; line-height:1}

/* نقل‌قول، سؤال‌های متداول، دعوت به اقدام */
.article-body blockquote{margin:1.6em 0; padding:.6em 1.2em; color:var(--a-muted); border-inline-start:4px solid var(--a-line); background:var(--a-soft); border-radius:8px}
.article-body blockquote>:last-child{margin-bottom:0}
.article-faq details{margin:.6em 0; padding:.7em 1em; border:1px solid var(--a-line); border-radius:10px}
.article-faq summary{cursor:pointer; font-weight:700}
.article-faq details[open] summary{margin-bottom:.5em}
.article-cta{margin:2.2em 0; padding:1.3em 1.5em; background:var(--a-soft); border:1px solid var(--a-line); border-radius:14px}
.article-cta>:last-child{margin-bottom:0}

@media (max-width:600px){
  .article-body{font-size:1rem; line-height:1.95}
  .article-body h2{font-size:1.35em}
  .article-callout{padding:.9em 1em}
  .article-code pre{font-size:.82rem}
}
