/* ═══════════════════════════════════════════════════════════════════
   دانشنامه فرش پلاس — زبان بصری «دار و گره»
   رنگ‌ها از رنگرزی سنتی: لاکی (روناس)، سرمه‌ای (نیل)، طلایی (اسپرک)،
   فیروزه‌ای و کرمِ پشم. صفحه مثل یک قالی قاب دارد: حاشیه بالا، ریشه پایین.
   ═══════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Vazirmatn";
  src: url("../vendor/vazirmatn/vazirmatn-arabic-wght-normal.05d9ce2a23d3.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../vendor/vazirmatn/vazirmatn-latin-wght-normal.e7eada615dc3.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #F7F1E6; --paper-2: #EFE4D0; --card: #FFFCF6; --ink: #2B211B; --ink-2: #5A4B3F; --muted: #85766A;
  --lacquer: #A12B2B; --lacquer-2: #C23B35; --navy: #1E2A47; --navy-2: #263559; --gold: #C8963E; --gold-2: #E2B866;
  --teal: #2C7A78; --madder: #C9603A; --wool: #F3E9D2;
  --line: rgba(43, 33, 27, .12); --line-2: rgba(43, 33, 27, .2); --dot: rgba(43, 33, 27, .07);
  --shadow: 0 1px 2px rgba(43,33,27,.06), 0 8px 24px -12px rgba(43,33,27,.25);
  --radius: 14px; --header-h: 64px;
  --bs-body-font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --bs-body-bg: var(--paper); --bs-body-color: var(--ink); --bs-border-color: var(--line);
  --bs-link-color: var(--lacquer); --bs-link-hover-color: var(--lacquer-2);
  --bs-link-color-rgb: 161, 43, 43; --bs-link-hover-color-rgb: 194, 59, 53;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111726; --paper-2: #182036; --card: #19223A; --ink: #F1E8D8; --ink-2: #D2C5AE; --muted: #9D927F;
    --lacquer: #E36A5E; --lacquer-2: #F0877A; --navy: #0C1222; --navy-2: #2A3A63; --gold: #E1B45E; --gold-2: #F0CD86;
    --teal: #5DB6B0; --line: rgba(241,232,216,.12); --line-2: rgba(241,232,216,.2); --dot: rgba(241,232,216,.05);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
    --bs-link-color-rgb: 227, 106, 94; --bs-link-hover-color-rgb: 240, 135, 122;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111726; --paper-2: #182036; --card: #19223A; --ink: #F1E8D8; --ink-2: #D2C5AE; --muted: #9D927F;
  --lacquer: #E36A5E; --lacquer-2: #F0877A; --navy: #0C1222; --navy-2: #2A3A63; --gold: #E1B45E; --gold-2: #F0CD86;
  --teal: #5DB6B0; --line: rgba(241,232,216,.12); --line-2: rgba(241,232,216,.2); --dot: rgba(241,232,216,.05);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
  --bs-link-color-rgb: 227, 106, 94; --bs-link-hover-color-rgb: 240, 135, 122;
  color-scheme: dark;
}

html { scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  font-family: var(--bs-body-font-family); background-color: var(--paper); color: var(--ink);
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.3px);
  background-size: 14px 14px; /* کاغذ شطرنجی نقشه‌کش */
  font-feature-settings: "ss01"; text-rendering: optimizeLegibility; line-height: 1.9;
}
a { text-decoration: none; color: var(--lacquer); }
a:hover { color: var(--lacquer-2); }
::selection { background: var(--gold-2); color: #2B211B; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -60px; background: var(--navy); color: #fff; padding: .5rem 1rem; border-radius: 8px; z-index: 2000; }
.skip-link:focus { top: .75rem; color: #fff; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -.01em; line-height: 1.5; color: var(--ink); }

/* ── حاشیهٔ قالی (نوار تکرارشونده) و ریشه ─────────────────────────── */
.band {
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='18'%3E%3Crect width='36' height='18' fill='%231E2A47'/%3E%3Crect y='1.5' width='36' height='1' fill='%23C8963E'/%3E%3Crect y='15.5' width='36' height='1' fill='%23C8963E'/%3E%3Cpath d='M9 4.2l4.8 4.8L9 13.8 4.2 9z' fill='%23A12B2B'/%3E%3Cpath d='M9 6.8 11.2 9 9 11.2 6.8 9z' fill='%23F3E9D2'/%3E%3Ccircle cx='27' cy='9' r='2.1' fill='%23C8963E'/%3E%3Ccircle cx='27' cy='9' r='.8' fill='%231E2A47'/%3E%3Cpath d='M15 9h6M33 9h3M0 9h3' stroke='%23F3E9D2' stroke-width='.8'/%3E%3C/svg%3E") repeat-x center / 36px 18px;
}
.fringe {
  height: 26px; background: repeating-linear-gradient(90deg, var(--wool) 0 2px, transparent 2px 7px);
  -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent);
  transform-origin: top; transition: transform .6s cubic-bezier(.3,1.6,.5,1);
}
.site-footer:hover .fringe { transform: skewX(-8deg); }

/* ── سربرگ ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 1030; background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.site-header .container-xl { min-height: calc(var(--header-h) - 18px); }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.brand:hover .brand-mark { transform: rotate(90deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-weight: 900; font-size: 1.15rem; }
.brand-text small { font-size: .78rem; color: var(--lacquer); font-weight: 700; letter-spacing: .02em; }
.main-nav { gap: .15rem; }
.main-nav a { color: var(--ink-2); font-weight: 600; font-size: .92rem; padding: .35rem .65rem; border-radius: 999px; transition: background .2s, color .2s; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--paper-2); color: var(--ink); }
.header-search { position: relative; display: flex; align-items: center; width: min(360px, 42vw); }
.header-search input {
  width: 100%; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: .5rem 1rem .5rem 2.6rem; font: inherit; font-size: .92rem; transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); }
.header-search button { position: absolute; inset-inline-end: .35rem; border: 0; background: var(--navy); color: var(--wool); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn { border: 0; background: transparent; color: var(--ink-2); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
@media (max-width: 575.98px) {
  .brand-text small { display: none; }
  .header-search { width: auto; flex: 1; }
  .header-search input { padding-inline-start: .8rem; font-size: .88rem; }
}

/* پیشنهادهای زندهٔ جستجو */
.suggest-box { position: absolute; top: calc(100% + 6px); inset-inline: 0; min-width: 280px; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 50; }
.suggest-box a { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem .9rem; color: var(--ink); font-size: .92rem; border-bottom: 1px solid var(--line); }
.suggest-box a:last-child { border-bottom: 0; }
.suggest-box a:hover, .suggest-box a.active { background: var(--paper-2); }
.suggest-box .kind { font-size: .72rem; color: var(--muted); white-space: nowrap; align-self: center; }
.suggest-box .kind b { color: var(--lacquer); font-weight: 700; }

/* نوار پیشرفت مطالعه: یک رشتهٔ پود که از راست به چپ رد می‌شود */
.warp-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 1040; pointer-events: none; }
.warp-progress span { display: block; height: 100%; width: 100%; transform-origin: right; transform: scaleX(0);
  background: repeating-linear-gradient(90deg, var(--lacquer) 0 10px, var(--gold) 10px 16px, var(--navy-2) 16px 22px); }

