/* قالب «زكريا القضاة» — تصميم «المخطوطة المذهّبة».
   الفكرة: الموقع صفحةٌ من مخطوط مذهّب — ورق دافئ، حبر، زمرّد، ذهب، ولمسة مداد أحمر للعناوين الصغيرة (الترويس).
   عناصر الهوية: الشمسة (حول صورة الشيخ)، عنوان السورة (خرطوشة العناوين)، الرواق (أقواس الأبواب)، الفهرس (قوائم المقالات)، الخاتمة (الذيل).
   الخطوط: Noto Kufi Arabic للعناوين والواجهة · Noto Naskh Arabic للنص · Aref Ruqaa للشعار وعبارة البطل · Amiri للآيات.
   --link للنصوص الخضراء، --primary لتعبئة الأزرار، --accent ذهبي مقروء كنص، --gold ذهبي زخرفي (خطوط فقط).
   كل زوج نص/خلفية ≥ 4.5:1 (WCAG 2.2 AA). */

:root, :root[data-theme="light"] {
  --bg: #F4EEDF; --raised: #FBF7EC; --sunken: #EAE2CE;
  --text: #1F1B14; --text2: #574E3D; --text3: #6B614E;
  --border: #8A7F66; --divider: #DDD3B9;
  --primary: #0F5132; --on-primary: #FFFFFF; --link: #0F5132;
  --accent: #765510; --gold: #B38A2E; --rubric: #8C2F23;
  --tint: rgba(15, 81, 50, .07);
  --warn-bg: #F7E9C6; --warn-text: #5A3B00;
  --hero-1: #082F1D; --hero-2: #145338; --hero-text: #F7F0DA; --hero-gold: #E3C16B;
  --shadow: 0 1px 1px rgba(60,45,15,.05), 0 10px 30px -12px rgba(60,45,15,.22);
  --grain: .07;
}
:root[data-theme="reading"] {
  --bg: #EDE0C4; --raised: #F6ECD4; --sunken: #E1D2B0;
  --text: #2A2114; --text2: #564A33; --text3: #685B41;
  --border: #85775A; --divider: #D2C29C;
  --primary: #124D30; --on-primary: #F9F1DC; --link: #124D30;
  --accent: #6E4E0C; --gold: #A9812A; --rubric: #83291E;
  --tint: rgba(18, 77, 48, .08);
  --warn-bg: #EBDAAE; --warn-text: #553700;
  --hero-1: #0B311F; --hero-2: #17523A; --hero-text: #F6ECD0; --hero-gold: #DDB95F;
  --shadow: 0 1px 1px rgba(60,45,15,.07), 0 10px 30px -12px rgba(60,45,15,.28);
  --grain: .09;
}
:root[data-theme="dark"] {
  --bg: #0C1512; --raised: #13201B; --sunken: #08100D;
  --text: #EFE9D8; --text2: #BDB69F; --text3: #9A947F;
  --border: #5E7064; --divider: #24362D;
  --primary: #1C7A4D; --on-primary: #FFFFFF; --link: #8FD9AE;
  --accent: #E2BC6A; --gold: #C9A450; --rubric: #EC9A8A;
  --tint: rgba(143, 217, 174, .08);
  --warn-bg: #2A2411; --warn-text: #EACB7C;
  --hero-1: #06180F; --hero-2: #0F3324; --hero-text: #F1EAD3; --hero-gold: #E2BC6A;
  --shadow: 0 1px 1px rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.7);
  --grain: .05;
}
:root {
  --kufi: "Noto Kufi Arabic", "Tajawal", system-ui, sans-serif;
  --naskh: "Noto Naskh Arabic", "Amiri", serif;
  --ruqaa: "Aref Ruqaa", "Noto Kufi Arabic", serif;
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0l3.5 3.5h5v5L24 12l-3.5 3.5v5h-5L12 24l-3.5-3.5h-5v-5L0 12l3.5-3.5v-5h5z' fill='black'/%3E%3C/svg%3E");
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23E3C16B' stroke-width='1'%3E%3Cpath stroke-opacity='.20' d='M48 8l11.7 11.7H76.3V36.3L88 48 76.3 59.7V76.3H59.7L48 88 36.3 76.3H19.7V59.7L8 48l11.7-11.7V19.7h16.6z'/%3E%3Cpath stroke-opacity='.11' d='M48 26l6.4 6.4h9.2v9.2L70 48l-6.4 6.4v9.2h-9.2L48 70l-6.4-6.4h-9.2v-9.2L26 48l6.4-6.4v-9.2h9.2z'/%3E%3Cpath stroke-opacity='.13' d='M0 0l19.7 19.7M96 0L76.3 19.7M0 96l19.7-19.7M96 96L76.3 76.3M48 0v8M48 88v8M0 48h8M88 48h8'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { font-size: calc(100% * var(--fs, 1)); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--kufi); font-size: 1rem; line-height: 1.75;
  transition: background .3s, color .3s; overflow-x: hidden;
}
/* حُبيبات الورق */
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25  0 0 0 0 .2  0 0 0 0 .1  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
body > * { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--hero-gold); color: #1B1405; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; z-index: 100; }
.skip:focus { top: 8px; }
.wrap { width: min(1160px, 100% - 36px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 28px); margin-inline: auto; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* ظهور تدريجي عند التمرير (فقط مع JS) */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }

