/* ============================================================
   أرشيف محمد طاهر الجلواح — الأنماط
   العالم البصري: «البشت الحساوي» — قماش صوفي داكن (أو جمليّ نهاراً)
   تحفّه خيوط الزري الذهبية. كل خط في الصفحة خيط، وكل قسم لوحة قماش
   تلتقي بجارتها عند درزة.
   ============================================================ */

:root {
  /* الصوف: أرضية النهار (ظلّ النخيل الأخضر) */
  --wool: #E9EEE6;
  --wool-2: #DCE4D8;
  --wool-3: #F4F7F2;
  --ink: #15221B;
  --ink-2: #33433A;
  --muted: #5A6A5F;
  --line: #C5D0C3;
  --line-strong: #9CAB9C;

  /* خيط الزري — أخضر في النهار */
  --zari: #1F6B47;
  --zari-2: #3E8A63;
  --zari-deep: #144A31;

  /* أخضر النخيل: حبر ثانٍ */
  --palm: #1B4D37;
  --name-ink: #1F6B47;
  --name-glint: #7FC59C;
  --palm-soft: #BFD0BC;

  /* الخريطة */
  --sea: #D6E0D3;
  --land: #C3CDBF;
  --land-arab: #B5C6B0;
  --land-visited: #8FB292;

  /* دلالي */
  --warn: #7E3510;
  --warn-soft: #EBD9CB;
  /* غسيل فوق صورة الأقمار الصناعية في الخريطة: يفتّحها نهاراً ويعتّمها ليلاً */
  --map-shade: rgba(236,244,232,.16);

  --shadow: 0 2px 0 rgba(28,26,21,.04), 0 18px 40px -24px rgba(28,26,21,.45);
  --shadow-lift: 0 6px 0 rgba(28,26,21,.03), 0 30px 50px -28px rgba(28,26,21,.55);

  --f-display: "Aref Ruqaa", "Amiri", "Scheherazade New", serif;
  --f-kufi: "Reem Kufi", "Noto Kufi Arabic", "Tahoma", sans-serif;
  /* العناوين الكبيرة بخط القاهرة (Cairo) بطلب المالك */
  --f-head: "Cairo", "Almarai", "Segoe UI", "Tahoma", sans-serif;
  --f-poem: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Times New Roman", serif;
  --f-body: "Almarai", "IBM Plex Sans Arabic", "Segoe UI", "Tahoma", sans-serif;

  --measure: 36rem;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: clamp(18px, 4.5vw, 56px);
  --spine: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* ضفيرة الزري: قناع SVG يُلوَّن بلون الخيط */
  --braid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8' viewBox='0 0 16 8'%3E%3Cpath d='M0 4C4 0 4 0 8 4S12 8 16 4' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3Cpath d='M0 4C4 8 4 8 8 4S12 0 16 4' fill='none' stroke='%23000' stroke-width='1.1'/%3E%3C/svg%3E");
  --twill: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 1px, transparent 1px 5px);
  --twill-dark: repeating-linear-gradient(135deg, rgba(0,0,0,.025) 0 1px, transparent 1px 5px);

  color-scheme: light;
}
/* الافتراضي داكن حتى يختار الزائر غير ذلك (app.js يضبط data-theme) */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wool: #121511;
    --wool-2: #191D18;
    --wool-3: #222722;
    --ink: #F1EADA;
    --ink-2: #CDC4AE;
    --muted: #958C77;
    --line: #2F352E;
    --line-strong: #4C544A;
    --zari: #D1A64A;
    --zari-2: #EFCF7C;
    --zari-deep: #9E7A2C;
    --palm: #7FC59C;
   --name-ink: #D1A64A;
   --name-glint: #FFF3C4;
    --palm-soft: #1E3A2C;
    --sea: #0F1412;
    --land: #232A25;
    --land-arab: #2A3A30;
    --land-visited: #35543F;
    --warn: #E3925F;
    --warn-soft: #3A2417;
    --map-shade: rgba(8,12,9,.42);
    --shadow: 0 2px 0 rgba(0,0,0,.25), 0 18px 40px -22px rgba(0,0,0,.9);
    --shadow-lift: 0 6px 0 rgba(0,0,0,.2), 0 30px 50px -26px rgba(0,0,0,.95);
    --twill: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px), repeating-linear-gradient(45deg, rgba(0,0,0,.25) 0 1px, transparent 1px 4px);
    --twill-dark: repeating-linear-gradient(135deg, rgba(0,0,0,.28) 0 1px, transparent 1px 4px), repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 1px, transparent 1px 4px);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wool: #121511;
  --wool-2: #191D18;
  --wool-3: #222722;
  --ink: #F1EADA;
  --ink-2: #CDC4AE;
  --muted: #958C77;
  --line: #2F352E;
  --line-strong: #4C544A;
  --zari: #D1A64A;
  --zari-2: #EFCF7C;
  --zari-deep: #9E7A2C;
  --palm: #7FC59C;
  --name-ink: #D1A64A;
  --name-glint: #FFF3C4;
  --palm-soft: #1E3A2C;
  --sea: #0F1412;
  --land: #232A25;
  --land-arab: #2A3A30;
  --land-visited: #35543F;
  --warn: #E3925F;
  --warn-soft: #3A2417;
  --map-shade: rgba(8,12,9,.42);
  --shadow: 0 2px 0 rgba(0,0,0,.25), 0 18px 40px -22px rgba(0,0,0,.9);
  --shadow-lift: 0 6px 0 rgba(0,0,0,.2), 0 30px 50px -26px rgba(0,0,0,.95);
  --twill: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px), repeating-linear-gradient(45deg, rgba(0,0,0,.25) 0 1px, transparent 1px 4px);
  --twill-dark: repeating-linear-gradient(135deg, rgba(0,0,0,.28) 0 1px, transparent 1px 4px), repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 1px, transparent 1px 4px);
  color-scheme: dark;
}

/* ---------- الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--wool);
  background-image: var(--twill);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.8;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--zari); color: var(--wool); }
html { scrollbar-color: var(--zari-deep) var(--wool-2); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--wool-2); }
::-webkit-scrollbar-thumb { background: var(--zari-deep); border: 2px solid var(--wool-2); border-radius: 6px; }
a { color: var(--palm); text-decoration: none; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--zari); outline-offset: 3px; border-radius: 2px; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; caret-color: var(--zari); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
b, strong { font-weight: 700; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; top: -60px; right: 12px; background: var(--zari); color: var(--wool); padding: 8px 14px; z-index: 100; }
.skip:focus { top: 12px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.12em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* الخيط: خط زري أفقي أو ضفيرة */
.thread { height: 1px; background: linear-gradient(to left, transparent, var(--zari) 12%, var(--zari) 88%, transparent); }
.braid { height: 8px; background-color: var(--zari); -webkit-mask: var(--braid) repeat-x center; mask: var(--braid) repeat-x center; }

