/* =========================================================
   Post body — typography & layout (Persian/RTL)
   ========================================================= */
.post-body {
  max-width: 820px;
  margin-inline: auto;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 2.2rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.12);
}

.post-heading {
  position: relative;
  margin-bottom: 2rem;
  padding: 0 0 1.75rem;
  border-bottom: 1px solid var(--color-border);
}

.post-heading h1 {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.55;
  margin-top: 0.65rem;
  letter-spacing: -0.02em;
}

.post-body h2 {
  position: relative;
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.6rem;
  margin-bottom: 0.85rem;
  padding-right: 1rem;
}

.post-body h2::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0.35rem;
  width: 4px;
  height: 1.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--color-accent) 0%, #7c3aed 100%);
}

.post-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.85rem;
  margin-bottom: 0.6rem;
}

.post-body p {
  margin-bottom: 1.35rem;
  color: var(--color-text);
  line-height: 2.1;
}

.post-body ul,
.post-body ol {
  padding-right: 1.6rem;
  padding-left: 0;
  margin-bottom: 1.35rem;
}

.post-body li {
  margin-bottom: 0.55rem;
  line-height: 1.9;
}

.post-body li::marker {
  color: var(--color-accent);
}

.post-body strong {
  font-weight: 700;
}

/* Inline code — always LTR */
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background-color: #eef2ff;
  color: #3730a3;
  padding: 0.15rem 0.45rem;
  border-radius: 8px;
  direction: ltr;
  unicode-bidi: embed;
  display: inline-block;
}

/* Code blocks */
.post-body pre {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    #111827;
  color: #dbe4ff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.75;
  padding: 1.3rem 1.4rem;
  border-radius: 16px;
  overflow-x: auto;
  margin-bottom: 1.65rem;
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 30px rgba(15, 23, 42, 0.28);
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
  direction: ltr;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.45rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.post-body th,
.post-body td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
}

.post-body th {
  font-weight: 700;
  background: #f8fafc;
}

.post-body tr:last-child td {
  border-bottom: none;
}

/* Post footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-start;
}

.post-footer .read-more {
  padding: 0.8rem 1.1rem;
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.post-footer .read-more:hover {
  background: #dbeafe;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.12);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .post-body {
    padding: 1.5rem;
    border-radius: 22px;
  }

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

@media (max-width: 600px) {
  .post-body {
    padding: 1.1rem;
  }

  .post-heading h1 {
    font-size: 1.5rem;
  }

  .post-body h2 {
    font-size: 1.2rem;
  }

  .post-body pre {
    font-size: 0.78rem;
    padding: 1rem;
  }
}

html[data-theme="dark"] .post-body {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(100, 116, 139, 0.35);
  box-shadow: 0 24px 58px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .post-body code {
  background-color: var(--code-inline-bg);
  color: var(--code-inline-text);
}

html[data-theme="dark"] .post-body th {
  background: rgba(30, 41, 59, 0.9);
}

html[data-theme="dark"] .post-footer .read-more {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(100, 116, 139, 0.35);
}

html[data-theme="dark"] .post-footer .read-more:hover {
  background: rgba(51, 65, 85, 0.9);
}
