/* ===== Blog Variables ===== */
:root {
    --blue-dark:   #0d2b6e;
    --blue-main:   #1a4db5;
    --blue-mid:    #2563eb;
    --blue-light:  #3b82f6;
    --blue-pale:   #dbeafe;
    --yellow:      #f59e0b;
    --yellow-light:#fef3c7;
    --text-dark:   #1e293b;
    --text-muted:  #64748b;
    --white:       #ffffff;
  }
  
  /* ===== Blog Hero ===== */
  .blog-hero {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-main) 60%, var(--blue-mid) 100%);
    padding: 60px 0;
    text-align: center;
    color: var(--white);
  }
  .blog-hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
  }
  .blog-hero p {
    font-size: 1.1rem;
    opacity: .85;
  }
  
  /* ===== Post Card ===== */
  .post-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(13,43,110,.1);
    transition: transform .25s, box-shadow .25s;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--blue-main);
  }
  .post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(13,43,110,.18);
  }
  .post-card__img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
  }
  .post-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .post-card__cat {
    display: inline-block;
    background: var(--blue-pale);
    color: var(--blue-main);
    font-size: .78rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    font-weight: 600;
  }
  .post-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.6;
  }
  .post-card__title a {
    color: var(--blue-dark);
    text-decoration: none;
  }
  .post-card__title a:hover { color: var(--blue-mid); }
  .post-card__summary {
    color: var(--text-muted);
    font-size: .9rem;
    line-height: 1.7;
    flex: 1;
  }
  .post-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--blue-pale);
  }
  .post-card__footer time {
    font-size: .8rem;
    color: var(--text-muted);
  }
  .btn-read-more {
    background: var(--yellow);
    color: var(--blue-dark);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s;
  }
  .btn-read-more:hover { background: #d97706; color: var(--white); }
  
  /* ===== Post Detail ===== */
  .post-detail {
    max-width: 820px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 14px;
    padding: 40px;
    box-shadow: 0 2px 16px rgba(13,43,110,.08);
  }
  .post-detail__header { margin-bottom: 28px; }
  .post-detail__cat {
    display: inline-block;
    background: var(--blue-pale);
    color: var(--blue-main);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 14px;
  }
  .post-detail__title {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--blue-dark);
    line-height: 1.5;
    margin-bottom: 14px;
  }
  .post-detail__meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: .85rem;
  }
  .post-detail__img {
    margin-bottom: 28px;
    border-radius: 10px;
    overflow: hidden;
  }
  .post-detail__img img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
  }
  .post-detail__body {
    font-size: 1rem;
    line-height: 2;
    color: var(--text-dark);
  }
  .post-detail__body p { margin-bottom: 18px; }
  .post-detail__tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--blue-pale);
  }
  .tag {
    display: inline-block;
    background: var(--yellow-light);
    color: var(--blue-dark);
    border: 1px solid var(--yellow);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .8rem;
    margin: 4px;
  }
  .btn-back {
    display: inline-block;
    margin-top: 24px;
    color: var(--blue-main);
    font-weight: 600;
    text-decoration: none;
  }
  .btn-back:hover { color: var(--blue-dark); }
  .blog-detail-page h1,
.blog-detail-page h2,
.blog-detail-page h3,
.blog-detail-page h4,
.blog-detail-page h5,
.blog-detail-page h6,
.blog-detail-page p,
.blog-detail-page li {
    text-align: right;
}
/* ===== RESPONSIVE FIXES FOR BLOG ARTICLES ===== */

/* جداول - مشکل اصلی */
.post-detail__body table {
  width: 100% !important;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  border-collapse: collapse;
}

.post-detail__body table th,
.post-detail__body table td {
  white-space: normal;
  min-width: 80px;
  font-size: 13px;
  padding: 8px 6px;
}

/* باکس‌های flex */
.post-detail__body div[style*="display: flex"],
.post-detail__body div[style*="display:flex"] {
  flex-wrap: wrap !important;
}

/* باکس‌های min-width */
.post-detail__body div[style*="min-width: 300px"],
.post-detail__body div[style*="min-width:300px"],
.post-detail__body div[style*="min-width: 280px"],
.post-detail__body div[style*="min-width:280px"],
.post-detail__body div[style*="min-width: 250px"],
.post-detail__body div[style*="min-width:250px"],
.post-detail__body div[style*="min-width: 320px"],
.post-detail__body div[style*="min-width:320px"] {
  min-width: 100% !important;
  flex: 1 1 100% !important;
}

/* دکمه‌های بزرگ داخل مقاله */
.post-detail__body .btn-back {
  display: inline-block;
  font-size: 14px !important;
  padding: 12px 20px !important;
  white-space: normal;
  max-width: 90%;
}

/* هدینگ‌های بزرگ */
.post-detail__body h1 {
  font-size: 22px !important;
  line-height: 1.4;
}

.post-detail__body h2 {
  font-size: 18px !important;
  line-height: 1.4;
}

.post-detail__body h3 {
  font-size: 16px !important;
  line-height: 1.4;
}

/* باکس‌های border-right */
.post-detail__body div[style*="border-right"] {
  padding: 12px !important;
  margin: 15px 0 !important;
}

/* تصاویر داخل مقاله */
.post-detail__body img {
  max-width: 100%;
  height: auto;
}

/* لیست‌ها */
.post-detail__body ul,
.post-detail__body ol {
  padding-right: 20px;
}

.post-detail__body ul li,
.post-detail__body ol li {
  font-size: 14px;
  margin-bottom: 6px;
}

/* پاراگراف‌ها */
.post-detail__body p {
  font-size: 14px;
  line-height: 1.8;
}

/* span ها و دکمه‌های inline */
.post-detail__body span[style*="padding"] {
  display: inline-block;
  margin: 3px;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
  .post-detail__body table {
      font-size: 11px;
  }
  
  .post-detail__body table th,
  .post-detail__body table td {
      padding: 6px 4px;
      font-size: 11px;
  }
  
  .post-detail__body h1 {
      font-size: 20px !important;
  }
  
  .post-detail__body h2 {
      font-size: 17px !important;
  }
  
  /* دکمه‌های span داخل مقاله */
  .post-detail__body span[style*="padding"] {
      padding: 4px 8px !important;
      font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  .post-detail__body h1 {
      font-size: 18px !important;
  }
  
  .post-detail__body h2 {
      font-size: 16px !important;
  }
  
  .post-detail__body p {
      font-size: 13px;
  }
}