/* الظهور التدريجي عند التمرير */
.rv { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- الرأس ---------- */
.masthead {
  position: sticky; top: 0; z-index: 30;
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
  padding-inline-start: var(--spine);
}
.masthead.is-stuck {
  background: color-mix(in srgb, var(--wool) 90%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.masthead .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.wordmark { font-family: var(--f-kufi); font-weight: 600; font-size: 1.2rem; color: var(--ink); line-height: 1; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.wordmark .knot { width: 12px; height: 12px; background: var(--zari); transform: rotate(45deg); flex: none; }
.wordmark small { font-family: var(--f-body); font-size: .68rem; color: var(--muted); letter-spacing: .04em; }
.head-tools { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.search { position: relative; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-strong); padding: 4px 4px; min-width: 300px; transition: border-color .2s; }
.search:focus-within { border-color: var(--zari); }
.search input { border: 0; background: transparent; width: 100%; outline: none; font-size: .9rem; }
.search input::placeholder { color: var(--muted); }
.search .ic { color: var(--muted); font-size: 15px; }
.search .qinfo { position: absolute; top: calc(100% + 6px); right: 0; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.tbtn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--wool-3); color: var(--ink-2); transition: border-color .2s, color .2s; }
.tbtn:hover { border-color: var(--zari); color: var(--zari); }
.tbtn .ic { font-size: 16px; }
.tbtn .i-moon { display: none; }
:root[data-theme="dark"] .tbtn .i-moon, :root:not([data-theme="light"]) .tbtn .i-moon { display: block; }
:root[data-theme="dark"] .tbtn .i-sun, :root:not([data-theme="light"]) .tbtn .i-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .tbtn .i-moon { display: none; }
  :root:not([data-theme="dark"]) .tbtn .i-sun { display: block; }
}
.menu-btn { display: none; }

/* ---------- العمود: خيط الزري الثابت على الحافة (الملاحة) ---------- */
.spine {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--spine); z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(to left, var(--wool-2), color-mix(in srgb, var(--wool-2) 60%, transparent));
  border-left: 1px solid var(--line);
}
.spine .rail { position: absolute; top: 0; bottom: 0; right: 33px; width: 1px; background: var(--line-strong); }
.spine .rail i { position: absolute; top: 0; left: 0; right: 0; height: 100%; background: var(--zari); transform-origin: top; transform: scaleY(var(--p, 0)); }
.spine ol { position: relative; display: grid; gap: 22px; }
.spine a { position: relative; display: grid; place-items: center; width: 22px; height: 22px; color: var(--ink-2); }
.spine .knot { width: 8px; height: 8px; background: var(--wool); border: 1px solid var(--zari-deep); transform: rotate(45deg); transition: transform .3s var(--ease), background .3s; }
.spine a:hover .knot, .spine a.is-active .knot { background: var(--zari); transform: rotate(45deg) scale(1.35); }
.spine .lbl {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(6px, -50%);
  background: var(--ink); color: var(--wool); font-size: .76rem; padding: 3px 12px; border-radius: 999px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
}
.spine a:hover .lbl, .spine a:focus-visible .lbl { opacity: 1; transform: translate(0, -50%); }
.spine .top { position: absolute; top: 16px; color: var(--muted); font-size: 14px; }
.spine .top:hover { color: var(--zari); }
main, .site-foot, .hero { padding-inline-start: var(--spine); }

/* ---------- الواجهة ---------- */
.hero {
  position: relative; min-height: calc(100vh - 64px); display: grid; align-content: center;
  padding-block: clamp(24px, 4vw, 56px) 0;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 88% 12%, color-mix(in srgb, var(--zari) 14%, transparent), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, color-mix(in srgb, var(--palm) 12%, transparent), transparent 70%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1.25fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
/* على الشاشات الواسعة: الصورة يميناً والنص يساراً */
.hero .portrait { order: -1; }
.hero-text { padding-block: 24px; }
.portrait .name {
  margin: 14px 0 0; text-align: center; display: block; width: 100%;
  font-family: var(--f-kufi); font-weight: 700; color: var(--name-ink); /* اسم الشاعر: أخضر في الثيم الفاتح، ذهبي في الداكن (بطلب المالك) */
  font-size: 2rem; line-height: 1.4; white-space: nowrap; letter-spacing: 0;
}
.hero .sub { font-size: 1.12rem; color: var(--ink-2); max-width: 34rem; line-height: 1.9; }
.hero .sub b { color: var(--ink); font-weight: 700; }
.epigraph { margin-top: 30px; position: relative; padding: 22px 0; max-width: 34rem; }
.epigraph::before, .epigraph::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(to left, var(--zari), transparent 85%); }
.epigraph::before { top: 0; }
.epigraph::after { bottom: 0; }
.epigraph .knot { position: absolute; top: -4px; right: 0; width: 8px; height: 8px; background: var(--zari); transform: rotate(45deg); }
.epigraph .knot.b { top: auto; bottom: -4px; }
.epigraph .v { display: block; font-family: var(--f-poem); font-size: clamp(1.4rem, 2.6vw, 1.85rem); line-height: 1.85; color: var(--ink); }
.epigraph cite { display: block; font-style: normal; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.epigraph cite b { color: var(--ink-2); font-weight: 400; }

/* البورتريه بإطار زري يُخاط عند التحميل */
.portrait { margin: 0; position: relative; justify-self: end; width: 100%; max-width: 420px; }
.portrait .frame { position: relative; aspect-ratio: 709/1024; padding: 12px; background: var(--wool-3); border: 1px solid var(--line); border-radius: var(--radius); outline: 1px solid var(--zari); outline-offset: 5px; box-shadow: var(--shadow-lift); }
.portrait img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; border-radius: calc(var(--radius) - 6px); }
.portrait figcaption { font-size: .78rem; color: var(--muted); margin-top: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.portrait figcaption a { color: var(--muted); }
.portrait .ph { position: absolute; z-index: 0; inset: 12px; display: grid; place-items: center; text-align: center; color: var(--ink-2); font-size: .85rem; padding: 20px; }

/* لوحة الحقائق: شريط منسوج */
.hero .wrap.facts-band { display: block; margin-top: clamp(28px, 5vw, 56px); position: relative; }
.facts-band .braid { opacity: .85; }
/* الحقائق بعرض الواجهة كاملاً؛ الفواصل خيوط من فجوة الشبكة */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.facts div { padding: 16px 18px; background: var(--wool-2); }
/* الخانة الأخيرة تملأ الصف فلا تبقى فجوة فارغة */
.facts div:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
.facts div:last-child:nth-child(3n+2) { grid-column: span 2; }
@media (max-width: 900px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:last-child { grid-column: auto; }
  .facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.facts dt { font-family: var(--f-display); font-size: 1rem; color: var(--zari-deep); line-height: 1.4; }
/* كل عنوان يحمل مصدره: خط زري تحته، ويتوهّج عند المرور */
.tlink { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--zari) 50%, transparent); text-underline-offset: .32em; transition: color .2s, text-decoration-color .2s; }
.tlink:hover, .tlink:focus-visible { color: var(--zari); text-decoration-color: var(--zari); }
.tlink .ic { color: var(--zari); font-size: .72em; margin-inline-start: 3px; vertical-align: .05em; }
.facts dt .ic { font-size: .75em; }
.facts dd { margin: 4px 0 0; font-size: .86rem; line-height: 1.65; color: var(--ink-2); }
.facts dd a { color: var(--muted); font-size: .8rem; margin-inline-start: 4px; }

/* ---------- الأقسام والدرزات ---------- */
.section { position: relative; padding-block: clamp(56px, 8vw, 104px); }
.section::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); }
.section::after { content: ""; position: absolute; top: -4px; right: 50%; width: 120px; height: 9px; transform: translateX(50%); background-color: var(--zari); -webkit-mask: var(--braid) repeat-x center; mask: var(--braid) repeat-x center; }
.section.band { background: var(--wool-2); background-image: var(--twill-dark); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 40px; align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { font-family: var(--f-head); font-weight: 800; font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1.35; color: var(--ink); position: relative; padding-bottom: 12px; }
.section-head h2::after { content: ""; position: absolute; right: 0; bottom: 0; width: 64px; height: 2px; background: var(--zari); transform-origin: right; transform: scaleX(0); transition: transform .8s var(--ease) .15s; }
.rv.is-in .section-head h2::after, .is-in .section-head h2::after, .section-head.is-in h2::after { transform: scaleX(1); }
.section-head .lede { color: var(--ink-2); max-width: var(--measure); margin-top: 10px; font-size: .98rem; }
.count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; white-space: nowrap; text-align: left; line-height: 1.5; padding-bottom: 14px; }
.count b { font-weight: 700; color: var(--ink); margin-inline-end: 4px; }
.sub-head { margin-top: clamp(44px, 6vw, 72px); margin-bottom: 20px; display: grid; gap: 6px; }
.sub-head h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.5rem; color: var(--ink); }
.sub-head p { color: var(--ink-2); font-size: .92rem; max-width: var(--measure); }
.src { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.src:hover { color: var(--zari); text-decoration: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; line-height: 1.5; padding: 1px 9px; border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: inset 0 0 0 2px var(--wool-3), inset 0 0 0 3px color-mix(in srgb, var(--zari) 45%, transparent); background: var(--wool-3); color: var(--ink-2); white-space: nowrap; letter-spacing: .01em; }
.tag.gold { border-color: var(--zari); color: var(--zari); }
.tag.palm { border-color: color-mix(in srgb, var(--palm) 60%, transparent); color: var(--palm); background: color-mix(in srgb, var(--palm) 10%, transparent); }
.empty { color: var(--muted); padding: 28px 0; font-size: .92rem; }
mark { background: color-mix(in srgb, var(--zari) 32%, transparent); color: inherit; padding: 0 2px; }

/* ---------- المرشحات: بطاقات منسوجة ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; align-items: center; }
.filters .lbl { font-size: .76rem; color: var(--muted); margin-inline-end: 2px; }
.chip { border: 1px solid var(--line); border-radius: 999px; background: var(--wool-3); padding: 4px 14px; font-size: .84rem; color: var(--ink-2); transition: border-color .2s, background .2s, color .2s; position: relative; }
.chip:hover { border-color: var(--zari); color: var(--ink); }
.chip.is-on { background: var(--zari); border-color: var(--zari-deep); color: var(--wool-3); box-shadow: inset 0 0 0 2px var(--zari), inset 0 0 0 3px color-mix(in srgb, var(--wool-3) 70%, transparent); }
.chip:not(.is-on) { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--zari) 35%, transparent); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .75; margin-inline-start: 5px; font-size: .74em; }
.select { border: 1px solid var(--line); border-radius: 999px; background: var(--wool-3); padding: 4px 14px; font-size: .84rem; color: var(--ink); }

/* ---------- السيرة ---------- */
.bio { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.bio-text { font-size: 1.08rem; line-height: 2; max-width: 40rem; color: var(--ink); }
.family { margin-top: 26px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--wool-3) 70%, transparent); font-size: .92rem; line-height: 1.8; color: var(--ink-2); display: grid; gap: 6px; }
.family b { font-family: var(--f-display); font-weight: 400; color: var(--zari); font-size: 1rem; }
.voice { display: grid; gap: 22px; align-content: start; }
.voice h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.voice blockquote { margin: 0; position: relative; padding: 0 30px 0 0; font-family: var(--f-poem); font-size: 1.25rem; line-height: 1.75; color: var(--ink); }
.voice blockquote .ic { position: absolute; right: 0; top: .2em; font-size: 18px; color: var(--zari); stroke-width: 1.3; }
.voice blockquote footer { font-family: var(--f-body); font-size: .76rem; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.voice blockquote footer a { color: var(--muted); }

.tributes { margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tributes figure { margin: 0; padding: 22px 22px 18px; background: var(--wool-3); position: relative; }
.tributes figure::before { content: ""; position: absolute; top: 0; right: 22px; width: 36px; height: 3px; background: var(--zari); }
.tributes blockquote { margin: 0; font-family: var(--f-poem); font-size: 1.18rem; line-height: 1.75; white-space: pre-line; color: var(--ink); }
.tributes figcaption { font-size: .76rem; color: var(--muted); margin-top: 12px; }
.tributes figcaption a { color: var(--muted); }

/* الجدول الزمني: خيط وعُقد */
.timeline { margin-top: clamp(44px, 6vw, 72px); position: relative; display: grid; }
.timeline::before { content: ""; position: absolute; top: 10px; bottom: 10px; right: 96px; width: 1px; background: linear-gradient(var(--zari), var(--zari-deep)); }
.tl-item { display: grid; grid-template-columns: 78px 1fr; gap: 36px; padding-block: 14px; position: relative; }
.tl-item::before { content: ""; position: absolute; right: 92px; top: 26px; width: 9px; height: 9px; background: var(--wool); border: 1px solid var(--zari); transform: rotate(45deg); transition: background .3s; }
.tl-item:hover::before { background: var(--zari); }
.tl-year { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.3; text-align: left; font-size: 1.05rem; }
.tl-year small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; }
.tl-year.txt { font-size: .8rem; font-weight: 400; color: var(--ink-2); }
.tl-body { max-width: var(--measure); color: var(--ink-2); font-size: .96rem; }

/* ---------- الخريطة: كل أنماطها في map.css ---------- */

/* ---------- الصور ---------- */
.gallery { columns: 4 220px; column-gap: 14px; }
.gallery figure { margin: 0 0 14px; break-inside: avoid; background: var(--wool-3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.gallery figure:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.gallery .shot { position: relative; display: block; width: 100%; cursor: zoom-in; background: var(--wool-2); overflow: hidden; }
.gallery .shot img { display: block; width: 100%; height: auto; transition: transform .6s var(--ease); }
.gallery figure:hover .shot img { transform: scale(1.03); }
.gallery .shot.is-missing { aspect-ratio: 4/3; display: grid; place-items: center; cursor: default; }
.gallery .shot .ph { display: grid; gap: 8px; justify-items: center; color: var(--ink-2); font-size: .78rem; text-align: center; padding: 16px; }
.gallery .shot .ph .ic { font-size: 26px; color: var(--zari); stroke-width: 1.2; }
.gallery .shot .ph i { font-style: normal; font-family: var(--f-display); font-size: .9rem; color: var(--ink); }
.gallery figcaption { padding: 10px 12px 12px; font-size: .84rem; line-height: 1.55; color: var(--ink); }
.gallery figcaption small { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: .78rem; margin-top: 4px; }
.gallery figcaption .tlink { color: var(--ink); }

/* المعاينة الكبرى */
.lightbox { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--wool) 94%, transparent); backdrop-filter: blur(10px); display: grid; grid-template-rows: 1fr auto; padding: 24px; padding-inline-start: calc(24px + var(--spine)); }
.lightbox[hidden] { display: none; }
.lightbox .stage { display: grid; place-items: center; min-height: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; box-shadow: var(--shadow-lift); border: 8px solid var(--wool-3); border-radius: var(--radius); }
.lightbox .cap { text-align: center; padding: 14px 0 0; font-size: .92rem; color: var(--ink); }
.lightbox .cap small { display: block; color: var(--muted); font-size: .76rem; margin-top: 4px; }
.lightbox .cap .tlink { color: var(--ink); }
.lightbox .x, .lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--wool-3); color: var(--ink); }
.lightbox .x { top: 22px; right: calc(22px + var(--spine)); transform: none; }
.lightbox .nav.prev { right: calc(22px + var(--spine)); }
.lightbox .nav.next { left: 22px; }
.lightbox .nav:hover, .lightbox .x:hover { border-color: var(--zari); color: var(--zari); }