/* ══ الترويسة ══ */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--gold); }
.site-header::after { content: ""; position: absolute; inset-inline: 0; bottom: -5px; height: 1px; background: var(--gold); opacity: .45; }
.bar { display: flex; align-items: center; gap: 14px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--ruqaa); font-weight: 700; font-size: 1.65rem; color: var(--text); text-decoration: none; white-space: nowrap; line-height: 1.1; }
.brand::before { content: ""; width: 30px; height: 30px; background: var(--gold); -webkit-mask: var(--star) center/contain no-repeat; mask: var(--star) center/contain no-repeat; flex: none; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.brand:hover::before { transform: rotate(135deg); }
.brand small { display: block; font-family: var(--kufi); font-weight: 400; font-size: .7rem; color: var(--rubric); letter-spacing: 0; margin-top: 3px; }
.nav { display: flex; gap: 2px; margin-inline-start: 18px; flex: 1; }
.nav a { white-space: nowrap; color: var(--text2); text-decoration: none; padding: 8px 12px; font-size: .95rem; font-weight: 500; position: relative; transition: color .2s; }
.nav a::after { content: ""; position: absolute; inset-inline: 13px; bottom: 3px; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.nav a:hover { color: var(--text); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--link); font-weight: 700; }
.tools { display: flex; gap: 6px; align-items: center; }
.btn-ic { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--divider); background: transparent; color: var(--text); cursor: pointer; font: inherit; font-weight: 600; transition: border-color .2s, background .2s; }
.btn-ic:hover { border-color: var(--gold); background: var(--tint); }
.menu-btn { display: none; }
@media (max-width: 1180px) {
  .nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--raised); flex-direction: column; padding: 10px 18px 16px; border-bottom: 1px solid var(--gold); margin: 0; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 6px; border-bottom: 1px solid var(--divider); }
  .nav a::after { display: none; }
  .menu-btn { display: inline-flex; }
  .brand { flex: 1; }
}
@media (max-width: 540px) {
  .bar { gap: 6px; min-height: 60px; }
  .brand { font-size: 1.25rem; min-width: 0; gap: 8px; }
  .brand::before { width: 22px; height: 22px; }
  .brand small { display: none; }
  .tools { gap: 4px; }
  .btn-ic { min-width: 40px; }
  #modeBtn { padding: 0 8px !important; }
}

/* ══ أزرار ══ */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 30px; font: inherit; font-weight: 600; font-size: 1.02rem; text-decoration: none; border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.btn::before { content: ""; position: absolute; inset: 4px; border: 1px solid currentColor; opacity: .35; pointer-events: none; transition: inset .2s, opacity .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(0,0,0,.45); }
.btn:hover::before { inset: 6px; opacity: .7; }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--link); }

/* ══ البطل: لوحة الافتتاح ══ */
.hero-band { position: relative; color: var(--hero-text); isolation: isolate; overflow: hidden;
  background: radial-gradient(120% 90% at 18% 40%, var(--hero-2) 0%, var(--hero-1) 70%); }
