/* Footer style override if you want it flatter on blog page */
footer {
  background: var(--tfm-dark); /* whatever your dark color is */
  color: #fff;
  text-align: center;

  padding: 12px 0; /* MUCH thinner */
  font-size: 0.85rem; /* cleaner, not heavy */
  line-height: 1; /* vertically centers the text */

  display: flex;
  justify-content: center;
  align-items: center;
}

/* Override page-header spacing for blog page */
.page-header {
  margin: 120px auto 40px !important; /* back to safe value */
}

.post-grid {
  margin-top: 32px !important;
}

/* ======================================
   BLOG CARD — FINAL POLISHED DESIGN
====================================== */

.post-card {
  background: #ffffff;
  border-radius: 16px; /* cleaner, less balloon-like */
  padding: 22px 24px; /* more breathable */
  border: 1px solid var(--tfm-border); /* consistent with site */
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  height: 100%;
}

/* Hover — subtle but premium */
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  border-color: var(--tfm-primary);
}

/* Title */
.post-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tfm-primary-dark);
  line-height: 1.35;
  margin-bottom: 8px;
}

/* Date */
.post-date {
  font-size: 0.85rem;
  color: var(--tfm-muted);
  margin-bottom: 14px;
}

/* Excerpt */
.post-excerpt {
  font-size: 0.95rem;
  color: var(--tfm-text);
  line-height: 1.55;
  margin-bottom: 18px;
  max-width: 95%;
}

/* Read more */
.read-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tfm-secondary);
}

.read-more:hover {
  text-decoration: underline;
}

/* ===========================================
   RTL FIX — Automatically apply RTL for Arabic
=========================================== */

/* 1. If browser detects Arabic language */
.post-card:lang(ar),
.post-card *:lang(ar) {
  direction: rtl;
  text-align: right;
}

/* 2. Force RTL if any Arabic Unicode characters are present */
.post-card:has([dir="rtl"]),
.post-card:has(.arabic) {
  direction: rtl;
  text-align: right;
}

.post-card.rtl {
  direction: rtl;
  text-align: right;
}

.post-card[dir="rtl"] * {
  direction: rtl;
  text-align: right;
}

/* Keep Read → aligned properly even in RTL */
.post-card.rtl .read-more,
.post-card[dir="rtl"] .read-more {
  direction: ltr;
  text-align: left;
  display: inline-block;
}
