/* ==========================================================================
   blog.css — استایل صفحات عمومی بلاگ (فهرست + تک‌نوشته)
   مکمل home-v2.css — از همان توکن‌های :root استفاده می‌کند
   ========================================================================== */

/* ---------- چیدمان کلی ---------- */
.blog-main{
  padding-top:7.5rem;
  padding-bottom:4.5rem;
  min-height:70vh;
}
@media(min-width:768px){
  .blog-main{padding-top:9rem;padding-bottom:6rem}
}

/* نوبار روی صفحات داخلی همیشه توپر باشد */
.navbar-solid{
  background:rgba(7,6,13,.85);
  border-bottom-color:var(--line);
  box-shadow:0 8px 30px rgba(0,0,0,.45);
}
.nav-links a.active{
  color:#fff;
  background:rgba(139,92,246,.14);
}
.mobile-menu a.active{
  color:#fff;
  background:rgba(139,92,246,.16);
}

/* ---------- هیرو بلاگ ---------- */
.blog-hero{
  text-align:center;
  max-width:680px;
  margin-inline:auto;
  margin-bottom:3rem;
}
.blog-hero-title{
  font-size:clamp(2rem,5vw,3.1rem);
  font-weight:900;
  line-height:1.3;
  letter-spacing:-.02em;
  margin-bottom:.9rem;
}
.blog-hero-sub{
  color:var(--text-soft);
  font-size:clamp(.98rem,2vw,1.12rem);
  line-height:1.95;
}

/* ---------- چیپ‌های دسته‌بندی ---------- */
.blog-chips{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:.6rem;
  margin-bottom:3rem;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.55rem 1.15rem;
  border-radius:var(--radius-full);
  background:rgba(255,255,255,.04);
  border:1px solid var(--line);
  color:var(--text-soft);
  font-size:.86rem;
  font-weight:700;
  transition:color var(--dur-fast),background var(--dur-fast),border-color var(--dur-fast),transform var(--dur-fast) var(--ease-out-soft);
}
.chip:hover{
  color:#fff;
  border-color:var(--line-brand);
  background:rgba(139,92,246,.10);
  transform:translateY(-2px);
}
.chip.active{
  background:var(--grad-brand);
  border-color:transparent;
  color:#fff;
  box-shadow:var(--glow-brand-sm);
}
.chip-count{
  font-size:.72rem;
  font-weight:800;
  background:rgba(255,255,255,.12);
  border-radius:var(--radius-full);
  padding:.05rem .55rem;
  line-height:1.6;
}
.chip.active .chip-count{background:rgba(255,255,255,.22)}

/* ---------- گرید کارت‌ها ---------- */
.posts-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:1.5rem;
}
@media(min-width:640px){.posts-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.posts-grid{grid-template-columns:repeat(3,1fr);gap:1.75rem}}

