/* aledaar — manuscript palette: parchment & brass by day, ink-teal & gold by night.
   Every text/background pair is checked by tools/contrast.py (WCAG AA ≥ 4.5, body text ≥ 7). */
:root {
  --bg: #F6F1E6;
  --surface: #FFFDF8;
  --surface-2: #EFE6D3;
  --text: #1E1A15;
  --muted: #5B5044;
  --accent: #7E520E;
  --accent-ink: #5E3C08;
  --line: #DCCFB6;
  --hl: #A32718;
  --mark: #F2D58E;
  --cat: #2C6A61;
  --mark-text: #1E1A15;
  --hero: #FBF6EA;
  --hero-2: #EADFC6;
  --hero-text: #1E1A15;
  --hero-muted: #554A3E;
  --hero-accent: #7A4F0D;
  --hero-orn: #8A5A12;
  --btn-bg: #7E520E;
  --btn-text: #FFFDF8;
  --btn-hover: #6A440B;
  --gold: #E0BB72;
  --gold-ink: #1B1407;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 8px 28px rgba(60, 40, 10, .08);
  --radius: 14px;
  --f-display: "Amiri", "Noto Naskh Arabic", serif;
  --f-body: "Noto Naskh Arabic", "Amiri", serif;
  --f-ui: "IBM Plex Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
  --fs: 1.16rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1416; --surface: #141E21; --surface-2: #1B282C; --text: #ECE5D5; --muted: #B5AB97;
    --accent: #DDB46A; --accent-ink: #EBCB8E; --line: #2C3B3F; --hl: #F08C7A; --cat: #84C4B5; --mark: #6B5320; --mark-text: #FFF6E2;
    --hero: #0F2624; --hero-2: #081816; --hero-text: #F1E9D8; --hero-muted: #C9BDA4; --hero-accent: #E0BB72; --hero-orn: #E0BB72; --btn-bg: #E0BB72; --btn-text: #1B1407; --btn-hover: #EBCB8E;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1416; --surface: #141E21; --surface-2: #1B282C; --text: #ECE5D5; --muted: #B5AB97;
  --accent: #DDB46A; --accent-ink: #EBCB8E; --line: #2C3B3F; --hl: #F08C7A; --cat: #84C4B5; --mark: #6B5320; --mark-text: #FFF6E2;
  --hero: #0F2624; --hero-2: #081816; --hero-text: #F1E9D8; --hero-muted: #C9BDA4; --hero-accent: #E0BB72; --hero-orn: #E0BB72; --btn-bg: #E0BB72; --btn-text: #1B1407; --btn-hover: #EBCB8E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: var(--fs); line-height: 2; overflow-x: hidden; transition: background-color .3s, color .3s; }
a { color: var(--accent); text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 99; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; font-family: var(--f-ui); }
.skip:focus { top: 1rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- icons: gpt-image-2 emblems used as masks, painted with the theme's colour ---------- */
.ico { display: inline-block; flex: none; background: var(--accent); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-emblem { width: 40px; height: 40px; }
.ico-sm { width: 1.25em; height: 1.25em; vertical-align: -.25em; margin-inline-end: .4em; }
.ico-card { width: 76px; height: 76px; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.ico-hero { width: clamp(44px, 6vw, 52px); height: clamp(44px, 6vw, 52px); background: var(--hero-accent); }
.ico-phead { width: 64px; height: 64px; background: var(--hero-accent); margin-bottom: .4rem; }
.ico-foot { width: 52px; height: 52px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: .55rem 16px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; flex: none; }
.brand-t { display: flex; flex-direction: column; line-height: 1.25; font-family: var(--f-display); }
.brand-t b { font-size: 1.18rem; font-weight: 700; }
.brand-t small { font-size: .85rem; color: var(--muted); }
.nav { display: flex; gap: .15rem; margin-inline-start: auto; font-family: var(--f-ui); font-size: .95rem; }
.nav a { color: var(--text); text-decoration: none; padding: .45rem .7rem; border-radius: 999px; white-space: nowrap; transition: background-color .2s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav .ico-sm { width: 1.3em; height: 1.3em; margin-inline-end: .3em; vertical-align: -.3em; }
.tools { display: flex; gap: .3rem; flex: none; }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: background-color .2s, transform .2s; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
.menu { display: none; }
@media (max-width: 1160px) {
  .menu { display: inline-grid; }
  .tools { margin-inline-start: auto; }
  .nav { position: fixed; inset: 61px 0 auto 0; flex-direction: column; gap: 0; margin: 0; padding: .5rem 16px 1rem; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); font-size: 1.05rem; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: .8rem .6rem; border-radius: 10px; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav .ico-sm { display: inline-block; }
}
@media (max-width: 420px) { .brand-t small { display: none; } .brand-t b { font-size: 1.05rem; } }

/* ---------- hero & page header: deep ink-green in both themes, with a khatam lattice ---------- */
.hero, .phead { position: relative; overflow: hidden; color: var(--hero-text); background: radial-gradient(120% 90% at 50% 0%, var(--hero) 0%, var(--hero-2) 100%); }
.hero-pat { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-pat::before { content: ""; position: absolute; top: 50%; left: 50%; width: min(980px, 150vw); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-8deg); background: var(--hero-orn); opacity: .055; -webkit-mask: url("icons/emblem-wm.webp") center / contain no-repeat; mask: url("icons/emblem-wm.webp") center / contain no-repeat; }
.hero-pat::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 40%, color-mix(in srgb, var(--hero-orn) 14%, transparent), transparent 70%); }
.phead .hero-pat::before { width: min(620px, 120vw); opacity: .045; }
.hero::after, .phead::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hero-orn), transparent); opacity: .55; }
.hero, .phead { border-bottom: 1px solid var(--line); }
.hero-in { position: relative; max-width: 900px; margin: 0 auto; padding: 1rem 16px 2.8rem; text-align: center; animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.hero-kicker { margin: 0; font-family: var(--f-ui); letter-spacing: .02em; color: var(--hero-muted); font-size: 1rem; }
.hero-name { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.3; color: var(--hero-text); }
.hero-rahimahu { margin: 0; font-family: var(--f-display); font-size: clamp(1.05rem, 2.2vw, 1.25rem); line-height: 1.6; color: var(--hero-accent); }
.hero-intro { max-width: 860px; margin: .5rem auto 0; color: var(--hero-muted); font-size: .98rem; line-height: 1.85; }
.hero-intro p { margin: 0; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: .9rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.3rem; border-radius: 999px; font-family: var(--f-ui); font-weight: 600; font-size: 1rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .2s, background-color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--btn-bg); color: var(--btn-text); box-shadow: 0 6px 20px color-mix(in srgb, var(--btn-bg) 30%, transparent); }
.btn-gold:hover { color: var(--btn-text); background: var(--btn-hover); }
.btn-ghost { color: var(--hero-text); border-color: color-mix(in srgb, var(--hero-text) 40%, transparent); }
.btn-ghost:hover { color: var(--hero-text); background: color-mix(in srgb, var(--hero-text) 10%, transparent); }

