/* ============================================================
   زنهار — Blog stylesheet
   Mirrors the design tokens from the homepage (site/index.html)
   and adds typography + layout for articles + listing page.
   ============================================================ */

:root {
  --primary: #2D6A4F;
  --primary-dark: #1E4A37;
  --primary-darker: #143228;
  --cream: #F5E9D3;
  --cream-soft: #FAF3E4;
  --cream-deep: #ECDDC0;
  --gold: #D4A574;
  --gold-soft: #E5C49A;
  --ink: #14271F;
  --muted: #5B6F66;
  --line: rgba(45, 106, 79, 0.12);
  --shadow-sm: 0 1px 2px rgba(20, 39, 31, 0.06), 0 2px 8px rgba(20, 39, 31, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 39, 31, 0.08), 0 12px 40px rgba(20, 39, 31, 0.06);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-weight: 400;
  line-height: 1.85;
  color: var(--ink);
  background: var(--cream-soft);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Sticky footer: body fills viewport, main grows to push footer down */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}

/* ===== Layout primitives ===== */
.container { width: min(1120px, 92%); margin-inline: auto; }

/* ===== Top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 243, 228, 0.88);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--primary-darker);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.brand-name {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
}
.topbar-actions {
  display: flex; align-items: center; gap: 22px;
}
.topbar-link {
  font-size: 15px; font-weight: 600;
  color: var(--primary-darker);
  text-decoration: none;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.topbar-link:hover { color: var(--primary); border-bottom-color: var(--gold); }
@media (max-width: 480px) {
  .topbar-actions { gap: 14px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-family: inherit; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: none; transition: transform .15s ease, box-shadow .25s ease, background .25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: var(--cream);
  box-shadow: 0 6px 18px rgba(45, 106, 79, 0.28), inset 0 1px 0 rgba(245, 233, 211, 0.15);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 26px rgba(45, 106, 79, 0.35), inset 0 1px 0 rgba(245, 233, 211, 0.18);
  transform: translateY(-1px);
}
.btn-bazaar-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* ===== Eyebrow chip ===== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(212, 165, 116, 0.18);
  color: var(--primary-darker);
  font-size: 14px; font-weight: 500;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.22);
}

/* ============================================================
   Blog index — listing page
   ============================================================ */
.blog-list {
  padding: clamp(48px, 8vw, 96px) 0 clamp(80px, 10vw, 120px);
}
.blog-list-head {
  text-align: center; max-width: 720px; margin: 0 auto 56px;
}
.blog-list-kicker {
  display: inline-block;
  font-size: 13px; font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.blog-list-title {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700; line-height: 1.35;
  color: var(--primary-darker);
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}
.blog-list-lead {
  font-size: 17px; color: var(--muted); line-height: 1.85; margin: 0;
}
.post-list {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.post-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.post-card a {
  display: block;
  padding: 28px 28px 26px;
  text-decoration: none;
  color: var(--ink);
}
.post-card time {
  display: block;
  font-size: 13px; color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.post-card h2 {
  font-size: 21px; font-weight: 700;
  color: var(--primary-darker);
  line-height: 1.5; letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.post-card p {
  font-size: 15px; color: var(--muted);
  line-height: 1.8; margin: 0;
}
.post-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted); font-size: 17px;
}

/* ============================================================
   Single post — article page
   ============================================================ */
.post {
  background:
    radial-gradient(40% 30% at 50% 0%, rgba(212, 165, 116, 0.10), transparent 70%),
    var(--cream-soft);
  padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 9vw, 100px);
}
.post-container { max-width: 760px; }

.post-header { margin-bottom: 48px; }
.post-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--primary);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color .15s ease;
}
.post-back:hover { color: var(--primary-dark); }
.post-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800; line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--primary-darker);
  margin: 0 0 20px;
}
.post-lead {
  font-size: 19px; line-height: 1.85;
  color: var(--muted);
  margin: 0 0 22px;
}
.post-meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: 14px; color: var(--muted);
}
.post-meta time { color: var(--gold); font-weight: 600; }

/* Post body typography */
.post-content {
  font-size: 17px;
  line-height: 1.95;
  color: var(--ink);
}
.post-content > * + * { margin-top: 1.4em; }
.post-content h2 {
  font-size: 26px; font-weight: 700;
  color: var(--primary-darker);
  line-height: 1.45; letter-spacing: -0.015em;
  margin-top: 2.2em; margin-bottom: 0.6em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--line);
}
.post-content h3 {
  font-size: 21px; font-weight: 700;
  color: var(--primary-darker);
  margin-top: 1.8em; margin-bottom: 0.5em;
  letter-spacing: -0.01em;
}
.post-content h4 {
  font-size: 17px; font-weight: 700;
  color: var(--primary-darker);
  margin-top: 1.5em; margin-bottom: 0.4em;
}
.post-content p {
  margin: 0;
}
.post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(45, 106, 79, 0.32);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color .15s ease, color .15s ease;
}
.post-content a:hover {
  color: var(--primary-dark);
  text-decoration-color: var(--gold);
}
.post-content strong { color: var(--primary-darker); font-weight: 700; }
.post-content em { font-style: italic; color: var(--ink); }
.post-content ul,
.post-content ol {
  margin: 0;
  padding-inline-start: 1.4em;
}
.post-content li { margin-bottom: 0.5em; }
.post-content li::marker { color: var(--gold); }
.post-content blockquote {
  margin: 1.6em 0;
  padding: 18px 24px;
  background: var(--cream);
  border-inline-start: 4px solid var(--gold);
  border-radius: 12px;
  color: var(--ink);
  font-size: 16.5px;
  font-style: normal;
}
.post-content blockquote p:first-child { margin-top: 0; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 2.2em 0;
}
.post-content img,
.post-content video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-inline: auto;
}
.post-content figure { margin: 1.6em 0; }
.post-content figcaption {
  margin-top: 8px;
  font-size: 13.5px; color: var(--muted); text-align: center;
}

/* Inline code + code blocks — force LTR */
.post-content code,
.post-content pre {
  font-family: 'JetBrains Mono', 'Fira Code', SFMono-Regular, Menlo, Monaco,
    'Cascadia Mono', 'Roboto Mono', Consolas, monospace;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}
.post-content code {
  background: rgba(45, 106, 79, 0.08);
  color: var(--primary-darker);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.88em;
}
.post-content pre {
  background: var(--primary-darker);
  color: var(--cream);
  padding: 18px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.7;
}
.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  margin: 1.6em 0;
}
.post-content th,
.post-content td {
  text-align: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.post-content th {
  background: var(--cream);
  color: var(--primary-darker);
  font-weight: 700;
}

/* Post CTA */
.post-cta {
  margin-top: 64px;
  padding: 40px 36px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  text-align: center;
}
.post-cta-arch {
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.post-cta h3 {
  font-size: 22px; font-weight: 700;
  color: var(--primary-darker);
  margin: 0 0 8px;
}
.post-cta p {
  font-size: 15.5px; color: var(--muted);
  margin: 0 0 22px;
}
.post-cta .btn { padding: 14px 26px; font-size: 16px; }

/* ============================================================
   Footer
   ============================================================ */
footer[role="contentinfo"] {
  padding: 36px 0 48px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 18px;
  color: var(--muted); font-size: 13px;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--primary-darker); font-weight: 600;
}
.footer-brand .brand-mark { width: 26px; height: 26px; border-radius: 8px; box-shadow: none; }
.footer-links {
  display: flex; gap: 18px; align-items: center;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: 13px; }

/* ============================================================
   Reduce-motion respect
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