.hero-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--lattice); -webkit-mask-image: radial-gradient(100% 100% at 80% 50%, #000 0%, transparent 85%); mask-image: radial-gradient(100% 100% at 80% 50%, #000 0%, transparent 85%); }
.hero-frame { position: absolute; inset: 16px; border: 1px solid var(--hero-gold); opacity: .55; pointer-events: none; }
.hero-frame::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--hero-gold); opacity: .5; }
.hero-frame i { position: absolute; width: 18px; height: 18px; background: var(--hero-gold); -webkit-mask: var(--star) center/contain no-repeat; mask: var(--star) center/contain no-repeat; }
.hero-frame i:nth-child(1) { top: -9px; left: -9px; } .hero-frame i:nth-child(2) { top: -9px; right: -9px; }
.hero-frame i:nth-child(3) { bottom: -9px; left: -9px; } .hero-frame i:nth-child(4) { bottom: -9px; right: -9px; }
.hero { padding: 84px 28px 120px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 48px; align-items: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--hero-gold); margin: 0 0 18px; }
.hero-kicker::before, .hero-kicker::after { content: ""; width: 34px; height: 1px; background: var(--hero-gold); opacity: .7; }
.hero h1 { font-family: var(--ruqaa); font-weight: 700; font-size: clamp(2.5rem, 6.2vw, 4.6rem); line-height: 1.32; margin: 0 0 20px; color: #fff; }
.hero h1 em { font-style: normal; color: var(--hero-gold); }
.hero p.lead { font-family: var(--naskh); font-size: 1.3rem; line-height: 2; color: var(--hero-text); opacity: .92; margin: 0 0 32px; max-width: 30em; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn { background: var(--hero-gold); border-color: var(--hero-gold); color: #1B1405; }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
/* الشمسة وصورة الشيخ */
.shamsa-wrap { position: relative; width: min(100%, 440px); aspect-ratio: 1; margin-inline: auto; display: grid; place-items: center; }
.shamsa { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--hero-gold); overflow: visible; }
.shamsa .s-out { animation: zq-spin 160s linear infinite; }
.shamsa .s-in { animation: zq-spin 110s linear infinite reverse; }
@keyframes zq-spin { to { transform: rotate(360deg); } }
.shamsa-wrap img.portrait { position: relative; width: 50%; aspect-ratio: 1; height: auto; object-fit: cover; object-position: 50% 22%; border-radius: 50%; border: 3px solid var(--hero-gold); box-shadow: 0 0 0 6px var(--hero-1), 0 0 0 7px var(--hero-gold), 0 26px 60px rgba(0,0,0,.55); }
.shamsa-wrap::after { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(227,193,107,.20), transparent 68%); z-index: -1; }
/* دخول مرتّب */
.js .hero-in > * { opacity: 0; transform: translateY(22px); animation: zq-up .9s cubic-bezier(.2,.7,.2,1) forwards; }
.js .hero-in > :nth-child(1) { animation-delay: .05s; } .js .hero-in > :nth-child(2) { animation-delay: .18s; }
.js .hero-in > :nth-child(3) { animation-delay: .32s; } .js .hero-in > :nth-child(4) { animation-delay: .46s; }
.js .shamsa-wrap { opacity: 0; transform: scale(.9) rotate(-8deg); animation: zq-bloom 1.3s cubic-bezier(.2,.7,.2,1) .25s forwards; }
@keyframes zq-up { to { opacity: 1; transform: none; } }
@keyframes zq-bloom { to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 54px 18px 104px; gap: 30px; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .hero .cta { justify-content: center; }
  .shamsa-wrap { order: -1; width: min(78%, 300px); }
  .hero-frame { inset: 9px; }
}

/* شريط الأرقام: خرطوشة تتدلّى من اللوحة */
.stats { position: relative; z-index: 3; margin: -52px auto 0; width: min(720px, 100% - 44px); display: grid; grid-template-columns: repeat(3, 1fr); background: var(--raised); border: 1px solid var(--gold); outline: 1px solid var(--gold); outline-offset: 4px; box-shadow: var(--shadow); }
.stats div { position: relative; padding: 18px 10px 16px; text-align: center; }
.stats div + div::before { content: ""; position: absolute; inset-inline-start: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: var(--gold); -webkit-mask: var(--star) center/contain no-repeat; mask: var(--star) center/contain no-repeat; }
.stats b { display: block; font-size: 2.1rem; font-weight: 700; color: var(--link); line-height: 1.25; }
.stats span { color: var(--text2); font-size: .9rem; }
@media (max-width: 620px) { .stats div { padding: 14px 4px 12px; } .stats b { font-size: 1.45rem; } .stats span { font-size: .8rem; } }

/* ══ البحث ══ */
.searchbox { display: flex; gap: 0; margin: 44px auto 0; max-width: 760px; border: 1px solid var(--border); background: var(--raised); transition: border-color .2s, box-shadow .2s; }
.searchbox:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--tint); }
.searchbox input { flex: 1; min-width: 0; min-height: 58px; padding: 0 22px; border: 0; background: transparent; color: var(--text); font-family: var(--naskh); font-size: 1.15rem; outline: none; }
.searchbox input::placeholder { color: var(--text3); }
.searchbox .btn { min-height: 58px; }
.searchbox .btn::before { display: none; }

/* ══ عنوان القسم: خرطوشة «عنوان السورة» ══ */
.unwan { display: flex; align-items: center; gap: 16px; margin: 84px 0 34px; font-size: 1.5rem; font-weight: 700; line-height: 1.4; }
.unwan::before, .unwan::after { content: ""; flex: 1; height: 1px; }
.unwan::before { background: linear-gradient(90deg, var(--gold), transparent); }
.unwan::after { background: linear-gradient(90deg, transparent, var(--gold)); }
.unwan span { position: relative; isolation: isolate; padding: 11px 54px; background: var(--gold); color: var(--text);
  clip-path: polygon(24px 0, calc(100% - 24px) 0, 100% 50%, calc(100% - 24px) 100%, 24px 100%, 0 50%); }
