/* ===== فهرست بلاگ (طرح «Blog») =====
   روی home.css سوار است (رنگ‌ها، هدر، فوتر)؛ فقط بخش‌های خاص بلاگ اینجاست.
   قالب: scripts/blog/index.tpl.html — کارت‌ها را scripts/blog/build.py می‌سازد. */

.blob1 { top: -260px; right: -160px; height: 620px; width: 620px; background: radial-gradient(closest-side, rgba(48,111,87,.13), rgba(48,111,87,0)); }
.blob2 { top: 0; left: -220px; height: 560px; width: 560px; background: radial-gradient(closest-side, rgba(0,167,157,.09), rgba(0,167,157,0)); }
.hdr-nav a.on { background: var(--mint2); color: var(--gd); }

/* ---------- هیرو ---------- */
.bhero { position: relative; margin: 0 auto; max-width: 1200px; padding: 64px 24px 44px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.bhero h1 { margin: 16px 0 0; font-size: clamp(30px, 4.6vw, 54px); font-weight: 900; line-height: 1.3; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.bhero > p { margin: 16px 0 0; max-width: 40rem; font-size: clamp(15.5px, 1.5vw, 17.5px); line-height: 1.95; color: var(--muted); text-wrap: balance; }
.bhero .r3 { animation-delay: .18s; }
.bhero .r4 { animation-delay: .24s; }
.bsearch { margin: 30px 0 0; width: 100%; max-width: 560px; display: flex; align-items: center; gap: 10px; border-radius: 16px; border: 1px solid var(--line); background: #ffffff; padding: 6px 16px; box-shadow: 0 1px 2px rgba(16,40,32,.04), 0 18px 40px -28px rgba(16,48,36,.35); transition: box-shadow .2s, border-color .2s; }
.bsearch:focus-within { border-color: #cfe0d6; box-shadow: 0 0 0 3px rgba(48,111,87,.12), 0 18px 40px -28px rgba(16,48,36,.35); }
.bsearch input { flex: 1; min-width: 0; height: 44px; border: none; outline: none; background: transparent; font-family: inherit; font-size: 15.5px; color: var(--ink); }
.bsearch input:focus-visible { outline: none; }
.bsearch input::placeholder { color: var(--faint2); }
.bsearch input::-webkit-search-cancel-button { display: none; }
.bsearch-x { display: grid; height: 30px; width: 30px; flex-shrink: 0; place-items: center; border: none; border-radius: 999px; background: #f0f5f2; cursor: pointer; color: var(--muted); padding: 0; }
.bsearch-x:hover { background: var(--mint3); }
.bchips { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bchips:empty { display: none; }
.bchip { display: inline-flex; flex-shrink: 0; align-items: center; gap: 8px; border-radius: 999px; cursor: pointer; padding: 8px 15px; font-size: 13.5px; font-weight: 700; transition: all .2s; border: 1px solid var(--line); background: #ffffff; color: var(--sub); }
.bchip:hover { border-color: #cfe0d6; }
.bchip-n { border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 700; background: #f0f5f2; color: var(--soft); }
.bchip[aria-pressed="true"] { border-color: var(--g); background: var(--g); color: #ffffff; }
.bchip[aria-pressed="true"] .bchip-n { background: rgba(255,255,255,.2); color: #ffffff; }

/* ---------- مقالات ---------- */
.bposts { position: relative; margin: 0 auto; max-width: 1200px; padding: 0 24px 96px; }
.b-meta { font-size: 12.5px; color: var(--faint); }

/* کاور: عکسِ مقاله یا زمینه‌ی رنگی با آیکن سند */
.bc-img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; }
.bc-ph { position: absolute; inset: 0; display: grid; place-items: center; }
.bc-mark { position: absolute; bottom: -18%; left: -6%; height: 78%; opacity: .07; }
.bc-ic { position: relative; display: grid; place-items: center; height: 72px; width: 72px; border-radius: 22px; background: rgba(255,255,255,.7); box-shadow: 0 18px 40px -22px rgba(16,48,36,.45); }

/* مقاله‌ی منتخب */
.bfeat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; border-radius: 26px; border: 1px solid #e3eae5; background: #ffffff; box-shadow: 0 1px 2px rgba(16,40,32,.04), 0 30px 60px -40px rgba(16,48,36,.35); transition: all .25s; }
.bfeat:hover { border-color: #cfe0d6; box-shadow: 0 1px 2px rgba(16,40,32,.04), 0 36px 70px -40px rgba(16,48,36,.45); }
.bf-text { display: flex; flex-direction: column; justify-content: center; padding: 40px; text-align: right; }
.bf-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bf-flag { border-radius: 999px; background: var(--g); padding: 4px 11px; font-size: 11.5px; font-weight: 800; color: #ffffff; }
.bf-cat { font-size: 12.5px; font-weight: 700; color: var(--g); }
.bfeat h2 { margin: 16px 0 0; font-size: clamp(22px, 2.6vw, 32px); font-weight: 900; line-height: 1.5; color: var(--ink); text-wrap: balance; }
.bfeat p { margin: 12px 0 0; font-size: 15.5px; line-height: 2; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bf-foot { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bf-foot .b-meta { font-size: 13px; }
.bf-more { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--gd); }
.bf-cover { position: relative; min-height: 340px; overflow: hidden; }
.bf-cover .bc-ic { height: 104px; width: 104px; border-radius: 30px; }

.blist-head { margin: 44px 0 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.blist-head.first { margin-top: 0; }
.blist-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--ink); }
.blist-head span { font-size: 13px; font-weight: 600; color: var(--faint); }

/* کارت‌ها */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.bcard { display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; border: 1px solid #e6ece8; background: #ffffff; box-shadow: 0 1px 2px rgba(16,40,32,.03); transition: all .25s; }
.bcard:hover { transform: translateY(-3px); border-color: #d7e6dc; box-shadow: 0 24px 50px -30px rgba(16,48,36,.35); }
.bc-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.bc-cat { position: absolute; top: 14px; right: 14px; z-index: 1; border-radius: 999px; background: rgba(255,255,255,.92); padding: 4px 11px; font-size: 11.5px; font-weight: 800; color: var(--gd); box-shadow: 0 4px 12px -6px rgba(16,40,32,.3); }
.bc-body { display: flex; flex: 1; flex-direction: column; padding: 20px 20px 18px; text-align: right; }
.bc-cat-m { display: none; font-size: 12px; font-weight: 800; color: var(--g); }
.bcard h3 { margin: 0; font-size: 17.5px; font-weight: 800; line-height: 1.7; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard p { margin: 8px 0 0; font-size: 14px; line-height: 1.95; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc-foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #f0f3f1; }
.bc-arrow { display: grid; height: 32px; width: 32px; place-items: center; border-radius: 10px; background: var(--mint2); color: var(--gd); }
/* بدون جاوااسکریپت هم تکرارِ مقاله‌ی منتخب در فهرست دیده نشود */
.bgrid .bcard[data-first] { display: none; }
.bgrid.filtered .bcard[data-first] { display: flex; }
.bgrid.filtered .bcard[data-first][hidden] { display: none; }

.bmore { margin-top: 32px; display: flex; justify-content: center; }
.bmore button { border: 1px solid #cfe0d6; background: #ffffff; cursor: pointer; border-radius: 12px; padding: 12px 24px; font-size: 14.5px; font-weight: 700; color: var(--gd); }
.bmore button:hover { background: #f2f6f3; }

.bempty { margin: 8px auto 0; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 10px; border-radius: 22px; border: 1px dashed #d7e3db; background: #fbfdfc; padding: 40px 24px; text-align: center; }
.bempty > span:first-child { display: grid; height: 48px; width: 48px; place-items: center; border-radius: 14px; background: var(--mint2); color: var(--g); }
.bempty b { font-size: 16px; color: var(--ink); }
.bempty > span:last-child { font-size: 14px; color: var(--soft); }

/* پرسش از دستیار */
.bask { position: relative; overflow: hidden; margin-top: 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-radius: 24px; border: 1px solid #d9e8df; background: linear-gradient(120deg, #eef6f1, #e3f1ec); padding: 28px 32px; }
.bask-mark { pointer-events: none; position: absolute; left: -20px; bottom: -40px; height: 170px; opacity: .06; }
.bask-id { position: relative; display: flex; align-items: center; gap: 16px; }
.bask-ic { display: grid; height: 52px; width: 52px; flex-shrink: 0; place-items: center; border-radius: 16px; background: var(--grad); box-shadow: 0 12px 24px -12px rgba(39,88,63,.7); }
.bask-ic img { height: 26px; display: block; }
.bask-t { font-size: 18px; font-weight: 800; color: var(--ink); }
.bask-s { margin-top: 4px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.bask-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; background: var(--grad); padding: 12px 20px; font-size: 14.5px; font-weight: 700; color: #ffffff; box-shadow: 0 12px 24px -12px rgba(39,88,63,.7); }
.bask-btn:hover { color: #ffffff; filter: brightness(1.06); }

/* ---------- موبایل ---------- */
@media (max-width: 720px) {
  .bhero { padding: 40px 20px 32px; }
  .bchips { flex-wrap: nowrap; justify-content: flex-start; width: 100%; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .bchips::-webkit-scrollbar { display: none; }
  .bposts { padding: 0 20px 72px; }
  .bfeat { grid-template-columns: minmax(0, 1fr); }
  .bf-cover { order: -1; min-height: 180px; }
  .bf-text { padding: 22px; }
  .blist-head { margin: 32px 0 14px; }
  .bask { padding: 22px; }
  /* کارت‌ها ردیفی می‌شوند: عکس کوچک کنار عنوان */
  .bgrid { display: flex; flex-direction: column; gap: 12px; }
  .bcard { flex-direction: row; gap: 14px; align-items: stretch; border-radius: 18px; padding: 10px; }
  .bcard:hover { transform: none; }
  .bc-cover { width: 104px; min-height: 100px; aspect-ratio: auto; flex-shrink: 0; border-radius: 12px; }
  .bc-cover .bc-cat, .bc-cover .bc-mark, .bcard p, .bc-arrow { display: none; }
  .bc-cover .bc-ic { height: 44px; width: 44px; border-radius: 14px; box-shadow: none; background: rgba(255,255,255,.75); }
  .bc-cover .bc-ic svg { width: 22px; height: 22px; }
  .bc-body { min-width: 0; padding: 4px 2px 2px 0; }
  .bc-cat-m { display: block; }
  .bcard h3 { margin-top: 5px; font-size: 15px; }
  .bc-foot { padding-top: 6px; border-top: 0; }
  .bc-foot .b-meta { font-size: 12px; }
}
