/* =======================================================================
   SOLBA CANDY — مجله (/blog)
   فقط صفحه‌های مجله این فایل را لود می‌کنند (layout-top با extraCss).
   رنگ‌ها و فونت‌ها از site.css می‌آیند؛ اینجا هیچ متغیر جدیدی ساخته نمی‌شود.
   ======================================================================= */

.blog-page { padding: 118px 0 60px; }

/* ---- سربرگ ---- */
.blog-head { text-align: center; margin-bottom: 30px; }

.blog-h1 {
  margin: 0 0 10px;
  font-size: 34px; font-weight: 900; line-height: 1.5;
  color: var(--indigo);
}

.blog-intro {
  max-width: 720px; margin: 0 auto;
  color: #6f6694; font-size: 15px; font-weight: 600; line-height: 2;
}

/* ---- شبکه کارت‌ها ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
}

.blog-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .22s ease;
}

.blog-card:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -22px rgba(120, 80, 160, .5); }

.blog-card-media {
  display: block; position: relative;
  aspect-ratio: 16 / 9; background: var(--lav);
  overflow: hidden;
}

.blog-card-media img { width: 100%; height: 100%; object-fit: cover; }

.blog-card-media-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 40px;
  background: linear-gradient(135deg, var(--blush), var(--lav-2));
}

.blog-card-body { display: flex; flex-direction: column; gap: 9px; padding: 16px 18px 18px; flex: 1; }

.blog-card-title { font-size: 17px; font-weight: 900; line-height: 1.75; color: var(--indigo); }
.blog-card-title a { color: inherit; }
.blog-card-title a:hover { color: var(--hotpink); }

.blog-card-excerpt { color: #6f6694; font-size: 13.5px; font-weight: 600; line-height: 1.95; }

.blog-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 12px;
  border-top: 1px dashed var(--lav-2);
}

.blog-date { color: #9c92bd; font-size: 12px; font-weight: 700; }

.blog-more {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--hotpink); font-size: 13px; font-weight: 900;
}

.blog-more svg { width: 15px; height: 15px; }

/* ---- حالت خالی ---- */
.blog-empty {
  text-align: center; padding: 56px 22px;
  background: var(--card); border: 1.5px dashed var(--lav-2); border-radius: 24px;
}