/* منوی موبایل */
.menu-canvas { background: var(--paper); color: var(--ink); }
.menu-list, .menu-list ul { list-style: none; padding: 0; margin: 0; }
.menu-list > li > a { display: flex; gap: .6rem; align-items: center; padding: .6rem .25rem; font-weight: 700; color: var(--ink); border-bottom: 1px dashed var(--line-2); }
.menu-list ul a { display: block; padding: .35rem 2rem .35rem 0; color: var(--ink-2); font-size: .92rem; }
.ico { flex-shrink: 0; color: var(--lacquer); }

/* مسیر */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; padding: 0; margin: 1rem 0 0; font-size: .82rem; color: var(--muted); }
.crumbs li + li::before { content: "◂"; margin-inline-end: .35rem; color: var(--gold); font-size: .7rem; }
.crumbs a { color: var(--ink-2); }

/* ── دکمه‌ها و برچسب‌ها ────────────────────────────────────────────── */
.btn { font-weight: 700; border-radius: 999px; padding-inline: 1.2rem; }
.btn-lacquer { --bs-btn-bg: var(--lacquer); --bs-btn-color: #fff; --bs-btn-border-color: var(--lacquer); --bs-btn-hover-bg: var(--lacquer-2); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--lacquer-2); --bs-btn-active-bg: var(--lacquer); --bs-btn-active-color:#fff; }
.btn-gold { --bs-btn-bg: var(--gold); --bs-btn-color: #2B211B; --bs-btn-border-color: var(--gold); --bs-btn-hover-bg: var(--gold-2); --bs-btn-hover-color: #2B211B; --bs-btn-hover-border-color: var(--gold-2); }
.btn-line { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line-2); --bs-btn-hover-bg: var(--paper-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line-2); }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .7rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: .8rem; font-weight: 600; border: 1px solid var(--line); }
a.chip:hover { background: var(--card); color: var(--lacquer); border-color: var(--gold); }
.chip-cat { background: color-mix(in srgb, var(--lacquer) 10%, transparent); color: var(--lacquer); border-color: transparent; }