/* ---------- الإصدارات: الرفّ ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 26px 20px; }
.book { position: relative; display: grid; gap: 12px; align-content: start; }
.shelf { perspective: 1200px; }
.book .cover { position: relative; aspect-ratio: 3/4.3; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-sm); box-shadow: var(--shadow); transform-origin: center bottom; transition: transform .55s var(--ease), box-shadow .55s var(--ease); background: var(--wool-2); }
.book:hover .cover { transform: translateY(-10px) scale(1.06); box-shadow: 0 30px 50px -22px rgba(0,0,0,.6), 0 0 0 1px var(--zari); }
.book .cover .sheen { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%); transform: translateX(-120%); transition: transform .8s var(--ease); pointer-events: none; z-index: 2; }
.book:hover .cover .sheen { transform: translateX(120%); }
.book .cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to left, rgba(0,0,0,.18), transparent 12%, transparent 88%, rgba(255,255,255,.08)); pointer-events: none; }
.book .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* الغلاف المؤلَّف طباعياً عند غياب الصورة */
.book .cover.typo { --cloth: var(--palm); background: var(--cloth); background-image: var(--twill-dark); color: #F3ECDC; padding: 14px; text-align: center; }
.book[data-type="شعر شعبي"] .cover.typo { --cloth: #8C5A16; }
.book[data-type="نثر"] .cover.typo { --cloth: #4A3B2E; }
.book[data-type="شرح وتعليق"] .cover.typo { --cloth: #2B2E33; }
.book .cover.typo .in { position: absolute; inset: 10px; border: 1px solid rgba(243,236,220,.55); box-shadow: inset 0 0 0 3px var(--cloth), inset 0 0 0 4px rgba(243,236,220,.35); }
.book .cover.typo h3 { position: relative; font-family: var(--f-poem); font-weight: 700; font-size: 1.35rem; line-height: 1.35; color: #F6EFDF; }
.book .cover.typo .y { position: absolute; bottom: 20px; left: 0; right: 0; font-size: .74rem; letter-spacing: .06em; color: rgba(246,239,223,.8); }
.book .cover.typo .t { position: absolute; top: 20px; left: 0; right: 0; font-family: var(--f-display); font-size: .8rem; color: rgba(246,239,223,.85); }
.book .cover.typo .nc { position: absolute; bottom: 4px; left: 0; right: 0; font-size: .6rem; color: rgba(246,239,223,.55); }
.book .meta { display: grid; gap: 2px; font-size: .8rem; color: var(--muted); }
.book .meta h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.15rem; line-height: 1.4; color: var(--ink); }
.book .meta .byline { color: var(--ink-2); font-size: .82rem; line-height: 1.55; }
.book .meta .yr { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.book .meta .note { color: var(--ink-2); font-size: .8rem; line-height: 1.55; margin-top: 4px; }
.book .meta .listen { font-size: .8rem; margin-top: 6px; }
.book .meta .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .78rem; color: var(--muted); margin-top: 28px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 14px; margin-inline-end: 7px; vertical-align: -2px; background: var(--c); }
.outlets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.outlets li { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--wool-3) 70%, transparent); font-size: .9rem; }
.outlets li b { font-family: var(--f-head); font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.outlets li span { color: var(--ink-2); line-height: 1.6; }
.stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stores > li { display: grid; gap: 2px; align-content: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--wool-3) 85%, transparent); }
.stores > li > b { font-family: var(--f-head); font-weight: 800; font-size: 1.22rem; color: var(--ink); }
.stores > li > span { color: var(--muted); font-size: .82rem; }
.store-books { margin-top: 8px; }
.store-books li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: .93rem; }
.store-books li .num { color: var(--zari); font-weight: 700; white-space: nowrap; }
.two-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 40px; }
.honors li { display: grid; grid-template-columns: 70px 1fr; gap: 14px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: .93rem; color: var(--ink-2); }
.honors .y { font-weight: 700; color: var(--ink); line-height: 1.3; }
.honors .y small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; }
.memberships li { position: relative; padding: 9px 22px 9px 0; border-top: 1px dashed var(--line); font-size: .93rem; color: var(--ink-2); }
.memberships li::before { content: ""; position: absolute; right: 2px; top: 1.05em; width: 7px; height: 7px; border: 1px solid var(--zari); transform: rotate(45deg); }
.manuscripts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.manuscripts li { display: grid; gap: 2px; padding: 12px 16px; min-width: 170px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.manuscripts li b { font-family: var(--f-head); font-weight: 800; font-size: 1.12rem; color: var(--ink); }
.manuscripts li span { color: var(--muted); font-size: .8rem; }
.tag.oop { border-color: color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn); }
.outlets-sub { font-family: var(--f-head); font-weight: 800; font-size: 1.12rem; color: var(--ink-2); margin: 22px 0 10px; }
.ways { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.ways a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--zari); border-radius: 999px; padding: 8px 16px; font-size: .95rem; color: var(--zari); background: var(--wool-3); }
.ways a:hover { background: var(--zari); color: var(--wool); text-decoration: none; }
.ways a .ic { font-size: 14px; }
.accounts { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: .88rem; }
.accounts > span { color: var(--muted); }

/* ---------- القصائد ---------- */
.poems { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.poem { border-bottom: 1px solid var(--line); transition: background .3s; }
.poem[open] { background: color-mix(in srgb, var(--wool-3) 65%, transparent); border-radius: var(--radius); }
.poem summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: start; padding: 20px 6px 18px; }
.poem summary::-webkit-details-marker { display: none; }
.poem summary h3 { font-family: var(--f-poem); font-weight: 700; font-size: 1.5rem; color: var(--ink); line-height: 1.4; }
.poem summary:hover h3 { color: var(--zari); }
.poem .tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; padding-top: 6px; }
.poem .chev { font-size: 16px; color: var(--muted); transition: transform .3s var(--ease); margin-inline-start: 6px; }
.poem[open] .chev { transform: rotate(180deg); }
.poem .first { grid-column: 1 / -1; font-family: var(--f-poem); color: var(--ink-2); font-size: 1.12rem; }
.poem[open] .first { display: none; }
.poem .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--muted); }
.poem .meta b { font-weight: 400; color: var(--ink-2); }
.poem-body { padding: 4px 6px 26px; }
.verses { font-family: var(--f-poem); font-size: 1.36rem; line-height: 2.15; color: var(--ink); max-width: 50rem; margin-inline: auto; padding-block: 10px 16px; counter-reset: bayt; }
/* البيت: صدر وعجز على شبكة ظاهرة (خيط بينهما) */
.bayt { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3.2rem; position: relative; }
.bayt::before { content: ""; position: absolute; top: .55em; bottom: .55em; right: 50%; width: 1px; background: var(--line); }
.bayt::after { counter-increment: bayt; content: counter(bayt); position: absolute; left: -2.4rem; top: 0; font-family: var(--f-body); font-size: .62rem; color: var(--muted); font-variant-numeric: tabular-nums; opacity: 0; }
.bayt:nth-child(5n)::after { opacity: 1; }
.bayt span { display: block; }
.bayt span:last-child { text-align: right; padding-inline-start: .2em; }
.bayt.half::before { display: none; }
.stanza p { text-align: right; }
.verses .lbl { font-family: var(--f-body); font-size: .78rem; color: var(--zari); margin: 16px 0 4px; }
.verses .gap { color: var(--muted); text-align: center; letter-spacing: .3em; }
.poem-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; max-width: 50rem; margin-inline: auto; }
.poem-foot .partial { color: var(--warn); }
.poem-foot .acts { margin-inline-start: auto; display: flex; gap: 6px; }
.abtn { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--wool-3); color: var(--ink-2); transition: border-color .2s, color .2s; }
.abtn:hover { border-color: var(--zari); color: var(--zari); }
.abtn .ic { font-size: 13px; }
.titles-only { columns: 2; column-gap: 40px; font-size: .92rem; margin-top: 4px; }
.titles-only li { break-inside: avoid; padding-block: 8px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; }
.titles-only .t { font-family: var(--f-poem); font-size: 1.15rem; color: var(--ink); }
.titles-only .n { color: var(--muted); font-size: .78rem; text-align: left; }

