/* =======================================
   POST PAGE — CENTERED READING LAYOUT
   Cleaned, optimized, and organized
======================================= */

/* ---- Main Container ---- */
.post-container {
  max-width: 760px; /* Ideal reading width */
  margin: 150px auto 80px; /* Spacing below fixed header */
  padding: 0 24px; /* Mobile-friendly horizontal padding */
}

/* ---- Article Card Wrapper ---- */
.post-body {
  background: #fff;
  border-radius: 20px;
  padding: 48px 40px;
  border: 1px solid var(--tfm-border);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

/* ---- Title ---- */
.post-container h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tfm-primary-dark);
  margin-bottom: 6px;
  line-height: 1.25;
}

/* ---- Meta Text ---- */
.post-meta {
  color: var(--tfm-muted);
  font-size: 0.92rem;
  margin-bottom: 32px;
}

/* ---- Headings ---- */
.post-container h2 {
  margin-top: 42px;
  margin-bottom: 14px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--tfm-primary-dark);
}

/* ---- Paragraphs ---- */
.post-container p {
  font-size: 1.05rem;
  line-height: 1.72;
  margin-bottom: 18px;
}

/* ---- Bullet Lists ---- */
.post-container ul {
  padding-left: 22px;
  margin: 14px 0 18px;
}

.post-container li {
  margin-bottom: 8px;
  line-height: 1.6;
  font-size: 1.05rem;
}

/* ---- Back Link ---- */
.back-link {
  margin-top: 40px;
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tfm-secondary);
}

.back-link:hover {
  text-decoration: underline;
}

/* =======================================
   RESPONSIVE BREAKPOINTS
======================================= */

/* ---- Tablet (≤ 1024px) ---- */
@media (max-width: 1024px) {
  .post-container {
    margin: 130px auto 70px;
    padding: 0 28px;
  }

  .post-body {
    padding: 42px 34px;
  }

  .post-container h1 {
    font-size: 1.8rem;
  }
}

/* ---- Medium Screens (≤ 768px) ---- */
@media (max-width: 768px) {
  .post-container {
    margin: 120px auto 60px;
    padding: 0 20px;
  }

  .post-body {
    padding: 36px 28px;
    border-radius: 16px;
  }

  .post-container h1 {
    font-size: 1.65rem;
  }

  .post-container h2 {
    font-size: 1.22rem;
  }

  .post-container p,
  .post-container li {
    font-size: 1rem;
  }
}

/* ---- Mobile Phones (≤ 480px) ---- */
@media (max-width: 480px) {
  .post-container {
    margin: 110px auto 50px; /* Ensures it clears fixed header */
    padding: 0 16px;
  }

  .post-body {
    padding: 28px 20px;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  }

  .post-container h1 {
    font-size: 1.45rem;
    line-height: 1.3;
  }

  .post-container h2 {
    font-size: 1.15rem;
  }

  .post-container p,
  .post-container li {
    font-size: 0.97rem;
    line-height: 1.65;
  }

  .back-link {
    font-size: 0.9rem;
  }
}

/* =======================================
   RTL SUPPORT (Arabic posts)
======================================= */

.post-container:dir(rtl),
.post-container[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

.post-container:dir(rtl) .back-link,
.post-container[dir="rtl"] .back-link {
  direction: ltr;
  text-align: left;
}

/* =======================================
   READING PROGRESS BAR
======================================= */

#reading-progress {
  position: fixed;
  top: 80px; /* height of your fixed navbar */
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #4a3d9a, #1752a1, #108cce);
  z-index: 9999;
  transition: width 0.15s ease-out;
}