/* ── کارت با لچک (گوشه‌بندیِ قالی) ─────────────────────────────────── */
.lachak { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; isolation: isolate; }
.lachak::before, .lachak::after {
  content: ""; position: absolute; width: 58px; height: 58px; z-index: -1; opacity: .9; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='58' height='58'%3E%3Cpath d='M58 0H0c16 4 26 10 32 24 14 6 22 16 26 34z' fill='%23C8963E' fill-opacity='.18'/%3E%3Cpath d='M58 0H22c10 3 16 8 20 14 6 4 12 10 16 22z' fill='%23A12B2B' fill-opacity='.2'/%3E%3Ccircle cx='47' cy='11' r='2.4' fill='%23A12B2B' fill-opacity='.45'/%3E%3C/svg%3E") no-repeat;
}
.lachak::before { top: 0; right: 0; }
.lachak::after { bottom: 0; left: 0; transform: rotate(180deg); }

.a-card { display: flex; flex-direction: column; height: 100%; padding: 1.2rem 1.25rem 1.1rem; color: var(--ink); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s; }
.a-card:hover { transform: translateY(-4px); color: var(--ink); border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: 0 18px 40px -20px rgba(161,43,43,.45); }
.a-card h3 { font-size: 1.07rem; margin: .45rem 0 .35rem; }
.a-card p { color: var(--ink-2); font-size: .9rem; line-height: 1.85; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.a-card .meta { margin-top: auto; padding-top: .75rem; font-size: .76rem; color: var(--muted); display: flex; gap: .75rem; }
.a-card .en { font-size: .75rem; color: var(--muted); direction: ltr; text-align: end; font-weight: 500; letter-spacing: .02em; }
.star { color: var(--gold); }

/* ── صفحهٔ اصلی ─────────────────────────────────────────────────────── */
.hero { position: relative; padding: 2.5rem 0 3rem; overflow: hidden; }
.hero-title { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 900; line-height: 1.3; margin: .6rem 0 1rem; }
.hero-title .knot { color: var(--lacquer); position: relative; white-space: nowrap; }
.hero-title .knot::after { content: ""; position: absolute; inset-inline: 0; bottom: .08em; height: .18em; background: repeating-linear-gradient(90deg, var(--gold) 0 6px, transparent 6px 9px); border-radius: 3px; opacity: .8; }
.hero-kicker { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .85rem; color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); padding: .3rem .8rem; border-radius: 999px; }
.hero-lead { font-size: 1.1rem; color: var(--ink-2); max-width: 36rem; }
.hero-search { position: relative; max-width: 36rem; margin: 1.6rem 0 1rem; }
.hero-search input { width: 100%; font: inherit; font-size: 1.08rem; padding: 1rem 1.3rem 1rem 8.2rem; border-radius: 18px; border: 2px solid var(--navy-2); background: var(--card); color: var(--ink); box-shadow: 0 10px 0 -4px var(--navy-2); transition: box-shadow .2s, transform .2s; }
.hero-search input:focus { outline: none; transform: translateY(-2px); box-shadow: 0 12px 0 -4px var(--gold); border-color: var(--gold); }
.hero-search button { position: absolute; inset-inline-end: .5rem; top: .5rem; bottom: .5rem; border-radius: 12px; border: 0; background: var(--lacquer); color: #fff; font-weight: 800; padding-inline: 1.2rem; }
.hero-search .suggest-box { top: calc(100% + 14px); }
.try { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.stats { display: flex; gap: 1.5rem; margin-top: 1.8rem; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.8rem; font-weight: 900; color: var(--navy-2); line-height: 1.1; }
:root[data-theme="dark"] .stat b { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat b { color: var(--gold); } }
.stat span { font-size: .82rem; color: var(--muted); }

/* صحنهٔ دار قالی */
.loom-stage { position: relative; max-width: 520px; margin-inline: auto; }
.loom-stage svg.loom { width: 100%; height: auto; display: block; overflow: hidden; pointer-events: none; }
.loom-canvas { position: absolute; image-rendering: pixelated; }
.loom-controls { display: flex; justify-content: center; align-items: center; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 700; font-size: .88rem; padding: .35rem 1rem; border-radius: 999px; transition: background .25s, color .25s; }
.seg button[aria-pressed="true"] { background: var(--navy-2); color: var(--wool); }
.loom-caption { text-align: center; font-size: .84rem; color: var(--muted); min-height: 3.2em; margin: .5rem auto 0; max-width: 28rem; }
.loom-caption b { color: var(--lacquer); }
.loom-counter { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); padding: .25rem .7rem; border-radius: 999px; }

/* دروازه‌های اصلی: ماشینی و دستباف */
.section { padding: 3rem 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); margin: 0; display: flex; align-items: center; gap: .6rem; }
.sec-head h2::before { content: ""; width: 26px; height: 26px; flex-shrink: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l4 7 7 4-7 4-4 7-4-7-7-4 7-4z' fill='%23A12B2B'/%3E%3Cpath d='M12 7l2 3 3 2-3 2-2 3-2-3-3-2 3-2z' fill='%23C8963E'/%3E%3C/svg%3E") center/contain no-repeat; }
.sec-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.portal { position: relative; border-radius: 22px; overflow: hidden; color: var(--wool); padding: 2rem; min-height: 100%; display: flex; flex-direction: column; isolation: isolate; box-shadow: var(--shadow); }
.portal::before { content: ""; position: absolute; inset: 0; z-index: -2; }
.portal::after { content: ""; position: absolute; inset: 10px; border: 1.5px dashed rgba(243,233,210,.35); border-radius: 14px; z-index: -1; pointer-events: none; }
.portal-machine::before { background:
  repeating-linear-gradient(90deg, rgba(243,233,210,.07) 0 1px, transparent 1px 8px),
  repeating-linear-gradient(0deg, rgba(243,233,210,.05) 0 1px, transparent 1px 8px),
  linear-gradient(135deg, #1E2A47, #2A3A63 60%, #1E2A47); }
.portal-hand::before { background:
  radial-gradient(circle at 20% 110%, rgba(200,150,62,.35), transparent 40%),
  radial-gradient(circle at 90% -10%, rgba(243,233,210,.15), transparent 35%),
  linear-gradient(135deg, #8E2424, #A12B2B 55%, #7A1E1F); }
.portal h2 { color: var(--wool); font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 900; margin: .3rem 0 .5rem; }
.portal p { color: rgba(243,233,210,.85); max-width: 32rem; }
.portal .tag-top { font-size: .8rem; font-weight: 800; letter-spacing: .05em; color: var(--gold-2); }
.portal ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem 1rem; }
.portal li a { display: flex; align-items: center; gap: .45rem; color: var(--wool); padding: .3rem 0; font-weight: 600; font-size: .93rem; border-bottom: 1px dotted rgba(243,233,210,.25); }
.portal li a::before { content: ""; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); flex-shrink: 0; }
.portal li a:hover { color: #fff; }
.portal .btn { align-self: flex-start; margin-top: auto; }
.portal-deco { position: absolute; inset-inline-end: -40px; bottom: -40px; width: 220px; height: 220px; opacity: .22; z-index: -1; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 575.98px) { .portal { padding: 1.4rem; } .portal ul { grid-template-columns: 1fr; } }

.cat-tile { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; color: var(--ink); height: 100%; transition: transform .3s, border-color .3s; }
.cat-tile:hover { color: var(--ink); transform: translateY(-3px); border-color: var(--gold); }
.cat-tile .ico-wrap { width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--lacquer) 10%, var(--paper-2)); display: grid; place-items: center; flex-shrink: 0; transform: rotate(45deg); }
.cat-tile .ico-wrap .ico { transform: rotate(-45deg); }
.cat-tile h3 { font-size: 1rem; margin: 0 0 .15rem; }
.cat-tile p { font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.7; }

/* واژهٔ روز و «آیا می‌دانستید» */
.word-day { background: var(--navy); color: var(--wool); border-radius: 22px; padding: 1.8rem; position: relative; overflow: hidden; height: 100%; }
.word-day::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M20 4l6 10 10 6-10 6-6 10-6-10-10-6 10-6z' fill='none' stroke='%23C8963E' stroke-opacity='.18'/%3E%3C/svg%3E"); pointer-events: none; }
.word-day .label { color: var(--gold-2); font-size: .8rem; font-weight: 800; }
.word-day h3 { color: #fff; font-size: 2rem; font-weight: 900; margin: .4rem 0 0; }
.word-day .en { direction: ltr; text-align: end; color: rgba(243,233,210,.6); font-size: .9rem; }
.word-day p { color: rgba(243,233,210,.88); margin: 1rem 0; }
.word-day a { color: var(--gold-2); font-weight: 700; position: relative; z-index: 1; }
.facts { counter-reset: fact; list-style: none; padding: 0; margin: 0; }
.facts li { counter-increment: fact; position: relative; padding: .9rem 3rem .9rem 0; border-bottom: 1px dashed var(--line-2); }
.facts li::before { content: counter(fact, persian); position: absolute; right: 0; top: .85rem; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; background: var(--paper-2); color: var(--lacquer); font-weight: 900; border-radius: 50%; }
.facts a { color: var(--ink); font-weight: 800; }
.facts p { margin: .15rem 0 0; font-size: .9rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── صفحهٔ مقاله ───────────────────────────────────────────────────── */
.article-head { padding: 1.4rem 0 1rem; }
.article-head h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; margin: .5rem 0 .2rem; }
.article-head .en { direction: ltr; text-align: end; color: var(--muted); font-size: .95rem; font-weight: 500; letter-spacing: .02em; }
.byline { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--muted); font-size: .82rem; margin-top: .6rem; }
.byline span { display: inline-flex; align-items: center; gap: .3rem; }
.byline .ok { color: var(--teal); font-weight: 700; }
.lead-box { font-size: 1.12rem; line-height: 2.05; color: var(--ink); border-inline-start: 4px solid var(--gold); padding: .3rem 1.1rem .3rem 0; margin: 1.2rem 0 1.6rem; }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 992px) { .article-grid { grid-template-columns: 240px minmax(0, 1fr); } }
@media (min-width: 1200px) { .article-grid { grid-template-columns: 250px minmax(0, 1fr) 300px; } }

/* فهرست مطالب مثل «چله»: یک تار عمودی و گره‌های روی آن */
.toc { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; font-size: .88rem; padding-bottom: 1rem; }
.toc h2 { font-size: .8rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; margin-bottom: .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0 1.1rem 0 0; position: relative; }
.toc > ol::before { content: ""; position: absolute; right: 4px; top: .5rem; bottom: .5rem; width: 2px; background: repeating-linear-gradient(var(--line-2) 0 4px, transparent 4px 7px); }
.toc li { position: relative; }
.toc a { display: block; padding: .3rem 0; color: var(--ink-2); line-height: 1.6; transition: color .2s; }
.toc a::before { content: ""; position: absolute; right: -1.1rem; top: .75rem; width: 10px; height: 10px; background: var(--card); border: 2px solid var(--line-2); transform: rotate(45deg); transition: background .25s, border-color .25s, transform .25s; }
.toc ol ol { padding-right: .8rem; }
.toc ol ol a { font-size: .82rem; }
.toc ol ol a::before { right: -1.9rem; width: 6px; height: 6px; top: .85rem; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--lacquer); font-weight: 700; }
.toc a.active::before { background: var(--lacquer); border-color: var(--lacquer); transform: rotate(45deg) scale(1.2); }
.toc-mobile { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 1.5rem; }
.toc-mobile summary { padding: .7rem 1rem; font-weight: 800; cursor: pointer; }
.toc-mobile .toc { position: static; max-height: none; padding: 0 1rem 1rem; }