.post-card{
  display:flex;
  flex-direction:column;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  overflow:hidden;
  transition:transform var(--dur-med) var(--ease-out-soft),border-color var(--dur-fast),box-shadow var(--dur-med) var(--ease-out-soft);
}
.post-card:hover{
  transform:translateY(-6px);
  border-color:var(--line-brand);
  box-shadow:var(--glow-brand-sm);
}
.post-card-media{
  display:block;
  aspect-ratio:16/9;
  overflow:hidden;
  background:var(--surface-2);
}
.post-card-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform var(--dur-slow) var(--ease-out-soft);
}
.post-card:hover .post-card-media img{transform:scale(1.05)}
.post-card-ph{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:1.25rem;
  text-align:center;
  background:
    radial-gradient(18rem 12rem at 80% 0%,rgba(99,102,241,.30),transparent 65%),
    radial-gradient(16rem 12rem at 15% 100%,rgba(217,70,239,.24),transparent 65%),
    var(--surface-2);
}
.post-card-ph span{
  font-weight:800;
  font-size:.95rem;
  line-height:1.8;
  background:var(--grad-text);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
}
.post-card-body{
  display:flex;
  flex-direction:column;
  flex:1;
  gap:.7rem;
  padding:1.3rem 1.4rem 1.5rem;
}
.post-card-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.6rem;
  font-size:.78rem;
  color:var(--text-faint);
}
.post-card-badge{
  display:inline-block;
  padding:.2rem .8rem;
  border-radius:var(--radius-full);
  background:rgba(139,92,246,.12);
  border:1px solid var(--line-brand);
  color:var(--violet-300);
  font-weight:700;
  font-size:.74rem;
  transition:background var(--dur-fast),color var(--dur-fast);
}
.post-card-badge:hover{background:rgba(139,92,246,.24);color:#fff}
.post-card-date{color:var(--text-faint)}
.post-card-title{
  font-size:1.08rem;
  font-weight:800;
  line-height:1.7;
  color:var(--text);
}
.post-card-title a{transition:color var(--dur-fast)}
.post-card-title a:hover{color:var(--violet-300)}
.post-card-excerpt{
  color:var(--text-soft);
  font-size:.88rem;
  line-height:1.9;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.post-card-more{
  margin-top:auto;
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  font-size:.85rem;
  font-weight:800;
  color:var(--violet-400);
  transition:color var(--dur-fast),gap var(--dur-fast);
}
.post-card-more svg{width:16px;height:16px;flex-shrink:0}
.post-card-more:hover{color:var(--fuchsia-400);gap:.65rem}

/* ---------- صفحه‌بندی ---------- */
.pager{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  margin-top:3rem;
}
.pager-link{
  min-width:2.6rem;
  height:2.6rem;
  padding-inline:.9rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--radius-full);
  background:rgba(255,255,255,.04);
  border:1px solid var(--line);
  color:var(--text-soft);
  font-size:.88rem;
  font-weight:700;
  transition:color var(--dur-fast),background var(--dur-fast),border-color var(--dur-fast);
}
.pager-link:hover{color:#fff;border-color:var(--line-brand);background:rgba(139,92,246,.10)}
.pager-link.active{
  background:var(--grad-brand);
  border-color:transparent;
  color:#fff;
  box-shadow:var(--glow-brand-sm);
  cursor:default;
}
.pager-dots{color:var(--text-faint);padding-inline:.2rem}

/* ---------- حالت خالی / ۴۰۴ ---------- */
.blog-empty{
  text-align:center;
  padding:4.5rem 1.5rem;
  max-width:480px;
  margin-inline:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1.25rem;
}
.blog-empty svg{width:54px;height:54px;color:var(--violet-400);opacity:.8}
.blog-empty p{color:var(--text-soft);font-size:1.02rem;line-height:2}
.blog-404-code{
  font-size:clamp(4rem,12vw,6.5rem);
  font-weight:900;
  line-height:1.1;
  background:var(--grad-text);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
}
.blog-404-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:.75rem}

/* ---------- تک‌نوشته ---------- */
.breadcrumb{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.5rem;
  font-size:.82rem;
  color:var(--text-faint);
  margin-bottom:1.75rem;
}
.breadcrumb a{color:var(--text-soft);transition:color var(--dur-fast)}
.breadcrumb a:hover{color:var(--violet-300)}
.breadcrumb-sep{opacity:.5}

.post-wrap{max-width:820px;margin-inline:auto}
.post-header{margin-bottom:1.75rem}
.post-title{
  font-size:clamp(1.6rem,4.4vw,2.5rem);
  font-weight:900;
  line-height:1.5;
  letter-spacing:-.02em;
  margin-bottom:1.1rem;
}
.post-meta-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:1.15rem;
  color:var(--text-faint);
  font-size:.85rem;
}
.post-meta-item{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  color:var(--text-soft);
}
.post-meta-item svg{width:16px;height:16px;flex-shrink:0;color:var(--violet-400)}
.post-meta-cat{transition:color var(--dur-fast)}
.post-meta-cat:hover{color:var(--violet-300)}

.post-cover{
  margin-bottom:2.25rem;
  border-radius:var(--radius-lg);
  overflow:hidden;
  border:1px solid var(--line);
  box-shadow:var(--shadow-md);
}
.post-cover img{
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
}