.unwan span::before { content: ""; position: absolute; inset: 1.5px; z-index: -1; background: var(--raised);
  clip-path: polygon(23.5px 0, calc(100% - 23.5px) 0, 100% 50%, calc(100% - 23.5px) 100%, 23.5px 100%, 0 50%); }
.unwan span::after { content: ""; position: absolute; inset: 5px 30px; z-index: -1; border-block: 1px solid var(--gold); opacity: .45; }
.sec-sub { color: var(--text2); margin: -18px auto 30px; text-align: center; font-family: var(--naskh); font-size: 1.1rem; max-width: 40em; }
.more-link { display: flex; justify-content: center; margin-top: 28px; }
.more-link a { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 2px; }
.more-link a:hover { border-bottom-width: 2px; }
@media (max-width: 540px) { .unwan { font-size: 1.2rem; margin: 62px 0 26px; gap: 8px; } .unwan span { padding: 9px 34px; } }

/* ══ الرواق: أبواب المكتبة أقواساً ══ */
.riwaq { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 22px 18px; }
.bab { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 54px 20px 24px; min-height: 320px; background: var(--raised); border: 1px solid var(--divider); border-radius: 50% 50% 6px 6px / 34% 34% 6px 6px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s, background .3s; }
.bab::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--gold); border-radius: inherit; opacity: .45; pointer-events: none; transition: opacity .3s, inset .3s; }
.bab:hover { transform: translateY(-8px); border-color: var(--gold); }
.bab:hover::before { opacity: 1; inset: 10px; }
.bab .ic { width: 64px; height: 64px; padding: 16px; border-radius: 50%; color: var(--link); background: var(--tint); border: 1px solid var(--gold); margin-bottom: 14px; transition: transform .5s cubic-bezier(.2,.7,.2,1), background .3s, color .3s; }
.bab:hover .ic { transform: rotate(-8deg) scale(1.08); background: var(--primary); color: var(--on-primary); }
.bab-no { font-size: .8rem; color: var(--rubric); font-weight: 600; margin-bottom: 2px; }
.bab .t { font-weight: 700; font-size: 1.22rem; line-height: 1.5; }
.bab .d { font-family: var(--naskh); color: var(--text2); font-size: 1rem; line-height: 1.7; margin-top: 4px; }
.bab .n { margin-top: auto; padding-top: 14px; font-size: .86rem; font-weight: 600; color: var(--accent); }
.bab.gold { background: linear-gradient(180deg, var(--hero-2), var(--hero-1)); color: var(--hero-text); border-color: var(--hero-gold); }
.bab.gold::before { border-color: var(--hero-gold); }
.bab.gold .ic { color: #1B1405; background: var(--hero-gold); border-color: var(--hero-gold); }
.bab.gold .bab-no, .bab.gold .n { color: var(--hero-gold); }
.bab.gold .d { color: var(--hero-text); opacity: .85; }
.ic { width: 36px; height: 36px; flex: none; }
@media (max-width: 540px) { .riwaq { grid-template-columns: repeat(2, 1fr); gap: 14px 12px; } .bab { min-height: 250px; padding: 34px 10px 18px; border-radius: 50% 50% 6px 6px / 30% 30% 6px 6px; } .bab .ic { width: 52px; height: 52px; padding: 13px; } .bab .t { font-size: 1.05rem; } .bab .d { font-size: .9rem; } }

/* ══ المجلس: شريط المحاضرات ══ */
.majlis { position: relative; margin-top: 96px; padding: 10px 0 78px; color: var(--hero-text); isolation: isolate; background: linear-gradient(180deg, var(--hero-1), var(--hero-2)); }
.majlis::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--lattice); opacity: .6; }
.majlis .unwan { margin-top: 62px; }
.majlis .unwan::before { background: linear-gradient(90deg, var(--hero-gold), transparent); }
.majlis .unwan::after { background: linear-gradient(90deg, transparent, var(--hero-gold)); }
.majlis .unwan span { background: var(--hero-gold); color: var(--hero-text); }
.majlis .unwan span::before { background: var(--hero-1); }
.majlis .unwan span::after { border-color: var(--hero-gold); }
.majlis .sec-sub { color: var(--hero-text); opacity: .85; }
.majlis-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.feature { position: relative; display: block; min-height: 340px; overflow: hidden; border: 1px solid var(--hero-gold); text-decoration: none; color: #fff; background: #000 center/cover no-repeat; }
.feature::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(4,16,10,.92)); transition: opacity .3s; }
.feature::after { content: ""; position: absolute; inset: 7px; border: 1px solid var(--hero-gold); opacity: .5; pointer-events: none; }
.feature .cap { position: absolute; inset-inline: 26px; bottom: 22px; }
.feature .cap small { display: block; color: var(--hero-gold); font-size: .85rem; margin-bottom: 4px; }
.feature .cap b { font-size: 1.5rem; font-weight: 700; line-height: 1.5; }
.play { position: absolute; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: var(--hero-gold); display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(227,193,107,.22), 0 10px 30px rgba(0,0,0,.5); transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.play::before { content: ""; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #1B1405; margin-left: 5px; }
.feature:hover .play { transform: scale(1.1); box-shadow: 0 0 0 18px rgba(227,193,107,.14), 0 10px 30px rgba(0,0,0,.5); }
.vstack { display: grid; gap: 12px; align-content: stretch; }
.vrow { display: grid; grid-template-columns: 148px 1fr; gap: 16px; align-items: center; padding: 10px; text-decoration: none; color: var(--hero-text); border: 1px solid rgba(227,193,107,.28); background: rgba(255,255,255,.035); transition: background .25s, border-color .25s, transform .25s; }
.vrow:hover { background: rgba(227,193,107,.10); border-color: var(--hero-gold); transform: translateX(-6px); }
.vrow .th { aspect-ratio: 16/9; background: #000 center/cover no-repeat; }
.vrow b { font-weight: 600; line-height: 1.6; font-size: 1.02rem; }
.vrow small { display: block; color: var(--hero-gold); font-size: .8rem; }
.majlis .more-link a { color: var(--hero-gold); border-color: var(--hero-gold); }
@media (max-width: 860px) { .majlis-grid { grid-template-columns: 1fr; } .feature { min-height: 230px; } .vrow { grid-template-columns: 116px 1fr; } }

/* ══ الفهرس: قوائم المقالات ══ */
.fihris { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.fihris-row { display: flex; align-items: baseline; gap: 14px; padding: 15px 8px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--divider); transition: background .2s, padding .25s; }
.fihris li:first-child .fihris-row { border-top: 1px solid var(--divider); }
.fihris-row:hover { background: var(--tint); padding-inline-start: 18px; }
.fihris-row .no { position: relative; flex: none; align-self: center; width: 42px; height: 42px; display: grid; place-items: center; font-size: .92rem; font-weight: 700; color: var(--accent); isolation: isolate; }
.fihris-row .no::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--gold); opacity: .2; -webkit-mask: var(--star) center/contain no-repeat; mask: var(--star) center/contain no-repeat; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .3s; }
.fihris-row:hover .no::before { transform: rotate(90deg); opacity: .38; }
.fihris-row .t { font-family: var(--naskh); font-weight: 600; font-size: 1.22rem; line-height: 1.7; }
.fihris-row .dots { flex: 1; min-width: 20px; border-bottom: 2px dotted var(--border); opacity: .45; transform: translateY(-5px); }
.fihris-row .cat { color: var(--rubric); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.fihris-row .date { color: var(--text3); font-size: .82rem; white-space: nowrap; }
@media (max-width: 700px) { .fihris-row { flex-wrap: wrap; gap: 4px 12px; } .fihris-row .t { flex: 1 1 calc(100% - 60px); font-size: 1.1rem; } .fihris-row .dots { display: none; } .fihris-row .cat { margin-inline-start: 56px; } }

/* ══ شريط التطبيق ══ */
.appbar { margin-top: 84px; position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--raised); border: 1px solid var(--gold); padding: 26px 30px; box-shadow: var(--shadow); }
.appbar::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--gold); opacity: .4; pointer-events: none; }
.appbar b { font-size: 1.25rem; }
.appbar span { color: var(--text2); font-family: var(--naskh); font-size: 1.05rem; }
/* شارة Google Play: الصورة فيها هامش شفاف مدمج، فتُسحب قليلاً لتحاذي النص. */
.appbar .play-badge { display: block; margin: -14px -12px; border-radius: 10px; }
.appbar .play-badge img { display: block; height: 78px; width: auto; }
.appbar .play-badge:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ══ ترويسة الصفحات الداخلية ══ */
.page-head { position: relative; color: var(--hero-text); isolation: isolate; text-align: center; padding: 46px 0 54px; background: radial-gradient(100% 140% at 50% 0%, var(--hero-2), var(--hero-1)); border-bottom: 1px solid var(--hero-gold); }
.page-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--lattice); opacity: .7; }
.page-head::after { content: ""; position: absolute; inset-inline: 0; bottom: 5px; height: 1px; background: var(--hero-gold); opacity: .5; }
.page-head .crumbs { color: var(--hero-text); opacity: .85; padding: 0 0 12px; }
.page-head .crumbs a { color: var(--hero-gold); }
.page-head h1 { font-family: var(--ruqaa); font-size: clamp(2.2rem, 5.4vw, 3.6rem); line-height: 1.35; margin: 0; color: #fff; font-weight: 700; }
.page-head p { font-family: var(--naskh); font-size: 1.15rem; margin: 10px auto 0; max-width: 36em; opacity: .9; }
.crumbs { font-size: .88rem; color: var(--text2); padding: 26px 0 8px; }
.crumbs a { color: var(--text2); }

/* ══ المقالة: ورقة المخطوط ══ */
.folio { position: relative; background: var(--raised); border: 1px solid var(--divider); padding: clamp(26px, 6vw, 68px) clamp(18px, 6vw, 68px); margin: 34px auto 0; box-shadow: var(--shadow); }
.folio::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--gold); opacity: .5; pointer-events: none; }
.folio-head { text-align: center; margin-bottom: 30px; }
.folio-head .cat { display: inline-block; color: var(--rubric); font-weight: 600; font-size: .95rem; text-decoration: none; margin-bottom: 8px; }
.folio-head h1 { font-size: clamp(1.75rem, 4.4vw, 2.7rem); line-height: 1.55; margin: 0; font-weight: 700; text-wrap: balance; }
.orn { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px auto; color: var(--gold); }
.orn::before, .orn::after { content: ""; width: 70px; height: 1px; background: currentColor; }
.orn i { width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--star) center/contain no-repeat; mask: var(--star) center/contain no-repeat; }
.orn i:nth-child(2) { width: 24px; height: 24px; }
.meta { color: var(--text3); font-size: .9rem; display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; justify-content: center; }
.act { padding: 0 16px; text-decoration: none; font-size: .9rem; min-height: 42px; }
.body { font-family: var(--naskh); font-size: 1.32rem; line-height: 2.15; }
.body p { margin: 0 0 1.15em; }
.body > p:first-of-type { font-size: 1.12em; color: var(--text); }
.verse, .hadith { position: relative; font-family: "Amiri", serif; font-size: 1.5rem; line-height: 2.2; text-align: center; margin: 1.5em 0; padding: 24px 26px; background: var(--sunken); border: 1px solid var(--gold); }
.verse::before, .hadith::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--gold); opacity: .4; pointer-events: none; }
.hadith { border-style: dashed; }
.verse small, .hadith small { display: block; font-family: var(--kufi); font-size: .82rem; color: var(--rubric); margin-top: 6px; }
.notice { display: flex; gap: 12px; padding: 16px 18px; background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--accent); border-inline-start-width: 5px; margin: 0 0 28px; font-size: .98rem; line-height: 1.8; }
.notice b { font-weight: 700; }
.progress { position: fixed !important; top: 0; inset-inline: 0; height: 3px; z-index: 99 !important; }
.progress i { display: block; height: 100%; width: 0; background: var(--hero-gold); }
.folio-end { text-align: center; color: var(--gold); letter-spacing: .6em; margin-top: 30px; font-size: 1.2rem; }
.related { margin-top: 20px; }
.body img, .body video, .body iframe { max-width: 100%; height: auto; }
.body img { border: 1px solid var(--divider); padding: 5px; background: var(--bg); }
.body figure { margin: 1.3em 0; }
.body figcaption, .wp-caption-text { font-family: var(--kufi); font-size: .86rem; color: var(--text2); text-align: center; }
.body table { width: 100%; border-collapse: collapse; font-family: var(--kufi); font-size: 1rem; display: block; overflow-x: auto; }
.body td, .body th { border: 1px solid var(--divider); padding: 8px 10px; }
.body blockquote { margin: 1.3em 0; padding: 6px 22px; border-inline-start: 3px double var(--gold); background: var(--sunken); }
.body h2, .body h3, .body h4 { font-family: var(--kufi); line-height: 1.6; margin: 1.6em 0 .5em; color: var(--link); }
.body a { word-break: break-word; }
/* ══ قارئ الكتاب (PDF من الموقع بدل Scribd — inc/pdf.php) ══ */
.body .pdf-book, .pdf-book { margin: 1.8em 0; padding: 20px 20px 18px; background: var(--sunken); border: 1px solid var(--gold); outline: 1px solid var(--gold); outline-offset: -6px; font-family: var(--kufi); }
.pdf-head { display: flex; align-items: center; gap: 14px; }
.pdf-ic { width: 46px; height: 46px; flex: none; padding: 10px; color: var(--gold); border: 1px solid var(--gold); border-radius: 50%; background: var(--raised); }
.pdf-head b { display: block; font-size: 1.1rem; line-height: 1.6; color: var(--link); }
.pdf-head small { color: var(--text3); font-size: .85rem; }
.pdf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pdf-actions .btn { min-height: 46px; padding: 0 22px; font-size: .96rem; }
.pdf-actions .btn svg { width: 20px; height: 20px; flex: none; }
.body .pdf-actions a { text-decoration: none; word-break: normal; }
.body .pdf-frame, .pdf-frame { display: block; width: 100%; height: 78vh; min-height: 520px; margin-top: 18px; border: 1px solid var(--divider); background: #fff; }
.body .pdf-book.compact, .pdf-book.compact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin: 14px 0; padding: 14px 16px; outline: none; }
.pdf-book.compact .pdf-ic { width: 40px; height: 40px; padding: 8px; }
.pdf-book.compact .pdf-head b { font-size: 1rem; }
.pdf-book.compact .pdf-actions { margin-top: 0; }
.pdf-book.compact .pdf-actions .btn { min-height: 42px; padding: 0 16px; font-size: .9rem; }
@media (max-width: 760px) { .body .pdf-frame, .pdf-frame { display: none; } .pdf-actions .btn { flex: 1 1 auto; } .pdf-book.compact .pdf-actions { width: 100%; } }
@media print { .pdf-frame, .pdf-actions { display: none !important; } }
.alignleft { float: left; margin: 0 1em 1em 0; } .alignright { float: right; margin: 0 0 1em 1em; } .aligncenter { display: block; margin-inline: auto; }
@media (max-width: 540px) { .folio::before { inset: 5px; } .body { font-size: 1.2rem; line-height: 2.05; } }

