/* ============================================================
   بلاگ بیت‌فا — آرشیو + مقاله
   وابسته به توکن‌های main.css (:root)
   ============================================================ */

.blog-wrap { padding: 36px 0 64px; }
.container--article { max-width: 1080px; }

/* ---------- هدر بلاگ ---------- */
.blog-hero { text-align: center; padding: 18px 0 8px; }
.blog-hero__title { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; }
.blog-hero__sub { color: var(--muted); max-width: 62ch; margin: 0 auto 10px; font-size: 16px; }
.blog-hero--cat { text-align: right; padding-top: 6px; }
.blog-hero--cat .blog-hero__sub { margin-inline: 0; }
.blog-hero__desc p { margin: 0 0 .6em; }

/* ---------- چیپ دسته‌ها ---------- */
.b-cats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 30px; }
.blog-hero--cat + .b-cats { justify-content: flex-start; }
.b-cats__chip {
	display: inline-flex; align-items: center; gap: 7px;
	background: var(--surface-2); border: 1px solid var(--border);
	border-radius: 100px; padding: 7px 16px; font-size: 14px; font-weight: 600; transition: .2s;
}
.b-cats__chip span { color: var(--muted); font-size: 12px; }
.b-cats__chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- شاخص ---------- */
.b-featured { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; margin-bottom: 44px; }
.b-featured__list { display: flex; flex-direction: column; gap: 12px; }
.b-mini {
	display: flex; gap: 12px; align-items: center;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
	padding: 10px; transition: .2s;
}
.b-mini:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.b-mini__thumb { flex: 0 0 84px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.b-mini__thumb img { width: 100%; height: 100%; object-fit: cover; }
.b-mini__title { display: block; font-weight: 700; font-size: 14px; line-height: 1.7; }
.b-mini__meta { color: var(--muted); font-size: 12px; }

/* ---------- کارت مقاله ---------- */
.b-grid { display: grid; gap: 22px; }
.b-grid--3 { grid-template-columns: repeat(3, 1fr); }
.b-grid--4 { grid-template-columns: repeat(4, 1fr); }
.bcard {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	overflow: hidden; display: flex; flex-direction: column; transition: .2s;
}
.bcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.bcard__thumb { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.bcard__thumb img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.bcard:hover .bcard__thumb img { transform: scale(1.04); }
.bcard__ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 40px; color: var(--primary); opacity: .5; }
.bcard__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bcard__cat { color: var(--primary); font-size: 12.5px; font-weight: 700; }
.bcard__title { font-size: 16px; line-height: 1.75; margin: 0; flex: 1; }
.bcard__title a:hover { color: var(--primary); }
.bcard__excerpt { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0; }
.bcard__meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.bcard--big .bcard__title { font-size: clamp(18px, 2vw, 23px); }
.bcard--big .bcard__thumb { aspect-ratio: 16/9; }

/* ---------- ردیف دسته ---------- */
.b-catrow { margin-bottom: 44px; }
.b-catrow__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.b-catrow__head h2 { font-size: 21px; margin: 0; position: relative; padding-right: 14px; }
.b-catrow__head h2:not(:empty)::before { content: ''; position: absolute; right: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; background: var(--primary); }
.b-catrow__more { color: var(--primary); font-weight: 700; font-size: 14px; }

/* ---------- باند CTA ---------- */
.b-band {
	background: var(--dark-2); color: #fff; border-radius: var(--radius-lg);
	padding: 34px 38px; display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
	margin-bottom: 44px;
}
.b-band__txt { display: flex; flex-direction: column; gap: 6px; }
.b-band__txt strong { font-size: 20px; }
.b-band__txt span { color: var(--dark-muted); font-size: 15px; }
.b-band__btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- بردکرامب ---------- */
.b-crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.b-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.b-crumbs li:not(:last-child)::after { content: '/'; margin: 0 6px; color: var(--border); }
.b-crumbs a:hover { color: var(--primary); }
.b-crumbs span[aria-current] { color: var(--text); font-weight: 600; }

/* ---------- نوار پیشرفت مطالعه ---------- */
.b-progress { position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 200; background: transparent; pointer-events: none; }
.b-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .1s linear; }

