/* =====================================================
   Delsapay Blog Design — آرشیو + پست تکی
   ===================================================== */

/* ---------- اصلاح: page-header فقط در خانه مخفی باشد ---------- */
body.home .page-header { display: none !important; }

/* ---------- هدر آرشیو و پست تکی ---------- */
body.blog .page-header,
body.archive .page-header,
body.single-post .page-header {
  display: block !important;
  text-align: center;
  padding: 64px 24px 36px !important;
  background: radial-gradient(800px 300px at 50% 0%, rgba(124,58,237,.16), transparent 70%) !important;
}
body.blog .page-header .entry-title,
body.single-post .page-header .entry-title {
  font-size: clamp(26px, 4vw, 42px) !important;
  font-weight: 800 !important;
  color: #F1F5F9 !important;
  line-height: 1.4 !important;
  margin: 0 auto !important;
  max-width: 820px;
}
body.blog .page-header::after {
  content: 'جدیدترین مقالات و راهنماهای خرید از دل‌سپی';
  display: block;
  color: #94A3B8;
  font-size: 15px;
  margin-top: 14px;
}

/* =====================================================
   آرشیو — گرید کارت‌ها
   ===================================================== */
body.blog .site-main,
body.archive .site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px 80px !important;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
body.blog .site-main > .page-header,
body.archive .site-main > .page-header {
  grid-column: 1 / -1;
}

/* کارت پست */
body.blog article.post,
body.archive article.post {
  background: var(--dpg-card) !important;
  border: 1px solid var(--dpg-border) !important;
  border-radius: 22px !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease !important;
  position: relative;
}
body.blog article.post:hover,
body.archive article.post:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 26px 60px rgba(124,58,237,.2), 0 10px 30px rgba(2,6,23,.5) !important;
  border-color: rgba(139,92,246,.45) !important;
}

/* تصویر کارت */
body.blog article.post > a:has(img),
body.archive article.post > a:has(img) {
  display: block;
  height: 200px;
  overflow: hidden;
  position: relative;
}
body.blog article.post .wp-post-image,
body.archive article.post .wp-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease !important;
}
body.blog article.post:hover .wp-post-image,
body.archive article.post:hover .wp-post-image {
  transform: scale(1.06);
}
/* لایه رنگی روی تصویر — هر کارت رنگ متفاوت تا تکراری به نظر نرسد */
body.blog article.post > a:has(img)::after,
body.archive article.post > a:has(img)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(124,58,237,.42) 0%, rgba(79,70,229,.12) 55%, transparent 100%);
  pointer-events: none;
}
body.blog article.post:nth-child(3n+2) > a:has(img)::after,
body.archive article.post:nth-child(3n+2) > a:has(img)::after {
  background: linear-gradient(165deg, rgba(245,158,11,.4) 0%, rgba(245,158,11,.08) 55%, transparent 100%);
}
body.blog article.post:nth-child(3n+3) > a:has(img)::after,
body.archive article.post:nth-child(3n+3) > a:has(img)::after {
  background: linear-gradient(165deg, rgba(16,185,129,.38) 0%, rgba(16,185,129,.08) 55%, transparent 100%);
}

/* متادیتا */
.dpg-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  color: var(--dpg-dim) !important;
  font-size: 13px;
  line-height: 1.7;
}
.dpg-post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dpg-post-meta a { color: #A78BFA !important; text-decoration: none !important; }
.dpg-post-meta a:hover { color: #C4B5FD !important; }

body.blog article.post .dpg-post-meta,
body.archive article.post .dpg-post-meta {
  padding: 20px 22px 0;
}

/* عنوان کارت */
body.blog article.post .entry-title,
body.archive article.post .entry-title {
  margin: 0 !important;
  padding: 10px 22px 0;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.55 !important;
  color: #F1F5F9 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.1em;
}
body.blog article.post .entry-title a,
body.archive article.post .entry-title a {
  color: #F1F5F9 !important;
  text-decoration: none !important;
  transition: color .25s;
}
body.blog article.post:hover .entry-title a,
body.archive article.post:hover .entry-title a {
  color: #C4B5FD !important;
}

/* خلاصه */
body.blog article.post .dpg-excerpt,
body.archive article.post .dpg-excerpt {
  margin: 0 !important;
  padding: 8px 22px 0;
  color: var(--dpg-dim) !important;
  font-size: 14px !important;
  line-height: 1.9 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* دکمه ادامه مطلب */
body.blog article.post .dpg-read-more,
body.archive article.post .dpg-read-more {
  margin: 16px 22px 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #A78BFA !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  transition: gap .25s ease, color .25s ease;
}
body.blog article.post .dpg-read-more:hover,
body.archive article.post .dpg-read-more:hover {
  gap: 12px;
  color: #C4B5FD !important;
}

/* ---------- صفحه‌بندی ---------- */
body.blog .pagination,
body.archive .pagination {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 26px 0 0;
  margin: 0;
}
body.blog .pagination .page-numbers,
body.archive .pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--dpg-card) !important;
  border: 1px solid var(--dpg-border) !important;
  color: #CBD5E1 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: all .25s ease;
}
body.blog .pagination .page-numbers.current,
body.archive .pagination .page-numbers.current {
  background: linear-gradient(135deg, #7C3AED, #4F46E5) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 8px 22px rgba(124,58,237,.4);
}
body.blog .pagination .page-numbers:hover:not(.current),
body.archive .pagination .page-numbers:hover:not(.current) {
  border-color: rgba(139,92,246,.5) !important;
  color: #fff !important;
  transform: translateY(-2px);
}

/* =====================================================
   پست تکی
   ===================================================== */
body.single-post .site-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 24px 80px !important;
}

/* تصویر شاخص */
.dpg-featured-image {
  margin: 26px 0 22px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--dpg-border);
  box-shadow: 0 22px 60px rgba(2,6,23,.5);
}
.dpg-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* متادیتای پست تکی */
body.single-post .page-content > .dpg-post-meta {
  justify-content: center;
  margin-bottom: 8px;
}