/* متن مقاله */
.prose { font-size: 1.04rem; line-height: 2.05; max-width: 50rem; }
.prose h2 { font-size: 1.5rem; margin: 2.6rem 0 .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: center; }
.prose h2::before { content: ""; width: 14px; height: 14px; flex-shrink: 0; background: var(--lacquer); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--gold); margin-inline: .2rem .1rem; }
.prose h3 { font-size: 1.18rem; margin: 1.8rem 0 .6rem; color: var(--navy-2); }
:root[data-theme="dark"] .prose h3 { color: var(--gold-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prose h3 { color: var(--gold-2); } }
.prose p { margin-bottom: 1.1rem; }
.prose ul, .prose ol { padding-right: 1.4rem; margin-bottom: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose ul > li::marker { content: "◆  "; color: var(--gold); font-size: .7em; }
.prose strong { font-weight: 800; color: var(--ink); }
.prose blockquote { border-inline-start: 4px solid var(--teal); background: color-mix(in srgb, var(--teal) 8%, transparent); padding: .8rem 1.2rem; border-radius: 0 12px 12px 0; color: var(--ink-2); }
.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose a.wl { color: var(--lacquer); background-image: linear-gradient(var(--gold), var(--gold)); background-size: 100% 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .3s; }
.prose a.wl:hover { background-size: 100% 100%; color: #2B211B; }
.wl-missing { color: var(--muted); border-bottom: 1px dashed var(--muted); cursor: help; }
.cite { font-size: .72em; line-height: 0; margin-inline-start: 1px; }
.cite a { color: var(--teal); font-weight: 700; padding: 0 1px; }
.cite a:hover { background: color-mix(in srgb, var(--teal) 15%, transparent); border-radius: 3px; }
.table-wrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.prose .table { margin: 0; font-size: .88rem; --bs-table-bg: transparent; --bs-table-color: var(--ink); }
.prose .table thead th { background: var(--navy-2); color: var(--wool); font-weight: 700; border: 0; }
.prose .table td, .prose .table th { padding: .65rem .85rem; border-color: var(--line); vertical-align: top; }
.prose .table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }

/* راهنمای شناورِ واژه‌ها */
.term-hint { border-bottom: 1.5px dotted var(--gold); cursor: help; }
.term-pop { position: absolute; z-index: 1060; width: min(320px, 88vw); background: var(--navy); color: var(--wool); border-radius: 14px; padding: .9rem 1rem; box-shadow: 0 18px 40px -12px rgba(0,0,0,.5); font-size: .88rem; line-height: 1.8; }
.term-pop b { color: #fff; font-size: 1rem; }
.term-pop .en { direction: ltr; text-align: end; font-size: .78rem; color: rgba(243,233,210,.6); }
.term-pop a { color: var(--gold-2); font-weight: 700; font-size: .82rem; }

/* شناسنامه (اینفوباکس) مثل برچسب پشت قالی */
.infobox { position: relative; background: var(--card); border-radius: 16px; padding: 0 0 1rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.infobox::after { content: ""; position: absolute; inset: 7px; border: 1.5px dashed color-mix(in srgb, var(--gold) 60%, transparent); border-radius: 11px; pointer-events: none; }
.infobox-head { background: var(--lacquer); color: #fff; border-radius: 16px 16px 0 0; padding: .9rem 1.2rem .8rem; position: relative; }
.infobox-head::before { content: ""; position: absolute; left: 1.1rem; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); transform: translateY(-50%); box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.infobox-head small { display: block; font-size: .72rem; opacity: .8; font-weight: 700; letter-spacing: .05em; }
.infobox-head b { font-size: 1.05rem; }
.infobox dl { margin: .4rem 1.2rem 0; font-size: .86rem; }
.infobox dt { color: var(--muted); font-weight: 600; font-size: .76rem; margin-top: .65rem; }
.infobox dd { margin: 0; color: var(--ink); font-weight: 600; line-height: 1.7; }
.side-sticky { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 1rem; }
.share { display: flex; gap: .4rem; flex-wrap: wrap; }
.share a, .share button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--ink-2); background: var(--card); }
.share a:hover, .share button:hover { color: var(--lacquer); border-color: var(--gold); }

/* پرسش‌ها */
.faq { margin-top: 2.5rem; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: .6rem; transition: border-color .25s; }
.faq details[open] { border-color: var(--gold); }
.faq summary { list-style: none; cursor: pointer; padding: .9rem 1.1rem; font-weight: 700; display: flex; gap: .7rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "؟"; flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--lacquer) 12%, transparent); color: var(--lacquer); font-weight: 900; }
.faq details p { padding: 0 3.3rem 1rem 1.1rem; margin: 0; color: var(--ink-2); }

/* منابع */
.refs { margin-top: 2.5rem; font-size: .9rem; }
.refs ol { padding-right: 1.6rem; }
.refs li { margin-bottom: .55rem; line-height: 1.8; padding-inline-start: .2rem; }
.refs li:target { background: color-mix(in srgb, var(--gold) 22%, transparent); border-radius: 6px; }
.refs li::marker { color: var(--teal); font-weight: 800; }
.refs .title { color: var(--ink); direction: auto; unicode-bidi: plaintext; }
.refs a.out { font-size: .78rem; margin-inline-start: .4rem; white-space: nowrap; }
.refs .back { font-size: .75rem; color: var(--muted); margin-inline-start: .3rem; }
.rel-low { font-size: .7rem; color: var(--madder); margin-inline-start: .35rem; }

.feedback { margin: 2.5rem 0 1rem; padding: 1.2rem 1.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.feedback .q { font-weight: 800; }
.feedback .thanks { color: var(--teal); font-weight: 700; }

/* ── فهرست‌ها، واژه‌نامه ──────────────────────────────────────────── */
.page-head { padding: 1.4rem 0 1.6rem; }
.page-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 900; margin: .3rem 0 .4rem; }
.page-head p { color: var(--ink-2); max-width: 44rem; }
.alpha { display: flex; flex-wrap: wrap; gap: .3rem; position: sticky; top: var(--header-h); z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); padding: .6rem 0; backdrop-filter: blur(8px); }
.alpha a, .alpha span { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: .95rem; }
.alpha a { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.alpha a:hover { background: var(--lacquer); color: #fff; border-color: var(--lacquer); }
.alpha span { color: var(--line-2); }
.letter-h { font-size: 2rem; font-weight: 900; color: var(--lacquer); margin: 2rem 0 .8rem; display: flex; align-items: center; gap: .8rem; }
.letter-h::after { content: ""; flex: 1; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10'%3E%3Cpath d='M0 5h16' stroke='%23C8963E' stroke-opacity='.5'/%3E%3Cpath d='M8 1l4 4-4 4-4-4z' fill='%23C8963E' fill-opacity='.5'/%3E%3C/svg%3E") repeat-x center; }
.term-card { padding: 1rem 1.1rem; height: 100%; display: block; color: var(--ink); }
.term-card:hover { color: var(--ink); border-color: var(--gold); }
.term-card h3 { font-size: 1.05rem; margin: 0; }
.term-card .en { direction: ltr; text-align: end; font-size: .75rem; color: var(--muted); }
.term-card p { font-size: .88rem; color: var(--ink-2); margin: .35rem 0 0; line-height: 1.8; }
.index-list { columns: 3 16rem; column-gap: 2rem; list-style: none; padding: 0; }
.index-list li { break-inside: avoid; padding: .3rem 0; border-bottom: 1px dotted var(--line-2); }
.index-list a { color: var(--ink); font-weight: 600; }
.index-list small { color: var(--muted); font-size: .75rem; }

.result { padding: 1.1rem 1.2rem; margin-bottom: .8rem; display: block; color: var(--ink); }
.result:hover { color: var(--ink); border-color: var(--gold); }
.result h2 { font-size: 1.15rem; margin: .2rem 0; }
.result p { font-size: .92rem; color: var(--ink-2); margin: 0; }
mark { background: color-mix(in srgb, var(--gold) 45%, transparent); color: inherit; padding: 0 .15em; border-radius: 3px; }

/* ── پانوشت ──────────────────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: rgba(243,233,210,.85); margin-top: 4rem; }
.site-footer a { color: var(--wool); }
.site-footer a:hover { color: var(--gold-2); }
.brand-foot .brand-text b { color: #fff; }
.brand-foot .brand-text small { color: var(--gold-2); }
.foot-about { font-size: .92rem; max-width: 30rem; }
.foot-h { font-size: .85rem; color: var(--gold-2); font-weight: 800; letter-spacing: .04em; }
.foot-links { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.foot-links li { padding: .2rem 0; }
.foot-copy { font-size: .78rem; color: rgba(243,233,210,.55); }

/* ۴۰۴ */
.lost { text-align: center; padding: 3rem 0 2rem; }
.lost h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 900; }
.lost svg { max-width: 280px; margin: 0 auto 1rem; display: block; }

/* ظاهرشدن نرم هنگام اسکرول */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header, .site-footer, .toc, .side-col, .feedback, .warp-progress, .share { display: none !important; }
  body { background: #fff; }
  .article-grid { display: block; }
}
.loom-front .weaver { transition: opacity .8s ease; }
.prose ol, .refs ol { list-style-type: persian; }
