/* ==========================================================================
   وبلاگ — فهرست، صفحهٔ مطلب و ویرایشگر مدیریت
   --------------------------------------------------------------------------
   ⚠️ همهٔ کلاس‌ها با پیشوند `bl-` (فهرست)، `bp-` (مطلب) و `bf-`
   (ویرایشگر). کلاس‌های قدیمی `blog-*` در `pages.css` دست‌نخورده‌اند.

   ⚠️ رنگ دسته با متغیر `--bc`، نه شش نسخه از هر قاعده.

   `bc-green`، `bc-blue`، … فقط `--bc` را عوض می‌کنند؛ نشان، کارت
   بی‌تصویر و اسلاید همه از همین یک متغیر رنگ می‌گیرند. در تم تیره
   نسخهٔ روشن‌تر همان رنگ می‌نشیند تا روی پس‌زمینهٔ تیره خوانا بماند.
   ========================================================================== */

/*
  ⚠️ `--bc-on` = رنگ متن روی زمینهٔ پر از رنگ دسته.

  در تم روشن سفید؛ در تم تیره رنگِ دسته روشن‌تر می‌شود و سفید
  روی آن خوانا نیست، پس متن تیره می‌شود.
*/
.bl-page, .bp-page, .bf-cats { --bc: var(--green); --bc-on: #fff; }
.bf-cats { --bc: #475569; }
[data-theme="dark"] .bl-page, [data-theme="dark"] .bp-page, [data-theme="dark"] .bf-cats { --bc-on: #06140d; }

.bc-green  { --bc: #00a859; }
.bc-blue   { --bc: #2563eb; }
.bc-amber  { --bc: #d97706; }
.bc-red    { --bc: #dc2626; }
.bc-violet { --bc: #7c3aed; }
.bc-slate  { --bc: #475569; }
[data-theme="dark"] .bc-green  { --bc: #34d399; }
[data-theme="dark"] .bc-blue   { --bc: #60a5fa; }
[data-theme="dark"] .bc-amber  { --bc: #fbbf24; }
[data-theme="dark"] .bc-red    { --bc: #f87171; }
[data-theme="dark"] .bc-violet { --bc: #a78bfa; }
[data-theme="dark"] .bc-slate  { --bc: #94a3b8; }

/* ---------- مسیر ---------- */
.bl-crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--slate); margin-bottom: 14px;
}
.bl-crumb a { color: var(--slate); transition: color var(--dur-fast); }
.bl-crumb a:hover { color: var(--green-text); }
.bl-crumb b { color: var(--ink); font-weight: 700; }
.bl-crumb span { opacity: .5; }

/* ==========================================================================
   فهرست
   ========================================================================== */
.bl-hero {
  position: relative; overflow: hidden;
  padding: clamp(28px, 5vw, 56px) 0 clamp(26px, 4vw, 44px);
  background:
    radial-gradient(900px 340px at 85% -10%, color-mix(in srgb, var(--green) 22%, transparent), transparent 70%),
    radial-gradient(700px 300px at 5% 120%, color-mix(in srgb, #7c3aed 14%, transparent), transparent 70%),
    var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.bl-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
  opacity: .5;
}
.bl-hero-in {
  position: relative; z-index: 1;
  display: grid; gap: 22px; align-items: end;
}
@media (min-width: 960px) {
  .bl-hero-in { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); }
}
.bl-hero h1 {
  margin: 0 0 8px; font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 900;
  line-height: 1.35; letter-spacing: -.01em;
  background: linear-gradient(120deg, var(--ink) 30%, var(--green-text));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.bl-hero h1 i { font-style: normal; -webkit-text-fill-color: initial; }
.bl-hero p { margin: 0; color: var(--slate); font-size: .95rem; line-height: 2; max-width: 620px; }

/* ---------- حالت‌های سربرگ (تنظیمات وبلاگ) ---------- */
.bl-hero { isolation: isolate; }
.bl-hero-bg, .bl-hero-ov { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.bl-hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bl-hero-ov { display: none; }
.bl-hero:not(.is-image) .bl-hero-bg { display: none; }

.bl-hero.is-color {
  background:
    radial-gradient(900px 360px at 88% -20%, color-mix(in srgb, #fff 16%, transparent), transparent 70%),
    linear-gradient(120deg, var(--bh-c1), var(--bh-c2));
  border-bottom-color: transparent;
}
.bl-hero.is-image { background: #0b1220; border-bottom-color: transparent; min-height: clamp(220px, 26vw, 360px); display: flex; align-items: flex-end; }
.bl-hero.is-image > .wrap { width: 90%; }
.bl-hero.is-image .bl-hero-ov {
  display: block;
  background: linear-gradient(to top, rgba(4,10,20, calc(var(--bh-ov) + .25)), rgba(4,10,20, var(--bh-ov)) 55%, rgba(4,10,20, calc(var(--bh-ov) * .6)));
}
.bl-hero.is-color::after, .bl-hero.is-image::after { opacity: .18; }

/* متن روشن روی زمینهٔ تیره */
.bl-hero.is-light h1 { background: none; color: #fff; -webkit-text-fill-color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.25); }
.bl-hero.is-light p { color: rgba(255,255,255,.86); }
.bl-hero.is-light .bl-crumb, .bl-hero.is-light .bl-crumb a { color: rgba(255,255,255,.75); }
.bl-hero.is-light .bl-crumb b { color: #fff; }
.bl-hero.is-light .bl-crumb a:hover { color: #fff; }
/* متن تیره روی رنگ روشنِ دلخواه — در تم تیره هم تیره می‌ماند */
.bl-hero.is-color:not(.is-light) h1 { background: none; color: #0b1220; -webkit-text-fill-color: #0b1220; }
.bl-hero.is-color:not(.is-light) p,
.bl-hero.is-color:not(.is-light) .bl-crumb,
.bl-hero.is-color:not(.is-light) .bl-crumb a { color: rgba(11,18,32,.72); }
.bl-hero.is-color:not(.is-light) .bl-crumb b { color: #0b1220; }
.bl-hero.is-image:not(.is-light) h1 { background: none; color: #0b1220; -webkit-text-fill-color: #0b1220; }

.bl-search {
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.bl-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent), var(--sh-md); }
.bl-search svg { flex: none; width: 19px; height: 19px; margin-inline-start: 10px; color: var(--slate); }
.bl-search input {
  flex: 1; min-width: 0; border: 0; background: none; outline: 0;
  padding: 9px 4px; font: inherit; font-size: .9rem; color: var(--ink);
}
.bl-search select {
  flex: none; border: 0; outline: 0; font: inherit; font-size: .78rem; font-weight: 700;
  color: var(--slate); background: var(--bg-subtle);
  padding: 8px 10px; border-radius: var(--r-full); cursor: pointer;
}
.bl-search button {
  flex: none; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: var(--r-full);
  background: var(--green-btn); color: var(--on-green);
  font: inherit; font-size: .84rem; font-weight: 800;
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.bl-search button:hover { background: var(--green-btn-hover); }
.bl-search button:active { transform: scale(.97); }
@media (max-width: 520px) {
  .bl-search { flex-wrap: wrap; border-radius: 18px; }
  .bl-search input { flex-basis: calc(100% - 40px); }
  .bl-search select, .bl-search button { flex: 1; }
}

.bl-main { display: flex; flex-direction: column; gap: 26px; padding-block: 28px 56px; }

/* ---------- اسلایدر ویژه ---------- */
.bl-slider { position: relative; }
.bl-track {
  display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; border-radius: 26px;
  overscroll-behavior-x: contain;
}
.bl-track::-webkit-scrollbar { display: none; }
.bl-slide {
  position: relative; flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 1920 / 720; min-height: 340px;
  border-radius: 26px; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-end;
  color: #fff; background: #0b1220;
}
.bl-slide picture, .bl-slide img, .bl-slide-ph {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.bl-slide img { object-fit: cover; transform: scale(1.04); transition: transform 1.4s var(--ease-out); }
.bl-slide.is-on img, .bl-slide:hover img { transform: scale(1); }
.bl-slide-ph {
  display: grid; place-items: center;
  background:
    radial-gradient(600px 300px at 80% 20%, color-mix(in srgb, var(--bc) 70%, transparent), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--bc) 55%, #0b1220), #0b1220);
}
.bl-slide-ph span { font-size: clamp(4rem, 10vw, 7rem); opacity: .35; filter: grayscale(.2); }
.bl-slide-shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to top, rgba(4,10,20,.88) 0%, rgba(4,10,20,.45) 45%, rgba(4,10,20,0) 75%),
    linear-gradient(to left, rgba(4,10,20,.45), transparent 60%);
}
.bl-slide-txt {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 10px;
  padding: clamp(20px, 4vw, 44px); max-width: 760px;
}
.bl-slide-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bl-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: var(--r-full);
  font-size: .72rem; font-weight: 800;
  background: rgba(255,255,255,.14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
}
.bl-pill.is-star { background: linear-gradient(120deg, #f59e0b, #f97316); border-color: transparent; }
.bl-slide strong {
  font-size: clamp(1.2rem, 2.8vw, 2.05rem); font-weight: 900; line-height: 1.5;
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.bl-slide em {
  font-style: normal; font-size: .92rem; line-height: 2; color: rgba(255,255,255,.85);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bl-slide-meta { font-size: .76rem; color: rgba(255,255,255,.72); }
.bl-slide-cta {
  align-self: flex-start; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-full);
  background: #fff; color: #0b1220; font-weight: 800; font-size: .84rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform var(--dur-base) var(--ease-spring), gap var(--dur-base);
}
.bl-slide:hover .bl-slide-cta { transform: translateY(-2px); gap: 12px; }
@media (max-width: 720px) {
  .bl-slide { aspect-ratio: 800 / 1000; min-height: 0; max-height: 78vh; }
  .bl-slide-shade { background: linear-gradient(to top, rgba(4,10,20,.92) 0%, rgba(4,10,20,.5) 50%, rgba(4,10,20,0) 80%); }
  .bl-slide-cta { display: none; }
}

.bl-nav {
  position: absolute; top: 50%; z-index: 3;
  width: 46px; height: 46px; margin-top: -23px;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.3); cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 1.6rem; line-height: 1;
  opacity: 0; transition: opacity var(--dur-base), background var(--dur-fast), transform var(--dur-fast);
}
.bl-nav.is-prev { inset-inline-start: 16px; }
.bl-nav.is-next { inset-inline-end: 16px; }
.bl-slider:hover .bl-nav, .bl-nav:focus-visible { opacity: 1; }
.bl-nav:hover { background: rgba(255,255,255,.3); transform: scale(1.06); }
@media (hover: none) { .bl-nav { display: none; } }

.bl-dots {
  position: absolute; z-index: 3; bottom: 18px; inset-inline-end: 22px;
  display: flex; gap: 6px;
}
.bl-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--r-full); background: rgba(255,255,255,.45);
  transition: width var(--dur-base) var(--ease-out), background var(--dur-base);
}
.bl-dots button.is-on { width: 26px; background: #fff; }
@media (max-width: 720px) { .bl-dots { inset-inline-end: 50%; transform: translateX(-50%); bottom: 12px; } }

/* ---------- دسته‌ها ---------- */
.bl-cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px;
  scrollbar-width: thin; scroll-snap-type: x proximity;
}
.bl-cat {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 7px;
  padding-block: 8px; padding-inline: 14px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: .84rem; font-weight: 700;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.bl-cat i { font-style: normal; }
.bl-cat b {
  min-width: 24px; padding: 2px 7px; border-radius: var(--r-full); text-align: center;
  font-size: .7rem; background: var(--bg-subtle); color: var(--slate);
}
.bl-cat:hover { border-color: var(--bc); transform: translateY(-1px); box-shadow: var(--sh-sm); }
.bl-cat.is-on {
  background: var(--bc); border-color: var(--bc); color: var(--bc-on);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--bc) 35%, transparent);
}
.bl-cat.is-on b { background: rgba(255,255,255,.22); color: var(--bc-on); }

.bl-active {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--slate);
}
.bl-chip-x {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-full);
  background: var(--green-100); color: var(--green-text); font-weight: 700;
}
.bl-chip-x b { font-size: 1rem; line-height: 1; }
.bl-chip-x:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger-text); }
.bl-clear { color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- کارت‌ها ---------- */
.bl-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.bl-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .bl-grid.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .bl-grid.is-3 { grid-template-columns: 1fr; } }

.bl-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base), border-color var(--dur-base);
}
.bl-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--bc) 45%, var(--line));
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--bc) 45%, transparent), var(--sh-md);
}
.bl-card-media {
  position: relative; display: block; aspect-ratio: 1200 / 630; overflow: hidden;
  background: var(--bg-subtle);
}
.bl-card-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .7s var(--ease-out);
}
.bl-card:hover .bl-card-media img { transform: scale(1.06); }
.bl-card-ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(260px 160px at 80% 10%, color-mix(in srgb, var(--bc) 32%, transparent), transparent 70%),
    linear-gradient(140deg, color-mix(in srgb, var(--bc) 16%, var(--surface)), var(--bg-subtle));
}
.bl-card-ph span { font-size: 3rem; opacity: .6; transition: transform var(--dur-slow) var(--ease-spring); }
.bl-card:hover .bl-card-ph span { transform: scale(1.12) rotate(-6deg); }
.bl-star {
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; font-size: .85rem; color: #fff;
  background: linear-gradient(120deg, #f59e0b, #f97316);
  box-shadow: 0 6px 16px rgba(249,115,22,.4);
}
.bl-card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; }
.bl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bl-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-full);
  font-size: .72rem; font-weight: 800;
  color: var(--bc); background: color-mix(in srgb, var(--bc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc) 22%, transparent);
  transition: background var(--dur-fast);
}
.bl-badge i { font-style: normal; }
a.bl-badge:hover { background: color-mix(in srgb, var(--bc) 20%, transparent); }
.bl-badge.is-lg { font-size: .8rem; padding: 6px 14px; }
.bl-read { font-size: .72rem; color: var(--slate); white-space: nowrap; }
.bl-card-title { margin: 0; font-size: 1.04rem; font-weight: 800; line-height: 1.7; }
.bl-card-title a {
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1.5px;
  transition: background-size var(--dur-slow) var(--ease-out), color var(--dur-fast);
}
.bl-card-title a:hover { color: var(--green-text); background-size: 100% 1.5px; }
.bl-card-ex {
  margin: 0; font-size: .85rem; line-height: 2; color: var(--slate);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bl-card-foot {
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; gap: 7px;
  font-size: .74rem; color: var(--slate); min-width: 0;
}
.bl-ava {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; font-weight: 800; font-size: .74rem; color: #fff;
  background: linear-gradient(135deg, var(--bc), color-mix(in srgb, var(--bc) 55%, #0b1220));
}
.bl-ava.is-lg { width: 42px; height: 42px; font-size: 1rem; }
.bl-by { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.bl-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.bl-views { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; }
.bl-views svg { width: 15px; height: 15px; }

/* کارت نخست — افقی و پهن */
@media (min-width: 900px) {
  .bl-card.is-lead { grid-column: 1 / -1; flex-direction: row; }
  /*
    ⚠️ ارتفاع ثابت، نه «به اندازهٔ تصویر».

    تصویر شاخص عمودی یا مربعی کارت را تا ۶۰۰ پیکسل بلند می‌کرد؛
    حالا قاب ثابت است و تصویر با `object-fit: cover` در آن می‌نشیند.
  */
  .bl-card.is-lead { height: clamp(300px, 26vw, 380px); }
  .bl-card.is-lead .bl-card-media { flex: 0 0 55%; aspect-ratio: auto; height: 100%; }
  .bl-card.is-lead .bl-card-body { padding: 30px 32px; justify-content: center; gap: 14px; }
  .bl-card.is-lead .bl-card-title { font-size: 1.55rem; line-height: 1.6; }
  .bl-card.is-lead .bl-card-title a { -webkit-line-clamp: 3; }
  .bl-card.is-lead .bl-card-ex { font-size: .92rem; -webkit-line-clamp: 4; }
  .bl-card.is-lead .bl-card-foot { margin-top: 8px; }
}

.bl-pager { display: flex; justify-content: center; }

.bl-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 56px 20px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 24px; background: var(--bg-subtle);
}
.bl-empty-ic {
  width: 76px; height: 76px; display: grid; place-items: center; font-size: 2.1rem;
  border-radius: 24px; background: var(--surface); box-shadow: var(--sh-md);
}
.bl-empty h2 { margin: 6px 0 0; font-size: 1.1rem; }
.bl-empty p { margin: 0 0 6px; color: var(--slate); font-size: .88rem; }

/* ==========================================================================
   صفحهٔ مطلب — جلد، ستون خواندن، ستون اشتراک و ستون کناری
   ========================================================================== */
.bp-progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: calc(var(--z-header) + 1);
  pointer-events: none;
}
.bp-progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--bc), color-mix(in srgb, var(--bc) 50%, #fff));
  transform: scaleX(0); transform-origin: right;
  box-shadow: 0 0 12px color-mix(in srgb, var(--bc) 60%, transparent);
}
[dir="ltr"] .bp-progress span { transform-origin: left; }

/* ---------- جلد ---------- */
.bp-cover {
  position: relative; isolation: isolate;
  margin-top: clamp(14px, 2.4vw, 28px);
  border-radius: 30px; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: clamp(260px, 30vw, 360px);
  background:
    radial-gradient(700px 320px at 90% -10%, color-mix(in srgb, var(--bc) 24%, transparent), transparent 70%),
    radial-gradient(600px 280px at 0% 120%, color-mix(in srgb, var(--bc) 14%, transparent), transparent 70%),
    var(--bg-subtle);
  border: 1px solid var(--line);
}
.bp-cover.has-img {
  min-height: clamp(380px, 44vw, 580px);
  border: 0; background: #0b1220;
  box-shadow: 0 40px 80px -40px rgba(4,10,20,.55);
}
.bp-cover-bg, .bp-cover-shade { position: absolute; inset: 0; z-index: -1; }
.bp-cover-bg img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: bp-zoom 1.6s var(--ease-out) both;
}
@keyframes bp-zoom { from { transform: scale(1.06); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.bp-cover-shade {
  background:
    linear-gradient(to top, rgba(4,10,20,.92) 0%, rgba(4,10,20,.62) 38%, rgba(4,10,20,.08) 72%),
    linear-gradient(to left, rgba(4,10,20,.35), transparent 55%);
}
.bp-cover-in {
  width: 100%; max-width: 860px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: clamp(22px, 4.4vw, 52px);
}
.bp-cover .bl-crumb { margin: 0; }
.bp-title {
  margin: 0; font-size: clamp(1.6rem, 3.9vw, 2.75rem);
  font-weight: 900; line-height: 1.45; letter-spacing: -.012em; color: var(--ink);
  text-wrap: balance;
}
.bp-lead { margin: 0; max-width: 680px; font-size: clamp(.95rem, 1.5vw, 1.1rem); line-height: 2.1; color: var(--slate); }
.bp-meta {
  width: 100%; margin-top: 6px; padding-top: 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
.bp-author { display: inline-flex; align-items: center; gap: 11px; }
.bp-author > span:last-child { display: flex; flex-direction: column; line-height: 1.6; }
.bp-author b { color: var(--ink); font-size: .92rem; }
.bp-author small { font-size: .74rem; color: var(--slate); }
.bp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--r-full);
  font-size: .76rem; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bp-chip svg { width: 16px; height: 16px; color: var(--bc); }
.bp-chip.is-link { transition: border-color var(--dur-fast), transform var(--dur-fast); }
.bp-chip.is-link:hover { border-color: var(--bc); transform: translateY(-1px); }

/* جلد تصویری: متن روشن، شیشه روی تصویر */
.bp-cover.has-img .bp-title { color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.35); }
.bp-cover.has-img .bp-lead { color: rgba(255,255,255,.86); }
.bp-cover.has-img .bl-crumb, .bp-cover.has-img .bl-crumb a { color: rgba(255,255,255,.72); }
.bp-cover.has-img .bl-crumb a:hover { color: #fff; }
.bp-cover.has-img .bp-meta { border-top-color: rgba(255,255,255,.16); }
.bp-cover.has-img .bp-author b { color: #fff; }
.bp-cover.has-img .bp-author small { color: rgba(255,255,255,.7); }
.bp-cover.has-img .bp-chip { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.bp-cover.has-img .bp-chip svg { color: #fff; }
.bp-cover.has-img .bl-badge {
  color: #fff; background: color-mix(in srgb, var(--bc) 70%, transparent);
  border-color: rgba(255,255,255,.25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
@media (max-width: 720px) {
  .bp-cover { border-radius: 22px; }
  .bp-cover.has-img { min-height: min(118vw, 78vh); }
  .bp-meta { justify-content: flex-start; }
}

/* ---------- چیدمان سه‌ستونه ---------- */
.bp-layout {
  --bp-read: 760px;
  display: grid; gap: 0 44px; justify-content: center;
  grid-template-columns: minmax(0, var(--bp-read));
  padding-block: clamp(28px, 4vw, 48px) 56px;
}
@media (min-width: 1100px) {
  .bp-layout { grid-template-columns: 52px minmax(0, var(--bp-read)); }
  .bp-layout.has-side { grid-template-columns: 52px minmax(0, var(--bp-read)) 290px; }
}
.bp-rail { display: none; }
@media (min-width: 1100px) {
  .bp-rail { display: block; }
  .bp-rail-in { position: sticky; top: 110px; }
}
.bp-main { min-width: 0; display: flex; flex-direction: column; gap: 28px; }

/* ---------- تایپوگرافی ستون خواندن ---------- */
.bp-prose { font-size: 1.08rem; }
.bp-prose .dsc { gap: 1.35em; }
.bp-prose .dsc-p, .bp-legacy p {
  margin: 0; font-size: 1.08rem; line-height: 2.3; color: var(--ink);
  opacity: .9; text-wrap: pretty;
}
.bp-legacy p + p { margin-top: 1.35em; }
.bp-legacy > p:first-child { font-size: 1.16rem; opacity: 1; }
.bp-prose .dsc-p.dsc-s-sm { font-size: .95rem; }
.bp-prose .dsc-p.dsc-s-lg { font-size: 1.2rem; }
.bp-prose .dsc-p.dsc-s-xl { font-size: 1.4rem; line-height: 2; }
.bp-prose .dsc-h {
  scroll-margin-top: 110px; margin: .7em 0 -.2em; color: var(--ink);
  font-weight: 900; line-height: 1.6; letter-spacing: -.005em;
  display: flex; align-items: center; gap: 12px;
}
.bp-prose .dsc-h::before {
  content: ""; flex: none; width: 6px; height: 1.05em; border-radius: 6px;
  background: linear-gradient(to bottom, var(--bc), color-mix(in srgb, var(--bc) 35%, transparent));
}
.bp-prose .dsc-h.dsc-s-sm { font-size: 1.1rem; }
.bp-prose .dsc-h.dsc-s-md { font-size: 1.3rem; }
.bp-prose .dsc-h.dsc-s-lg { font-size: 1.55rem; }
.bp-prose .dsc-h.dsc-s-xl { font-size: 1.85rem; }
.bp-prose .dsc-h.dsc-a-center { justify-content: center; }
.bp-prose .dsc-h.dsc-a-center::before, .bp-prose .dsc-h.dsc-a-end::before { display: none; }
.bp-prose .dsc-ul { gap: 10px; padding: 18px 22px; border-radius: 20px; background: var(--bg-subtle); border: 1px solid var(--line); }
.bp-prose .dsc-ul li { font-size: 1.02rem; line-height: 2.1; color: var(--ink); padding-inline-start: 30px; }
.bp-prose .dsc-ul li::before {
  content: "✓"; top: .45em; width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 50%; font-size: .68rem; color: var(--bc-on, #fff); background: var(--bc);
}
.bp-prose .dsc-quote {
  position: relative; margin: .4em 0; padding: 26px 30px 26px 26px; padding-inline: 58px 28px;
  border-radius: 24px; border: 0;
  background:
    radial-gradient(400px 200px at 100% 0%, color-mix(in srgb, var(--bc) 14%, transparent), transparent 70%),
    var(--bg-subtle);
  font-size: 1.18rem; line-height: 2.05; font-weight: 700; color: var(--ink);
}
.bp-prose .dsc-quote::before {
  content: "”"; position: absolute; top: 6px; inset-inline-start: 16px;
  font-size: 4.2rem; line-height: 1; font-weight: 900; color: var(--bc); opacity: .55;
  font-family: Georgia, serif;
}
.bp-prose .dsc-fig { margin: .5em 0; }
.bp-prose .dsc-fig img, .bp-prose .dsc-split-img img, .bp-prose .dsc-stack-img img {
  border-radius: 22px; box-shadow: 0 24px 50px -30px rgba(4,10,20,.45);
}
@media (min-width: 1100px) {
  /* تصویر تمام‌عرض کمی از ستون بیرون می‌زند — حس مجله */
  .bp-prose .dsc-fig.dsc-w-full { margin-inline: -36px; }
}
.bp-prose .dsc-fig figcaption { margin-top: 12px; font-size: .8rem; }
.bp-prose .dsc-split, .bp-prose .dsc-stack {
  padding: 20px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface);
}
.bp-prose .dsc-split-txt h4, .bp-prose .dsc-stack-txt h4 { font-size: 1.15rem; font-weight: 900; }
.bp-prose .dsc-split-txt p, .bp-prose .dsc-stack-txt p { font-size: 1rem; line-height: 2.15; color: var(--ink); opacity: .88; }
.bp-prose .dsc-gap { border: 0; height: 1px; margin: .6em 0; background: linear-gradient(90deg, transparent, var(--line-strong, var(--line)), transparent); }
.bp-prose .dsc-file { border-radius: 20px; padding: 16px 18px; }

/*
  ⚠️ دسکتاپ: ستون پهن‌تر و متن درشت‌تر.

  روی صفحهٔ عریض ستون ۷۶۰ پیکسلی و متن ۱۷ پیکسلی کوچک و گم دیده
  می‌شد. عرض ستون با اندازهٔ متن بزرگ می‌شود تا تعداد نویسهٔ هر
  خط (حدود ۷۵–۸۵) ثابت بماند — خط کوتاه‌تر یا بلندتر خواندن را
  سخت می‌کند.
*/
@media (min-width: 1280px) {
  .bp-layout { --bp-read: 860px; gap: 0 52px; }
  .bp-prose .dsc-p, .bp-legacy p { font-size: 1.2rem; line-height: 2.25; }
  .bp-legacy > p:first-child { font-size: 1.28rem; }
  .bp-prose .dsc-p.dsc-s-sm { font-size: 1.05rem; }
  .bp-prose .dsc-p.dsc-s-lg { font-size: 1.32rem; }
  .bp-prose .dsc-p.dsc-s-xl { font-size: 1.55rem; }
  .bp-prose .dsc-h.dsc-s-sm { font-size: 1.22rem; }
  .bp-prose .dsc-h.dsc-s-md { font-size: 1.45rem; }
  .bp-prose .dsc-h.dsc-s-lg { font-size: 1.75rem; }
  .bp-prose .dsc-h.dsc-s-xl { font-size: 2.05rem; }
  .bp-prose .dsc-ul li { font-size: 1.14rem; }
  .bp-prose .dsc-quote { font-size: 1.3rem; }
  .bp-prose .dsc-split-txt p, .bp-prose .dsc-stack-txt p { font-size: 1.1rem; }
  .bp-prose .dsc-file-txt b { font-size: 1.02rem; }
  .bp-lead { font-size: 1.18rem; max-width: 760px; }
}
@media (min-width: 1600px) {
  .bp-layout { --bp-read: 920px; }
  .bp-prose .dsc-p, .bp-legacy p { font-size: 1.26rem; }
  .bp-legacy > p:first-child { font-size: 1.34rem; }
}

.bp-end { display: flex; align-items: center; gap: 14px; color: var(--bc); }
.bp-end span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong, var(--line)), transparent); }
.bp-end i { font-style: normal; font-size: .9rem; opacity: .8; }

/* فهرست مطالب */
.bp-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 2px; }
.bp-toc li { counter-increment: toc; }
.bp-toc a {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px;
  font-size: .84rem; line-height: 1.8; color: var(--slate);
  border-inline-start: 2px solid transparent;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.bp-toc a::before { content: counter(toc, persian); flex: none; font-weight: 800; color: var(--bc); opacity: .75; }
.bp-toc a:hover { background: var(--bg-subtle); color: var(--ink); }
.bp-toc a.is-on { color: var(--ink); font-weight: 700; background: color-mix(in srgb, var(--bc) 9%, transparent); border-color: var(--bc); }
.bp-toc.is-inline { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 4px 14px; box-shadow: var(--sh-sm); }
.bp-toc.is-inline summary {
  cursor: pointer; list-style: none; padding: 12px 2px;
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem;
}
.bp-toc.is-inline summary::-webkit-details-marker { display: none; }
.bp-toc.is-inline summary b {
  margin-inline-start: auto; padding: 1px 9px; border-radius: var(--r-full);
  font-size: .72rem; background: var(--bg-subtle); color: var(--slate);
}
.bp-toc.is-inline ol { padding-bottom: 10px; }
@media (min-width: 1100px) { .bp-toc.is-inline { display: none; } }

.bp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bp-tags a {
  padding: 6px 14px; border-radius: var(--r-full);
  background: var(--bg-subtle); border: 1px solid var(--line); color: var(--ink);
  font-size: .8rem; font-weight: 700;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.bp-tags a:hover { border-color: var(--bc); color: var(--bc); background: color-mix(in srgb, var(--bc) 7%, transparent); }

/* ---------- اشتراک ---------- */
.bp-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bp-share-row.is-v { flex-direction: column; }
.bp-sh {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700;
  transition: transform var(--dur-fast), background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.bp-share-row.is-v .bp-sh { width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.bp-sh svg { width: 19px; height: 19px; }
.bp-sh:hover { transform: translateY(-2px); color: #fff; border-color: transparent; box-shadow: 0 10px 22px -10px rgba(0,0,0,.4); }
.bp-sh.is-tg:hover { background: #229ed9; }
.bp-sh.is-wa:hover { background: #1faa55; }
.bp-sh.is-x:hover { background: #111; }
.bp-sh.is-in:hover { background: #0a66c2; }
.bp-sh.is-copy:hover, .bp-sh.is-done { background: var(--green-btn); color: var(--on-green); }

.bp-authorbox {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px;
  padding: 22px; border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 200px at 100% 0%, color-mix(in srgb, var(--bc) 12%, transparent), transparent 70%),
    var(--surface);
}
.bl-ava.is-xl { width: 58px; height: 58px; font-size: 1.35rem; box-shadow: 0 10px 24px -10px var(--bc); }
.bp-authorbox-txt { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.bp-authorbox-txt small { font-size: .74rem; color: var(--slate); }
.bp-authorbox-txt b { font-size: 1.02rem; }
.bp-authorbox-txt span { font-size: .8rem; color: var(--slate); line-height: 1.9; }
@media (max-width: 600px) { .bp-authorbox-share { flex-basis: 100%; } }

.bp-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bp-pn-a {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.bp-pn-a.is-newer { text-align: end; grid-column: 2; }
.bp-pn-a small { font-size: .74rem; color: var(--bc); font-weight: 800; }
.bp-pn-a b { font-size: .92rem; line-height: 1.8; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bp-pn-a:hover { border-color: var(--bc); transform: translateY(-2px); box-shadow: var(--sh-md); }
@media (max-width: 600px) {
  .bp-pn { grid-template-columns: 1fr; }
  .bp-pn-a.is-newer { grid-column: auto; }
}

/* ---------- ستون کناری ---------- */
.bp-side { display: none; }
@media (min-width: 1100px) {
  .bp-side {
    display: flex; flex-direction: column; gap: 16px;
    position: sticky; top: 100px; align-self: start;
    max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin;
  }
}
/* فایل‌ها در موبایل هم لازم‌اند — زیر متن */
@media (max-width: 1099px) {
  .bp-layout.has-side .bp-side { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
  .bp-side .bp-toc.is-side { display: none; }
}
.bp-box { padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.bp-box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .92rem; font-weight: 900; }
.bp-box h2 span {
  margin-inline-start: auto; padding: 1px 9px; border-radius: var(--r-full);
  background: var(--bg-subtle); font-size: .72rem; color: var(--slate);
}
.bp-files { display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 110px; }
.bp-file {
  display: flex; align-items: center; gap: 10px;
  padding: 9px; border-radius: 14px; border: 1px solid transparent;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.bp-file .dsc-file-ic { width: 38px; height: 44px; font-size: .56rem; padding-bottom: 6px; }
.bp-file-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bp-file-txt b { font-size: .84rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-file-txt small { font-size: .72rem; color: var(--slate); }
.bp-file > svg { flex: none; width: 20px; height: 20px; color: var(--green-text); }
.bp-file:hover { background: var(--bg-subtle); border-color: var(--line); }

/* ---------- مرتبط‌ها ---------- */
.bp-related { padding: 48px 0 64px; background: var(--bg-subtle); border-top: 1px solid var(--line); }
.bp-related-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.bp-related-head small { display: block; font-size: .76rem; font-weight: 800; color: var(--bc); margin-bottom: 2px; }
.bp-related-head h2 { margin: 0; font-size: 1.45rem; font-weight: 900; }
.bp-related-head a { font-size: .84rem; font-weight: 800; color: var(--green-text); }

@media (prefers-reduced-motion: reduce) {
  .bl-slide img, .bl-card-media img, .bl-card, .bl-card-ph span { transition: none !important; transform: none !important; }
  .bp-cover-bg img { animation: none; }
}

/* ==========================================================================
   ویرایشگر مطلب (مدیریت)
   ========================================================================== */
.bf-page { display: flex; flex-direction: column; gap: 18px; }
.bf-page section.bf-card, .bf-page .bf-card { padding: 18px; }

.bf-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: 22px;
  background:
    radial-gradient(500px 160px at 90% -30%, color-mix(in srgb, var(--green) 20%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--line); box-shadow: var(--sh-sm);
  position: sticky; top: 8px; z-index: 20;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bf-head-ic {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center;
  font-size: 1.4rem; border-radius: 16px;
  background: linear-gradient(135deg, var(--green), #34d399);
  box-shadow: 0 10px 24px -10px var(--green);
}
.bf-head-id { flex: 1; min-width: 200px; }
.bf-head-id h1 { margin: 0; font-size: 1.15rem; font-weight: 900; }
.bf-head-id p { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .76rem; }
.bf-head-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-chip {
  padding: 3px 10px; border-radius: var(--r-full); font-weight: 800; font-size: .7rem;
  background: var(--bg-subtle); color: var(--slate);
}
.bf-chip.is-ok { background: var(--success-bg); color: var(--success-text); }
.bf-chip.is-warn { background: var(--warn-bg); color: var(--warn-text); }
.bf-dim { color: var(--slate); font-size: .76rem; }

.bf-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .bf-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .bf-side { position: sticky; top: 104px; }
}
.bf-main, .bf-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.bf-card {
  border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; gap: 14px;
}
.bf-card-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.bf-card-h h2 { margin: 0; font-size: .95rem; font-weight: 800; }
.bf-card-h small { font-size: .74rem; color: var(--slate); flex-basis: 100%; }
.bf-link { margin-inline-start: auto; font-size: .74rem; font-weight: 700; color: var(--green-text); }

.bf-title input {
  width: 100%; border: 0; outline: 0; background: none;
  font: inherit; font-size: clamp(1.25rem, 2.4vw, 1.7rem); font-weight: 900; line-height: 1.6;
  color: var(--ink); padding: 4px 2px;
  border-bottom: 2px solid var(--line); transition: border-color var(--dur-fast);
}
.bf-title input:focus { border-color: var(--green); }
.bf-title.has-err input { border-color: var(--danger); }
.bf-slug {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--bg-subtle); font-size: .8rem;
}
.bf-slug span { padding: 8px 10px; color: var(--slate); border-inline-end: 1px solid var(--line); font-family: ui-monospace, monospace; }
.bf-slug input { flex: 1; min-width: 0; border: 0; outline: 0; background: var(--surface); padding: 8px 10px; font: inherit; color: var(--ink); }

.bf-f { display: flex; flex-direction: column; gap: 6px; }
.bf-f > span { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; font-weight: 700; }
.bf-f > span i { font-style: normal; font-weight: 500; font-size: .72rem; color: var(--slate); }
.bf-f > small { font-size: .72rem; color: var(--slate); }
.bf-f textarea, .bf-f input[type="text"], .bf-legacy textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 10px 12px; font: inherit; font-size: .88rem; line-height: 1.9; color: var(--ink); outline: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.bf-f textarea:focus, .bf-f input[type="text"]:focus, .bf-legacy textarea:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}
.bf-err { margin: -6px 0 0; font-size: .76rem; font-weight: 700; color: var(--danger-text); }

.bf-limits {
  list-style: none; margin: 0; padding: 10px 12px; border-radius: 14px;
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  background: var(--bg-subtle); font-size: .74rem; color: var(--slate);
}
.bf-limits b { color: var(--ink); font-weight: 700; }
.bf-limits-link a { color: var(--green-text); font-weight: 700; }

.bf-legacy { border: 1px dashed var(--line); border-radius: 14px; padding: 4px 12px; }
.bf-legacy summary { cursor: pointer; padding: 8px 0; font-size: .8rem; font-weight: 700; color: var(--slate); }
.bf-legacy textarea { margin-bottom: 6px; }
.bf-legacy small { display: block; padding-bottom: 8px; font-size: .72rem; color: var(--slate); }

/* کلید روشن/خاموش */
.bf-sw { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .86rem; font-weight: 700; }
.bf-sw input { position: absolute; opacity: 0; pointer-events: none; }
.bf-sw-ui {
  flex: none; position: relative; width: 44px; height: 26px; border-radius: var(--r-full);
  background: var(--line-strong, var(--line)); transition: background var(--dur-base);
}
.bf-sw-ui::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: inset-inline-start var(--dur-base) var(--ease-spring);
}
.bf-sw input:checked + .bf-sw-ui { background: var(--green); }
.bf-sw input:checked + .bf-sw-ui::after { inset-inline-start: 21px; }
.bf-sw input:focus-visible + .bf-sw-ui { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 30%, transparent); }

.bf-save { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bf-save .btn { justify-content: center; }

.bf-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-cat { cursor: pointer; }
.bf-cat input { position: absolute; opacity: 0; pointer-events: none; }
.bf-cat span {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--surface);
  font-size: .78rem; font-weight: 700; color: var(--ink);
  transition: all var(--dur-fast);
}
.bf-cat:hover span { border-color: var(--bc); }
.bf-cat input:checked + span {
  background: var(--bc); border-color: var(--bc); color: var(--bc-on);
  box-shadow: 0 6px 16px -6px var(--bc);
}
.bf-cat input:focus-visible + span { outline: 2px solid var(--bc); outline-offset: 2px; }

.bf-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.bf-tags:empty { display: none; }
.bf-tags span {
  padding: 3px 10px; border-radius: var(--r-full); font-size: .72rem; font-weight: 700;
  background: var(--green-100); color: var(--green-text);
}

.bf-img { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.bf-img:last-of-type { border-bottom: 0; padding-bottom: 0; }
.bf-img-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .84rem; }
.bf-img-h span {
  padding: 2px 9px; border-radius: 8px; font-size: .72rem; font-weight: 800;
  background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green-text);
  font-family: ui-monospace, monospace;
}
.bf-img > small { font-size: .72rem; color: var(--slate); }


/* ==========================================================================
   ظاهر وبلاگ (مدیریت) — پیش‌نمایش زنده و کنترل‌ها
   ========================================================================== */
.bs-preview-card { gap: 12px; }
.bs-dev { margin-inline-start: auto; display: inline-flex; padding: 3px; border-radius: var(--r-full); background: var(--bg-subtle); border: 1px solid var(--line); }
.bs-dev button {
  border: 0; background: none; cursor: pointer; font: inherit; font-size: .74rem; font-weight: 800;
  padding: 6px 12px; border-radius: var(--r-full); color: var(--slate);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.bs-dev button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.bs-frame {
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line);
  background: var(--bg); margin-inline: auto; width: 100%;
  transition: max-width var(--dur-slow) var(--ease-out);
  max-width: 100%;
}
.bs-frame.is-mob { max-width: 390px; }
.bs-frame.is-mob .bl-hero-in { grid-template-columns: minmax(0, 1fr); }
.bs-frame.is-mob .bl-hero h1 { font-size: 1.5rem; }
.bs-frame.is-mob .bl-search { flex-wrap: wrap; border-radius: 18px; }
.bs-frame.is-mob .bl-search input { flex-basis: calc(100% - 40px); }
.bs-frame.is-mob .bl-search select, .bs-frame.is-mob .bl-search button { flex: 1; }
.bs-stage { pointer-events: none; }
.bs-stage .wrap { padding-inline: 22px; }

.bs-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .bs-modes { grid-template-columns: 1fr; } }
.bs-mode { cursor: pointer; }
.bs-mode input { position: absolute; opacity: 0; pointer-events: none; }
.bs-mode-ui {
  display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px;
  border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.bs-mode-ui b { font-size: .8rem; text-align: center; }
.bs-mode:hover .bs-mode-ui { transform: translateY(-2px); }
.bs-mode input:checked + .bs-mode-ui {
  border-color: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
}
.bs-mode input:focus-visible + .bs-mode-ui { outline: 2px solid var(--green); outline-offset: 2px; }
.bs-mode-th { display: block; height: 62px; border-radius: 12px; }
.bs-mode-th.is-gradient {
  background:
    radial-gradient(120px 60px at 85% 0%, color-mix(in srgb, var(--green) 35%, transparent), transparent 70%),
    radial-gradient(100px 50px at 0% 100%, rgba(124,58,237,.18), transparent 70%), var(--bg-subtle);
}
.bs-mode-th.is-color { background: linear-gradient(120deg, #0f5132, #00a859); }
.bs-mode-th.is-image {
  background:
    linear-gradient(to top, rgba(4,10,20,.6), transparent),
    radial-gradient(60px 40px at 70% 40%, #fbbf24, transparent 70%),
    linear-gradient(160deg, #0e7490, #0b1220);
}

.bs-when[hidden] { display: none !important; }
.bs-when { display: flex; flex-direction: column; gap: 14px; animation: bs-in var(--dur-base) var(--ease-out); }
@keyframes bs-in { from { opacity: 0; transform: translateY(6px); } }
.bs-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--bg-subtle); font-size: .8rem; color: var(--slate); line-height: 1.9; }

.bs-colors { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bs-color { display: flex; flex-direction: column; gap: 8px; }
.bs-color > span { font-size: .8rem; font-weight: 800; }
.bs-color-row { display: flex; align-items: center; gap: 10px; }
.bs-swatch-big {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 14px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), var(--sh-sm);
}
.bs-swatch-big input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; }
.bs-hex {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 .88rem ui-monospace, monospace; letter-spacing: .04em; outline: 0; text-align: left;
}
.bs-hex:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent); }
.bs-hex.is-bad { border-color: var(--danger); }
.bs-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-swatches button {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.bs-swatches button:hover { transform: scale(1.12); }
.bs-swatches button.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--green); }

.bs-imgs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.bs-imgs .bf-img { border-bottom: 0; padding-bottom: 0; }
.bs-range { display: flex; flex-direction: column; gap: 6px; }
.bs-range > span { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 800; }
.bs-range b { color: var(--green-text); }
.bs-range input { width: 100%; accent-color: var(--green); }
.bs-range small { font-size: .72rem; color: var(--slate); }

.bs-seg { display: flex; padding: 3px; border-radius: 14px; background: var(--bg-subtle); border: 1px solid var(--line); }
.bs-seg label { flex: 1; cursor: pointer; }
.bs-seg input { position: absolute; opacity: 0; pointer-events: none; }
.bs-seg span {
  display: block; text-align: center; padding: 8px 6px; border-radius: 11px;
  font-size: .76rem; font-weight: 800; color: var(--slate);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.bs-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.bs-seg input:focus-visible + span { outline: 2px solid var(--green); }
.bl-search[hidden] { display: none; }
.bs-stage .bl-search :disabled { opacity: 1; cursor: default; }