/* ══ التصنيف والترقيم ══ */
.catbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 22px 0 0; }
.catbar a { padding: 6px 18px; border: 1px solid rgba(227,193,107,.5); text-decoration: none; color: var(--hero-text); font-weight: 500; font-size: .93rem; transition: background .2s, color .2s; }
.catbar a:hover, .catbar a[aria-current="true"] { background: var(--hero-gold); color: #1B1405; border-color: var(--hero-gold); }
.pager { margin: 34px 0 0; }
.pager .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pager .page-numbers { min-width: 46px; min-height: 46px; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--divider); text-decoration: none; color: var(--text); font-weight: 600; padding: 0 14px; transition: border-color .2s; }
.pager a.page-numbers:hover { border-color: var(--gold); }
.pager .page-numbers.current { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ══ اسأل الشيخ ══ */
.ask-form { display: grid; gap: 18px; }
.ask-form label { font-weight: 600; display: block; margin-bottom: 6px; }
.ask-form input, .ask-form select, .ask-form textarea { width: 100%; font-family: var(--naskh); font-size: 1.12rem; padding: 12px 16px; border: 1px solid var(--border); background: var(--bg); color: var(--text); min-height: 52px; border-radius: 0; }
.ask-form input:focus, .ask-form select:focus, .ask-form textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 4px var(--tint); }
.ask-form textarea { min-height: 170px; resize: vertical; line-height: 1.9; }
.ask-form .hint { color: var(--text2); font-size: .86rem; margin: 6px 0 0; }
.ask-form .btn { justify-self: start; }

