/* Article layout based on the supplied AtraByte reference. */
.blog-detail-page {
  --bdx-ink: #201e46;
  --bdx-muted: #625f83;
  --bdx-accent: #6554e8;
  --bdx-line: #eae8f5;
  --bdx-tint: #f5f3ff;
  --bdx-width: 1160px;
  background: #fff;
  color: var(--bdx-ink);
}
.bdx, .bdx *, .bdx *::before, .bdx *::after { box-sizing: border-box; }
.bdx { padding-top: var(--nav, 68px); background: #fff; color: var(--bdx-ink); font-family: 'Vazirmatn', sans-serif; }
.bdx [hidden] { display: none !important; }
.bdx a { color: inherit; text-decoration: none; }
.bdx a:hover { color: var(--bdx-accent); }
.bdx button, .bdx input, .bdx textarea { font: inherit; }
.bdx button { cursor: pointer; }
.bdx :is(a, button, input, textarea):focus-visible { outline: 3px solid var(--bdx-accent); outline-offset: 4px; }
.bdx h1, .bdx h2, .bdx h3 { color: var(--bdx-ink); text-wrap: balance; font-weight: 800; }
.bdx p { text-wrap: pretty; }
.bdx-progress { position: fixed; inset: var(--nav,68px) 0 auto; height: 3px; z-index: 101; background: var(--bdx-accent); transform: scaleX(0); transform-origin: left; pointer-events: none; }
html[dir=rtl] .bdx-progress { transform-origin: right; }
.bdx-hero { background: #f8f7fc; }
.bdx-hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; direction: ltr; }
.bdx-hero__copy { position: relative; padding: 22px 52px 32px max(24px, calc((100vw - var(--bdx-width)) / 2)); direction: ltr; align-self: center; text-align: left; }
html[dir=rtl] .bdx-hero__copy { direction: rtl; }
.bdx-breadcrumb { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-bottom: 38px; color: var(--bdx-muted); font-size: 12px; }
html[dir=ltr] .bdx-breadcrumb { justify-content: flex-start; }
.bdx-hero__identity { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 14px; align-items: center; margin-bottom: 18px; font-size: 12px; color: var(--bdx-accent); }
.bdx-hero__identity > span { color: var(--bdx-ink); }
.bdx-category::before { content: '/'; margin-inline-end: 14px; color: var(--bdx-muted); }
.bdx-hero h1 { font-size: clamp(27px, 2.6vw, 40px); line-height: 1.65; margin: 0 0 16px; }
.bdx-dek { font-size: 15px; line-height: 2; color: #504c72; margin: 0 0 24px; }
.bdx-byline { display: inline-flex; direction: ltr; gap: 12px; align-items: center; vertical-align: middle; margin-right: 20px; }
.bdx-byline > div { direction: rtl; text-align: left; }
html[dir=ltr] .bdx-byline > div { direction: ltr; }
.bdx-byline strong { display: block; font-size: 13px; }
.bdx-byline span:not(.bdx-avatar) { display: block; color: var(--bdx-muted); font-size: 11px; margin-top: 4px; }
.bdx-avatar { width: 54px; height: 54px; object-fit: cover; border-radius: 50%; flex: 0 0 auto; }
.bdx-avatar--initial { display: inline-grid; place-items: center; background: #e6e1ff; color: #4635a6; font-size: 23px; font-weight: 700; }
.bdx-byline .bdx-avatar { width: 42px; height: 42px; font-size: 18px; }
.bdx-meta { display: inline-flex; gap: 20px; align-items: center; vertical-align: middle; margin: 12px 0 0; color: var(--bdx-muted); font-size: 11px; }
.bdx-meta > div { display: flex; gap: 5px; }
.bdx-meta dt { font-weight: 400; }
.bdx-meta dd { margin: 0; }
.bdx-cover { margin: 0; position: relative; min-height: 490px; height: 100%; overflow: hidden; }
.bdx-cover img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.bdx-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #f8f7fc, transparent 12%); pointer-events: none; }
.bdx-cover--empty { display: flex; flex-direction: column; justify-content: center; align-items: center; background: #26233f; color: #fff; }
.bdx-cover--empty span { font-size: 28px; }
.bdx-cover--empty b { font-size: 100px; color: #a99af8; }
.bdx-reading, .bdx-adjacent, .bdx-related, .bdx-comments { width: min(calc(100% - 48px), var(--bdx-width)); margin-inline: auto; }
.bdx-reading { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 38px; direction: ltr; padding-top: 28px; align-items: start; }
.bdx-reading__main { min-width: 0; direction: ltr; border-left: 1px solid var(--bdx-line); padding-left: 20px; }
html[dir=rtl] .bdx-reading__main { direction: rtl; }
.bdx-rail { position: sticky; top: calc(var(--nav,68px) + 24px); min-width: 0; color: var(--bdx-ink); }
.bdx-rail__panel { border: 1px solid var(--bdx-line); border-radius: 7px; }
.bdx-rail h2, .bdx-share > span { font-size: 14px; font-weight: 800; display: block; margin: 0 0 18px; }
.bdx-toc, .bdx-reading-status, .bdx-share { padding: 20px; }
.bdx-toc ol { padding: 0; margin: 0; list-style: none; max-height: 260px; overflow-y: auto; }
.bdx-toc__item a { position: relative; display: flex; align-items: baseline; gap: 12px; padding: 8px 0; font-size: 12px; color: var(--bdx-muted); }
.bdx-toc__number { width: 8px; flex-shrink: 0; font-size: 0; }
.bdx-toc__number::before { content: ''; display: block; width: 5px; height: 5px; border: 1px solid #aaa4c8; border-radius: 50%; }
.bdx-toc__title { font-weight: 400; flex: 1; text-align: right; direction: rtl; }
html[dir=ltr] .bdx-toc__title { direction: ltr; text-align: left; }
.bdx-toc__item--sub a { padding-inline-start: 12px; }
.bdx-toc a.is-active { color: #4938ad; }
.bdx-toc a.is-active .bdx-toc__number::before { background: #6554e8; border-color: #6554e8; }
.bdx-toc a.is-active strong { font-weight: 700; }
.bdx-reading-status, .bdx-share { border-top: 1px solid var(--bdx-line); }
.bdx-reading-status__row { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.bdx-reading-track { height: 7px; flex: 1; border-radius: 10px; overflow: hidden; background: #f0edf9; }
#bdx-reading-indicator { display: block; width: 0; height: 100%; background: #6554e8; border-radius: inherit; }
.bdx-share > div { display: flex; flex-direction: column; gap: 4px; }
.bdx-share a, .bdx-share button { display: flex; align-items: center; justify-content: space-between; min-height: 38px; color: #373253; font-size: 13px; border: 0; background: none; padding: 5px 0; text-align: left; }
.bdx-share a b { color: var(--bdx-accent); }
.bdx-share button.is-copied { color: #28734e; }
.bdx-consult { background: var(--bdx-tint); margin-top: 20px; padding: 26px; border-radius: 7px; }
.bdx-consult__icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 7px; background: #e2dcff; color: #4d3ac0; margin-bottom: 18px; }
.bdx-consult h2 { font-size: 19px; line-height: 1.7; margin-bottom: 8px; }
.bdx-consult p { font-size: 14px; line-height: 1.9; color: var(--bdx-muted); }
html[dir=rtl] .bdx-consult :is(h2,p) { direction: rtl; text-align: left; }
.bdx-consult button, .bdx-cta button, .bdx-form button { border: 0; border-radius: 7px; background: #4939ae; color: #fff; padding: 13px 20px; font-size: 14px; min-height: 46px; }
.bdx-consult button { width: 100%; margin-top: 8px; }
.bdx-prose { font-size: 15px; line-height: 2.1; color: #504c68; overflow-wrap: anywhere; }
.bdx-prose > :first-child { margin-top: 0; }
.bdx-prose :is(h2,h3,h4) { scroll-margin-top: calc(var(--nav,68px) + 28px); line-height: 1.7; margin: 32px 0 10px; }
.bdx-prose h2 { font-size: 25px; }
.bdx-prose h3 { font-size: 21px; }
.bdx-prose p { margin: 0 0 16px; }
.bdx-prose img, .bdx-prose video { max-width: 100%; height: auto; border-radius: 5px; }
.bdx-prose figure { margin: 22px 0; }
.bdx-prose figcaption { font-size: 12px; color: var(--bdx-muted); text-align: center; }
.bdx-prose blockquote { position: relative; margin: 20px 0 30px; padding: 20px 28px 20px 65px; border: 0; border-radius: 5px; background: var(--bdx-tint); color: #3e328e; font-weight: 600; }
.bdx-prose blockquote::before { content: '“'; position: absolute; left: 20px; top: 0; font-family: Georgia, serif; font-size: 65px; color: var(--bdx-accent); }
.bdx-prose blockquote p:last-child { margin-bottom: 0; }
.bdx-prose :is(ul,ol) { padding-inline-start: 24px; margin-bottom: 22px; }
.bdx-prose li::marker { color: var(--bdx-accent); }
.bdx-prose a { color: #4a36bb; text-decoration: underline; text-underline-offset: 4px; }
.bdx-prose pre { direction: ltr; text-align: left; overflow: auto; background: #f5f3fa; padding: 18px; border-radius: 6px; }
.bdx-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.bdx-prose :is(td,th) { border: 1px solid var(--bdx-line); padding: 10px 14px; }
.bdx-author { direction: ltr; display: flex; gap: 20px; align-items: center; border-top: 1px solid var(--bdx-line); margin-top: 36px; padding: 22px 0; }
.bdx-author > div { flex: 1; }
html[dir=rtl] .bdx-author > div { direction: rtl; text-align: left; }
.bdx-author span:not(.bdx-avatar) { color: var(--bdx-muted); font-size: 12px; }
.bdx-author h2 { font-size: 16px; margin: 3px 0 7px; }
.bdx-author p { color: var(--bdx-muted); font-size: 12px; line-height: 1.9; margin: 0; }
.bdx-author__social { display: inline-block; font-weight: 800; margin-top: 6px; }
.bdx-adjacent { display: flex; direction: ltr; justify-content: space-between; gap: 32px; padding-block: 42px; }
.bdx-adjacent > a { max-width: 46%; }
.bdx-adjacent > a:last-child { text-align: right; }
.bdx-adjacent span { display: block; font-size: 13px; color: var(--bdx-muted); margin-bottom: 7px; }
.bdx-adjacent strong { font-size: 15px; color: #4939ae; }
.bdx-related { padding-block: 0 32px; }
.bdx-related > header, .bdx-comments > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--bdx-line); padding-bottom: 14px; }
.bdx-related > header p { display: none; }
.bdx-related h2, .bdx-comments h2 { font-size: 22px; margin: 0; }
.bdx-related > header > a { font-size: 12px; color: var(--bdx-muted); }
.bdx-related__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; }
.bdx-related__grid article > a { display: flex; direction: ltr; gap: 18px; align-items: center; height: 100%; }
.bdx-related__grid figure { width: 38%; flex: 0 0 38%; aspect-ratio: 1.12; margin: 0; }
.bdx-related__grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.bdx-related__grid a > div { flex: 1; min-width: 0; }
html[dir=rtl] .bdx-related__grid a > div { direction: rtl; }
.bdx-related__grid p { display: inline-block; font-size: 10px; color: #5a4d9d; background: var(--bdx-tint); padding: 2px 7px; border-radius: 4px; margin: 0 0 8px; }
.bdx-related__grid h3 { font-size: 14px; line-height: 1.8; margin-bottom: 18px; }
.bdx-related__grid span { font-size: 10px; color: var(--bdx-muted); }
.bdx-related__grid a > b { display: none; }
.bdx-comments { padding-block: 32px 48px; border-top: 1px solid var(--bdx-line); }
.bdx-comments > header p { font-size: 12px; color: var(--bdx-muted); margin-bottom: 8px; }
.bdx-comments__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.bdx-comment-list article { padding: 18px 0; border-bottom: 1px solid var(--bdx-line); }
.bdx-comment-list article > div { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.bdx-comment-list b { display: grid; place-items: center; width: 34px; height: 34px; background: var(--bdx-tint); border-radius: 50%; }
.bdx-comment-list time { font-size: 11px; color: var(--bdx-muted); }
.bdx-comment-list p, .bdx-no-comments { font-size: 14px; line-height: 2; color: var(--bdx-muted); overflow-wrap: anywhere; }
.bdx-form form { display: flex; flex-direction: column; gap: 8px; }
.bdx-form label { font-size: 13px; }
.bdx-form :is(input,textarea) { width: 100%; border: 1px solid #d8d3e8; border-radius: 5px; padding: 11px; background: #fff; color: var(--bdx-ink); margin-bottom: 6px; }
.bdx-form textarea { min-height: 120px; resize: vertical; }
.bdx-form button { display: flex; justify-content: space-between; }
.bdx-form button:disabled { opacity: .65; cursor: wait; }
.bdx-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bdx-error { color: #a2253a; font-size: 13px; }
.bdx-success { padding: 20px; background: #eef9f2; color: #20613c; border-radius: 6px; }
.bdx-cta { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 40px; padding: 42px max(24px,calc((100vw - var(--bdx-width))/2)); background: #24213e; color: #fff; }
.bdx-cta h2 { color: #fff; font-size: 26px; line-height: 1.7; margin: 0; }
.bdx-cta > div { display: flex; flex-direction: column-reverse; }
.bdx-cta p { color: #d5d0e7; font-size: 13px; margin: 12px 0 0; }
.bdx-cta button { display: flex; align-items: center; gap: 26px; flex-shrink: 0; background: #6554e8; }
.bdx-cta button b { display: grid; place-items: center; background: #fff; color: #4939ae; border-radius: 50%; width: 32px; height: 32px; font-size: 20px; }
@media(min-width:1500px) { .bdx-hero__copy { padding-block: 38px; } .bdx-cover { min-height: 540px; } }
@media(max-width:1100px) {
  .bdx-hero__copy { padding-right: 30px; }
  .bdx-reading { grid-template-columns: 235px minmax(0,1fr); gap: 24px; }
  .bdx-related__grid { gap: 20px; }
  .bdx-related__grid article > a { flex-direction: column; align-items: stretch; }
  .bdx-related__grid figure { width: 100%; flex-basis: auto; aspect-ratio: 1.8; }
}
@media(max-width:760px) {
  .bdx-hero__grid { grid-template-columns: 1fr; }
  .bdx-hero__copy { padding: 22px 24px 28px; }
  .bdx-breadcrumb { margin-bottom: 28px; }
  .bdx-hero h1 { font-size: 29px; }
  .bdx-cover { min-height: 0; height: auto; aspect-ratio: 1.7; }
  .bdx-cover::after { background: linear-gradient(#f8f7fc, transparent 15%); }
  .bdx-reading { grid-template-columns: 1fr; gap: 26px; }
  .bdx-reading__main { border: 0; padding: 0; }
  .bdx-rail { position: static; }
  .bdx-rail__panel { display: grid; grid-template-columns: 1fr 1fr; }
  .bdx-toc { grid-row: span 2; }
  .bdx-reading-status { border-top: 0; }
  .bdx-reading-status, .bdx-share { border-left: 1px solid var(--bdx-line); }
  .bdx-consult { display: none; }
  .bdx-prose { font-size: 15px; }
  .bdx-prose h2 { font-size: 23px; }
  .bdx-comments__grid { grid-template-columns: 1fr; gap: 24px; }
  .bdx-related__grid { grid-template-columns: 1fr; }
  .bdx-related__grid article > a { flex-direction: row; }
  .bdx-related__grid figure { width: 30%; flex: 0 0 30%; aspect-ratio: 1.1; }
  .bdx-cta { flex-direction: column; align-items: stretch; gap: 24px; }
  .bdx-cta button { align-self: flex-start; }
}
@media(max-width:420px) {
  .bdx-reading, .bdx-adjacent, .bdx-related, .bdx-comments { width: calc(100% - 32px); }
  .bdx-hero__copy { padding-inline: 16px; }
  .bdx-hero h1 { font-size: 26px; }
  .bdx-toc, .bdx-reading-status, .bdx-share { padding: 14px; }
  .bdx-rail h2 { font-size: 12px; }
  .bdx-adjacent { gap: 20px; }
  .bdx-adjacent strong { font-size: 13px; }
  .bdx-related > header { align-items: baseline; }
}
@media(prefers-reduced-motion:reduce) { .bdx *, .bdx *::before, .bdx *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
/* Keep the reference's left-to-right composition inside the RTL page. */
.bdx-hero__identity { direction: ltr; }
.bdx-prose > img, .bdx-prose figure > img, .bdx-prose p > img { display: block; width: 100%; }
.bdx-cta { direction: ltr; }
.bdx-cta > div { direction: rtl; }
html[dir=ltr] .bdx-cta > div { direction: ltr; }
@media(max-width:760px) {
  .bdx-rail__panel:has(.bdx-toc[hidden]) { grid-template-columns: 1fr; }
  .bdx-rail__panel:has(.bdx-toc[hidden]) .bdx-reading-status,
  .bdx-rail__panel:has(.bdx-toc[hidden]) .bdx-share { border-left: 0; }
}
@media(prefers-reduced-motion:reduce) {
  html:has(.blog-detail-page) { scroll-behavior: auto !important; }
}
