/* Shared blog stylesheet. Each article is a self-contained HTML
   file that links to this for layout + typography. */

:root {
  --bg: #2A1F18;
  --bg-soft: #3D2D24;
  --card: #3D2D24;
  --border: #5C463A;
  --text: #F4E8D7;
  --text-dim: #B8A488;
  --text-muted: #A09078;
  --accent: #D87060;
  --accent-2: #E8A547;
  --accent-glow: rgba(216, 112, 96, 0.35);
  --gradient: linear-gradient(135deg, #D87060 0%, #E8A547 100%);
}
:root[data-theme="light"] {
  --bg: #F4E8D7;
  --bg-soft: #FFFAF0;
  --card: #FBF1DD;
  --border: #D9C5A8;
  --text: #3F2A1F;
  --text-dim: #6E5240;
  --text-muted: #785A45;
  --accent-glow: rgba(216, 112, 96, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.rtl { direction: rtl; }
body.rtl[data-font="fa"] { font-family: 'Yekan Bakh', 'Plus Jakarta Sans', sans-serif; }
@font-face { font-family: 'Yekan Bakh'; src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; }
@font-face { font-family: 'Yekan Bakh'; src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; }

.app {
  min-height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
  padding-top:    calc(20px + env(safe-area-inset-top));
  padding-right:  calc(20px + env(safe-area-inset-right));
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  padding-left:   calc(20px + env(safe-area-inset-left));
}

.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.article-header .logo {
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.article-header .lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--card);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.article-header .lang-switcher a {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.article-header .lang-switcher a.active {
  background: var(--gradient);
  color: white;
}

article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  margin-bottom: 24px;
}
@media (max-width: 600px) {
  article { padding: 24px 20px; }
}

article h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}
@media (max-width: 600px) {
  article h1 { font-size: 26px; }
}
article .meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
article .lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 28px;
}
article h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--accent-2);
  scroll-margin-top: 20px;
}
article h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--text);
}
article p {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 16px;
  color: var(--text);
}
article ul, article ol {
  margin: 0 0 18px 22px;
}
body.rtl article ul, body.rtl article ol { margin: 0 22px 18px 0; }
article li {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 8px;
  color: var(--text);
}
article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
article a:hover { color: var(--accent-2); }
article strong { color: var(--text); font-weight: 700; }
article em { color: var(--text-dim); }
article code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
article blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 18px 0;
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
  font-style: italic;
}
body.rtl article blockquote {
  border-left: none;
  border-right: 3px solid var(--accent);
  border-radius: 8px 0 0 8px;
}

.cta-box {
  margin-top: 36px;
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.cta-box h3 {
  margin: 0 0 8px;
  color: var(--accent-2);
}
.cta-box p {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 14px;
}
.cta-box .btn {
  display: inline-block;
  background: var(--gradient);
  color: white;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-box .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
  color: white;
}

.faq dt {
  font-weight: 700;
  margin-top: 16px;
  color: var(--text);
}
.faq dd {
  margin: 6px 0 0 0;
  color: var(--text-dim);
  line-height: 1.6;
}

footer.article-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
}
footer.article-footer a {
  color: var(--text-dim);
  text-decoration: none;
}
footer.article-footer a:hover { color: var(--accent); }

.related-posts {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.related-posts h3 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.related-posts ul { margin: 0; list-style: none; padding: 0; }
.related-posts li { margin-bottom: 6px; }
.related-posts a { color: var(--text-dim); text-decoration: none; font-size: 14px; }
.related-posts a:hover { color: var(--accent); }