/* ══ مشغّل المحاضرات ══ */
.lec-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); gap: 26px; align-items: start; margin-top: 40px; }
@media (max-width: 920px) { .lec-layout { grid-template-columns: 1fr; } }
.player { position: relative; background: #000; aspect-ratio: 16/9; box-shadow: var(--shadow); border: 1px solid var(--gold); outline: 1px solid var(--gold); outline-offset: 5px; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.now { display: block; margin: 24px 2px 0; font-weight: 700; font-size: 1.4rem; line-height: 1.6; color: var(--text); text-decoration: none; }
a.now:hover { color: var(--link); }
.now-series { color: var(--rubric); font-size: .92rem; font-weight: 600; margin: 2px 2px 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { font: inherit; font-weight: 600; font-size: .92rem; padding: 8px 14px; border: 1px solid var(--divider); background: var(--raised); color: var(--text); cursor: pointer; min-height: 44px; transition: border-color .2s; }
.tabs button:hover { border-color: var(--gold); }
.tabs button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.vlist { list-style: none; margin: 0; padding: 0; background: var(--raised); border: 1px solid var(--divider); max-height: 72vh; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
.vlist button { width: 100%; text-align: start; display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--divider); font-family: var(--naskh); font-size: 1.05rem; color: var(--text); cursor: pointer; min-height: 56px; transition: background .2s; }
.vlist button:hover { background: var(--tint); }
.vlist button[aria-current="true"] { background: var(--tint); color: var(--link); font-weight: 700; box-shadow: inset -4px 0 0 var(--gold); }
.vlist .no { font-family: var(--kufi); color: var(--accent); font-size: .82rem; min-width: 1.8em; text-align: center; }
.vlist img { width: 76px; height: 43px; object-fit: cover; background: var(--sunken); flex: none; }
/* صفحة المحاضرة الواحدة (lecture.php) */
.vlist a { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--divider); font-family: var(--naskh); font-size: 1.05rem; color: var(--text); text-decoration: none; min-height: 56px; transition: background .2s; }
.vlist a:hover { background: var(--tint); }
.vlist a[aria-current="page"], .vlist a[aria-current="true"] { background: var(--tint); color: var(--link); font-weight: 700; box-shadow: inset -4px 0 0 var(--gold); }
.lec-title { font-size: clamp(1.8rem, 4.4vw, 2.8rem) !important; }
.lec-facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; display: block; }
.lec-facade img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; transition: opacity .2s; }
.lec-facade:hover img, .lec-facade:focus-visible img { opacity: 1; }
.lec-facade:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.lec-play { position: absolute; inset-inline-start: 50%; top: 50%; width: 76px; height: 54px; transform: translate(50%, -50%); background: rgba(18, 61, 47, .9); border: 2px solid var(--gold); border-radius: 14px; }
[dir="ltr"] .lec-play { transform: translate(-50%, -50%); }
.lec-play::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #fff; transform: translateX(3px); }
.lec-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 20px 2px 0; color: var(--text2); font-size: .95rem; }
.lec-meta span + span::before { content: "·"; margin-inline-end: 18px; color: var(--gold); }
.lec-desc { font-family: var(--naskh); font-size: 1.1rem; line-height: 2; margin: 10px 2px 0; }
.lec-actions { justify-content: flex-start; }
.lec-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.lec-pn a { display: block; padding: 12px 16px; border: 1px solid var(--divider); background: var(--raised); color: var(--text); text-decoration: none; font-family: var(--naskh); font-size: 1.02rem; line-height: 1.7; transition: border-color .2s; }
.lec-pn a:hover { border-color: var(--gold); }
.lec-pn small { display: block; font-family: var(--kufi); font-size: .8rem; color: var(--accent); }
.lec-pn .lec-prev { grid-column: 2; text-align: end; }
@media (max-width: 560px) { .lec-pn { grid-template-columns: 1fr; } .lec-pn .lec-prev { grid-column: auto; } }
.lec-list-h { font-size: 1.15rem; margin: 0 0 12px; }
.lec-list-h small { color: var(--text2); font-weight: 400; }

