/* ==========================================================================
   واژه‌یار — «آموزش» (learn.php). An editorial page of its own, on the landing's tokens. RTL-first, mobile-first, light/dark.
   ========================================================================== */
@font-face { font-family: "Yekan Bakh"; src: url("../fonts/yekanbakh.woff2?v=1") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Outfit"; src: url("../fonts/outfit.woff2?v=5") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #fbfaff; --surface: #fff; --soft: #f3f0ff; --ink: #1b1838; --ink-2: #47436b; --muted: #6f6b93; --line: #e6e1f7;
  --brand: #6c5ce7; --on-brand: #fff; --brand-soft: #efeaff; --accent: #ff7a59; --good: #16a34a; --bad: #e5573f;
  --font: "Yekan Bakh", "Outfit", Tahoma, system-ui, -apple-system, "Segoe UI", sans-serif; --en: "Outfit", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0c1e; --surface: #1a1835; --soft: #201d40; --ink: #f3f1ff; --ink-2: #cfcbf0; --muted: #9b98bd; --line: #2b2852;
    --brand: #a597ff; --on-brand: #14112e; --brand-soft: #262250; --good: #4ade80; --bad: #ff8d78; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0c1e; --surface: #1a1835; --soft: #201d40; --ink: #f3f1ff; --ink-2: #cfcbf0; --muted: #9b98bd; --line: #2b2852;
  --brand: #a597ff; --on-brand: #14112e; --brand-soft: #262250; --good: #4ade80; --bad: #ff8d78; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.8; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
.en { font-family: var(--en); direction: ltr; unicode-bidi: isolate; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.draft-bar { margin: 0; padding: 7px 16px; text-align: center; background: var(--accent); color: #1b1838; font-weight: 800; font-size: .84rem; }

.nav { display: flex; align-items: center; gap: 20px; height: 62px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.1rem; }
.nav nav { display: none; flex: 1; gap: 18px; font-size: .9rem; font-weight: 700; color: var(--muted); }
.nav nav .on { color: var(--brand); }
.inst { margin-inline-start: auto; padding: 7px 14px; border-radius: 12px; background: var(--brand); color: var(--on-brand); font-size: .82rem; font-weight: 800; }

.hero { padding: 34px 0 18px; }
.hero h1 { margin: 0 0 6px; font-size: 1.85rem; font-weight: 900; line-height: 1.4; letter-spacing: -.3px; }
.hero p { margin: 0 0 16px; color: var(--ink-2); font-size: .98rem; }
.hero.empty { text-align: center; padding: 40px 0 60px; }
.hero.empty img { margin: 0 auto 12px; }
.btn { display: inline-block; padding: 9px 18px; border-radius: 13px; background: var(--brand); color: var(--on-brand); font-weight: 800; }
.search { display: flex; align-items: center; gap: 8px; max-width: 520px; padding: 4px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.search:focus-within { border-color: var(--brand); }
.search input { flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: .95rem; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 6px; }
.cats a { padding: 6px 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .82rem; font-weight: 800; }
.cats a.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.tag { display: inline-block; color: var(--c, var(--brand)); font-size: .76rem; font-weight: 800; }
.meta { color: var(--muted); font-size: .76rem; }
.lead-card { display: grid; margin: 12px 0 28px; overflow: hidden; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.lead-card img { width: 100%; height: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.lead-card div { align-self: center; padding: 18px 20px 20px; }
.lead-card h2 { margin: 2px 0 8px; font-size: 1.32rem; font-weight: 900; line-height: 1.5; }
.lead-card p { margin: 0 0 8px; color: var(--ink-2); font-size: .92rem; }
.h-sec { margin: 6px 0 12px; }
.h-sec h2 { margin: 0; font-size: 1.14rem; font-weight: 900; }
.grid { display: grid; gap: 18px; margin-bottom: 30px; }
.post { display: block; }
.post img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 16px; margin-bottom: 8px; }
.post h3 { margin: 0 0 2px; font-size: .98rem; font-weight: 800; line-height: 1.6; }
.lead-card:hover h2, .post:hover h3 { color: var(--brand); }
.band { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin: 4px 0 28px; padding: 22px 22px 56px; overflow: hidden; border-radius: 24px; background: #1b1838; color: #fff; }
.band b { display: block; font-size: 1.14rem; font-weight: 900; }
.band p { margin: 0; color: #cfcbf0; font-size: .9rem; }
.band a { padding: 9px 16px; border-radius: 13px; background: #fff; color: #1b1838; font-size: .86rem; font-weight: 800; }
.band img { position: absolute; left: 18px; bottom: -18px; width: 96px; }
.foot { padding: 18px 16px 74px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .78rem; }

.crumb { padding: 16px 0 6px; color: var(--muted); font-size: .76rem; }
.art-head h1 { margin: 2px 0 8px; font-size: 1.72rem; font-weight: 900; line-height: 1.5; letter-spacing: -.3px; }
.dek { margin: 0 0 10px; color: var(--ink-2); font-size: 1rem; }
.byline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 14px; color: var(--muted); font-size: .78rem; }
.cover { width: 100%; max-width: 780px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 20px; margin-bottom: 16px; }
.layout { display: grid; gap: 28px; padding-bottom: 12px; }
.side { display: none; }
.toc { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-size: .84rem; }
.toc b { display: block; margin-bottom: 4px; font-weight: 900; }
.toc a { display: block; padding: 4px 0; color: var(--ink-2); line-height: 1.6; }
.toc a.on { color: var(--brand); font-weight: 800; }
.side-cta { margin-top: 12px; padding: 16px; border-radius: 18px; background: var(--brand-soft); text-align: center; font-size: .86rem; }
.side-cta img { margin: 0 auto 6px; }
.side-cta b { display: block; font-weight: 900; line-height: 1.6; }
.side-cta a { display: block; margin-top: 10px; padding: 8px; border-radius: 12px; background: var(--brand); color: var(--on-brand); font-weight: 800; }

.body { min-width: 0; max-width: 680px; font-size: 1.02rem; line-height: 2.05; }
.body h2 { margin: 28px 0 6px; font-size: 1.24rem; font-weight: 900; line-height: 1.6; scroll-margin-top: 14px; }
.body p { margin: 0 0 12px; color: var(--ink-2); }
.body ul { margin: 0 0 12px; padding-inline-start: 20px; color: var(--ink-2); }
.body a { color: var(--brand); font-weight: 700; }
.body b { color: var(--ink); }
.tldr { margin-bottom: 18px; padding: 14px 18px; border-radius: 18px; background: var(--soft); font-size: .94rem; line-height: 1.95; }
.tldr b { display: block; font-weight: 900; }
.tldr ul { margin: 4px 0 0; }
.boxes { display: grid; gap: 6px; align-items: end; margin: 14px 0 6px; }
.boxes div { padding: 8px 2px; border-radius: 12px; background: var(--brand); color: var(--on-brand); text-align: center; font-size: .86rem; font-weight: 800; line-height: 1.5; }
.boxes small { display: block; font-size: .68rem; font-weight: 600; opacity: .85; }
.try { margin: 20px 0; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--brand); }
.try .tag { display: block; }
.try > b { display: block; margin-bottom: 8px; font-size: 1rem; font-weight: 900; line-height: 1.8; }
.opts { display: grid; gap: 7px; }
.opts button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--ink-2); font: inherit; font-size: .9rem; text-align: start; cursor: pointer; }
.opts button:hover:enabled { border-color: var(--brand); }
.opts button:disabled { cursor: default; }
.opts .ok { border-color: var(--good); color: var(--good); font-weight: 800; }
.opts .no { border-color: var(--bad); color: var(--bad); }
.try small { display: none; margin-top: 8px; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.try.done small { display: block; }
.inline-cta { display: flex; align-items: center; gap: 12px; margin: 22px 0; padding: 16px 18px; border-radius: 20px; background: linear-gradient(135deg, #6c5ce7, #8e7bff 60%, #ff7a9e 130%); color: #fff; }
.inline-cta img { flex: none; width: 58px; padding: 7px; border-radius: 16px; background: #fff; }
.inline-cta b { display: block; color: #fff; font-size: 1rem; font-weight: 900; line-height: 1.6; }
.inline-cta span { display: block; font-size: .84rem; line-height: 1.8; opacity: .92; }
.body .inline-cta a { display: inline-block; margin-top: 8px; padding: 6px 13px; border-radius: 11px; background: #fff; color: #4a3cc4; font-size: .84rem; font-weight: 800; }
.faq details { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .94rem; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq p { margin: 6px 0 0; font-size: .92rem; }
.note { margin: 12px 0 16px; padding-inline-start: 12px; border-inline-start: 3px solid var(--accent); color: var(--muted); font-size: .86rem; line-height: 1.9; }
.tbl-scroll { margin: 10px 0 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.7; }
th, td { padding: 8px 12px; text-align: start; border-top: 1px solid var(--line); color: var(--ink-2); }
th { border-top: 0; background: var(--soft); color: var(--ink); font-weight: 800; }
.read-on { display: block; margin: 20px 0; padding: 12px 16px; border-radius: 16px; background: var(--soft); border-inline-start: 4px solid var(--brand); }
.body .read-on b { display: block; color: var(--brand); font-size: .98rem; font-weight: 800; line-height: 1.7; }
.read-on small { color: var(--muted); font-size: .76rem; font-weight: 700; }
.foot-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 10px; }
.dock { position: fixed; inset: auto 0 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); font-size: .84rem; font-weight: 800; }
.dock a { padding: 6px 15px; border-radius: 11px; background: var(--brand); color: var(--on-brand); }

@media (min-width: 760px) {
  .nav, .wrap { padding-inline: 20px; }
  .nav nav { display: flex; }
  .inst { margin-inline-start: 0; }
  .hero h1 { font-size: 2.5rem; }
  .lead-card { grid-template-columns: 1.15fr 1fr; }
  .lead-card h2 { font-size: 1.62rem; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .band { flex-direction: row; align-items: center; justify-content: space-between; padding: 24px 28px 24px 156px; }
  .band img { width: 112px; bottom: -22px; }
  .art-head { max-width: 780px; }
  .art-head h1 { font-size: 2.3rem; }
  .layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .side { display: block; position: sticky; top: 14px; align-self: start; }
  .dock { display: none; }
  .foot { padding-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