.blog-empty-emoji { font-size: 46px; margin-bottom: 10px; }
.blog-empty h2 { font-size: 20px; font-weight: 900; margin-bottom: 8px; color: var(--indigo); }
.blog-empty p { color: #6f6694; font-weight: 600; margin-bottom: 18px; }

/* ---- صفحه‌بندی ---- */
.blog-pager {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap; margin-top: 36px;
}

.blog-pager a, .blog-pager span {
  min-width: 42px; padding: 9px 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 14px; font-weight: 800;
  background: var(--card); color: var(--indigo);
  border: 1.5px solid var(--lav-2);
}

.blog-pager a:hover { border-color: var(--pink); color: var(--hotpink); }
.blog-pager .is-current { background: var(--hotpink); color: #fff; border-color: var(--hotpink); }
.blog-pager .is-dots { background: transparent; border: none; color: #9c92bd; }

/* =======================================================================
   صفحه مقاله
   ======================================================================= */
.post-page { padding: 118px 0 60px; }

.post-crumbs {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: 12.5px; font-weight: 700; color: #9c92bd;
}

.post-crumbs a { color: var(--purple); }
.post-crumbs a:hover { color: var(--hotpink); }

/* ---- چیدمان: متن مقاله + ستون محصول‌ها ----
   بدون محصول انتخاب‌شده، مقاله مثل قبل وسط صفحه می‌ماند. */
.post-layout.has-aside {
  display: grid;
  grid-template-columns: minmax(0, 860px) 290px;
  gap: 26px;
  justify-content: center;
  align-items: start;
}

/* ستون کناری: خودِ کارت‌های محصول، بدون قاب یا کادر دور آن‌ها.
   همراه خواننده می‌ماند و اگر از ارتفاع صفحه بلندتر شد، خودش اسکرول می‌خورد. */
.post-aside-inner { position: sticky; top: 104px; }

.post-aside-title {
  font-size: 15px; font-weight: 900; color: var(--indigo);
  text-align: center; margin-bottom: 10px;
}

/* کارت‌ها در یک ناحیه اسکرول‌شونده‌اند؛ لبه‌های بالا و پایین محو می‌شوند تا
   کارتی که نیمه‌دیده است بریده به‌نظر نرسد */
.post-aside-fade { position: relative; }

.post-aside-fade::before,
.post-aside-fade::after {
  content: ''; position: absolute; right: 0; left: 12px;
  height: 26px; z-index: 3; pointer-events: none;
}

.post-aside-fade::before { top: 0; background: linear-gradient(to bottom, var(--bg), transparent); }
.post-aside-fade::after { bottom: 0; background: linear-gradient(to top, var(--bg), transparent); }

/* فاصله بالا و پایین، تا بالا آمدن کارت هنگام هاور و سایه‌اش بریده نشود.
   scrollbar-width/-color عمداً تعریف نمی‌شود: در کرومیوم استایل اسکرول‌بار
   سراسری سایت (site.css) را از کار می‌اندازد و نوار خاکستری پیش‌فرض می‌دهد. */
.post-aside-scroll {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  /* بالا و پایین دست‌کم به اندازه ارتفاع محوکننده (۲۶ پیکسل) فاصله دارد،
     وگرنه کارت اول و آخر همان‌جا که هستند نیمه‌محو دیده می‌شوند و هنگام
     هاور که ۶ پیکسل بالا می‌آیند، بریده به‌نظر می‌رسند */
  padding: 30px 12px 30px;
}

.post-aside-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* کارت‌های این ستون بدون خط دور، و بج‌ها با فونت فارسی سایت.
   (prod-tag در site.css فونت Baloo2 می‌گیرد که حرف فارسی ندارد و متن بج
   به فونت پیش‌فرض ویندوز می‌افتد.) */
.post-aside .prod-card { border-color: transparent; }

.post-aside .prod-tag {
  font-family: 'Estedad', Tahoma, sans-serif;
  letter-spacing: 0;
}

.post-shell {
  max-width: 860px; margin: 0 auto;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* تصویر شاخص هر نسبتی داشته باشد، ارتفاعش کنترل‌شده می‌ماند و متن مقاله را پایین نمی‌راند */
.post-cover { background: var(--lav); }
.post-cover img { width: 100%; max-height: 420px; object-fit: cover; display: block; }

.post-inner { padding: 30px 34px 36px; }

.post-h1 {
  font-size: 30px; font-weight: 900; line-height: 1.65;
  color: var(--indigo); margin-bottom: 12px;
}

.post-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 22px;
  border-bottom: 1px dashed var(--lav-2);
  color: #9c92bd; font-size: 12.5px; font-weight: 700;
}

.post-lead {
  background: linear-gradient(135deg, rgba(236, 72, 153, .10), rgba(168, 85, 247, .08));
  border: 1px solid rgba(236, 72, 153, .18);
  border-radius: 18px;
  padding: 15px 18px; margin-bottom: 26px;
  color: #574d79; font-size: 14.5px; font-weight: 700; line-height: 2;
}

/* ---- متن مقاله (خروجی lib/markdown.js) ---- */
.post-body { color: var(--ink); font-size: 15.5px; font-weight: 500; line-height: 2.15; }

.post-body h2 {
  margin: 34px 0 12px;
  font-size: 22px; font-weight: 900; line-height: 1.7; color: var(--indigo);
  padding-right: 14px; border-right: 5px solid var(--pink); border-radius: 3px;
}

.post-body h3 { margin: 26px 0 10px; font-size: 18px; font-weight: 900; color: var(--purple); }
.post-body h4 { margin: 22px 0 8px; font-size: 16px; font-weight: 900; color: var(--purple); }

.post-body p { margin-bottom: 16px; }

.post-body a { color: var(--hotpink); font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.post-body a:hover { color: var(--hotpink-2); }

.post-body ul, .post-body ol { margin: 0 0 18px; padding-right: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body ul li::marker { color: var(--pink); }
.post-body ol li::marker { color: var(--purple); font-weight: 800; }

.post-body strong { font-weight: 900; color: var(--indigo); }

.post-body code {
  background: var(--lav); color: var(--purple);
  border-radius: 7px; padding: 2px 7px; font-size: 13.5px;
}

.post-body blockquote {
  margin: 22px 0; padding: 14px 18px;
  background: var(--lav); border-right: 5px solid var(--lilac);
  border-radius: 14px; color: #574d79; font-weight: 700;
}

.post-body blockquote p { margin: 0; }

.post-body hr { margin: 28px 0; border: none; border-top: 1px dashed var(--lav-2); }

.blog-figure { margin: 24px 0; }
.blog-figure img { width: 100%; height: auto; border-radius: 18px; border: 1.5px solid var(--line); }
.blog-figure figcaption { margin-top: 8px; text-align: center; color: #9c92bd; font-size: 12.5px; font-weight: 700; }

/* ---- پایان مقاله ---- */
.post-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 32px; padding-top: 20px;
  border-top: 1px dashed var(--lav-2);
}

.post-others { max-width: 860px; margin: 40px auto 0; }
.post-others h2 { font-size: 20px; font-weight: 900; color: var(--indigo); margin-bottom: 16px; text-align: center; }

/* =======================================================================
   موبایل
   ======================================================================= */
/* زیر ۱۲۴۰ پیکسل جا برای ستون کناری نیست: محصول‌ها زیر مقاله می‌آیند */
@media (max-width: 1239px) {
  .post-layout.has-aside { grid-template-columns: minmax(0, 860px); }
  .post-aside { width: 100%; max-width: 860px; margin: 22px auto 0; }
  .post-aside-inner { position: static; }
  .post-aside-fade::before, .post-aside-fade::after { display: none; }
  .post-aside-scroll { max-height: none; overflow: visible; padding: 0; }
  .post-aside-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 1024px) {
  .blog-page, .post-page { padding-top: 96px; }
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .blog-h1 { font-size: 27px; }
  .post-inner { padding: 24px 22px 28px; }
  .post-h1 { font-size: 24px; }
  .post-body h2 { font-size: 20px; }
}

@media (max-width: 640px) {
  .blog-page, .post-page { padding: 88px 0 34px; }
  .blog-grid { grid-template-columns: 1fr; gap: 14px; }
  .blog-h1 { font-size: 23px; }
  .blog-intro { font-size: 13.5px; }
  .blog-card-title { font-size: 16px; }
  .post-shell { border-radius: 20px; }
  .post-cover img { max-height: 240px; }
  .post-inner { padding: 20px 16px 24px; }
  .post-h1 { font-size: 21px; }
  .post-body { font-size: 15px; }
  .post-body h2 { font-size: 18.5px; margin-top: 28px; }
  .post-body h3 { font-size: 16.5px; }
  .post-body ul, .post-body ol { padding-right: 18px; }
  .post-foot .btn { width: 100%; justify-content: center; }
  .post-aside-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