/* ══ الخاتمة (الذيل) ══ */
.site-footer { margin-top: 110px; position: relative; isolation: isolate; color: var(--hero-text); text-align: center; padding: 64px 0 46px; background: linear-gradient(180deg, var(--hero-2), var(--hero-1)); border-top: 1px solid var(--hero-gold); }
.site-footer::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--lattice); opacity: .55; }
.site-footer::after { content: ""; position: absolute; inset-inline: 0; top: 5px; height: 1px; background: var(--hero-gold); opacity: .5; }
.foot-mark { width: 54px; height: 54px; margin: -91px auto 22px; background: var(--hero-gold); -webkit-mask: var(--star) center/contain no-repeat; mask: var(--star) center/contain no-repeat; }
.foot-links { display: flex; gap: 6px 26px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px; }
.foot-links a { color: var(--hero-text); text-decoration: none; font-weight: 500; border-bottom: 1px solid transparent; }
.foot-links a:hover { border-color: var(--hero-gold); color: var(--hero-gold); }
.foot-badge { display: block; width: max-content; margin: -14px auto 16px; border-radius: 10px; }
.foot-badge img { display: block; height: 70px; width: auto; }
.foot-badge:focus-visible { outline: 2px solid var(--hero-gold); outline-offset: 2px; }
/* نصّ الخاتمة على هيئة مثلث كخواتيم المخطوطات */
.colophon { font-family: var(--naskh); font-size: 1.08rem; line-height: 2; opacity: .92; }
.colophon span { display: block; margin-inline: auto; }
.colophon span:nth-child(1) { font-family: var(--ruqaa); font-size: 1.9rem; color: var(--hero-gold); opacity: 1; }
.colophon span:nth-child(2) { max-width: 30em; } .colophon span:nth-child(3) { max-width: 20em; } .colophon span:nth-child(4) { max-width: 10em; font-size: .95rem; }
.colophon span:nth-child(5) { color: var(--hero-gold); font-size: 1.3rem; }

@media print {
  .site-header, .site-footer, .progress, .actions, .searchbox, .related, .skip, .appbar, body::before { display: none !important; }
  :root, :root[data-theme] { --bg: #fff; --raised: #fff; --sunken: #fff; --text: #000; --text2: #000; --text3: #000; --divider: #bbb; --primary: #000; --link: #000; --accent: #000; --gold: #777; --rubric: #000; }
  body { background: #fff; font-size: 12pt; }
  .folio { border: 0; box-shadow: none; padding: 0; margin: 0; } .folio::before { display: none; }
  .body { font-size: 14pt; line-height: 1.95; }
  .verse, .hadith { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .rv, .js .hero-in > *, .js .shamsa-wrap { opacity: 1 !important; transform: none !important; }
}

/* ضبط الجوال: عبارة البطل بلا خطّين جانبيين، وزر التشغيل أعلى من العنوان */
@media (max-width: 860px) {
  .hero-kicker::before, .hero-kicker::after { display: none; }
  .play { top: 36%; width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .play::before { border-width: 10px 0 10px 16px; }
  .feature .cap b { font-size: 1.2rem; }
}