/* نوار پیشرفت مطالعه */
.dpg-progress-bar {
  height: 3px;
  border-radius: 3px;
  background: rgba(148,163,184,.14);
  overflow: hidden;
  margin: 18px 0 8px;
}
.dpg-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7C3AED, #4F46E5);
  transition: width .1s linear;
}

/* ---------- تایپوگرافی محتوا ---------- */
body.single-post .page-content {
  font-size: 16.5px;
  line-height: 2.15;
  color: #CBD5E1;
  overflow-wrap: break-word;
}
body.single-post .page-content h2 {
  font-size: 26px;
  font-weight: 800;
  color: #F1F5F9;
  margin: 48px 0 20px;
  padding-right: 16px;
  position: relative;
}
body.single-post .page-content h2::before {
  content: '';
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #7C3AED, #4F46E5);
}
body.single-post .page-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: #E2E8F0;
  margin: 36px 0 14px;
}
body.single-post .page-content h4 {
  font-size: 17px;
  font-weight: 700;
  color: #E2E8F0;
  margin: 28px 0 12px;
}
body.single-post .page-content p { margin: 0 0 20px; }
body.single-post .page-content ul,
body.single-post .page-content ol {
  margin: 0 0 24px;
  padding-right: 26px;
}
body.single-post .page-content li { margin-bottom: 10px; }
body.single-post .page-content li::marker { color: #A78BFA; font-weight: 700; }
body.single-post .page-content strong { color: #F8FAFC; }
body.single-post .page-content a {
  color: #A78BFA !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
body.single-post .page-content blockquote {
  margin: 30px 0;
  padding: 22px 26px;
  border-radius: 16px;
  border-right: 4px solid #7C3AED;
  background: rgba(124,58,237,.08);
  color: #E2E8F0;
  font-size: 16px;
}
body.single-post .page-content code {
  background: rgba(124,58,237,.14);
  color: #C4B5FD;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: .92em;
  direction: ltr;
  display: inline-block;
}
body.single-post .page-content pre {
  background: #0B1220;
  border: 1px solid var(--dpg-border);
  border-radius: 16px;
  padding: 20px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
body.single-post .page-content pre code { background: none; padding: 0; }
body.single-post .page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--dpg-border);
  font-size: 14.5px;
}
body.single-post .page-content th {
  background: rgba(124,58,237,.18);
  color: #F1F5F9;
  padding: 12px 16px;
  text-align: right;
}
body.single-post .page-content td {
  padding: 11px 16px;
  border-top: 1px solid var(--dpg-border);
  color: #CBD5E1;
}
body.single-post .page-content img {
  border-radius: 16px;
  margin: 10px 0;
}
body.single-post .page-content hr {
  border: none;
  height: 1px;
  background: var(--dpg-border);
  margin: 34px 0;
}

/* ---------- باکس CTA ---------- */
.dpg-cta-box {
  margin: 54px 0 34px;
  border-radius: 26px;
  padding: 46px 34px 40px;
  background: linear-gradient(135deg, rgba(124,58,237,.14), rgba(79,70,229,.06)), var(--dpg-card-2);
  border: 1px solid rgba(139,92,246,.35);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dpg-cta-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 170px at 50% 0%, rgba(124,58,237,.28), transparent 70%);
  pointer-events: none;
}
.dpg-cta-inner { position: relative; }
.dpg-cta-icon { font-size: 42px; display: block; margin-bottom: 10px; }
.dpg-cta-box h3 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
}
.dpg-cta-box p {
  color: #94A3B8;
  font-size: 15px;
  line-height: 1.9;
  max-width: 520px;
  margin: 0 auto 24px;
}
.dpg-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.dpg-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  box-shadow: 0 12px 30px rgba(124,58,237,.4);
  transition: transform .3s ease, box-shadow .3s ease;
}
.dpg-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(124,58,237,.52);
}
.dpg-cta-btn.ghost {
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.25);
  box-shadow: none;
}