/* ---------- مقاله ---------- */
.bpost__head { background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 26px 0 22px; margin-bottom: 26px; }
.bpost__title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; line-height: 1.6; margin: 0 0 14px; }
.bpost__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.bpost__mdot { opacity: .5; }
.bpost__author { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.bpost__avatar {
	width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff;
	display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.bpost__updated { color: var(--accent); font-weight: 600; }
.bpost__thumb { margin: 0 0 26px; border-radius: var(--radius); overflow: hidden; }
.bpost__thumb img { width: 100%; }

.bpost__layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.bpost__side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- بدنه‌ی مقاله ---------- */
.bpost__main { font-size: 16.5px; line-height: 2.1; }
.bpost__main h2 { font-size: 23px; margin: 1.6em 0 .7em; padding-right: 14px; position: relative; scroll-margin-top: 96px; }
.bpost__main h2::before { content: ''; position: absolute; right: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--primary); }
.bpost__main h3 { font-size: 18.5px; margin: 1.4em 0 .6em; scroll-margin-top: 96px; }
.bpost__main img { border-radius: var(--radius-sm); margin: 1em auto; }
.bpost__main a { color: var(--primary-d); text-decoration: underline; text-underline-offset: 4px; }
.bpost__main blockquote {
	margin: 1.4em 0; padding: 16px 20px; background: var(--surface-2);
	border-right: 4px solid var(--primary); border-radius: var(--radius-sm); font-style: normal;
}
.bpost__main ul { list-style: disc; padding-right: 22px; margin: 0 0 1.2em; }
.bpost__main ol { padding-right: 22px; margin: 0 0 1.2em; }
.bpost__main li { margin-bottom: .4em; }
.bpost__main table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 14.5px; display: block; overflow-x: auto; white-space: nowrap; }
.bpost__main table th { background: var(--dark-2); color: #fff; padding: 10px 14px; text-align: right; }
.bpost__main table td { border: 1px solid var(--border); padding: 10px 14px; }
.bpost__main table tr:nth-child(even) td { background: var(--surface-2); }

/* ---------- باکس خلاصه ---------- */
.b-summary {
	background: rgba(247,160,29,.07); border: 1px solid rgba(247,160,29,.35);
	border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 22px;
}
.b-summary__label { font-weight: 800; color: var(--primary-d); font-size: 14px; margin-bottom: 6px; }
.b-summary p { margin: 0; font-size: 15px; line-height: 2; }

/* ---------- فهرست مطالب ---------- */
.b-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.b-toc__head { font-weight: 800; font-size: 15px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.b-toc__list { list-style: none; margin: 0; padding: 10px 0; max-height: 55vh; overflow-y: auto; }
.b-toc__list li a { display: block; padding: 6px 18px; font-size: 13.5px; color: var(--muted); border-right: 2px solid transparent; }
.b-toc__list li a:hover { color: var(--primary); }
.b-toc__list li.is-active a { color: var(--primary-d); border-right-color: var(--primary); font-weight: 700; }
.b-toc__l3 a { padding-right: 34px !important; font-size: 12.5px !important; }
.b-toc--inline { display: none; margin-bottom: 22px; }
.b-toc__toggle {
	display: flex; width: 100%; align-items: center; justify-content: space-between;
	background: var(--surface-2); border: 0; padding: 13px 18px; font-weight: 800; font-size: 14.5px; cursor: pointer;
}
.b-toc__toggle svg { transition: .2s; }
.b-toc__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- CTA میان‌متن و سایدبار ---------- */
.b-cta {
	display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
	background: var(--dark-2); color: #fff; border-radius: var(--radius);
	padding: 20px 24px; margin: 2em 0;
}
.b-cta__txt { display: flex; flex-direction: column; gap: 4px; }
.b-cta__txt strong { font-size: 16.5px; }
.b-cta__txt span { color: var(--dark-muted); font-size: 13.5px; }
.b-cta__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.b-cta .btn--ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.b-sidecta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.b-sidecta__title { font-weight: 800; font-size: 15.5px; }
.b-sidecta p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- FAQ (به تیترهای بعد از «سوالات متداول» در JS کلاس داده می‌شود) ---------- */
.b-faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.b-faq-item > h3 {
	margin: 0 !important; padding: 13px 18px; font-size: 15.5px !important; cursor: pointer;
	display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface-2);
}
.b-faq-item > h3::after { content: '+'; font-size: 20px; color: var(--primary); flex-shrink: 0; }
.b-faq-item.is-open > h3::after { content: '−'; }
.b-faq-item__body { padding: 4px 18px; display: none; }
.b-faq-item.is-open .b-faq-item__body { display: block; }

/* ---------- رأی، برچسب، اشتراک، نویسنده ---------- */
.b-vote {
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 18px; margin: 2em 0 1.2em;
}
.b-vote__q { font-weight: 700; font-size: 14.5px; }
.b-vote__btns { display: flex; gap: 8px; }
.b-vote__btn { background: var(--surface); border: 1px solid var(--border); border-radius: 100px; padding: 6px 16px; cursor: pointer; font-size: 13.5px; transition: .2s; }
.b-vote__btn:hover { border-color: var(--primary); }
.b-vote__thanks { color: var(--accent); font-weight: 700; font-size: 14px; }
.b-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.2em; }
.b-tags a { background: var(--surface-2); border-radius: 100px; padding: 5px 14px; font-size: 12.5px; color: var(--muted); }
.b-tags a:hover { color: var(--primary); }
.b-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 1.6em; }
.b-share a, .b-share__copy {
	border: 1px solid var(--border); background: var(--surface); border-radius: 100px;
	padding: 6px 16px; font-size: 13px; cursor: pointer; transition: .2s;
}
.b-share a:hover, .b-share__copy:hover { border-color: var(--primary); color: var(--primary); }
.b-authorbox {
	display: flex; gap: 16px; align-items: flex-start;
	border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 1em;
}
.b-authorbox__avatar {
	flex: 0 0 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff;
	display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
}
.b-authorbox__name { font-weight: 800; margin-bottom: 4px; }
.b-authorbox__bio { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }

/* ---------- مرتبط‌ها ---------- */
.b-related { margin: 40px 0 10px; }
.b-related__title { font-size: 21px; margin-bottom: 16px; padding-right: 14px; position: relative; }
.b-related__title::before { content: ''; position: absolute; right: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 4px; background: var(--primary); }

/* ---------- ویجت قیمت زنده ---------- */
.b-prices { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 1.6em 0; }
.b-prices__head { display: flex; justify-content: space-between; align-items: center; background: var(--dark-2); color: #fff; padding: 10px 16px; font-size: 14px; font-weight: 700; }
.b-prices__live { color: var(--accent); font-size: 12px; animation: bpulse 2s infinite; }
@keyframes bpulse { 50% { opacity: .45; } }
.b-prices table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 0 !important; display: table !important; white-space: normal !important; }
.b-prices th { background: var(--surface-2) !important; color: var(--muted) !important; font-size: 12.5px; padding: 8px 16px !important; text-align: right; }
.b-prices td { padding: 10px 16px !important; border: 0 !important; border-top: 1px solid var(--border) !important; }
.b-prices tr:nth-child(even) td { background: transparent !important; }
.b-prices__coin { font-weight: 700; }
.b-prices__coin span { color: var(--muted); font-size: 12px; font-weight: 400; }
.b-prices .is-up { color: var(--accent); font-weight: 700; }
.b-prices .is-down { color: var(--danger); font-weight: 700; }

/* ---------- ویدیوی آپارات ---------- */
.b-video { margin-bottom: 22px; }
.b-video__frame { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: var(--dark-2); }
.b-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.b-video__cap { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ---------- ماشین‌حساب ---------- */
.b-calc { border: 1px solid rgba(247,160,29,.4); border-radius: var(--radius); overflow: hidden; margin: 1.6em 0; background: var(--surface); }
.b-calc__head { background: rgba(247,160,29,.09); color: var(--primary-d); font-weight: 800; font-size: 15px; padding: 13px 18px; }
.b-calc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 18px; }
.b-calc__grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.b-calc__grid input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 15px; width: 100%; background: var(--surface-2); }
.b-calc__grid input:focus { outline: none; border-color: var(--primary); }
.b-calc__out { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 18px 18px; }
.b-calc__out > div { flex: 1 1 140px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.b-calc__out span { color: var(--muted); font-size: 12px; }
.b-calc__out strong { font-size: 17px; }
.b-calc__out .is-good strong { color: var(--accent); }
.b-calc__out .is-bad strong { color: var(--danger); }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1024px) {
	.b-grid--4 { grid-template-columns: repeat(2, 1fr); }
	.b-featured { grid-template-columns: 1fr; }
	.bpost__layout { grid-template-columns: 1fr; }
	.bpost__side { position: static; }
	.b-toc--sticky { display: none; }
	.b-toc--inline { display: block; }
}
@media (max-width: 760px) {
	.b-grid--3 { grid-template-columns: 1fr; }
	.b-grid--4 { grid-template-columns: 1fr; }
	.b-band { padding: 26px 22px; }
	.bpost__main { font-size: 15.5px; }
	.blog-wrap { padding-top: 22px; }
}
