/* آسا بلاگ — شیوه‌نامه مشترک */

:root {
  --fg: #1f2328;
  --muted: #656d76;
  --line: #d8dee4;
  --bg: #fff;
  --bg-soft: #f6f8fa;
  --accent: #0969da;
  --gold: #9a6700;
  --up: #1a7f37;
  --down: #cf222e;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6edf3;
    --muted: #8b949e;
    --line: #30363d;
    --bg: #0d1117;
    --bg-soft: #161b22;
    --accent: #4493f8;
    --gold: #e3b341;
    --up: #3fb950;
    --down: #f85149;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.95;
  font-family: Tahoma, "Segoe UI", Vazirmatn, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------- سربرگ ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  margin-bottom: 34px;
  background: var(--bg);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
}

.brand img { width: 30px; height: 30px; }
.brand b { font-size: 1.08rem; }
.brand span { display: block; color: var(--muted); font-size: 0.76rem; line-height: 1.4; }

.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.nav a:hover { text-decoration: underline; }
.nav a.current { color: var(--fg); font-weight: bold; }

/* ---------- نوار نرخ‌ها ---------- */

.ticker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 12px 14px;
  margin-bottom: 34px;
  display: flex;
  gap: 10px 26px;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

.ticker div { display: flex; align-items: baseline; gap: 6px; }
.ticker b { font-weight: normal; color: var(--muted); }
.ticker .val { font-weight: bold; }
.ticker .up { color: var(--up); font-size: 0.78rem; }
.ticker .down { color: var(--down); font-size: 0.78rem; }
.ticker .note { color: var(--muted); font-size: 0.74rem; width: 100%; }

/* ---------- مطلب شاخص ---------- */

.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}

.hero img { width: 100%; }
.hero .body { padding: 20px 22px 24px; }
.hero h2 { margin: 0 0 8px; font-size: 1.35rem; line-height: 1.6; }
.hero h2 a { color: var(--fg); text-decoration: none; }
.hero h2 a:hover { color: var(--accent); }
.hero p { margin: 12px 0 0; color: var(--fg); }

/* ---------- کارت‌ها ---------- */

.section-title {
  font-size: 1.05rem;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
  margin-bottom: 44px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img { width: 100%; }
.card .body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 6px; font-size: 1rem; line-height: 1.7; }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }

.meta { color: var(--muted); font-size: 0.78rem; display: flex; gap: 10px; flex-wrap: wrap; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  text-decoration: none;
}

/* ---------- متن مطلب ---------- */

.prose { font-size: 15.5px; }
.prose h2 { font-size: 1.15rem; margin: 38px 0 10px; }
.prose h3 { font-size: 1.02rem; margin: 28px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-inline-start: 22px; }
.prose li { margin-bottom: 8px; }
.prose blockquote {
  margin: 22px 0;
  padding: 2px 16px;
  border-inline-start: 3px solid var(--gold);
  color: var(--muted);
}

.post-title { font-size: 1.6rem; line-height: 1.6; margin: 0 0 10px; }
.lead { font-size: 1.02rem; color: var(--muted); margin: 0 0 26px; }

figure { margin: 28px 0; }
figure img { border: 1px solid var(--line); border-radius: var(--radius); width: 100%; }
figcaption { color: var(--muted); font-size: 0.8rem; margin-top: 8px; text-align: center; }

.callout {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 26px 0;
  font-size: 0.92rem;
}

.callout b { display: block; margin-bottom: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

th, td { border: 1px solid var(--line); padding: 9px 12px; text-align: start; }
th { background: var(--bg-soft); font-weight: bold; }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin: 0 0 30px;
  font-size: 0.9rem;
}

.toc b { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-inline-start: 20px; }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- فهرست بایگانی ---------- */

.posts { list-style: none; padding: 0; margin: 0; }

.posts li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.posts a { color: var(--fg); text-decoration: none; }
.posts a:hover { color: var(--accent); }
.posts time { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

.year { margin: 34px 0 10px; font-size: 1rem; color: var(--muted); }

/* ---------- پانوشت ---------- */

.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 20px;
  font-size: 0.9rem;
}

.prev-next a { text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 50px;
  padding: 26px 0 44px;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px 30px;
  margin-bottom: 22px;
}

.site-footer h4 { margin: 0 0 8px; font-size: 0.88rem; color: var(--fg); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 5px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal { border-top: 1px solid var(--line); padding-top: 16px; font-size: 0.8rem; }