/* ---------- باکس نویسنده ---------- */
.dpg-author-box {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 28px;
  border-radius: 22px;
  background: var(--dpg-card);
  border: 1px solid var(--dpg-border);
  margin: 10px 0 36px;
}
.dpg-author-box img.avatar {
  border-radius: 50%;
  border: 2px solid rgba(139,92,246,.45);
  flex-shrink: 0;
}
.dpg-author-label {
  color: #A78BFA;
  font-size: 12.5px;
  font-weight: 700;
}
.dpg-author-info h4 {
  margin: 5px 0 7px;
  color: #F1F5F9;
  font-size: 17px;
}
.dpg-author-info p {
  margin: 0;
  color: var(--dpg-dim);
  font-size: 14px;
  line-height: 1.8;
}

/* ---------- ناوبری پست قبلی/بعدی ---------- */
.dpg-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 36px;
}
.dpg-post-nav-card {
  background: var(--dpg-card);
  border: 1px solid var(--dpg-border);
  border-radius: 16px;
  padding: 18px 20px;
  text-decoration: none !important;
  transition: border-color .3s, transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dpg-post-nav-card:hover {
  border-color: rgba(139,92,246,.45);
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(124,58,237,.16);
}
.dpg-post-nav-card.next { text-align: left; }
.dpg-post-nav-card.empty { visibility: hidden; }
.dpg-nav-label {
  color: #A78BFA;
  font-size: 12.5px;
  font-weight: 700;
}
.dpg-nav-title {
  color: #E2E8F0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- مقالات مرتبط ---------- */
.dpg-related { margin: 10px 0 40px; }
.dpg-related-title {
  font-size: 22px;
  font-weight: 800;
  color: #F1F5F9;
  margin-bottom: 22px;
}
.dpg-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.dpg-related-card {
  background: var(--dpg-card);
  border: 1px solid var(--dpg-border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  text-decoration: none !important;
}
.dpg-related-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139,92,246,.42);
  box-shadow: 0 16px 40px rgba(124,58,237,.18);
}
.dpg-related-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.dpg-related-card-title {
  padding: 14px 16px 4px;
  color: #E2E8F0;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.dpg-related-card-date {
  padding: 0 16px 14px;
  color: #64748B;
  font-size: 12px;
}

/* ---------- نظرات ---------- */
body.single-post .comments-area {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 70px;
}
.comments-area .comments-title,
.comments-area .comment-reply-title {
  color: #F1F5F9;
  font-size: 20px;
  font-weight: 800;
}
.comment-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.comment-list .comment-body {
  background: var(--dpg-card);
  border: 1px solid var(--dpg-border);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.comment-author { color: #E2E8F0; font-weight: 700; }
.comment-author .avatar {
  border-radius: 50%;
  margin-left: 10px;
}
.comment-metadata { color: #64748B; font-size: 12.5px; margin: 4px 0 10px; }
.comment-metadata a { color: #64748B !important; }
.comment-content { color: #CBD5E1; font-size: 14.5px; line-height: 1.9; }
.comment-content p { margin: 0 0 10px; }
.comment-respond {
  background: var(--dpg-card);
  border: 1px solid var(--dpg-border);
  border-radius: 20px;
  padding: 26px;
  margin-top: 30px;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
  width: 100%;
  background: var(--dpg-card-2);
  border: 1px solid var(--dpg-border);
  border-radius: 12px;
  color: #E2E8F0;
  padding: 12px 16px;
  font-size: 14.5px;
  transition: border-color .25s;
}
.comment-respond input:focus,
.comment-respond textarea:focus {
  outline: none;
  border-color: rgba(139,92,246,.55);
}
.comment-form .submit {
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 30px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}
.comment-form .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(124,58,237,.4);
}

/* =====================================================
   ریسپانسیو
   ===================================================== */
@media (max-width: 1024px) {
  body.blog .site-main,
  body.archive .site-main {
    grid-template-columns: repeat(2, 1fr);
  }
  .dpg-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  body.blog .site-main,
  body.archive .site-main {
    grid-template-columns: 1fr;
    padding: 10px 16px 60px !important;
  }
  .dpg-related-grid {
    grid-template-columns: 1fr;
  }
  .dpg-author-box {
    flex-direction: column;
    text-align: center;
  }
  .dpg-post-nav {
    grid-template-columns: 1fr;
  }
  body.single-post .page-content {
    font-size: 15.5px;
    line-height: 2;
  }
  body.single-post .page-content h2 { font-size: 22px; }
  .dpg-cta-box { padding: 36px 22px 32px; }
  body.single-post .site-main { padding: 10px 16px 60px !important; }
  body.single-post .comments-area { padding: 0 16px 50px; }
}