/* وضع القراءة */
.reader { position: fixed; inset: 0; z-index: 70; background: var(--wool); background-image: var(--twill); overflow: auto; padding: 0 var(--gutter) 60px; padding-inline-start: calc(var(--gutter) + var(--spine)); }
.reader[hidden] { display: none; }
.reader .bar { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 14px 0; background: color-mix(in srgb, var(--wool) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); z-index: 2; }
.reader .bar .ttl { font-family: var(--f-display); font-size: 1.05rem; color: var(--ink); margin-inline-end: auto; }
.reader .bar .tbtn { width: 34px; height: 34px; }
.reader article { max-width: 54rem; margin: clamp(30px, 6vw, 64px) auto 0; }
.reader h2 { font-family: var(--f-poem); font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--ink); text-align: center; }
.reader .meta { text-align: center; color: var(--muted); font-size: .84rem; margin-top: 8px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.reader .verses { font-size: clamp(1.45rem, 2.4vw, 1.7rem); line-height: 2.25; margin-top: 30px; max-width: none; }
.reader .poem-foot { max-width: none; margin-top: 20px; }
.reader .pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); }
.reader .pager button { display: flex; flex-direction: column; gap: 2px; text-align: start; color: var(--ink-2); font-size: .78rem; }
.reader .pager button b { font-family: var(--f-poem); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.reader .pager button:hover b { color: var(--zari); }
.reader .pager button:last-child { text-align: end; align-items: flex-end; }

/* ---------- الفيديو ---------- */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.video { display: flex; flex-direction: column; }
.video .frame { position: relative; aspect-ratio: 16/9; background: var(--wool-2); cursor: pointer; display: grid; place-items: center; border-radius: var(--radius); outline: 1px solid var(--zari); outline-offset: 6px; margin: 8px; }
.video .frame .clip { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius); }
.video .frame .clip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform .6s var(--ease), opacity .3s; }
.video .frame:hover .clip img { transform: scale(1.04); opacity: 1; }
.video .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.video .play { position: relative; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: var(--zari); color: #FFFDF7; box-shadow: 0 0 0 6px color-mix(in srgb, var(--zari) 30%, transparent), 0 12px 30px -10px rgba(0,0,0,.7); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.video .play .ic { font-size: 26px; fill: currentColor; stroke: none; margin-inline-start: -3px; transform: scaleX(-1); }
.video .frame:hover .play { transform: scale(1.1); box-shadow: 0 0 0 10px color-mix(in srgb, var(--zari) 25%, transparent), 0 16px 34px -10px rgba(0,0,0,.7); }
.video .frame.no-embed { cursor: default; background: linear-gradient(160deg, var(--palm) 0%, #0F1A14 100%); }
.video .frame.no-embed .ph { color: #F1EADA; text-align: center; display: grid; gap: 6px; justify-items: center; }
.video .frame.no-embed .ph .ic { font-size: 30px; stroke-width: 1.2; opacity: .8; }
.video .frame.no-embed .ph b { font-family: var(--f-display); font-weight: 400; font-size: 1.05rem; }
.video .pf { align-self: flex-start; margin: 10px 8px 0; }
.video .body { padding: 6px 8px 8px; display: grid; gap: 4px; }
.video h3 { font-size: 1rem; font-weight: 700; line-height: 1.55; }
.video .ch { font-size: .76rem; color: var(--muted); }
.video p { font-size: .84rem; color: var(--ink-2); }
.video .body a.open { font-size: .78rem; margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; }

/* ---------- ما كُتب عنه ---------- */
.press { border-top: 1px solid var(--line-strong); }
.press .yr { font-family: var(--f-display); font-size: 1.5rem; color: var(--zari); padding: 22px 0 6px; display: flex; align-items: center; gap: 14px; }
.press .yr::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.press-item { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 20px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.press-item .when { font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--muted); line-height: 1.5; padding-top: 4px; }
.press-item h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.55; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.press-item h3 a { color: var(--ink); }
.press-item h3 a:hover { color: var(--zari); text-decoration: none; }
.press-item .by { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.press-item .by b { color: var(--ink-2); font-weight: 400; }
.press-item p.sum { color: var(--ink-2); font-size: .92rem; margin-top: 6px; max-width: 48rem; }
.byhim { border-top: 1px solid var(--line-strong); }
.byhim li { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 20px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.byhim .d { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .78rem; padding-top: 3px; }
.byhim .t { font-weight: 700; }
.byhim .o { color: var(--muted); font-size: .8rem; }
.byhim .n { color: var(--ink-2); font-size: .84rem; margin-top: 2px; }


/* ---------- المصادر ---------- */
.src-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; padding: 10px 22px; border: 1px solid var(--zari); border-radius: 999px; color: var(--zari); background: transparent; transition: background .2s, color .2s; }
.src-toggle:hover { background: var(--zari); color: var(--wool-3); }
.src-toggle .chev { transition: transform .3s var(--ease); }
.src-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sources { columns: 3 260px; column-gap: 36px; font-size: .82rem; margin-top: 24px; }
.sources[hidden] { display: none; }
.sources li { break-inside: avoid; padding-block: 8px; border-bottom: 1px solid var(--line); }
.sources li b { display: block; font-family: var(--f-body); font-weight: 700; color: var(--ink); direction: ltr; text-align: right; }
.sources li b .n { font-weight: 400; color: var(--muted); font-size: .74rem; }
.sources li a { color: var(--ink-2); display: block; font-size: .78rem; line-height: 1.6; overflow-wrap: anywhere; }
.sources li a:hover { color: var(--zari); }

/* ---------- الذيل ---------- */
.site-foot { padding-block: clamp(40px, 6vw, 72px) 56px; border-top: 1px solid var(--line); background: var(--wool-2); background-image: var(--twill-dark); font-size: .84rem; color: var(--muted); position: relative; }
.site-foot::after { content: ""; position: absolute; top: -4px; right: 50%; width: 120px; height: 9px; transform: translateX(50%); background-color: var(--zari); -webkit-mask: var(--braid) repeat-x center; mask: var(--braid) repeat-x center; }
.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 40px; align-items: start; }
.site-foot .about { display: grid; gap: 10px; }
.site-foot .about h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.4rem; color: var(--ink); }
.site-foot .about p { max-width: 36rem; }
.site-foot code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: .78rem; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 6px; direction: ltr; unicode-bidi: embed; }
.corr { display: grid; gap: 10px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--wool-3); }
.corr h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.corr p { font-size: .8rem; }
.corr label { display: grid; gap: 4px; font-size: .78rem; color: var(--ink-2); }
.corr input, .corr textarea { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--wool); padding: 8px 12px; font-size: .9rem; color: var(--ink); }
.corr textarea { min-height: 96px; resize: vertical; }
.corr input:focus, .corr textarea:focus { outline: 0; border-color: var(--zari); }
.corr .hp { display: none; }
.corr button { justify-self: start; background: var(--zari); color: var(--wool); border-radius: 999px; padding: 8px 22px; font-weight: 700; border: 1px solid var(--zari-deep); }
.corr button:hover { background: var(--zari-2); }
.toast { position: fixed; inset-inline: 16px; bottom: 20px; margin-inline: auto; max-width: 26rem; z-index: 90; background: var(--ink); color: var(--wool); border-radius: 999px; padding: 10px 18px; font-size: .88rem; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s var(--ease); pointer-events: none; }
.toast.is-on { opacity: 1; transform: none; }

/* رفع الصور داخل النسخة المنشورة على claude.ai (يظهر للمالك فقط) */
button.up { border: 1px dashed var(--line-strong); color: var(--palm); padding: 1px 9px; font-size: .72rem; white-space: nowrap; }
button.up:hover { background: var(--palm-soft); border-style: solid; }
button.up[disabled] { opacity: .6; cursor: default; }
.upload-hint { background: var(--palm-soft); padding: 12px 16px; font-size: .86rem; line-height: 1.75; margin-bottom: 20px; max-width: 60rem; }

