/* Basaer / Clear Proofs — encyclopedia theme
   Palette taken from shuounislamiya.org (header #2A1C10→#3A2716, nav #4A2F1A→#5A3A20,
   gold #E0C08A, page #F4ECD8, cards #F9F2E0 / #D9CDB3, gold button #6D5636→#B89660). */

@font-face { font-family: 'Thmanyah'; src: url('../fonts/thmanyahsans-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Thmanyah'; src: url('../fonts/thmanyahsans-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Thmanyah'; src: url('../fonts/thmanyahsans-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Thmanyah'; src: url('../fonts/thmanyahsans-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Thmanyah'; src: url('../fonts/thmanyahsans-Black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --bg: #F4ECD8;
  --bg-2: #EFE6CF;
  --paper: #FBF7EC;
  --card: #F9F2E0;
  --line: #D9CDB3;
  --line-2: #E7DDC6;
  --ink: #2B2010;
  --ink-2: #3B2E1A;
  --muted: #76664D;
  --muted-2: #9A8A6E;
  --gold: #E0C08A;
  --gold-2: #B89660;
  --gold-3: #8B6F47;
  --gold-4: #6D5636;
  --brown-900: #24180D;
  --brown-800: #2A1C10;
  --brown-700: #3A2716;
  --brown-600: #4A2F1A;
  --brown-500: #5A3A20;
  --red: #A3281B;
  --verse: #6E4B12;
  --link: #7A4B18;
  --mark: rgba(224, 192, 138, .45);
  --shadow: 0 6px 22px rgba(59, 46, 26, .08);
  --shadow-2: 0 14px 40px rgba(59, 46, 26, .14);
  --radius: 12px;
  --grad-gold: linear-gradient(135deg, #6D5636 0%, #8B6F47 55%, #B89660 100%);
  --grad-top: linear-gradient(135deg, #2A1C10, #3A2716);
  --grad-nav: linear-gradient(135deg, #4A2F1A, #5A3A20);
  --grad-foot: linear-gradient(#3A2716, #24180D);
  --wrap: 1240px;
  --read: 46rem;
  --fs: 19px;
  --lh: 2.05;
  /* Arabic edition: Thmanyah only */
  --f-body: 'Thmanyah', sans-serif;
  --f-alt: 'Thmanyah', sans-serif;
  --f-ui: 'Thmanyah', sans-serif;
  --f-head: 'Thmanyah', sans-serif;
  --f-quran: 'Thmanyah', sans-serif;
  --f-brand: 'Thmanyah', sans-serif;
  --f-num: 'Thmanyah', sans-serif;
  --f-latin: 'Thmanyah', sans-serif;
  --f-arabic: 'Thmanyah', sans-serif;
  color-scheme: light;
}
html[lang="en"] {
  --f-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --f-alt: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --f-ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --f-head: 'Source Serif 4', Georgia, serif;
  --f-brand: 'Source Serif 4', Georgia, serif;
  --f-num: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --f-latin: 'Source Serif 4', Georgia, serif;
  --f-arabic: 'Thmanyah', sans-serif;
  --f-quran: 'Thmanyah', sans-serif;
  --fs: 18.5px;
  --lh: 1.78;
}
html[data-font="b"] { --f-body: var(--f-alt); }
html[data-fs="1"] { --fs: 17px; }
html[data-fs="3"] { --fs: 21px; }
html[data-fs="4"] { --fs: 23.5px; }
html[lang="en"][data-fs="1"] { --fs: 16.5px; }
html[lang="en"][data-fs="3"] { --fs: 20.5px; }
html[lang="en"][data-fs="4"] { --fs: 23px; }

html[data-theme="sepia"] {
  --bg: #EADCBE; --bg-2: #E2D2B0; --paper: #F3E6CA; --card: #F1E3C4; --line: #CDB88F; --line-2: #D9C7A2;
  --ink: #2E2110; --muted: #6E5B3E;
}
html[data-theme="dark"] {
  --bg: #16100A; --bg-2: #1C140C; --paper: #1F170E; --card: #241A10; --line: #3E2F1E; --line-2: #33261A;
  --ink: #EDE3CC; --ink-2: #E2D5B8; --muted: #B3A386; --muted-2: #8F8067;
  --red: #E8836E; --verse: #E6C47E; --link: #E0C08A; --mark: rgba(224, 192, 138, .25);
  --shadow: 0 6px 22px rgba(0, 0, 0, .35); --shadow-2: 0 14px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-ui); font-size: 16px; line-height: 1.7;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--gold-2) 70%, transparent); text-underline-offset: .22em; }
a:hover { color: var(--gold-3); }
html[data-theme="dark"] a:hover { color: #F2D7A6; }
button { font: inherit; color: inherit; }
.ic { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; flex: none; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--brown-900); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 10px; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
kbd .ic { width: 1em; height: 1em; vertical-align: -.12em; }
kbd { font-family: var(--f-ui); font-size: .8em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 .4em; background: var(--card); }

/* ---------------------------------------------------------------- header */
.site-head { position: relative; z-index: 30; }
.topbar { background: var(--grad-top); color: #ECECEC; }
.topbar-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 72px; gap: 8px; }
.tb-side { display: flex; align-items: center; gap: 6px; }
.tb-end { justify-content: flex-end; }
.brand { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--gold); line-height: 1; }
.brand-main { font-family: var(--f-brand); font-weight: 900; font-size: 36px; line-height: 1.1; letter-spacing: 0; color: #F0D9A8; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.brand-sub { font-family: var(--f-ui); font-size: 11.5px; letter-spacing: .02em; color: #CDB690; margin-top: 3px; }
.brand-en .brand-sub { margin-top: 4px; }
.brand-en .brand-main { margin-top: 0; }
.brand-en .brand-main { font-family: var(--f-latin); font-weight: 600; font-size: 30px; letter-spacing: .01em; }
.brand-main.sm { font-size: 30px; color: var(--gold-3); text-shadow: none; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(224,192,138,.18); background: rgba(255,255,255,.04); color: #EADCC0; cursor: pointer; transition: background .2s, border-color .2s; }
.icon-btn:hover { background: rgba(224,192,138,.14); border-color: rgba(224,192,138,.4); color: #fff; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding-inline: 12px; border-radius: 10px; border: 1px solid rgba(224,192,138,.35); color: var(--gold); text-decoration: none; font-weight: 600; font-size: 14px; background: rgba(224,192,138,.06); }
.lang-btn:hover { background: rgba(224,192,138,.16); color: #fff; }
.lang-btn span { font-family: var(--f-ui); }
.lang-btn[lang="ar"] span, .chip-lang[lang="ar"] { font-family: 'Thmanyah', sans-serif; }
.mainnav { background: var(--grad-nav); border-top: 1px solid rgba(224,192,138,.12); border-bottom: 1px solid rgba(0,0,0,.25); box-shadow: 0 4px 14px rgba(36,24,13,.18); position: sticky; top: 0; }
.site-head { position: sticky; top: -72px; }
.mainnav-in { display: flex; justify-content: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav-in::-webkit-scrollbar { display: none; }
.mainnav a { flex: none; color: #E9DCC2; text-decoration: none; font-weight: 700; font-size: 15px; padding: 14px 16px 13px; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .2s, border-color .2s; }
.mainnav a:hover { color: var(--gold); }
.mainnav a.on { color: var(--gold); border-bottom-color: var(--gold); }
.progress { position: absolute; inset-inline: 0; bottom: -3px; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--grad-gold); box-shadow: 0 0 6px rgba(184,150,96,.6); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 12px; border: 0; font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .2s, filter .2s; font-family: var(--f-ui); }
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--grad-gold); color: #fff; box-shadow: 0 6px 16px rgba(109,86,54,.35); }
.btn-gold:hover { color: #fff; filter: brightness(1.06); }
.btn-line { border: 1px solid rgba(224,192,138,.55); color: var(--gold); background: transparent; }
.btn-line:hover { background: rgba(224,192,138,.12); color: #fff; }
.btn-line-dark { border: 1px solid var(--line); color: var(--ink-2); background: var(--card); }
.btn-ghost { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); min-height: 40px; padding: 0 14px; font-size: 14px; }

/* ---------------------------------------------------------------- hero (home) */
.hero { position: relative; overflow: hidden; background:
  radial-gradient(1200px 400px at 50% -80px, rgba(224,192,138,.18), transparent 60%),
  radial-gradient(600px 300px at 90% 110%, rgba(184,150,96,.12), transparent 60%),
  linear-gradient(160deg, #2A1C10 0%, #3A2716 55%, #4A2F1A 100%); color: #EFE3C9; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: radial-gradient(circle at 25% 25%, #E0C08A 1px, transparent 1.6px), radial-gradient(circle at 75% 75%, #E0C08A 1px, transparent 1.6px);
  background-size: 34px 34px; }
.hero-in { position: relative; text-align: center; padding: 56px 0 44px; }
.hero-kicker { display: inline-block; margin: 0 0 6px; padding: 4px 14px; border-radius: 999px; border: 1px solid rgba(224,192,138,.35); color: var(--gold); font-size: 13.5px; font-weight: 600; }
.hero-title { margin: 0 0 14px; font-family: var(--f-brand); font-weight: 900; font-size: clamp(72px, 11vw, 124px); line-height: 1.25; color: #F2DCAC; text-shadow: 0 4px 24px rgba(0,0,0,.35); }
.hero-title.en { font-family: var(--f-latin); font-weight: 600; font-size: clamp(52px, 8vw, 88px); line-height: 1.15; margin: 10px 0 6px; }
.hero-sub { margin: 4px auto 6px; max-width: 760px; font-size: clamp(18px, 2.2vw, 23px); font-weight: 600; color: #F1E6CE; }
.hero-author { margin: 0; color: var(--gold); font-weight: 700; font-size: 17px; }
.hero-tr { margin: 2px 0 0; color: #CDB690; font-size: 14px; }
.hero-search { position: relative; display: flex; align-items: center; gap: 8px; max-width: 720px; margin: 26px auto 18px; background: var(--paper); border-radius: 16px; padding: 7px; box-shadow: 0 14px 40px rgba(0,0,0,.35); color: var(--ink); }
.hero-search > .ic { margin-inline-start: 10px; color: var(--gold-3); width: 22px; height: 22px; }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 17px; padding: 10px 4px; color: var(--ink); outline: none; }
.hero-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 34px; margin: 30px 0 0; padding: 0; }
.hero-stats div { text-align: center; min-width: 110px; }
.hero-stats dt { font-size: 30px; font-weight: 800; color: #F2DCAC; font-family: var(--f-num); line-height: 1.2; }
.hero-stats dd { margin: 0; color: #CDB690; font-size: 14px; }
.hero-dl { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-dl a { display: inline-flex; align-items: center; gap: 6px; color: #E9DCC2; text-decoration: none; font-size: 14px; padding: 7px 14px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(224,192,138,.22); }
.hero-dl a:hover { background: rgba(224,192,138,.14); color: #fff; }

/* ---------------------------------------------------------------- section headings */
.home { padding: 40px 0 70px; }
.h-sec { margin-bottom: 54px; }
.h-line { position: relative; margin: 0 0 22px; padding-bottom: 12px; font-family: var(--f-head); font-weight: 800; font-size: 26px; color: var(--ink); }
html[lang="en"] .h-line { font-weight: 600; }
.h-line::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; width: 64px; height: 3px; border-radius: 3px; background: var(--grad-gold); }
.h-sub { margin: -12px 0 22px; color: var(--muted); }

/* parts */
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.part-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pc-head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 10px; text-decoration: none; color: var(--ink); }
.pc-num { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 14px; background: var(--grad-gold); color: #fff; font-family: var(--f-num); font-weight: 800; font-size: 24px; box-shadow: 0 6px 14px rgba(109,86,54,.35); }
.pc-head small { display: block; color: var(--gold-3); font-weight: 700; font-size: 13px; }
.pc-head b { display: block; font-family: var(--f-head); font-size: 21px; line-height: 1.4; }
.pc-sub { margin: 0 20px 10px; color: var(--muted); font-size: 14.5px; }
.pc-list { list-style: none; margin: 0; padding: 0 12px; flex: 1; }
.pc-list a { display: flex; flex-direction: column; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); border-top: 1px dashed var(--line-2); }
.pc-list li:first-child a { border-top: 0; }
.pc-list a:hover { background: var(--bg-2); }
.pc-list a span { font-size: 12.5px; color: var(--gold-3); font-weight: 700; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 0; padding: 12px 20px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 14px; }
.pc-foot a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--grad-gold); color: #fff; }

/* featured */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .18s, box-shadow .2s, border-color .2s; border-top: 3px solid var(--gold-2); }
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); color: var(--ink); border-color: var(--gold-2); }
.feat-k { font-size: 12.5px; color: var(--gold-3); font-weight: 700; }
.feat b { font-family: var(--f-head); font-size: 18px; line-height: 1.6; }
.feat-ex { color: var(--muted); font-size: 14px; line-height: 1.75; font-family: var(--f-body); }

/* chapter tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background .2s, border-color .2s, transform .15s; }
.tile:hover { border-color: var(--gold-2); background: var(--paper); transform: translateY(-2px); color: var(--ink); }
.tile-n { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold-2); color: var(--gold-4); font: 800 19px var(--f-num); background: var(--paper); }
.tile-t { flex: 1; min-width: 0; }
.tile-t small { display: block; color: var(--gold-3); font-weight: 700; font-size: 12.5px; }
.tile-t b { display: block; font-family: var(--f-head); font-size: 16.5px; line-height: 1.5; }
.tile-c { flex: none; font: 700 13px var(--f-num); color: var(--muted); background: var(--bg-2); border-radius: 999px; padding: 3px 10px; }

/* ---------------------------------------------------------------- band (hub headers) */
.band { background: linear-gradient(160deg, #2A1C10 0%, #3A2716 60%, #4A2F1A 100%); color: #EFE3C9; position: relative; overflow: hidden; }
.band::before { content: ""; position: absolute; inset: 0; opacity: .06; background-image: radial-gradient(circle at 25% 25%, #E0C08A 1px, transparent 1.6px); background-size: 30px 30px; pointer-events: none; }
.band-in { position: relative; padding: 22px 0 34px; }
.band-sm .band-in { padding-bottom: 26px; }
.band h1 { margin: 6px 0 8px; font-family: var(--f-head); font-weight: 800; font-size: clamp(28px, 4vw, 42px); line-height: 1.35; color: #F4E4C0; }
html[lang="en"] .band h1 { font-weight: 600; }
.band h1 small { display: block; font-size: .45em; color: var(--gold); font-weight: 700; margin-bottom: 4px; font-family: var(--f-ui); }
.band-kicker { margin: 12px 0 0; color: var(--gold); font-weight: 700; font-size: 14px; }
.band-sub { margin: 0 0 12px; color: #D9C8A6; font-size: 17px; max-width: 800px; }
.band-meta { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; color: #CDB690; font-size: 14.5px; }
.band-meta span { padding: 3px 12px; border-radius: 999px; background: rgba(224,192,138,.1); border: 1px solid rgba(224,192,138,.22); }
.band .crumbs a, .band .crumbs span { color: #CDB690; }
.band .crumbs a:hover { color: #fff; }

/* crumbs */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "‹"; margin-inline: 6px; opacity: .6; }
html[dir="ltr"] .crumbs li + li::before { content: "›"; }
.crumbs a { text-decoration: none; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--gold-3); }
.crumbs span { color: var(--muted); }
.ic-home { width: 1.05em; height: 1.05em; }

/* ---------------------------------------------------------------- hubs */
.hub { padding: 30px 0 70px; }
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.intro-card, .prose-card { padding: 26px 30px; margin-bottom: 24px; }
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.q-list a { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .2s, background .2s, transform .15s; }
.q-list a:hover { border-color: var(--gold-2); background: var(--paper); transform: translateX(-2px); color: var(--ink); }
html[dir="ltr"] .q-list a:hover { transform: translateX(2px); }
.n { display: inline-grid; place-items: center; flex: none; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 10px; background: var(--grad-gold); color: #fff; font: 700 15px var(--f-num); }
.n-star { background: var(--bg-2); color: var(--gold-3); border: 1px solid var(--line); }
.qt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qt b { font-family: var(--f-head); font-size: 17.5px; line-height: 1.6; font-weight: 700; }
html[lang="en"] .qt b { font-weight: 600; }
.qt .ex { color: var(--muted); font-size: 14.5px; line-height: 1.8; font-family: var(--f-body); }
.sec-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.sec-toc a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
html[dir="rtl"] .sec-toc a { padding: 6px 6px 6px 14px; }
.sec-toc a .n { min-width: 28px; height: 28px; border-radius: 50%; font-size: 13px; }
.sec { margin: 34px 0; }
.sec h2 { font-family: var(--f-head); font-size: 25px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sec h2 small { display: block; font-size: 13px; color: var(--gold-3); font-family: var(--f-ui); }
.sec > .prose { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; margin-bottom: 14px; }
.part-hub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ch-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.ch-block h2 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 0 0 10px; font-family: var(--f-head); font-size: 20px; line-height: 1.45; }
.ch-block h2 a { text-decoration: none; color: var(--ink); }
.ch-block h2 small { display: block; font-size: 13px; color: var(--gold-3); font-family: var(--f-ui); }
.cnt { flex: none; font: 700 12.5px var(--f-num); color: var(--muted); background: var(--bg-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.mini-list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow: auto; scrollbar-width: thin; }
.mini-list a { display: flex; gap: 10px; align-items: baseline; padding: 6px 4px; text-decoration: none; color: var(--ink-2); font-size: 15px; line-height: 1.6; border-top: 1px dashed var(--line-2); }
.mini-list li:first-child a { border-top: 0; }
.mini-list a:hover { color: var(--gold-3); }
.mini-list .n { min-width: 30px; height: 26px; border-radius: 8px; font-size: 12.5px; }
.part-extras, .toc-front { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.card-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-weight: 700; }
.band .card-link { background: rgba(255,255,255,.05); border-color: rgba(224,192,138,.3); color: #F1E3C4; }
.card-link:hover { border-color: var(--gold-2); color: var(--gold-3); }
.band .card-link:hover { color: #fff; background: rgba(224,192,138,.14); }

/* contents */
.toc-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.filter { flex: 1 1 360px; display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 12px; padding: 0 14px; color: var(--ink); }
.filter input { flex: 1; border: 0; background: transparent; font: inherit; padding: 12px 0; outline: none; color: var(--ink); }
.toc-part { margin: 34px 0; }
.toc-part > h2 { margin: 0 0 14px; font-family: var(--f-head); font-size: 26px; }
.toc-part > h2 a { color: var(--ink); text-decoration: none; }
.toc-part > h2 small { display: block; font-size: 13px; color: var(--gold-3); font-family: var(--f-ui); }
.toc-ch { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.toc-ch summary { display: flex; justify-content: flex-start; align-items: center; gap: 10px; cursor: pointer; padding: 14px 18px; font-weight: 700; font-family: var(--f-head); font-size: 18px; list-style: none; }
.toc-ch summary::-webkit-details-marker { display: none; }
.toc-ch summary .cnt { margin-inline-start: auto; }
.toc-ch summary::after { content: "+"; font: 700 20px var(--f-num); color: var(--gold-3); }
.toc-ch[open] summary::after { content: "−"; }
.toc-ch[open] summary { border-bottom: 1px solid var(--line-2); background: var(--bg-2); }
.toc-ch ol, .toc-extra { list-style: none; margin: 0; padding: 8px 12px; columns: 2 380px; column-gap: 26px; }
.toc-ch li, .toc-extra li { break-inside: avoid; }
.toc-ch li a, .toc-extra li a { display: flex; gap: 10px; align-items: baseline; padding: 6px 6px; text-decoration: none; color: var(--ink-2); line-height: 1.6; border-radius: 8px; }
.toc-ch li a:hover, .toc-extra li a:hover { background: var(--bg-2); color: var(--gold-4); }
.toc-ch .n, .toc-extra .n { min-width: 30px; height: 26px; border-radius: 8px; font-size: 12.5px; }
.toc-sec { column-span: all; font-weight: 800; color: var(--gold-4); padding: 10px 6px 4px; border-top: 1px solid var(--line-2); margin-top: 6px; }
.toc-more { display: inline-flex; align-items: center; gap: 6px; margin: 0 18px 14px; font-size: 14px; font-weight: 700; }
.toc [hidden] { display: none !important; }
mark, .hl { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------------------------------------------------------------- reader */
.reader { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 26px 0 60px; }
.reader.has-side { grid-template-columns: 300px minmax(0, 1fr); }
.side { position: relative; }
.side-in { position: sticky; top: 62px; max-height: calc(100vh - 78px); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.side-head { display: block; padding: 14px 16px; text-decoration: none; background: var(--bg-2); border-bottom: 1px solid var(--line); color: var(--ink); }
.side-head small { display: block; color: var(--gold-3); font-weight: 700; font-size: 12.5px; }
.side-head b { font-family: var(--f-head); font-size: 16.5px; line-height: 1.5; }
.side-list { list-style: none; margin: 0; padding: 6px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side-list a { display: flex; gap: 10px; align-items: baseline; padding: 7px 8px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-size: 14px; line-height: 1.6; border-inline-start: 3px solid transparent; }
.side-list a:hover { background: var(--bg-2); }
.side-list a.on { background: var(--paper); border-inline-start-color: var(--gold-2); color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(59,46,26,.07); }
.side-list .n { min-width: 28px; height: 24px; border-radius: 7px; font-size: 12px; }
.side-list a:not(.on) .n { background: var(--bg-2); color: var(--gold-4); border: 1px solid var(--line); }
.sb-sec { font-size: 12.5px; font-weight: 800; color: var(--gold-4); padding: 10px 10px 4px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.side-btn { display: none; }

.paper#article { padding: 26px clamp(18px, 4vw, 56px) 40px; min-width: 0; }
.a-head { position: relative; margin: 14px 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.a-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.q-badge { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; background: var(--grad-gold); color: #fff; font-weight: 700; font-size: 13.5px; }
.ctx { color: var(--gold-3); font-weight: 700; text-decoration: none; }
.sep { opacity: .5; }
.a-head h1 { margin: 0; font-family: var(--f-head); font-weight: 800; font-size: clamp(25px, 3.1vw, 36px); line-height: 1.6; color: var(--ink); }
html[lang="en"] .a-head h1 { font-weight: 600; line-height: 1.35; }
.h-sub { display: block; font-size: .78em; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
.a-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.a-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.a-meta a { color: var(--muted); text-decoration: none; }
.a-meta a:hover { color: var(--gold-3); }
.chip-lang { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2) !important; font-weight: 600; }
.chip-lang:hover { border-color: var(--gold-2); }
.tools { display: flex; gap: 4px; margin-inline-start: auto; }
.tool { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--gold-4); cursor: pointer; }
.tool:hover { border-color: var(--gold-2); background: var(--paper); }
.on-page { margin: 0 0 24px; padding: 14px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); font-size: 15px; }
.on-page b { display: block; color: var(--gold-4); margin-bottom: 6px; }
.on-page ol { margin: 0; padding-inline-start: 1.3em; columns: 2 260px; }
.on-page a { text-decoration: none; color: var(--ink-2); }
.on-page a:hover, .on-page a.cur { color: var(--gold-3); }

/* prose */
.prose { font-family: var(--f-body); font-size: var(--fs); line-height: var(--lh); color: var(--ink); text-align: justify; text-justify: inter-word; hyphens: manual; overflow-wrap: break-word; }
html[lang="en"] .prose { text-align: left; hyphens: auto; }
.prose p { margin: 0 0 1.05em; }
.prose p.c { text-align: center; }
.prose p[dir="ltr"] { text-align: left; font-family: var(--f-latin); font-size: .93em; line-height: 1.8; }
.prose p[dir="rtl"] { text-align: right; font-family: var(--f-arabic); font-size: 1.06em; line-height: 2; }
.prose strong { font-weight: 700; color: var(--ink); }
html[lang="ar"] .prose strong { font-weight: 700; }
.prose .red { color: var(--red); }
.prose a { word-break: break-word; }
.prose .q { font-family: var(--f-quran); color: var(--verse); font-weight: 500; }
html[lang="en"] .prose .q { font-family: inherit; font-size: 1em; font-style: italic; }
.prose .q strong { font-weight: 700; }
.prose .orn { color: var(--gold-3); font-family: var(--f-quran); font-style: normal; padding-inline: .08em; }
.prose .ayah-no { display: inline-grid; place-items: center; min-width: 1.75em; height: 1.75em; margin-inline: .2em; padding: 0 .28em; border-radius: 50%; border: 1.5px solid var(--gold-2); color: var(--gold-4); font: 700 .62em/1 var(--f-num); vertical-align: .18em; background: var(--card); }
html[data-theme="dark"] .prose .ayah-no { color: var(--gold); }
.prose sup:not(.fnref), .prose sub { font-size: .7em; line-height: 0; }
.fnref { line-height: 0; font-size: .64em; vertical-align: super; }
.fnref a { display: inline-block; min-width: 1.55em; padding: .18em .38em; margin-inline: .1em; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: var(--gold-4); text-decoration: none; font: 700 1em/1.15 var(--f-num); text-align: center; transition: background .15s; }
.fnref a:hover, .fnref a.act { background: var(--gold); color: var(--brown-900); border-color: var(--gold-2); }
.prose .fig { margin: 1.4em auto 1.6em; text-align: center; }
.prose .fig img { display: block; margin: 0 auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 4px; box-shadow: 0 4px 16px rgba(59,46,26,.10); cursor: zoom-in; }
html[data-theme="dark"] .prose .fig img { background: #fffdf8; }
.prose .fig.multi { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.prose .fig.multi img { margin: 0; max-width: calc(50% - 8px); }
.prose .li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5em; margin-bottom: .55em; }
.prose .li .mk { color: var(--gold-3); font-weight: 700; min-width: 1.2em; font-family: var(--f-num); font-size: .9em; padding-top: .18em; }
.prose .li.l1 { padding-inline-start: 1.6em; }
.prose .li.l2 { padding-inline-start: 3.2em; }
.prose .li.l3, .prose .li.l4 { padding-inline-start: 4.6em; }
.prose h2.sub, .prose h3.sub { font-family: var(--f-head); font-size: 1.12em; line-height: 1.5; margin: 1.6em 0 .7em; color: var(--gold-4); font-weight: 700; padding-inline-start: .7em; border-inline-start: 3px solid var(--gold-2); }
html[data-theme="dark"] .prose h3.sub, html[data-theme="dark"] .prose h2.sub { color: var(--gold); }
.prose h2.sub { font-size: 1.3em; }
.prose .bib { padding-inline-start: 2em; text-indent: -2em; text-align: start; margin-bottom: .6em; font-size: .92em; line-height: 1.7; }
.table-wrap { overflow-x: auto; margin: 1.2em 0 1.6em; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .9em; line-height: 1.7; text-align: start; }
.table-wrap th, .table-wrap td { border: 1px solid var(--line-2); padding: .5em .75em; vertical-align: top; }
.table-wrap th { background: var(--bg-2); font-weight: 700; }
.table-wrap td.arc { font-family: var(--f-arabic); font-size: 1.35em; text-align: center; }
.prose .table-wrap td[dir="rtl"] { font-family: var(--f-arabic); }
::target-text { background: var(--mark); }
.prose p:target { background: var(--mark); border-radius: 6px; }

/* poems (two hemistichs per line) */
.prose .poem { margin: 1.2em auto 1.6em; padding: .8em 1em; max-width: 40rem; text-align: center; border-inline-start: 3px solid var(--gold-2); background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 10px; }
.prose .bayt { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2em; padding: .15em 0; }
.prose .bayt span:first-child { text-align: end; }
.prose .bayt span:last-child { text-align: start; }
@media (max-width: 560px) { .prose .bayt { grid-template-columns: 1fr; gap: 0; } .prose .bayt span { text-align: center !important; } .prose .bayt + .bayt { margin-top: .5em; } }
.prose bdi { unicode-bidi: isolate; }

/* notes */
.notes { margin-top: 40px; padding-top: 18px; border-top: 2px solid var(--line); }
.notes h2 { font-family: var(--f-head); font-size: 21px; margin: 0 0 14px; color: var(--gold-4); }
html[data-theme="dark"] .notes h2 { color: var(--gold); }
.notes ol { list-style: none; margin: 0; padding: 0; font-family: var(--f-body); font-size: calc(var(--fs) * .8); line-height: 1.85; }
.notes li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px 8px; border-radius: 8px; border-bottom: 1px dashed var(--line-2); scroll-margin-top: 90px; }
.notes li:target { background: var(--mark); }
.fn-back { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 5px; border-radius: 7px; background: var(--grad-gold); color: #fff !important; text-decoration: none; font: 700 12.5px var(--f-num); margin-top: .25em; }
.fn-body { overflow-wrap: anywhere; min-width: 0; }
.fn-body p { margin: 0 0 .25em; }
.fn-body .ibid, .fn-pop .ibid { color: var(--muted); font-size: .92em; }
.fn-body p[lang="ar"], .fn-pop .fp-b p[lang="ar"] { font-family: var(--f-arabic); }
.fn-body .li, .fn-pop .li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45em; }
.fn-body .mk, .fn-pop .mk { color: var(--gold-3); font-weight: 700; }
.prose img.inl { display: inline; vertical-align: middle; margin: 0 .15em; width: auto; border: 0; padding: 0; box-shadow: none; background: transparent; }
.fn-body p[dir="ltr"] { text-align: left; font-family: var(--f-latin); }
.fn-body p[dir="rtl"] { text-align: right; }
.fn-pop .fp-b p { margin: 0 0 .3em; }
.fn-pop .fp-b p[dir="ltr"] { text-align: left; }

/* related */
.related { margin-top: 34px; }
.related h2 { font-family: var(--f-head); font-size: 20px; margin: 0 0 12px; color: var(--gold-4); }
html[data-theme="dark"] .related h2 { color: var(--gold); }
.rel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rel { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-inline-start: 3px solid var(--gold-2); text-decoration: none; color: var(--ink); transition: border-color .2s, background .2s; }
.rel:hover { background: var(--paper); border-color: var(--gold-2); color: var(--ink); }
.rel small { color: var(--gold-3); font-weight: 700; font-size: 12.5px; }
.rel b { font-family: var(--f-head); font-size: 15.5px; line-height: 1.6; }
.continue { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin: -4px auto 16px; padding: 8px 18px; border-radius: 12px; background: rgba(224,192,138,.1); border: 1px solid rgba(224,192,138,.35); color: #F1E6CE; text-decoration: none; max-width: 640px; }
.continue[hidden] { display: none; }
.continue small { color: var(--gold); font-weight: 700; font-size: 13px; }
.continue b { font-size: 15.5px; line-height: 1.5; }
.continue:hover { background: rgba(224,192,138,.18); color: #fff; }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 34px; }
.pn { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .15s; min-width: 0; }
.pn:hover { border-color: var(--gold-2); transform: translateY(-2px); color: var(--ink); }
.pn small { color: var(--gold-3); font-weight: 700; font-size: 13px; }
.pn.next { text-align: end; align-items: flex-end; }
.pn-t { display: flex; align-items: flex-start; gap: 8px; font-family: var(--f-head); font-weight: 700; font-size: 15.5px; line-height: 1.6; }
.pn.next .pn-t { flex-direction: row-reverse; }
.pn .n { min-width: 30px; height: 26px; border-radius: 7px; font-size: 12.5px; }

/* ---------------------------------------------------------------- search */
.big-search { display: flex; align-items: center; gap: 8px; margin-top: 14px; background: var(--paper); border-radius: 14px; padding: 6px 6px 6px 14px; color: var(--ink); max-width: 900px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
html[dir="rtl"] .big-search { padding: 6px 14px 6px 6px; }
.big-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 17px; padding: 10px 0; outline: none; color: var(--ink); }
.big-search select { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 14px; color: var(--ink-2); max-width: 44%; }
.s-status { color: var(--muted); margin: 0 0 16px; min-height: 1.5em; }
.s-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.s-results li a { display: block; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.s-results li a:hover { border-color: var(--gold-2); background: var(--paper); }
.s-results .s-crumb { font-size: 13px; color: var(--gold-3); font-weight: 700; }
.s-results .s-title { display: flex; gap: 10px; align-items: baseline; font-family: var(--f-head); font-weight: 700; font-size: 18px; line-height: 1.55; margin: 4px 0; }
.s-results .s-title .n { min-width: 32px; height: 26px; font-size: 12.5px; border-radius: 7px; }
.s-results .s-snip { color: var(--ink-2); font-family: var(--f-body); font-size: 15px; line-height: 1.9; }
.s-sep { margin: 14px 4px 2px; color: var(--muted); font-weight: 700; font-size: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.s-more { display: block; width: fit-content; margin: 18px auto 0; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(20, 13, 6, .55); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 70px 16px 16px; }
.overlay[hidden] { display: none; }
.ov-box { width: min(760px, 100%); background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2); }
.search-box { padding: 10px; }
.qs-form { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--line-2); }
html[dir="rtl"] .qs-form { padding: 4px 12px 4px 6px; }
.qs-form > .ic { color: var(--gold-3); width: 22px; height: 22px; }
.qs-form input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 18px; padding: 12px 0; outline: none; color: var(--ink); }
.qs-form .icon-btn, .sb-head .icon-btn { color: var(--ink-2); border-color: var(--line); background: var(--card); }
.qs-results { max-height: min(62vh, 560px); overflow: auto; }
.qs-results:empty { display: none; }
.qs-results a { display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.qs-results a:hover, .qs-results a.sel { background: var(--bg-2); }
.qs-results .s-crumb { font-size: 12.5px; color: var(--gold-3); font-weight: 700; }
.qs-results b { display: block; font-family: var(--f-head); font-size: 16px; line-height: 1.55; }
.qs-results .s-snip { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.8; font-family: var(--f-body); }
.qs-results .qs-all { text-align: center; font-weight: 700; color: var(--gold-4); border-top: 1px solid var(--line-2); border-radius: 0; margin-top: 4px; }
.qs-results .qs-msg { padding: 14px; color: var(--muted); text-align: center; }
.hero-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); padding: 6px; text-align: start; z-index: 5; }
.settings-box { padding: 18px 20px; max-width: 460px; }
.sb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sb-head h2 { margin: 0; font-size: 19px; font-family: var(--f-head); }
.sb-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); font-family: var(--f-ui); }
.seg button.on { background: var(--grad-gold); color: #fff; }
.seg .fs2 { font-size: 16px; } .seg .fs3 { font-size: 18px; } .seg .fs4 { font-size: 20px; }
.sb-kbd { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 2; border-top: 1px solid var(--line-2); padding-top: 12px; }
.drawer { justify-content: flex-start; padding: 0; }
.drawer-box { width: min(360px, 88vw); height: 100%; border-radius: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.d-top { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.d-top:hover, .d-ch:hover, .d-p:hover { background: var(--bg-2); }
.d-part { border-top: 1px solid var(--line-2); padding: 8px 0; }
.d-p { display: block; padding: 8px 12px; font-weight: 800; color: var(--gold-4); text-decoration: none; border-radius: 10px; }
.d-ch { display: block; padding: 7px 12px 7px 12px; font-size: 14.5px; color: var(--ink-2); text-decoration: none; border-radius: 10px; line-height: 1.6; }
.d-ch b { color: var(--gold-3); font-size: 12.5px; display: block; }

/* footnote popover */
.fn-pop { position: absolute; z-index: 70; width: min(440px, calc(100vw - 24px)); max-height: 46vh; overflow: auto; padding: 14px 16px 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--gold-2); border-radius: 12px; box-shadow: var(--shadow-2); font-family: var(--f-body); font-size: 15px; line-height: 1.85; }
.fn-pop .fp-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-family: var(--f-ui); font-size: 12.5px; color: var(--gold-3); font-weight: 700; }
.fn-pop .fp-h a { color: var(--gold-3); }
.fn-pop .fp-b { overflow-wrap: anywhere; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(15, 10, 5, .92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 94vw; max-height: 90vh; overflow: auto; }
.lightbox img { display: block; max-width: 94vw; max-height: 90vh; width: auto; height: auto; background: #fff; border-radius: 6px; cursor: zoom-in; }
.lightbox.zoom figure { cursor: grab; }
.lightbox.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox .icon-btn { position: absolute; background: rgba(0,0,0,.4); }
.lb-close { top: 14px; inset-inline-end: 14px; }
.lb-prev { inset-inline-start: 14px; top: 50%; }
.lb-next { inset-inline-end: 14px; top: 50%; }
html[dir="rtl"] .lb-prev .ic, html[dir="rtl"] .lb-next .ic { transform: scaleX(-1); }
.lb-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #E9DCC2; font: 600 13px var(--f-num); }

.to-top { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--grad-gold); color: #fff; box-shadow: 0 8px 20px rgba(59,46,26,.35); cursor: pointer; display: grid; place-items: center; }
.to-top[hidden] { display: none; }

/* 404 */
.page-404 .band-in { text-align: center; padding: 60px 0 64px; }
.page-404 .band-sub { margin-inline: auto; }
.page-404 .nf-en a { color: var(--gold); }
.page-404 .hero-cta { margin-top: 22px; }

/* about */
.about-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.about-stats span { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.about-stats b { font-family: var(--f-num); color: var(--gold-4); }
.struct td:last-child { text-align: center; font-family: var(--f-num); font-weight: 700; }
.how li { margin-bottom: .5em; }
.about-dl { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.title-page .li { max-width: 34rem; }

/* ---------------------------------------------------------------- footer */
.site-foot { background: var(--grad-foot); color: #E6DCC4; margin-top: 10px; }
.f-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 30px; padding: 44px 0 30px; }
.f-col h3 { font-size: 15.5px; margin: 0 0 10px; color: var(--gold); line-height: 1.6; }
.f-col h3 a { color: inherit; text-decoration: none; }
.f-col ul { list-style: none; margin: 0; padding: 0; }
.f-col li a { display: block; color: #D8CAAC; text-decoration: none; padding: 4px 0; font-size: 14.5px; line-height: 1.6; }
.f-col li a:hover { color: #fff; }
.f-brand p { color: #CFC0A0; font-size: 14.5px; margin: 10px 0; }
.f-brand .brand-main { font-size: 42px; }
.f-author { color: var(--gold) !important; font-weight: 700; }
.f-dl { display: flex; gap: 8px; flex-wrap: wrap; }
.f-dl a, .f-links a { color: #E9DCC2; font-size: 14px; }
.f-dl a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; border: 1px solid rgba(224,192,138,.3); text-decoration: none; }
.f-bottom { border-top: 1px solid rgba(224,192,138,.15); padding: 14px 0; font-size: 13.5px; color: #BFAF8E; text-align: center; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .reader.has-side { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0; z-index: 75; background: rgba(20,13,6,.55); display: none; padding: 0; }
  .side.open { display: block; }
  .side-in { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(360px, 88vw); max-height: none; border-radius: 0; }
  .side-btn { display: inline-flex; align-items: center; gap: 8px; position: fixed; bottom: 22px; inset-inline-start: 18px; z-index: 40; padding: 11px 16px; border-radius: 999px; border: 0; background: var(--brown-600); color: var(--gold); font-weight: 700; box-shadow: 0 8px 22px rgba(36,24,13,.4); cursor: pointer; font-family: var(--f-ui); font-size: 14px; }
  .parts, .feats { grid-template-columns: repeat(2, 1fr); }
  .f-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar-in { min-height: 62px; }
  .brand-main { font-size: 36px; }
  .brand-sub { display: none; }
  .brand-en .brand-main { font-size: 24px; }
  .lang-btn span { display: none; }
  .lang-btn { padding: 0; width: 42px; justify-content: center; }
  .site-head { top: -62px; }
  .mainnav-in { justify-content: flex-start; }
  .mainnav a { padding: 12px 12px 11px; font-size: 14.5px; }
  .parts, .feats, .part-hub { grid-template-columns: 1fr; }
  .hero-in { padding: 34px 0 30px; }
  .hero-search { flex-wrap: wrap; }
  .hero-search .btn { display: none; }
  .hero-stats { gap: 12px 20px; }
  .hero-stats div { min-width: 40%; }
  .paper#article { padding: 18px 16px 30px; border-radius: 0; border-inline: 0; margin-inline: -16px; }
  .reader { padding-top: 0; }
  .tools { margin-inline-start: 0; width: 100%; }
  .a-head { margin-top: 10px; }
  .pager { grid-template-columns: 1fr; }
  .rel-grid { grid-template-columns: 1fr; }
  .pn.next { text-align: start; align-items: flex-start; }
  .pn.next .pn-t { flex-direction: row; }
  .intro-card, .prose-card { padding: 18px 16px; }
  .prose { text-align: start; }
  html[lang="ar"] .prose { text-align: justify; }
  .prose .fig.multi img { max-width: 100%; }
  .f-grid { grid-template-columns: 1fr; gap: 18px; }
  .toc-ch ol { columns: 1; }
  .big-search { flex-wrap: wrap; }
  .big-search select { max-width: 100%; flex: 1 1 100%; }
  .overlay { padding-top: 12px; }
  .fn-pop { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: 8px; width: auto; max-height: 55vh; }
}

/* print */
@media print {
  .site-head, .site-foot, .side, .side-btn, .tools, .pager, .to-top, .crumbs, .chip-lang, .overlay, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
  .paper { box-shadow: none; border: 0; }
  .reader.has-side { grid-template-columns: 1fr; }
  .prose { font-size: 12pt; }
  .prose .fig img { box-shadow: none; max-height: 60vh; width: auto; }
  a { color: #000; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