.phead-in { position: relative; max-width: 860px; margin: 0 auto; padding: 2.2rem 16px 2.4rem; text-align: center; }
.phead h1 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.7rem, 4.6vw, 2.7rem); line-height: 1.5; color: var(--hero-text); }
.phead-b, .phead-m { margin: .6rem auto 0; max-width: 640px; color: var(--hero-muted); font-family: var(--f-ui); font-size: 1rem; line-height: 1.8; }
.phead a { color: var(--hero-accent); }
.crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-bottom: 1rem; font-family: var(--f-ui); font-size: .9rem; color: var(--hero-muted); }
.crumbs a { color: var(--hero-muted); text-decoration: none; }
.crumbs a:hover { color: var(--hero-accent); }

/* ---------- headings with an ornament ---------- */
.h-orn { display: flex; align-items: center; gap: 1rem; margin: 3.2rem 0 1.4rem; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 1.95rem); color: var(--text); }
.h-orn::before, .h-orn::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.h-orn::after { background: linear-gradient(270deg, transparent, var(--line)); }
.h-orn span { display: inline-flex; align-items: center; gap: .6rem; }
.h-orn span::before, .h-orn span::after { content: ""; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); opacity: .8; }

/* ---------- sayings carousel ---------- */
.rot { position: relative; margin: -2.2rem auto 0; max-width: 920px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 1.6rem clamp(1rem, 4vw, 2.6rem) 1.1rem; z-index: 2; }
.phead + .wrap .rot { margin-top: 2rem; }
.rot-orn { position: absolute; inset: 10px; border: 1px solid var(--line); border-radius: 16px; pointer-events: none; }
.rot-kicker { position: relative; margin: 0 0 .4rem; text-align: center; font-family: var(--f-ui); font-weight: 600; font-size: .95rem; color: var(--accent); }
.rot-stage { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; }
.rot-card { margin: 0; min-height: 9rem; display: flex; flex-direction: column; justify-content: center; text-align: center; transition: opacity .45s ease, transform .45s ease; }
.rot-card.out { opacity: 0; transform: translateX(var(--dir, -18px)); }
.rot-text { margin: 0; font-family: var(--f-display); font-size: clamp(1.35rem, 3.3vw, 1.9rem); line-height: 1.95; color: var(--text); white-space: pre-line; }
.rot-text::before, .rot-text::after { color: var(--accent); font-size: 1.1em; }
.rot-text::before { content: "« "; } .rot-text::after { content: " »"; }
.rot-card.mid .rot-text { font-size: clamp(1.18rem, 2.6vw, 1.5rem); }
.rot-card.long .rot-text { font-size: clamp(1.05rem, 2.1vw, 1.22rem); line-height: 2; text-align: justify; text-align-last: center; }
.rot-meta { margin-top: .8rem; display: flex; justify-content: center; gap: .9rem; flex-wrap: wrap; font-family: var(--f-ui); font-size: .88rem; color: var(--muted); }
.rot-cat { padding: .05rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); text-decoration: none; border: 1px solid transparent; transition: border-color .2s, color .2s; }
.rot-cat:hover { color: var(--text); border-color: var(--cat); }
.rot-src { color: var(--muted); }
.chev { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--accent); cursor: pointer; transition: background-color .2s, transform .2s, color .2s; }
.chev:hover { background: var(--accent); color: var(--surface); transform: scale(1.06); }
.chev svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rot-foot { position: relative; display: flex; align-items: center; gap: .8rem; margin-top: .9rem; }
.rot-bar { flex: 1; height: 3px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.rot-bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: right; transform: scaleX(0); }
.rot-bar span.run { transition: transform linear; transform: scaleX(1); }
.rot-count { font-family: var(--f-ui); font-size: .82rem; color: var(--muted); min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.rot-pause { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.rot-pause svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rot-pause .i-play { display: none; } .rot-pause[aria-pressed="true"] .i-play { display: block; } .rot-pause[aria-pressed="true"] .i-pause { display: none; }
@media (max-width: 600px) {
  .rot { padding: 1.3rem .9rem .9rem; border-radius: 18px; }
  .rot-stage { grid-template-columns: 1fr; }
  .rot-card { min-height: 11rem; }
  .chev { position: absolute; bottom: -3.1rem; width: 40px; height: 40px; z-index: 1; }
  .chev-prev { right: 0; } .chev-next { left: 0; }
  .rot-foot { padding: 0 3.1rem; margin-top: 1rem; }
}

/* ---------- section cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.1rem; }
.card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1.5rem 1.4rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow); overflow: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .3s; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0; transition: opacity .3s; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--text); }
.card:hover::before { opacity: 1; }
.card:hover .ico-card { transform: scale(1.07) rotate(-3deg); }
.card-t { margin-top: .5rem; font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; line-height: 1.5; }
.card-b { color: var(--muted); font-size: 1rem; line-height: 1.85; }
.card-n { margin-top: auto; padding-top: .6rem; font-family: var(--f-ui); font-size: .85rem; color: var(--accent); font-weight: 600; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; counter-reset: n; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.2rem; color: var(--text); text-decoration: none; transition: background-color .2s; }
.list a:hover { background: var(--surface-2); color: var(--text); }
.list-t { font-size: 1.08rem; line-height: 1.7; }
.list-m { flex: none; font-family: var(--f-ui); font-size: .82rem; color: var(--muted); }
.list-num li { counter-increment: n; }
.list-num a::before { content: counter(n); flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface-2); color: var(--accent); font-family: var(--f-ui); font-size: .85rem; font-weight: 600; }
.list-num .list-t { flex: 1; }

/* ---------- reading pages ---------- */
.page { max-width: 820px; padding-bottom: 3rem; }
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: right; transform: scaleX(0); }
.reader-tools { display: flex; justify-content: flex-end; gap: .4rem; margin: 1.4rem 0 .2rem; }
.pill { font-family: var(--f-ui); font-size: .9rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.pill:hover { background: var(--surface-2); }
.prose { font-size: var(--fs); line-height: 2.15; text-align: justify; text-justify: inter-word; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--f-display); line-height: 1.6; text-align: start; color: var(--text); }
.prose h2 { font-size: 1.65rem; margin: 2.2em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.35rem; margin: 1.8em 0 .5em; color: var(--accent-ink); }
.prose h4 { font-size: 1.18rem; margin: 1.5em 0 .4em; }
.prose ul, .prose ol { padding-inline-start: 1.6em; }
.prose li { margin: .25em 0; }
.prose hr { border: 0; height: 1px; margin: 2.2em auto; width: 60%; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.prose blockquote { margin: 1.4em 0; padding: .6em 1.2em; border-inline-start: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
.prose figure { margin: 1.4em 0; text-align: center; }
.prose img { border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.prose .hl { color: var(--hl); }
.prose .ul { text-decoration: underline; text-underline-offset: .3em; }
.prose audio { display: block; width: 100%; margin: .2em 0 1.4em; border-radius: 999px; }
.prose a[href^="#ftn"], .prose a[href^="#_ftn"] { font-size: .8em; vertical-align: super; text-decoration: none; }
.prose ol > li > a[href^="#p"] { text-decoration: none; }
.fb-post { position: relative; margin: 0 0 2.2rem; padding: 1.4rem 1.4rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.prose .fb-post + hr { display: none; }
.fb-date { margin: 0 0 .6rem !important; font-family: var(--f-ui); font-size: .85rem; color: var(--muted); text-align: start; }
.fb-post > p:last-child { margin: .6rem 0 0; padding-top: .6rem; border-top: 1px dashed var(--line); font-family: var(--f-ui); font-size: .85rem; text-align: start; }
.yt { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0 1.6rem; border-radius: var(--radius); overflow: hidden; background: #0b0f10 center / cover no-repeat; box-shadow: var(--shadow); }
.yt[data-kind="list"] { background-image: radial-gradient(120% 90% at 50% 0%, var(--hero), var(--hero-2)); }
.yt[data-kind="list"]::after { content: attr(data-label); position: absolute; top: 1rem; inset-inline-start: 1rem; padding: .1rem .8rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-family: var(--f-ui); font-size: .85rem; }
.yt-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; cursor: pointer; background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .35)); }
.yt-play::before { content: ""; position: absolute; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: var(--gold); box-shadow: 0 8px 30px rgba(0, 0, 0, .4); transition: transform .2s; }
.yt-play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -13px 0 0 -8px; border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent var(--gold-ink); }
.yt-play:hover::before { transform: scale(1.08); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.kids { margin-top: 2rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.pager-a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .2s, transform .2s; }
.pager-a:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.pager-a small { font-family: var(--f-ui); color: var(--accent); font-weight: 600; }
.pager-a span { line-height: 1.7; }
.pager-a.next { text-align: left; grid-column: 2; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager-a.next { grid-column: 1; } .prose { text-align: start; } }
.totop { position: fixed; bottom: 1.2rem; left: 1.2rem; z-index: 40; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--accent); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s; }
.totop.show { opacity: 1; visibility: visible; transform: none; }
.totop svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sayings page ---------- */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 2.4rem 0 0; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-family: var(--f-ui); font-size: .9rem; text-decoration: none; transition: background-color .2s, border-color .2s; }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip span { color: var(--accent); font-weight: 600; font-size: .8rem; }
.quotes { columns: 2 340px; column-gap: 1.1rem; }
.q { break-inside: avoid; margin: 0 0 1.1rem; padding: 1.2rem 1.3rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.q blockquote { margin: 0; font-family: var(--f-display); font-size: 1.22rem; line-height: 2; }
.q-long blockquote { font-size: 1.08rem; }
.q figcaption { margin-top: .5rem; font-family: var(--f-ui); font-size: .82rem; }
.q figcaption a { color: var(--muted); }
.qgroup { scroll-margin-top: 90px; }

/* ---------- search ---------- */
.search { display: flex; gap: .5rem; max-width: 620px; margin: 1.2rem auto 0; }
.search input { flex: 1; min-width: 0; padding: .75rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-family: var(--f-ui); }
.search input::placeholder { color: var(--muted); opacity: 1; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.results li > a { font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.results p { margin: .3rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.9; }
mark { background: var(--mark); color: var(--mark-text); border-radius: 3px; padding: 0 .15em; }
.empty { text-align: center; color: var(--muted); margin: 3rem 0; }

/* ---------- footer ---------- */
.foot { margin-top: 5rem; background: var(--surface); border-top: 1px solid var(--line); }
.foot-in { max-width: 820px; margin: 0 auto; padding: 2.6rem 16px 2rem; text-align: center; }
.foot-dua { margin: .8rem auto 1.2rem; max-width: 700px; text-wrap: balance; font-family: var(--f-display); font-size: 1.25rem; line-height: 2; color: var(--text); }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; font-family: var(--f-ui); font-size: .92rem; }
.foot-nav a { display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; }
.foot-nav .ico-sm { width: 1.35em; height: 1.35em; margin-inline-end: .35em; vertical-align: 0; }
.foot-search { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1rem; padding: .4rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); font-family: var(--f-ui); font-size: .92rem; text-decoration: none; transition: border-color .2s, color .2s; }
.foot-search:hover { border-color: var(--accent); color: var(--accent); }
.foot-search svg { width: 17px; height: 17px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.foot-nav a:hover { color: var(--accent); }
.foot-note { margin: 1.4rem 0 0; font-family: var(--f-ui); font-size: .82rem; color: var(--muted); }
.is-home .sections { scroll-margin-top: 80px; }

/* compact home header on phones: the menu already links everywhere */
@media (max-width: 600px) { .hero-cta { display: none; } .hero-in { padding-bottom: 2.9rem; } .hero-intro { font-size: .9rem; line-height: 1.75; } }

/* sayings page: theme chips as tabs */
.chips[role="tablist"] { position: sticky; top: 62px; z-index: 20; margin: 1.4rem -16px 0; padding: .7rem 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chip[role="tab"] { cursor: pointer; }
.chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.chip[aria-selected="true"] span { color: var(--surface); }
.qgroup[role="tabpanel"] { scroll-margin-top: 140px; animation: tabin .35s ease both; }
.qgroup[role="tabpanel"] .h-orn { margin-top: 1.6rem; }
@keyframes tabin { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 600px) {
  .chips[role="tablist"] { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .chips[role="tablist"]::-webkit-scrollbar { display: none; }
  .chip[role="tab"] { flex: none; scroll-snap-align: start; }
}

/* home header with his photo: an arch-framed portrait beside the name (stacked, round, on phones) */
.hero-in.has-portrait { display: flex; align-items: center; justify-content: center; gap: clamp(1.5rem, 4vw, 3rem); max-width: 1000px; text-align: start; }
.has-portrait .hero-txt { flex: 1; max-width: 640px; }
.has-portrait .hero-intro { margin-inline: 0; }
.has-portrait .hero-cta { justify-content: flex-start; }
.portrait { position: relative; flex: none; margin: 0 0 1rem; width: 184px; aspect-ratio: 4 / 5; padding: 5px; border: 1px solid color-mix(in srgb, var(--hero-accent) 55%, transparent); border-radius: 92px 92px 14px 14px; }
.portrait::after { content: ""; position: absolute; inset: -9px; border: 1px solid color-mix(in srgb, var(--hero-accent) 25%, transparent); border-radius: 101px 101px 20px 20px; pointer-events: none; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 87px 87px 9px 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
@media (max-width: 600px) {
  .hero-in.has-portrait { flex-direction: column; gap: .4rem; text-align: center; }
  .has-portrait .hero-intro { margin-inline: auto; }
  .portrait { width: 92px; height: 92px; aspect-ratio: auto; margin: 0; padding: 4px; border-radius: 50%; }
  .portrait::after { inset: -6px; border-radius: 50%; }
  .portrait img { width: 100%; height: 100%; border-radius: 50%; object-position: 50% 18%; }
}

/* home header: give the kicker, name and du'a room to breathe */
.hero-kicker { margin: 0 0 .5rem; letter-spacing: .03em; }
.hero-name { line-height: 1.55; }
.hero-rahimahu { margin-top: .55rem; }
.hero-cta { margin-top: 1.5rem; }

/* themes of «من أقوال الشيخ»: round medallions in verdigris, a second family beside the brass section stars */
.ico-cat { width: 1.45em; height: 1.45em; margin-inline-end: .4em; background: var(--cat); vertical-align: -.35em; }
.ico-cat-lg { width: 1.6em; height: 1.6em; background: var(--cat); }
.h-cat span::before, .h-cat span::after { background: var(--cat); }
.chip .ico-cat { margin-inline-end: .1em; }
.chip[aria-selected="true"] .ico-cat { background: var(--surface); }
.rot-cat { display: inline-flex; align-items: center; }
.rot-cat .ico-cat { width: 1.35em; height: 1.35em; margin-inline-end: .3em; }

.q figcaption { color: var(--muted); }