/* ---------- الاستجابة ---------- */
@media (max-width: 1100px) {
  :root { --spine: 0px; }
  .spine { position: sticky; top: 64px; bottom: auto; width: auto; height: auto; flex-direction: row; justify-content: flex-start; border-left: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--wool) 92%, transparent); backdrop-filter: blur(10px); z-index: 29; overflow-x: auto; scrollbar-width: none; }
  .spine::-webkit-scrollbar { display: none; }
  .spine .rail { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 2px; }
  .spine .rail i { transform-origin: right; transform: scaleX(var(--p, 0)); height: 2px; }
  .spine ol { display: flex; gap: 0; padding: 0 var(--gutter); }
  .spine a { width: auto; height: 40px; padding: 0 12px; gap: 8px; grid-auto-flow: column; }
  .spine .knot { width: 6px; height: 6px; }
  .spine .lbl { position: static; opacity: 1; transform: none; background: none; color: var(--ink-2); padding: 0; font-size: .82rem; }
  .spine a.is-active .lbl { color: var(--ink); font-weight: 700; }
  .spine .top { display: none; }
  .masthead { padding-inline-start: 0; }
  .lightbox .x, .lightbox .nav.prev { right: 22px; }
}
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero { min-height: 0; }
  .portrait { justify-self: center; max-width: 320px; order: -1; }
  .bio { grid-template-columns: 1fr; }
  .site-foot .wrap { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; }
  .count { text-align: right; }
}
@media (max-width: 640px) {
  .search { min-width: 0; flex: 1; }
  .head-tools { flex: 1; }
  .wordmark small { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .timeline::before { right: 66px; }
  .tl-item { grid-template-columns: 54px 1fr; gap: 24px; }
  .tl-item::before { right: 62px; }
  .tl-year { font-size: .92rem; }
  .bayt { grid-template-columns: 1fr; gap: 0; }
  .bayt::before { display: none; }
  .bayt span:last-child { padding-inline-start: 1.8em; }
  .verses { font-size: 1.2rem; line-height: 2; }
  .press-item, .byhim li { grid-template-columns: 1fr; gap: 4px; }
  .titles-only, .sources { columns: 1; }
  .lightbox { padding: 12px; }
  .lightbox .x { top: 12px; right: 12px; }
  .lightbox .nav { top: auto; bottom: 90px; transform: none; }
  .lightbox .nav.prev { right: 12px; }
  .lightbox .nav.next { left: 12px; }
  .tributes { grid-template-columns: 1fr; }
  .poem summary { padding-inline: 0; }
  .poem summary h3 { font-size: 1.3rem; }
  .poem .tags { justify-content: flex-start; grid-row: 3; }
}

/* ---------- الطباعة ---------- */
@media print {
  .spine, .masthead, .head-tools, .filters, .abtn, .poem-foot .acts, .corr, .video .play, .lightbox, .reader, .map-tools { display: none !important; }
  main, .hero, .site-foot { padding-inline-start: 0; }
  body { background: #fff; color: #000; }
  .poem { break-inside: avoid; }
  .poem summary .first { display: none; }
  details { display: block; }
  details > *:not(summary) { display: block !important; }
  .rv { opacity: 1; transform: none; }
  .rv .wrap > *, .rv .book { opacity: 1 !important; transform: none !important; }
  .dust { display: none !important; }
  a { color: inherit; }
}

/* ============================================================
   حركات منقولة يداً من مكتبات الحركة (Magic UI، React Bits، Aceternity UI،
   Animata، Hover.dev) — بلا أي مكتبة، وفق شرط المشروع. كل حركة بخيط الزري،
   وكلها تتعطّل مع prefers-reduced-motion (القاعدة العامة أعلاه).
   ============================================================ */

/* 1) خيط زري يدور حول إطار البورتريه — على غرار Border Beam في Magic UI */
@property --beam { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.portrait .frame::before {
  content: ""; position: absolute; inset: -7px; padding: 2px; border-radius: calc(var(--radius) + 6px);
  background: conic-gradient(from var(--beam), transparent 0 60%, var(--zari-2) 80%, #FFF3C4 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; z-index: 2;
  animation: beam 8s linear infinite;
}
@keyframes beam { to { --beam: 360deg; } }

/* 2) أبيات الواجهة تظهر كلمةً كلمة — على غرار BlurText في React Bits */
@media (prefers-reduced-motion: no-preference) {
  .epigraph .v .w { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(.3em); animation: word .9s var(--ease) forwards; animation-delay: calc(var(--i) * 110ms + 400ms); }
}
@keyframes word { to { opacity: 1; filter: blur(0); transform: none; } }

/* 3) بقعة ضوء زري تتبع المؤشر على الصور والأغلفة والشهادات — على غرار Spotlight Card في Aceternity UI */
.spot { position: relative; }
.spot .glow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .45s var(--ease);
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--zari) 34%, transparent), transparent 62%);
}
.spot:hover .glow { opacity: 1; }

/* 4) الأعداد تُعدّ صعوداً عند دخولها الشاشة — على غرار Counter في Animata (منطقها في app.js) */

/* 5) الخيط يُخاط حول الزر عند المرور — على غرار Draw Outline Button في Hover.dev */
.draw { position: relative; }
.draw .stitch { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); overflow: visible; pointer-events: none; }
.draw .stitch rect { x: 1px; y: 1px; width: calc(100% - 2px); height: calc(100% - 2px); rx: 999px; fill: none; stroke: var(--zari-2); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .8s var(--ease); }
.draw:hover .stitch rect, .draw:focus-visible .stitch rect { stroke-dashoffset: 0; }

/* ============================================================
   ثلاثي الأبعاد وحركة الواجهة — يدوي بالكامل
   ============================================================ */

/* 6) البورتريه ثابت بطلب المالك (أُزيل الميلان ثلاثي الأبعاد في 27 سبتمبر 2026) */
.portrait .shine { display: none; }

