/* =========================================================
   Dark Sistem – مقالات و آموزش‌ها (لیست + جزئیات مقاله)
   Uses main.css tokens → works in light + dark theme.
   RTL · mobile-first overrides. Prefix: bl-
   Breakpoints: ≥1200 wide · 1024–1199 · ≤1023 tablet (sidebar → stacked) · ≤700 · ≤520 · ≤380
   ========================================================= */

[hidden] { display: none !important; }
.bl { padding-bottom: clamp(2rem, 5vw, 4rem); }
.bl .i { flex: none; }

/* ---------- shared bits ---------- */
.bl-mi { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; }
.bl-mi .i { color: var(--accent); }
:root[data-theme="dark"] .bl-mi .i { color: #b79bff; }
.bl-badge {
  position: absolute; z-index: 2; top: .75rem; inset-inline-start: .75rem; max-width: calc(100% - 1.5rem); padding: .22rem .8rem; border-radius: 99px;
  background: var(--btn-bg); color: #fff; font-size: .74rem; font-weight: 700; line-height: 1.6; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: filter .15s;
}
.bl-badge:hover { filter: brightness(1.12); }
.bl-box {
  min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow);
}
:root[data-theme="dark"] .bl-box { background: linear-gradient(180deg, #120f2e, #0a0820); }
.bl-box__t { display: flex; align-items: center; gap: .55rem; margin: 0 0 .85rem; font-size: .98rem; font-weight: 800; color: var(--text-strong); }
.bl-box__t .i { width: 20px; height: 20px; color: var(--accent); }
:root[data-theme="dark"] .bl-box__t .i { color: #b79bff; }
.bl-btn, .bl-btn-o {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.3rem; border-radius: 12px; font-size: .9rem; font-weight: 700; line-height: 1.5; cursor: pointer;
  transition: filter .18s, transform .18s, background-color .18s, color .18s, border-color .18s;
}
.bl-btn { border: 0; background: var(--btn-bg); color: #fff; box-shadow: var(--btn-shadow); }
.bl-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.bl-btn-o { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.bl-btn-o:hover { background: var(--accent); color: #fff; }
.bl-btn-o--sm { min-height: 36px; padding: .3rem .9rem; font-size: .82rem; }
.bl-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .86rem; font-weight: 600; color: var(--accent); }
.bl-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.bl-link .i { transition: transform .18s; }
.bl-link:hover .i { transform: translateX(-3px); }

/* ---------- breadcrumbs ---------- */
.bl-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; margin: 0; padding: 0; }
.bl-crumbs li { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.bl-crumbs li + li::before { content: "‹"; opacity: .6; }
.bl-crumbs a:hover { color: var(--accent); }
.bl-crumbs li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(60vw, 520px); }
.bl-crumbs--page { padding-block: 1rem .9rem; font-size: .82rem; color: var(--muted); }
.bl-crumbs--page li > span { color: var(--text); }

/* ---------- hero ---------- */
.bl-hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: clamp(176px, 20vw, 240px); margin-top: 1rem;
  padding: clamp(1rem, 2.6vw, 1.8rem) clamp(1.1rem, 3vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--r-lg); background: #04030f; color: #fff;
}
.bl-hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 18% 50%; }
.bl-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to left, rgba(4, 3, 15, .96) 0, rgba(4, 3, 15, .82) 34%, rgba(4, 3, 15, .12) 74%); }
.bl-hero__body { max-width: min(100%, 540px); }
.bl-hero .bl-crumbs { margin-bottom: .9rem; font-size: .8rem; color: #b9b3e0; }
.bl-hero .bl-crumbs li > span { color: #fff; }
.bl-hero .bl-crumbs a:hover { color: #fff; }
.bl-hero h1 { display: flex; align-items: center; gap: .6rem; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; line-height: 1.5; color: #fff; }
.bl-hero h1 .i { width: 1.15em; height: 1.15em; color: #b79bff; }
.bl-hero p { margin-top: .5rem; font-size: clamp(.82rem, 1.5vw, .95rem); line-height: 1.95; color: #d8d3ff; }

/* ---------- list layout ---------- */
.bl-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "side main"; gap: 1.5rem; margin-top: 1.5rem; align-items: start; }
.bl-main { grid-area: main; min-width: 0; }
.bl-side { grid-area: side; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.bl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.bl-count { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: .9rem; font-weight: 500; color: var(--muted); }
.bl-count .i { width: 20px; height: 20px; color: var(--accent); }
:root[data-theme="dark"] .bl-count .i { color: #b79bff; }
.bl-count b { color: var(--text-strong); font-weight: 800; }
.bl-sort { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); }
.bl-sort__sel { position: relative; display: inline-flex; align-items: center; }
.bl-sort select {
  height: 40px; min-width: 150px; padding: 0 .9rem 0 2.2rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text);
  font-size: .85rem; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.bl-sort select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.bl-sort__sel .i { position: absolute; left: .75rem; pointer-events: none; color: var(--muted); }

/* ---------- cards ---------- */
.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: clamp(.8rem, 1.6vw, 1.25rem); }
.bl-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
:root[data-theme="dark"] .bl-card { background: linear-gradient(180deg, #120f2e, #0a0820); }
.bl-card:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.bl-card:focus-within { border-color: var(--accent); }
.bl-card__img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--media-bg); }
.bl-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.bl-card:hover .bl-card__img img { transform: scale(1.05); }
.bl-card__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 40%); pointer-events: none; }
.bl-card__body { display: flex; flex: 1; flex-direction: column; gap: .5rem; padding: .95rem 1rem 1rem; }
.bl-card__title { margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.75; color: var(--text-strong); }
.bl-card__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }       /* whole card is clickable */
.bl-card__title a:hover { color: var(--accent); }
.bl-card__title a:focus-visible { outline: 0; }
.bl-card__text { margin: 0; font-size: .84rem; line-height: 1.95; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bl-card__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin-top: auto; padding-top: .8rem; border-top: 1px dashed var(--line); font-size: .74rem; color: var(--muted);
}
.bl-card__body > .bl-card__text { margin-bottom: .3rem; }
.bl-card__go {
  display: grid; place-items: center; width: 32px; height: 32px; margin-inline-start: auto; border-radius: 50%; background: var(--btn-bg); color: #fff; box-shadow: var(--btn-shadow);
  transition: transform .2s;
}
.bl-card:hover .bl-card__go { transform: translateX(-3px); }

/* ---------- pagination ---------- */
.bl-pager { margin-top: 1.8rem; }
.bl-pager ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.bl-pg {
  display: grid; place-items: center; min-width: 40px; height: 40px; padding-inline: .5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
  font-size: .88rem; transition: border-color .15s, color .15s, background-color .15s;
}
a.bl-pg:hover { border-color: var(--accent); color: var(--accent); }
.bl-pg.is-active { border-color: transparent; background: var(--btn-bg); color: #fff; box-shadow: var(--btn-shadow); }
.bl-pg.is-disabled { opacity: .4; cursor: not-allowed; }

/* ---------- sidebar widgets ---------- */
.bl-search { position: relative; display: flex; align-items: center; height: 50px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s; }
:root[data-theme="dark"] .bl-search { background: #0e0c25; }
.bl-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bl-search input { flex: 1; min-width: 0; height: 100%; padding: 0 1rem; border: 0; background: transparent; color: var(--text); font-size: .88rem; outline: 0; }
.bl-search input::placeholder { color: var(--muted); }
.bl-search input::-webkit-search-cancel-button { display: none; }
.bl-search button { display: grid; place-items: center; width: 48px; height: 100%; border: 0; background: none; color: var(--muted); }
.bl-search button:hover { color: var(--accent); }

.bl-cats ul { display: flex; flex-direction: column; gap: .2rem; }
.bl-cats a { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .5rem .8rem; border: 1px solid transparent; border-radius: 10px; font-size: .88rem; color: var(--text); transition: background-color .15s, color .15s, border-color .15s; }
.bl-cats a .i { width: 20px; height: 20px; color: var(--muted); transition: color .15s; }
.bl-cats a em { margin-inline-start: auto; min-width: 26px; padding: .05rem .5rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-style: normal; font-size: .74rem; font-weight: 700; text-align: center; }
:root[data-theme="dark"] .bl-cats a em { color: #d8ccff; }
.bl-cats a:hover { background: var(--accent-soft); color: var(--accent); }
.bl-cats a:hover .i { color: var(--accent); }
.bl-cats a.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
:root[data-theme="dark"] .bl-cats a.is-active { color: #fff; }
.bl-cats a.is-active .i { color: var(--accent); }
.bl-cats a.is-active em { background: var(--accent); color: #fff; }

.bl-pop ul { display: flex; flex-direction: column; }
.bl-pop li + li { border-top: 1px dashed var(--line); }
.bl-pop li a { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: .75rem; padding: .65rem 0; }
.bl-pop li:first-child a { padding-top: 0; }
.bl-pop li:last-child a { padding-bottom: 0; }
.bl-pop img { width: 64px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--media-bg); border: 1px solid var(--line); }
.bl-pop span { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.bl-pop strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .84rem; font-weight: 700; line-height: 1.7; color: var(--text-strong); transition: color .15s; }
.bl-pop a:hover strong { color: var(--accent); }
.bl-pop small { font-size: .72rem; color: var(--muted); }

.bl-cta { position: relative; overflow: hidden; padding: 1.2rem 1.1rem 1.15rem; border-color: rgba(139, 92, 246, .55); background: linear-gradient(145deg, #1c1255, #0d0a2e) !important; color: #fff; }
.bl-cta::before { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .45), transparent 70%); pointer-events: none; }
.bl-cta__ic { position: absolute; inset-inline-end: 1rem; top: 1rem; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(139, 92, 246, .22); color: #c8b2ff; }
.bl-cta h2 { margin: 0 0 .4rem; padding-inline-end: 2.8rem; font-size: .98rem; font-weight: 800; line-height: 1.6; color: #fff; }
.bl-cta p { margin: 0 0 1rem; font-size: .82rem; line-height: 1.95; color: #cfc8f5; }
.bl-cta .bl-btn-o { width: 100%; border-color: #a78bfa; background: rgba(139, 92, 246, .12); color: #e6dcff; }
.bl-cta .bl-btn-o:hover { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }

/* =========================================================
   Article detail
   ========================================================= */
.bl-progress { position: fixed; z-index: 250; top: 0; inset-inline: 0; height: 3px; background: linear-gradient(to left, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: right center; pointer-events: none; }

.bl-alayout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(1.2rem, 2.5vw, 2.2rem); align-items: start; }
.bl-article { min-width: 0; }

.bl-ahead { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.bl-badge--static { position: static; inset: auto; max-width: none; }
.bl-ahead h1 { text-wrap: balance; font-size: clamp(1.45rem, 3.4vw, 2.3rem); font-weight: 800; line-height: 1.65; color: var(--text-strong); }
.bl-lead { font-size: clamp(.95rem, 1.6vw, 1.08rem); line-height: 2.1; color: var(--muted); }
.bl-ameta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; width: 100%; padding-block: .9rem; border-block: 1px dashed var(--line); font-size: .82rem; color: var(--muted); }
.bl-author { display: flex; align-items: center; gap: .65rem; }
.bl-author span:last-child { display: flex; flex-direction: column; line-height: 1.5; }
.bl-author strong { font-size: .86rem; color: var(--text-strong); }
.bl-author small { font-size: .72rem; color: var(--muted); }
.bl-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--btn-bg); color: #fff; font-family: var(--latin); font-size: 1.05rem; font-weight: 700; box-shadow: var(--btn-shadow); }
.bl-avatar--lg { width: 56px; height: 56px; font-size: 1.4rem; }

.bl-cover { margin: 1.3rem 0 1.4rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); background: var(--media-bg); }
.bl-cover img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }

/* table of contents */
.bl-toc { counter-reset: toc; display: flex; flex-direction: column; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.bl-toc a {
  counter-increment: toc; display: flex; align-items: baseline; gap: .6rem; padding: .5rem .7rem; border-inline-start: 2px solid transparent; border-radius: 8px;
  font-size: .86rem; line-height: 1.75; color: var(--muted); transition: color .15s, background-color .15s, border-color .15s;
}
.bl-toc a::before { content: counter(toc, persian) "."; flex: none; min-width: 1.4em; font-weight: 700; color: var(--accent); }
.bl-toc a:hover { color: var(--accent); background: var(--accent-soft); }
.bl-toc a.is-active { border-inline-start-color: var(--accent); background: var(--accent-soft); color: var(--text-strong); font-weight: 700; }
.bl-toc-m { display: none; margin-bottom: 1.4rem; padding: 0; }
.bl-toc-m summary { display: flex; align-items: center; gap: .6rem; min-height: 50px; padding: .6rem 1rem; font-size: .95rem; font-weight: 800; color: var(--text-strong); cursor: pointer; list-style: none; }
.bl-toc-m summary::-webkit-details-marker { display: none; }
.bl-toc-m summary .i:first-child { color: var(--accent); }
.bl-toc-m__chev { margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.bl-toc-m[open] .bl-toc-m__chev { transform: rotate(180deg); }
.bl-toc-m .bl-toc { padding: 0 .6rem .7rem; }

/* prose */
.bl-prose { font-size: clamp(.96rem, 1.3vw, 1.03rem); line-height: 2.15; color: var(--text); overflow-wrap: anywhere; }
.bl-prose > * + * { margin-top: 1rem; }
.bl-prose h2 { margin-top: 2.2rem; padding-inline-start: .85rem; border-inline-start: 4px solid var(--accent); font-size: clamp(1.15rem, 2.2vw, 1.45rem); font-weight: 800; line-height: 1.7; color: var(--text-strong); scroll-margin-top: calc(var(--header-h) + 16px); }
.bl-prose h3 { margin-top: 1.6rem; font-size: 1.1rem; font-weight: 800; color: var(--text-strong); }
.bl-prose a:not(.bl-btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.bl-prose strong { color: var(--text-strong); }
.bl-prose ul, .bl-prose ol { padding-inline-start: 1.5rem; }
.bl-prose ul { list-style: disc; }
.bl-prose ol { list-style: decimal; }
.bl-prose li { padding-inline-start: .3rem; }
.bl-prose li + li { margin-top: .45rem; }
.bl-prose li::marker { color: var(--accent); font-weight: 700; }
.bl-prose .bl-btn { margin-top: .4rem; color: #fff; }

.bl-callout { display: flex; gap: .8rem; padding: .95rem 1.1rem; border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--accent-soft); }
.bl-callout .i { width: 22px; height: 22px; margin-top: .45rem; color: var(--accent); }
.bl-callout p { margin: 0; font-size: .92rem; line-height: 2; }
:root[data-theme="dark"] .bl-callout .i { color: #b79bff; }

.bl-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.bl-table-wrap:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.bl-table-wrap table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .88rem; line-height: 1.8; }
.bl-table-wrap th, .bl-table-wrap td { padding: .7rem 1rem; text-align: start; vertical-align: top; }
.bl-table-wrap thead th { background: var(--accent-soft); color: var(--text-strong); font-weight: 800; white-space: nowrap; }
.bl-table-wrap tbody th { font-weight: 700; color: var(--text-strong); white-space: nowrap; }
.bl-table-wrap tbody tr + tr > * { border-top: 1px solid var(--line); }
.bl-table-wrap tbody tr:nth-child(even) { background: var(--surface-2); }

.bl-fig { margin: 1.4rem 0 0; }
.bl-fig img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border: 1px solid var(--line); border-radius: var(--r-md); }
.bl-fig figcaption { margin-top: .55rem; font-size: .8rem; text-align: center; color: var(--muted); }

.bl-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.bl-tags a { display: inline-flex; align-items: center; min-height: 34px; padding: .2rem .9rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .8rem; color: var(--text); transition: border-color .15s, color .15s, background-color .15s; }
.bl-tags a::before { content: "#"; margin-inline-end: .25rem; color: var(--accent); }
.bl-tags a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.bl-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 1rem; margin-top: 1.2rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.bl-share__t { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 700; color: var(--text-strong); }
.bl-share__btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.bl-share__b { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .35rem 1rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text); font-size: .82rem; font-weight: 600; transition: border-color .15s, color .15s, background-color .15s; }
.bl-share__b:hover, .bl-share__b.is-done { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.bl-authorbox { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
:root[data-theme="dark"] .bl-authorbox { background: linear-gradient(180deg, #120f2e, #0a0820); }
.bl-authorbox strong { display: block; font-size: .95rem; color: var(--text-strong); }
.bl-authorbox p { margin: .15rem 0 0; font-size: .82rem; line-height: 1.9; color: var(--muted); }

.bl-pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 1.2rem; }
.bl-pn__a { display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .15s, transform .15s; }
.bl-pn__a:hover { border-color: var(--accent); transform: translateY(-2px); }
.bl-pn__a .i { color: var(--accent); }
.bl-pn__a span { display: flex; flex-direction: column; min-width: 0; }
.bl-pn__a small { font-size: .74rem; color: var(--muted); }
.bl-pn__a strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .88rem; line-height: 1.7; color: var(--text-strong); }
.bl-pn__a--next { justify-content: space-between; text-align: end; }
.bl-pn__a--next span { align-items: flex-end; }

.bl-aside__in { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 1rem; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; }

.bl-related { margin-top: clamp(2rem, 4vw, 3.2rem); }
.bl-related__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.bl-related__head h2 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 800; color: var(--text-strong); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1199px) {
  .bl-layout { grid-template-columns: 270px minmax(0, 1fr); gap: 1.2rem; }
  .bl-alayout { grid-template-columns: minmax(0, 1fr) 270px; }
}

/* tablet & below: sidebar widgets stack around the list */
@media (max-width: 1023px) {
  .bl-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "search search" "cats cats" "main main" "pop cta"; gap: 1rem; margin-top: 1.1rem; }
  .bl-side { display: contents; }
  .bl-search { grid-area: search; }
  .bl-cats { grid-area: cats; padding: .55rem; }
  .bl-pop { grid-area: pop; }
  .bl-cta { grid-area: cta; }
  .bl-cats .bl-box__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bl-cats ul { flex-direction: row; gap: .45rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .bl-cats ul::-webkit-scrollbar { display: none; }
  .bl-cats li { flex: none; scroll-snap-align: center; }
  .bl-cats a { min-height: 42px; border-color: var(--line); border-radius: 99px; white-space: nowrap; padding-inline: .9rem; }

  .bl-alayout { grid-template-columns: minmax(0, 1fr); }
  .bl-aside { display: none; }
  .bl-toc-m { display: block; }
  .bl-hero__bg { object-position: 10% 50%; }
}

@media (max-width: 700px) {
  .bl-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "search" "cats" "main" "pop" "cta"; }
  .bl-pn { grid-template-columns: minmax(0, 1fr); }
  .bl-hero::after { background: linear-gradient(to left, rgba(4, 3, 15, .95) 0, rgba(4, 3, 15, .78) 60%, rgba(4, 3, 15, .5) 100%); }
}

@media (max-width: 520px) {
  .bl-hero { min-height: 0; margin-top: .6rem; border-radius: 18px; }
  .bl-toolbar { flex-wrap: wrap; }
  .bl-sort { flex: 1 1 100%; }
  .bl-sort > label { display: none; }
  .bl-sort__sel { flex: 1; }
  .bl-sort select { width: 100%; }
  .bl-card__body { padding: .85rem .9rem .9rem; }
  .bl-cover { border-radius: 16px; margin-block: 1rem; }
  .bl-cover img, .bl-fig img { aspect-ratio: 16 / 10; }
  .bl-ameta { gap: .5rem 1rem; }
  .bl-author { flex: 1 1 100%; }
  .bl-share { flex-direction: column; align-items: stretch; }
  .bl-share__btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bl-share__b { justify-content: center; padding-inline: .4rem; }
  .bl-authorbox { align-items: flex-start; }
  .bl-callout { padding: .8rem .9rem; }
  .bl-prose h2 { margin-top: 1.8rem; }
  .bl-pg { min-width: 38px; height: 38px; }
}

@media (max-width: 380px) {
  .bl-share__b span { font-size: .74rem; }
  .bl-share__b .i { display: none; }
  .bl-card__foot { gap: .35rem .7rem; font-size: .7rem; }
  .bl-pager ul { gap: .3rem; }
  .bl-pg { min-width: 36px; }
  .bl-avatar--lg { width: 46px; height: 46px; font-size: 1.15rem; }
}

@media (min-width: 1700px) {
  .bl-layout { grid-template-columns: 320px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .bl-card, .bl-card__img img, .bl-card__go, .bl-link .i, .bl-pn__a, .bl-toc-m__chev { transition: none; }
  .bl-card:hover, .bl-card:hover .bl-card__img img, .bl-card:hover .bl-card__go { transform: none; }
}

@media print {
  .bl-progress, .bl-aside, .bl-toc-m, .bl-share, .bl-pn, .bl-related, .bl-crumbs { display: none !important; }
  .bl-alayout { display: block; }
}

/* =========================================================
   محتوای نوشته‌شده با ادیتور (CKEditor 5) و حالت‌های خالی
   ========================================================= */
.bl-prose h4 { margin-top: 1.4rem; font-size: 1rem; font-weight: 800; color: var(--text-strong); }
.bl-prose blockquote {
  margin: 1.4rem 0 0; padding: .9rem 1.1rem; border-inline-start: 4px solid var(--accent);
  border-radius: var(--r-md); background: var(--accent-soft); font-size: .95rem; line-height: 2;
}
.bl-prose blockquote p { margin: 0; }
.bl-prose table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: .88rem; line-height: 1.8; }
.bl-prose figure { margin: 1.4rem 0 0; }
.bl-prose figure img, .bl-prose > img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.bl-prose figcaption { margin-top: .55rem; font-size: .8rem; text-align: center; color: var(--muted); }
.bl-prose hr { margin: 1.8rem 0; border: 0; border-top: 1px dashed var(--line); }
.bl-prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-md); }
.bl-prose .table { overflow-x: auto; }
.bl-prose table th, .bl-prose table td { padding: .6rem .9rem; border: 1px solid var(--line); text-align: start; vertical-align: top; }
.bl-prose table thead th { background: var(--accent-soft); color: var(--text-strong); font-weight: 800; }

.bl-empty { display: flex; flex-direction: column; align-items: center; gap: .55rem; padding: clamp(1.6rem, 5vw, 3rem) 1.2rem; text-align: center; }
.bl-empty > .i { width: 42px; height: 42px; color: var(--accent); opacity: .8; }
.bl-empty h2 { font-size: 1.05rem; font-weight: 800; color: var(--text-strong); }
.bl-empty p { font-size: .86rem; color: var(--muted); }
.bl-empty .bl-btn-o { margin-top: .4rem; }
.bl-pop__empty { display: block; padding: .5rem 0; font-size: .82rem; color: var(--muted); }