/* ---------- تایپوگرافی محتوای مقاله ---------- */
.post-content{
  color:var(--text-soft);
  font-size:1.02rem;
  line-height:2;
  overflow-wrap:break-word;
}
.post-content>*+*{margin-top:1.1rem}
.post-content h2{
  color:var(--text);
  font-size:1.45rem;
  font-weight:800;
  line-height:1.7;
  margin-top:2.6rem;
  padding-inline-start:.9rem;
  border-inline-start:4px solid transparent;
  border-image:var(--grad-brand) 1;
}
.post-content h3{
  color:var(--text);
  font-size:1.18rem;
  font-weight:800;
  line-height:1.7;
  margin-top:2rem;
}
.post-content h4{
  color:var(--text);
  font-size:1.04rem;
  font-weight:800;
  margin-top:1.6rem;
}
.post-content p{line-height:2.1}
.post-content a{
  color:var(--violet-300);
  text-decoration:underline;
  text-underline-offset:4px;
  text-decoration-color:rgba(139,92,246,.5);
  transition:color var(--dur-fast);
}
.post-content a:hover{color:var(--fuchsia-400)}
.post-content strong,.post-content b{color:var(--text);font-weight:800}
.post-content ul,.post-content ol{
  padding-inline-start:1.4rem;
  display:flex;
  flex-direction:column;
  gap:.45rem;
}
.post-content ul{list-style:disc}
.post-content ol{list-style:decimal}
.post-content li::marker{color:var(--violet-400)}
.post-content img{
  border-radius:var(--radius-md);
  border:1px solid var(--line);
  margin-block:1.6rem;
  margin-inline:auto;
}
.post-content figure{margin-block:1.6rem}
.post-content figure img{margin-block:0}
.post-content figcaption{
  text-align:center;
  font-size:.8rem;
  color:var(--text-faint);
  margin-top:.6rem;
}
.post-content blockquote{
  background:var(--surface);
  border:1px solid var(--line);
  border-inline-start:4px solid var(--violet-500);
  border-radius:var(--radius-md);
  padding:1.15rem 1.4rem;
  color:var(--text);
  font-style:normal;
}
.post-content code{
  direction:ltr;
  unicode-bidi:embed;
  font-family:ui-monospace,'Cascadia Code',Consolas,monospace;
  font-size:.86em;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:.4rem;
  padding:.12rem .45rem;
  color:var(--violet-300);
}
.post-content pre{
  direction:ltr;
  text-align:left;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  padding:1.1rem 1.3rem;
  overflow-x:auto;
  line-height:1.8;
}
.post-content pre code{background:none;border:none;padding:0;color:var(--text-soft)}
.post-content table{
  width:100%;
  border-collapse:collapse;
  font-size:.9rem;
  margin-block:1.6rem;
  display:block;
  overflow-x:auto;
}
.post-content th,.post-content td{
  border:1px solid var(--line);
  padding:.7rem 1rem;
  text-align:start;
}
.post-content th{background:var(--surface-2);color:var(--text);font-weight:800}
.post-content tr:nth-child(even) td{background:rgba(255,255,255,.02)}

/* ---------- بنر CTA ---------- */
.post-cta{margin-top:3.5rem}
.post-cta-card{
  max-width:820px;
  margin-inline:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:1.4rem;
  padding:2.4rem 1.8rem;
  border-radius:var(--radius-xl);
  background:
    radial-gradient(24rem 14rem at 85% 0%,rgba(255,255,255,.14),transparent 60%),
    var(--grad-brand);
  box-shadow:var(--glow-brand);
  color:#fff;
}
@media(min-width:768px){
  .post-cta-card{
    flex-direction:row;
    justify-content:space-between;
    text-align:start;
    padding:2.6rem 3rem;
  }
}
.post-cta-text h2{font-size:1.35rem;font-weight:900;margin-bottom:.5rem}
.post-cta-text p{font-size:.95rem;line-height:1.95;opacity:.92}
.post-cta-card .btn{flex-shrink:0}

/* ---------- مطالب مرتبط ---------- */
.related-posts{margin-top:4rem}
.related-title{
  font-size:1.4rem;
  font-weight:900;
  margin-bottom:1.75rem;
  padding-inline-start:.9rem;
  border-inline-start:4px solid transparent;
  border-image:var(--grad-brand) 1;
}

/* ---------- فوتر فشرده‌ی بلاگ ---------- */
.blog-footer{margin-top:2rem}
.blog-footer-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1.4rem;
  padding-block:2.5rem;
  text-align:center;
}
@media(min-width:768px){
  .blog-footer-inner{
    flex-direction:row;
    justify-content:space-between;
    text-align:start;
  }
}
.blog-footer .footer-brand{margin-bottom:0}
.blog-footer-links{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:.35rem;
}
.blog-footer-links a{
  padding:.45rem .95rem;
  border-radius:var(--radius-full);
  font-size:.85rem;
  font-weight:600;
  color:var(--text-soft);
  transition:color var(--dur-fast),background var(--dur-fast);
}
.blog-footer-links a:hover{color:#fff;background:rgba(255,255,255,.06)}

/* ---------- کاهش حرکت ---------- */
@media(prefers-reduced-motion:reduce){
  .post-card,
  .post-card-media img,
  .chip,
  .post-card-more{transition:none}
  .post-card:hover{transform:none}
  .post-card:hover .post-card-media img{transform:none}
}