/* 7) اسم الشاعر يلمع كخيط زري تحت الضوء (على غرار Animated Shiny Text في Magic UI) */
.portrait .name {
  background: linear-gradient(100deg, var(--name-ink) 35%, var(--name-glint) 50%, var(--name-ink) 65%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .portrait .name { animation: nameShine 5.5s linear infinite; }
}
@keyframes nameShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* 8) غبار الزري وخيوطه خلف الواجهة (لوحة رسم يديرها app.js) */
.hero .dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* 9) الكتب: تظهر على الرفّ بهدوء واحداً بعد الآخر (بلا تجسيم؛ المرور يبقى كما كان: رفعة ولمعة) */
@media (prefers-reduced-motion: no-preference) {
  .rv .book { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
  .rv.is-in .book { opacity: 1; transform: none; }
}

/* 10) الأقسام تصعد وتتضح عند التمرير، كتلةً بعد كتلة (على غرار Scroll Reveal في Animata) */
@media (prefers-reduced-motion: no-preference) {
  .rv .wrap > * { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .rv .wrap > :nth-child(2) { transition-delay: .12s; }
  .rv .wrap > :nth-child(3) { transition-delay: .22s; }
  .rv .wrap > :nth-child(n+4) { transition-delay: .3s; }
  .rv.is-in .wrap > * { opacity: 1; transform: none; }
}

/* 11) خيط الجدول الزمني يُرسم مع التمرير وعُقده تمتلئ عند المرور */
@media (prefers-reduced-motion: no-preference) {
  .timeline::before { transform-origin: top; transform: scaleY(var(--tl, 0)); transition: transform .2s linear; }
}
.tl-item.is-past::before { background: var(--zari); }

/* ============================================================
   الحكايات — لوحات متناوبة على القماش: صورة أو وثيقة في جانب، والقصة في الآخر
   ============================================================ */
.stories-section { padding-bottom: 0; }
.stories-section .section-head { margin-bottom: 0; }
.stories { margin-top: clamp(28px, 4vw, 48px); }
.story { position: relative; padding-block: clamp(44px, 6vw, 88px); }
.story::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: linear-gradient(to left, transparent, var(--zari) 12%, var(--zari) 88%, transparent); opacity: .55; }
.story:nth-child(even) { background: var(--wool); background-image: var(--twill); }
.story .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.story.is-flip .wrap { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.story.is-flip .st-visual { order: 2; }
.story.is-flip .st-text { order: 1; }

/* ظهور تدريجي لكل لوحة (لا يعتمد على .rv .wrap لأن اللوحات خارج الـ wrap الأول) */
@media (prefers-reduced-motion: no-preference) {
  .story.will-in .st-visual, .story.will-in .st-text { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .story.will-in .st-text { transition-delay: .14s; }
  .story.is-in .st-visual, .story.is-in .st-text { opacity: 1; transform: none; }
}

/* الصورة: إطار قماش بحاشية زري، مائل قليلاً كصورة على طاولة */
.st-photo { margin: 0; }
.st-frame { position: relative; background: var(--wool-3); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 12px; transform: rotate(-.7deg); overflow: hidden; }
.story.is-flip .st-frame { transform: rotate(.7deg); }
.st-frame::after { content: ""; position: absolute; inset: 12px; border-radius: calc(var(--radius) - 6px); border: 1px solid color-mix(in srgb, var(--zari) 65%, transparent); pointer-events: none; z-index: 2; }
.st-frame img { display: block; width: 100%; height: auto; max-height: 540px; object-fit: contain; border-radius: calc(var(--radius) - 6px); background: var(--wool-2); }
.st-missing { display: none; padding: 52px 20px; text-align: center; color: var(--muted); font-size: .86rem; line-height: 1.7; }
.st-frame.is-missing img { display: none; }
.st-frame.is-missing .st-missing { display: block; }
.st-photo figcaption { margin-top: 12px; font-size: .8rem; color: var(--ink-2); line-height: 1.65; max-width: 46ch; }
.st-photo figcaption .cr { display: block; color: var(--muted); font-size: .74rem; margin-top: 3px; }
.st-photo figcaption .cr a { color: var(--muted); }

/* الوثيقة المطبعية — حين لا صورة: رسالة، كتاب، عمود صحيفة، مجلة */
.st-doc { aspect-ratio: 4/5; max-height: 470px; display: grid; place-items: center; padding: clamp(22px, 4vw, 46px); position: relative; box-shadow: var(--shadow-lift); border-radius: var(--radius-sm); }
.st-doc-inner { display: grid; gap: 10px; text-align: center; max-width: 26ch; }
.st-doc .l1, .st-doc .l2, .st-doc .l3 { display: block; line-height: 1.5; unicode-bidi: plaintext; }

.st-doc--letter { background: linear-gradient(180deg, #FBF6E9, #EFE6D0); border: 1px solid #D9CBA6; transform: rotate(.8deg); color: #2B2417; }
.st-doc--letter::before { content: ""; position: absolute; inset: 14px; border: 1px dashed color-mix(in srgb, #8F6516 55%, transparent); border-radius: 4px; }
.st-doc--letter .l1 { font-family: var(--f-body); font-size: .8rem; letter-spacing: .04em; color: #7A6236; }
.st-doc--letter .l2 { font-family: var(--f-poem); font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; }
.st-doc--letter .l3 { font-family: var(--f-display); font-size: 1.05rem; color: #5B4E33; }
.st-doc--letter::after { content: ""; position: absolute; left: 24px; bottom: 24px; width: 66px; height: 66px; border: 2px solid color-mix(in srgb, #7E3510 55%, transparent); border-radius: 50%; transform: rotate(-14deg); opacity: .6; }

.st-doc--book { background: linear-gradient(90deg, #1B4D37 0 14px, #12362A 14px 18px, #1F4A39 18px); color: #F3EFE2; border-radius: 3px 8px 8px 3px; transform: rotate(-1deg); }
.st-doc--book::before { content: ""; position: absolute; inset: 26px 26px 26px 40px; border: 1px solid color-mix(in srgb, #D1A64A 80%, transparent); }
.st-doc--book .l1 { font-family: var(--f-kufi); font-size: clamp(1.3rem, 2.6vw, 1.8rem); color: #EFCF7C; }
.st-doc--book .l2 { font-family: var(--f-body); font-size: .85rem; letter-spacing: .12em; opacity: .8; }
.st-doc--book .l3 { font-family: var(--f-poem); font-size: 1.05rem; margin-top: 18px; opacity: .92; }

.st-doc--column { background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(27,26,23,.08) 22px 23px), #F4F0E6; border: 1px solid #B9B2A2; color: #1B1A17; transform: rotate(.5deg); }
.st-doc--column::before { content: ""; position: absolute; top: 18px; right: 18px; left: 18px; height: 3px; background: #1B1A17; }
.st-doc--column .l1 { font-family: var(--f-kufi); font-size: clamp(2rem, 5vw, 3.2rem); background: #F4F0E6; padding-inline: 8px; }
.st-doc--column .l2 { font-family: var(--f-body); font-size: .85rem; color: #3E3B34; background: #F4F0E6; padding-inline: 6px; }
.st-doc--column .l3 { font-family: var(--f-body); font-size: .78rem; color: #5E5A50; background: #F4F0E6; padding-inline: 6px; margin-top: 14px; }

.st-doc--magazine { background: linear-gradient(160deg, #C9392E, #8F1E1A); color: #FFF7EC; transform: rotate(-.7deg); }
.st-doc--magazine::before { content: ""; position: absolute; inset: 16px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; }
.st-doc--magazine .l1 { font-family: var(--f-kufi); font-size: clamp(2rem, 5vw, 3rem); color: #FFF; }
.st-doc--magazine .l2 { font-family: var(--f-body); font-size: .85rem; letter-spacing: .1em; opacity: .85; }
.st-doc--magazine .l3 { font-family: var(--f-poem); font-size: 1.05rem; margin-top: 18px; opacity: .95; }

/* النص */
.st-era { display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); margin-bottom: 14px; }
.st-era b { direction: ltr; unicode-bidi: isolate; font-family: var(--f-kufi); font-weight: 500; font-size: .95rem; color: var(--wool); background: var(--zari); padding: 4px 11px; border-radius: 999px; letter-spacing: .02em; }
.st-text h3 { margin: 0 0 8px; font-family: var(--f-head); font-weight: 800; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.3; color: var(--ink); }
.st-kicker { margin: 0 0 18px; font-family: var(--f-display); font-size: 1.08rem; color: var(--ink-2); line-height: 1.6; max-width: 44ch; }
.st-body { max-width: 62ch; font-size: 1.02rem; line-height: 1.95; color: var(--ink); }
.st-body p { margin: 0 0 1em; }
.st-quote { margin: 22px 0 18px; padding: 14px 20px 14px 0; border-right: 2px solid var(--zari); font-family: var(--f-poem); font-size: 1.35rem; line-height: 1.7; color: var(--ink); max-width: 46ch; }
.st-quote .ic { color: var(--zari); margin-inline-end: 6px; font-size: .8em; }
.st-quote cite { display: block; font-family: var(--f-body); font-style: normal; font-size: .76rem; color: var(--muted); margin-top: 8px; }
.st-sources { font-size: .78rem; color: var(--muted); line-height: 1.8; }
.st-sources span { color: var(--ink-2); }
.st-sources i { font-style: normal; }

@media (max-width: 860px) {
  .story .wrap, .story.is-flip .wrap { grid-template-columns: 1fr; gap: 26px; }
  .story.is-flip .st-visual { order: 1; }
  .story.is-flip .st-text { order: 2; }
  .st-visual { max-width: 440px; margin-inline: auto; width: 100%; }
  .st-doc { max-height: 350px; }
  .st-frame img { max-height: 380px; }
}


/* ============================================================
   الموقع بصفحات: الصفحة الرئيسية (مقدمة السيرة وأبواب الأرشيف)، وصفحة القصيدة، وصفحة الكتاب
   ============================================================ */
.home-lead .lead-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.lead-text h2 { font-family: var(--f-head); font-weight: 800; font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1.35; color: var(--ink); position: relative; padding-bottom: 12px; margin-bottom: 14px; }
.lead-text h2::after { content: ""; position: absolute; right: 0; bottom: 0; width: 64px; height: 2px; background: var(--zari); }
.lead-text p { font-size: 1.08rem; line-height: 2; color: var(--ink); max-width: 40rem; }
.lead-text .more { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--zari); font-weight: 700; }
.lead-text .more .ic { transition: transform .3s var(--ease); }
.lead-text .more:hover { text-decoration: none; } .lead-text .more:hover .ic { transform: translateX(-4px); }
.entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.entry { display: grid; grid-template-rows: 170px auto; background: var(--wool-3); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; }
.entry:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--zari); text-decoration: none; }
.entry .e-img { position: relative; background: var(--wool-2); overflow: hidden; }
.entry .e-img img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; transition: transform .6s var(--ease); }
.entry:hover .e-img img { transform: scale(1.04); }
.entry .e-img.q { display: grid; place-items: center; padding: 20px; font-family: var(--f-poem); font-size: 1.35rem; line-height: 1.7; color: var(--ink); text-align: center; background: linear-gradient(160deg, var(--palm-soft), var(--wool-2)); background-image: var(--twill-dark); }
.entry .e-body { padding: 14px 16px 18px; display: grid; gap: 4px; align-content: start; }
.entry .e-n { display: flex; align-items: baseline; gap: 6px; }
.entry .e-n b { font-size: 1.7rem; font-weight: 700; color: var(--zari); line-height: 1; }
.entry .e-n small { font-size: .78rem; color: var(--muted); }
.entry h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.entry p { font-size: .86rem; color: var(--ink-2); line-height: 1.7; }
.crumb { font-size: .84rem; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); } .crumb a:hover { color: var(--zari); }
.single-poem { max-width: 54rem; margin: 20px auto 0; }
.single-poem h1 { font-family: var(--f-poem); font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.6rem); text-align: center; color: var(--ink); }
.single-poem .meta { text-align: center; color: var(--muted); font-size: .84rem; margin-top: 8px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.single-poem .meta b { font-weight: 400; color: var(--ink-2); }
.single-poem .verses { font-size: clamp(1.45rem, 2.4vw, 1.7rem); line-height: 2.25; margin-top: 30px; max-width: none; }
.single-poem .poem-foot { max-width: none; margin-top: 20px; }
.single-poem .pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); }
.single-poem .pager a { display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); font-size: .78rem; }
.single-poem .pager a b { font-family: var(--f-poem); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.single-poem .pager a:hover { text-decoration: none; } .single-poem .pager a:hover b { color: var(--zari); }
.single-poem .pager a:last-child { text-align: end; align-items: flex-end; }
.single-book .bk-grid { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; margin-top: 16px; }
.single-book .bk-cover { border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-lift); aspect-ratio: 3/4.3; background: var(--wool-2); position: relative; }
.single-book .bk-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.single-book .bk-cover .cover.typo { position: absolute; inset: 0; }
.single-book h1 { font-family: var(--f-head); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.4; color: var(--ink); }
.single-book .byline { color: var(--ink-2); margin-top: 8px; }
.single-book .facts-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: .9rem; margin-top: 12px; }
.single-book .note { margin-top: 16px; font-size: 1.04rem; line-height: 1.9; color: var(--ink); max-width: 40rem; }
.single-book .listen { margin-top: 10px; }
.single-book h3 { font-family: var(--f-head); font-weight: 800; font-size: 1.3rem; color: var(--ink); margin: 28px 0 6px; }
.single-book ul li { padding: 8px 0; border-top: 1px dashed var(--line); font-size: .93rem; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.single-book ul li .num { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.book .cl { display: block; color: inherit; } .book .cl:hover { text-decoration: none; }
.book .meta .row .abtn { padding: 2px 10px; }
@media (max-width: 900px) {
  .home-lead .lead-grid { grid-template-columns: 1fr; }
  .single-book .bk-grid { grid-template-columns: 1fr; }
  .single-book .bk-cover { max-width: 280px; }
}

/* ---------- الجولة في الزمن (الصفحة الرئيسية): خيط مركزي وعُقد سنوية، وكل محطة لوحة ----------- */
.exhibit { position: relative; margin-top: 8px; }
.exhibit::before { content: ""; position: absolute; top: 0; bottom: 0; right: 50%; width: 1px; background: linear-gradient(var(--zari), var(--zari-deep)); }
.ex-decade { position: relative; text-align: center; margin: 34px 0 18px; font-family: var(--f-kufi); font-weight: 600; }
.ex-decade span { display: inline-block; background: var(--wool-2); color: var(--zari); border: 1px solid var(--zari); border-radius: 999px; padding: 4px 18px; font-size: 1rem; letter-spacing: .04em; }
.ex { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); gap: 0 18px; align-items: start; padding-block: 18px; }
.ex .ex-year { grid-column: 2; grid-row: 1; text-align: center; padding-top: 6px; position: relative; z-index: 1; }
.ex .ex-year b { display: inline-block; background: var(--zari); color: var(--wool); border-radius: 999px; padding: 4px 12px; font-size: .9rem; font-weight: 700; box-shadow: 0 0 0 4px var(--wool-2); }
/* السنة الهجرية على رقعة من لون الأرضية حتى لا يمرّ الخيط خلالها */
.ex .ex-year small { display: inline-block; color: var(--muted); font-size: .72rem; margin-top: 8px; background: var(--wool-2); padding: 1px 8px; border-radius: 999px; }
.ex .ex-text { grid-column: 3; grid-row: 1; background: var(--wool-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: .98rem; line-height: 1.85; color: var(--ink); box-shadow: var(--shadow); }
.ex .ex-visual { grid-column: 1; grid-row: 1; justify-self: end; max-width: 320px; width: 100%; display: block; padding: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift); background: var(--wool-3); border: 1px solid var(--line); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
button.ex-visual { cursor: zoom-in; }
.ex .ex-visual:hover { transform: translateY(-4px); text-decoration: none; border-color: var(--zari); }
/* الصورة كاملة بلا قصّ: تُعرض بنسبتها الأصلية */
.ex .ex-visual img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.ex .ex-visual.cover { max-width: 210px; }
.ex .ex-visual.verse { padding: 18px 20px; font-family: var(--f-poem); color: var(--ink); background: linear-gradient(160deg, var(--palm-soft), var(--wool-2)); }
.ex .ex-visual.verse .t { display: block; font-family: var(--f-body); font-size: .74rem; color: var(--zari); margin-bottom: 8px; }
.ex .ex-visual.verse .l { display: block; font-size: 1.25rem; line-height: 1.9; }
.ex.is-flip .ex-text { grid-column: 1; }
.ex.is-flip .ex-visual { grid-column: 3; justify-self: start; }
.ex-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .84rem; color: var(--zari); font-weight: 700; }
.ex-cta .ic { transition: transform .3s var(--ease); } .ex-cta:hover { text-decoration: none; } .ex-cta:hover .ic { transform: translateX(-3px); }
.ex-more { text-align: center; margin-top: 30px; }
@media (prefers-reduced-motion: no-preference) {
  .ex.will-in .ex-text, .ex.will-in .ex-visual { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .ex.will-in .ex-visual { transition-delay: .1s; }
  .ex.is-in .ex-text, .ex.is-in .ex-visual { opacity: 1; transform: none; }
}
.doors-section { padding-block: clamp(18px, 3vw, 30px) 0; }
.doors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.doors .lbl { font-size: .8rem; color: var(--muted); margin-inline-end: 6px; }
.doors a { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: .88rem; color: var(--ink); background: var(--wool-3); }
.doors a:hover { border-color: var(--zari); color: var(--zari); text-decoration: none; }
.doors a b { font-size: .74rem; color: var(--muted); font-weight: 400; }
@media (max-width: 760px) {
  .exhibit::before { right: 22px; }
  .ex, .ex.is-flip { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; }
  .ex .ex-year, .ex.is-flip .ex-year { grid-column: 1; grid-row: 1; padding-top: 2px; }
  .ex .ex-year b { padding: 3px 8px; font-size: .78rem; }
  .ex .ex-visual, .ex.is-flip .ex-visual { grid-column: 2; grid-row: 1; justify-self: start; max-width: 100%; }
  .ex .ex-visual.cover { max-width: 160px; }
  .ex .ex-text, .ex.is-flip .ex-text { grid-column: 2; grid-row: auto; margin-top: 10px; }
  .ex.has-visual .ex-text, .ex.has-visual.is-flip .ex-text { grid-row: 2; }
  .ex:not(.has-visual) .ex-text { grid-row: 1; margin-top: 0; }
}


/* العنصر الذي وصل إليه رابط مباشر يتوهّج لحظةً */
.is-target { outline: 2px solid var(--zari); outline-offset: 6px; border-radius: var(--radius); transition: outline-color 1.2s var(--ease); }

/* ============================================================
   جغرافيا الشعر — أنماط الخريطة
   الأرض قماش صوفي (--wool) وكل خيط عليها زري ذهبي (--zari).
   لا لون مكتوب مباشرة: الرموز تتبدّل مع الثيم من الورقة الرئيسية.
   --px يضبطه map.js = عرض viewBox ÷ عرض الشاشة، فتبقى الأحجام ثابتة عند أي تكبير.
   ============================================================ */

/* ---------- التخطيط ---------- */
/* الخريطة بكامل العرض ولوحة المدينة تحتها بالعرض (6 أكتوبر 2026 بطلب المالك) */
.map-wrap { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.map-stage { position: relative; background: var(--sea); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; direction: ltr; }
/* حاشية زري داخلية كحاشية البشت */
.map-stage::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--zari); border-radius: var(--radius); opacity: .35; pointer-events: none; }
/* ضفيرة الزري حاشيةً علوية للخريطة */
.map-stage::before { content: ""; position: absolute; top: 0; left: 36px; right: 36px; height: 8px; z-index: 3; background-color: var(--zari); -webkit-mask: var(--braid) repeat-x center; mask: var(--braid) repeat-x center; opacity: .9; pointer-events: none; }
#map { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 560; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; direction: ltr; --px: 1; }
.map-stage.is-dragging #map { cursor: grabbing; }
#map:focus-visible { outline: 2px solid var(--zari); outline-offset: -2px; }

/* ---------- الأرض والبحر ----------
   الأرض صورة أقمار صناعية تحت غسيل يتبع الثيم؛ الدول شفافة فوقها إلا المزارة فبصبغة زري.
   عند التقريب الشديد (deep) تتلاشى الصورة وتعود ألوان القماش وتتكشّف الواحة المرسومة. */
#map .shade { fill: var(--map-shade); pointer-events: none; }
#map .sea { fill: transparent; }
#map .land { fill: transparent; stroke: var(--wool); stroke-opacity: .5; stroke-width: calc(.7px * var(--px)); stroke-linejoin: round; }
#map .land.visited { fill: color-mix(in srgb, var(--zari) 16%, transparent); }
#map .weave { opacity: .3; }
#map .seas text { font: italic 400 12px var(--f-poem); fill: var(--ink-2); opacity: .8; letter-spacing: .25em; pointer-events: none; }
/* النخلة المرسومة: جذع زري وسعف أخضر */
#map .palm path { fill: none; stroke-linecap: round; stroke-width: 1.2; }
#map .palm .trunk { stroke: var(--zari-deep); }
#map .palm .fronds { stroke: var(--palm); }
/* شعار الواحة عند الموطن: يكبر قليلاً عند التقريب */
#map .oasis-mark { transform-origin: 0 0; transition: transform .4s var(--ease); }
#map[data-zoom="near"] .oasis-mark { transform: scale(1.45); }
#map .oasis-mark .ground { fill: var(--palm); fill-opacity: .28; stroke: var(--palm); stroke-opacity: .6; stroke-width: .8; }
#map .oasis-mark .pool { fill: color-mix(in srgb, var(--palm) 30%, var(--wool-3)); stroke: var(--wool-3); stroke-width: .6; }
/* رموز المدن المرسومة فوق الدبابيس عند التقريب */
#map .pin .ico { fill: none; stroke: var(--zari-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .3s var(--ease); pointer-events: none; }
#map[data-zoom="near"] .pin .ico { opacity: 1; }
.map-legend .lg-credit { flex-basis: 100%; font-size: .72rem; color: var(--muted); }
.map-legend .lg-credit a { color: var(--muted); text-decoration: underline; }

/* ---------- خيوط الزري من القارة ---------- */
#map .thread { fill: none; stroke: var(--zari); stroke-width: calc(1px * var(--px)); stroke-dasharray: calc(3.5px * var(--px)) calc(3.5px * var(--px)); stroke-linecap: round; opacity: .7; pointer-events: none; transition: opacity .3s var(--ease); }
#map .thread.is-lit { stroke-dasharray: none; stroke-width: calc(1.4px * var(--px)); opacity: .95; }
#map .thread.is-on, #map .thread.is-stitching { stroke: var(--zari-2); stroke-dasharray: none; stroke-width: calc(2px * var(--px)); opacity: 1; }
#map .thread.is-on { filter: drop-shadow(0 0 calc(2px * var(--px)) var(--zari)); }

/* كل ما داخل .mark و.lbl مرسوم بوحدات البكسل ثم يُقاس بـ --px */
#map .mark, #map .lbl { transform: scale(var(--px)); }

/* النقطة السائرة على الخيط أثناء التشغيل */
#map .dot { visibility: hidden; pointer-events: none; }
#map .dot.is-on { visibility: visible; }
#map .dot circle { fill: var(--zari-2); stroke: var(--wool); stroke-width: 1; }

/* ---------- الدبابيس ---------- */
#map .pin { cursor: pointer; outline: none; }
#map .pin .hit { fill: transparent; stroke: none; }
#map .pin .dotp { fill: var(--palm); stroke: var(--wool); stroke-width: 1.8; transition: fill .25s var(--ease), stroke .25s var(--ease); }
#map .pin .ring { fill: none; stroke: var(--zari-2); stroke-width: 1.5; opacity: 0; transition: opacity .2s var(--ease); }
#map .pin:hover .dotp, #map .pin.is-lit .dotp { fill: var(--zari-deep); }
#map .pin.is-on .dotp { fill: var(--zari); stroke: var(--zari-2); }
#map .pin.is-on .ring, #map .pin:focus-visible .ring { opacity: .95; }
#map .pin.home .dia { fill: var(--zari); stroke: var(--wool); stroke-width: 1.8; }
#map .pin.home.is-on .dia { fill: var(--zari-2); }
#map .pin.home .halo { fill: none; stroke: var(--zari); stroke-width: 1.2; opacity: .6; transform-origin: 0 0; animation: map-halo 2.6s var(--ease) infinite; }
@keyframes map-halo { from { transform: scale(1); opacity: .7; } to { transform: scale(3.4); opacity: 0; } }

/* الأسماء: هالة بلون القماش حول الحروف لتُقرأ فوق أي أرض */
#map .pin text { font-family: var(--f-body); font-size: 12.5px; font-weight: 500; fill: var(--ink); paint-order: stroke; stroke: var(--wool); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: all; }
#map .pin.home text { font-weight: 700; }
#map .pin.is-on text { font-weight: 700; fill: var(--zari-deep); }
#map[data-zoom="far"] .pin.minor:not(.is-on) text { display: none; }

/* ---------- الأدوات فوق الخريطة ---------- */
.map-tools { position: absolute; inset: 12px; z-index: 3; pointer-events: none; direction: rtl; }
.map-tools > * { pointer-events: auto; }
.map-views, .map-zoom { position: absolute; display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: color-mix(in srgb, var(--wool-3) 90%, transparent); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(4px); box-shadow: var(--shadow); }
.map-views { top: 0; right: 0; }
.map-zoom { bottom: 0; left: 0; }
.map-play { position: absolute; top: 0; left: 0; }
.map-btn { font: 500 .78rem/1 var(--f-body); color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 7px 12px; cursor: pointer; white-space: nowrap; transition: background .2s var(--ease), color .2s var(--ease); }
.map-btn:hover { background: var(--wool-2); color: var(--ink); }
.map-btn.is-on { background: var(--palm); color: var(--wool); border-color: var(--palm); }
.map-btn:focus-visible { outline: 2px solid var(--zari); outline-offset: 2px; }
.map-zoom .map-btn { min-width: 32px; text-align: center; font-size: .95rem; padding-block: 5px; }
.map-zoom [data-zoom="reset"] { font-size: .74rem; padding-block: 7px; }
.map-play { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-weight: 600; color: var(--zari-deep); background: color-mix(in srgb, var(--wool-3) 92%, transparent); border-color: var(--zari); box-shadow: var(--shadow); backdrop-filter: blur(4px); }
.map-play:hover { background: var(--wool-3); color: var(--zari-deep); }
.map-play .ic { font-size: 13px; }
.map-play .ip { fill: currentColor; stroke: none; }
.map-play .ipa, .map-play .ir { display: none; }
.map-play[data-state="playing"] .ip, .map-play[data-state="done"] .ip { display: none; }
.map-play[data-state="playing"] .ipa { display: inline-block; }
.map-play[data-state="done"] .ir { display: inline-block; }

/* ---------- التلميح وقراءة السنة ---------- */
.map-tip { position: absolute; z-index: 4; pointer-events: none; background: var(--ink); color: var(--wool); font: 500 .76rem/1.2 var(--f-body); padding: 5px 10px; border-radius: var(--radius); white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); direction: rtl; }
.map-year { position: absolute; z-index: 2; bottom: 10px; right: 14px; pointer-events: none; font: 700 clamp(2rem, 5vw, 3.4rem)/1 var(--f-display); font-variant-numeric: tabular-nums; color: var(--zari-deep); text-shadow: 0 1px 0 var(--wool), 0 0 18px var(--wool); opacity: 0; transition: opacity .4s var(--ease); direction: rtl; }
.map-year.is-in { opacity: 1; }

/* ---------- اللوحة الجانبية ---------- */
.map-panel { position: relative; overflow: visible; background: var(--wool-3); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-height: 240px; }
.map-panel::before { content: ""; position: absolute; top: -4px; left: 28px; right: 28px; height: 8px; background-color: var(--zari); -webkit-mask: var(--braid) repeat-x center; mask: var(--braid) repeat-x center; pointer-events: none; }
.mp-name { font: 800 1.4rem/1.4 var(--f-head); color: var(--ink); margin: 0; }
.mp-sub { font-size: .82rem; color: var(--muted); margin: 2px 0 12px; }
.mp-nav .ic { font-size: 12px; vertical-align: -1px; }
.mp-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px 14px; }
.mp-items li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 9px 10px; margin: 0; border: 1px dashed var(--line); border-radius: var(--radius); border-inline-start: 3px solid transparent; font-size: .9rem; line-height: 1.65; color: var(--ink-2); transition: background .3s var(--ease), border-color .3s var(--ease); }
.mp-items li.is-hl { background: var(--wool-2); border-inline-start-color: var(--zari); color: var(--ink); }
.mp-items .y { text-align: start; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .78rem; padding-top: 3px; }
.mp-tag { display: inline-block; font: 600 .66rem/1.6 var(--f-body); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); padding: 0 7px; border-radius: 999px; margin-inline-end: 6px; vertical-align: middle; }
.mp-items .tlink, .mp-off .tlink { color: inherit; }
.mp-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.mp-nav .map-btn { border-color: var(--line-strong); }
.mp-pos { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-off { margin-top: 12px; padding: 8px 10px; background: var(--wool-2); border-radius: var(--radius); font-size: .8rem; line-height: 1.6; color: var(--ink-2); }

/* ---------- المفتاح ---------- */
.map-legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: .78rem; color: var(--ink-2); }
.map-legend li { display: flex; align-items: center; gap: 7px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--palm)); flex: none; }
.map-legend .lg-home { width: 9px; height: 9px; border-radius: 1px; background: var(--zari); transform: rotate(45deg); }
.map-legend .lg-pin { background: var(--palm); box-shadow: 0 0 0 1.5px var(--wool); }
.map-legend .lg-thread { width: 24px; height: 0; border-radius: 0; background: none; border-top: 1.5px dashed var(--zari); }
.map-legend .lg-tag i { width: 8px; height: 8px; border-radius: 2px; }
.map-legend .lg-sum { margin-inline-start: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- القماش المطرّز: نسيج وغرز وعمق ---------- */
.map-col { display: grid; gap: 10px; perspective: 1600px; }
/* الأرض قماش البشت نفسه؛ البحر شفاف فوقه. الخريطة تميل بضع درجات مع المؤشر وترمي ظلاً */
.map-stage { background-image: var(--twill-dark); box-shadow: var(--shadow-lift); transform: rotateX(var(--mrx, 0deg)) rotateY(var(--mry, 0deg)); transition: transform .3s var(--ease); }
.map-stage.is-dragging { transform: none; }
#map .sea { fill: transparent; }
/* حدود الدول العربية غرزٌ متقطعة بخيط الزري */
#map .land.arab { stroke: var(--zari-deep); stroke-opacity: .5; stroke-dasharray: calc(2.2px * var(--px)) calc(1.6px * var(--px)); }
/* الدول المزارة مطرّزة بغرز مائلة فوق لونها */
#map .weave path { fill: url(#stitch); pointer-events: none; }
#map #stitch line { stroke: var(--zari-deep); stroke-width: calc(.55px * var(--px)); opacity: .42; }
#map .thread { stroke-width: calc(1.3px * var(--px)); }
#map .thread.is-lit { filter: drop-shadow(0 calc(1px * var(--px)) 0 rgba(0,0,0,.35)); }

/* ---------- الشريط الزمني: خيط تسحب عليه عُقدة ---------- */
.map-time { direction: rtl; position: relative; padding: 4px 8px 16px; }
.map-time[hidden] { display: none; }
.mt-lbl { display: flex; justify-content: space-between; gap: 10px; font: 500 .78rem/1.4 var(--f-body); color: var(--muted); margin-bottom: 4px; }
.mt-lbl b { font-weight: 700; color: var(--zari-deep); font-variant-numeric: tabular-nums; }
#mapRange { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; --v: 0%; }
#mapRange::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(to left, var(--zari) var(--v), var(--line-strong) var(--v)); }
#mapRange::-moz-range-track { height: 2px; border-radius: 2px; background: var(--line-strong); }
#mapRange::-moz-range-progress { height: 2px; background: var(--zari); }
#mapRange::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; background: var(--zari); border: 2px solid var(--wool-3); border-radius: 2px; transform: rotate(45deg); box-shadow: 0 0 0 1px var(--zari-deep); }
#mapRange::-moz-range-thumb { width: 11px; height: 11px; background: var(--zari); border: 2px solid var(--wool-3); border-radius: 2px; transform: rotate(45deg); box-shadow: 0 0 0 1px var(--zari-deep); }
#mapRange:focus-visible { outline: 2px solid var(--zari); outline-offset: 4px; border-radius: 4px; }
.mt-ticks { position: relative; height: 16px; margin: 2px 7px 0; font: 500 .7rem/1 var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-ticks span { position: absolute; right: var(--x); top: 6px; transform: translateX(50%); }
.mt-ticks span::before { content: ""; position: absolute; top: -7px; right: 50%; width: 1px; height: 5px; background: var(--line-strong); }

/* ---------- بيت القصيدة عند المحطة ---------- */
.map-verse {
  position: absolute; z-index: 2; left: 50%; bottom: 14px; width: max-content; max-width: min(58%, 460px); direction: rtl; text-align: right;
  padding: 12px 16px; background: color-mix(in srgb, var(--wool-3) 90%, transparent); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(4px);
  opacity: 0; transform: translate(-50%, 10px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.map-verse[hidden] { display: none; }
.map-verse.is-in { opacity: 1; transform: translate(-50%, 0); }
.mv-t { display: block; font: 500 .72rem/1.4 var(--f-body); color: var(--zari-deep); margin-bottom: 4px; }
.mv-b { display: grid; gap: 2px; font: 400 clamp(1rem, 1.5vw, 1.2rem)/1.7 var(--f-poem); color: var(--ink); }
.mv-go { display: inline-block; margin-top: 6px; font: 500 .74rem/1.4 var(--f-body); color: var(--palm); }

/* ---------- الشاشات الضيقة ---------- */
@media (max-width: 700px) {
  #map { aspect-ratio: 4 / 3; }
  .map-tools { inset: 8px; }
  .map-btn { font-size: .72rem; padding: 6px 9px; }
  .map-play { padding: 7px 10px; gap: 6px; }
  .map-year { bottom: auto; top: 46px; right: 10px; }
  .map-verse { left: 8px; right: 8px; bottom: 48px; width: auto; max-width: none; transform: translateY(10px); }
  .map-verse.is-in { transform: none; }
  .map-stage { transform: none; }
  .mp-items { grid-template-columns: 1fr; gap: 8px; }
  .mp-items li { grid-template-columns: 52px 1fr; }
}

/* ---------- تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  #map .pin.home .halo { animation: none; transform: scale(1.8); opacity: .45; }
  #map .thread, #map .pin .dotp, #map .pin .ring, .map-btn, .map-year, .mp-items li { transition: none; }
}
