/* ═══════════════════════════════════════════════════════════
   مدونة علي آل حوّاء — نظام التصميم
   عائلة خط ثمانية: سيريف ديسبلاي للعناوين، سيريف تكست للمتن، سانس للواجهة.
   الآيات وحدها بالرسم العثماني (حفص).
   ═══════════════════════════════════════════════════════════ */

@font-face { font-family: "Thmanyah Serif Display"; src: url(/fonts/thmanyah-serif-display-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url(/fonts/thmanyah-serif-display-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url(/fonts/thmanyah-serif-display-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url(/fonts/thmanyah-serif-text-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url(/fonts/thmanyah-serif-text-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Text"; src: url(/fonts/thmanyah-serif-text-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url(/fonts/thmanyah-sans-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url(/fonts/thmanyah-sans-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url(/fonts/thmanyah-sans-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Hafs"; src: url(/fonts/UthmanicHafs_V22.ttf) format("truetype"); font-display: swap; }

:root {
  --f-display: "Thmanyah Serif Display", "Thmanyah Serif Text", serif;
  --f-text: "Thmanyah Serif Text", "Thmanyah Serif Display", serif;
  --f-ui: "Thmanyah Sans", system-ui, sans-serif;
  --f-ayah: "Thmanyah Serif Text", "Hafs", serif;   /* ثمانية للآيات أيضًا، وحفص احتياط لعلامات الرسم العثماني الخاصة */

  --bg: #ffffff;
  --surface: #faf9f7;
  --text: #1c1c1b;
  --text-2: #3b3a37;
  --muted: #74716b;
  --line: #e9e7e2;
  --line-2: #d9d6cf;
  --link: #1c1c1b;
  --accent: #8a6a3d;          /* لمسة دافئة خفيفة للروابط عند المرور */
  --green: #2c6a4c;           /* الأخضر الرصين للآيات */
  --green-soft: #eef5f0;
  --hadith: #3d6b55;
  --mark: #f6ecc8;
  --gold: #a8833f;
  --logo-ink: #272724;        /* ألوان الشعار المعتمد: النهاري */
  --logo-gold: #B09A72;

  --fs: 1;                    /* معامل حجم الخط الذي يضبطه القارئ */
  --wrap: 720px;
  --narrow: 680px;
  --gap: clamp(1rem, 4vw, 1.5rem);
  --radius: 4px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #151515; --surface: #1c1c1b; --text: #e8e5df; --text-2: #d2cec6; --muted: #9b968d;
  --line: #2b2a28; --line-2: #3a3936; --link: #e8e5df; --accent: #d1b083;
  --green: #86c4a2; --green-soft: #18241e; --hadith: #9cc9b1; --mark: #4a3f1c; --gold: #d4b27a;
  --logo-ink: #F3EEE2; --logo-gold: #C9B48A;  /* الليلي */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@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-text); font-size: 1.125rem; line-height: 1.95;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, audio, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .35em; transition: color .2s; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--mark); color: var(--text); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: .5rem; top: .5rem; background: var(--text); color: var(--bg); padding: .5rem 1rem; z-index: 100; font-family: var(--f-ui); transform: translateY(-200%); }
.skip:focus { transform: none; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.ic { width: 1.25em; height: 1.25em; display: block; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gap)); margin-inline: auto; padding-inline: var(--gap); }
.wrap.narrow { max-width: calc(var(--narrow) + 2 * var(--gap)); }
.main { min-height: 60vh; }

/* ——— رأس الصفحة ——— */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 20; }
.header-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; min-height: 5rem; }
.header-row .brand { grid-column: 2; }
.header-row .header-tools { grid-column: 3; justify-self: end; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.logo { display: block; overflow: visible; }
.logo-head { height: 3rem; width: auto; aspect-ratio: 3720 / 1300; }
.brand { padding: .35rem 0; }
.header-tools { display: flex; align-items: center; gap: .25rem; }
.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--text); border-radius: 50%; cursor: pointer; }
.icon-btn:hover { background: var(--surface); color: var(--text); }
.social { list-style: none; margin: 0; padding: 0; display: flex; gap: .1rem; }
.social a { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--muted); border-radius: 50%; }
.social a:hover { color: var(--text); background: var(--surface); }
.social-head { margin-inline-end: .25rem; }

/* القائمة: صف أفقي هادئ على الشاشات الواسعة، ولوحة منسدلة بزر على الجوال */
.site-nav { border-top: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: center; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2.2rem; font-family: var(--f-ui); font-size: 1rem; font-weight: 500; }
.nav-list a { display: block; padding: .8rem 0; text-decoration: none; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav-list a:hover { color: var(--text); }
.nav-list a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.menu-toggle, .menu-close, .social-nav { display: none; }

@media (max-width: 760px) {
  .header-row { min-height: 4rem; display: flex; justify-content: space-between; }
  .logo-head { height: 2.6rem; }
  .social-head { display: none; }
  .menu-toggle { display: inline-grid; }
  .site-nav {
    position: fixed; inset: 0; background: var(--bg); border: 0; z-index: 50;
    opacity: 0; visibility: hidden; transform: translateY(-.5rem);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s; overflow-y: auto;
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease; }
  .nav-inner { flex-direction: column; align-items: stretch; padding-top: 1rem; padding-bottom: 2rem; }
  .menu-close { display: inline-grid; align-self: flex-end; }
  .nav-list { flex-direction: column; justify-content: flex-start; gap: 0; margin-top: 1rem; font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; }
  .nav-list a { padding: .85rem 0; border-bottom: 1px solid var(--line); margin: 0; }
  .nav-list a[aria-current="page"] { border-bottom-color: var(--line); color: var(--accent); }
  .social-nav { display: flex; margin-top: 2rem; }
  body.nav-open { overflow: hidden; }
}

/* ——— الصفحة الرئيسية: التعريف ——— */
.intro { padding: clamp(2.5rem, 8vw, 4.5rem) 0 2rem; }
.avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; margin-bottom: 1.5rem; background: var(--surface); }
.intro-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem, 6vw, 2.6rem); line-height: 1.3; margin: 0 0 1rem; }
.intro-text { font-size: calc(1.15rem * var(--fs)); color: var(--text-2); }
.intro-text p { margin: 0 0 1.1rem; }

/* ——— التوقيع: الشعار المعتمد في جهة اليسار ——— */
.signature { width: fit-content; margin: 2rem 0 .5rem; margin-inline-start: auto; }
.logo-sign { height: 4.6rem; width: auto; aspect-ratio: 3720 / 1300; }
.prose .signature { margin: 2.5em 0 1em; margin-inline-start: auto; }
.logo-byline { height: 1.6rem; width: auto; aspect-ratio: 3720 / 1110; }
.logo-foot { height: 4.2rem; width: auto; aspect-ratio: 3720 / 1300; }
.footer-brand { display: block; }

/* ——— الصورة الشخصية الكبيرة بألوانها الأصلية: أربعة أساليب عرض ——— */
.wrap-wide { max-width: calc(1040px + 2 * var(--gap)); }
.hero-arch, .hero-book-page { margin: 0; position: relative; overflow: hidden; background: #14110d; }
.hero-arch img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }

/* التخطيط الجانبي: الصورة في جهة والتحية في الأخرى (القوس، الدائرة، اللوحة) */
.intro-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.intro-side > figure { order: 1; }
@media (max-width: 820px) { .intro-side { grid-template-columns: 1fr; } .intro-side > figure { order: -1; margin-inline: auto; } }

/* (١) «القوس»: صورة طولية في قوس نافذة بحاشية ذهبية رفيعة */
.hero-arch { aspect-ratio: 3 / 4.2; border-radius: 50% 50% 6px 6px / 35.7% 35.7% 6px 6px; box-shadow: 0 0 0 1px var(--gold), 0 0 0 7px var(--bg), 0 0 0 8px color-mix(in srgb, var(--gold) 55%, transparent), 0 30px 60px -30px rgba(0,0,0,.45); margin: 8px; }
.hero-arch img { object-position: 38% 50%; }
.hero-arch:hover img { transform: scale(1.03); }
@media (max-width: 820px) { .hero-arch { width: min(78vw, 340px); } }

/* (٢) «الكتاب المفتوح»: صفحتان متقابلتان، التحية في صفحة والصورة تملأ الأخرى، وبينهما كعب الكتاب */
.book-spread { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 6px 6px 6px 6px; box-shadow: 0 1px 0 var(--line), 0 30px 70px -40px rgba(0,0,0,.5), 0 0 0 1px var(--line); }
.book-spread::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 36px; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(to right, transparent, rgba(0,0,0,.10) 45%, rgba(0,0,0,.16) 50%, rgba(0,0,0,.10) 55%, transparent); }
.book-pg { padding: clamp(1.5rem, 4vw, 3rem); min-width: 0; }
.book-pg-text { display: flex; align-items: center; }
.book-pg-photo { padding: clamp(.8rem, 2vw, 1.2rem); padding-inline-end: 1.6rem; }
.hero-book-page { margin: 0; height: 100%; min-height: 420px; overflow: hidden; border-radius: 2px; }
.hero-book-page img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; }
.intro-book { padding-bottom: 1rem; }
@media (max-width: 820px) {
  .book-spread { grid-template-columns: 1fr; }
  .book-spread::after { display: none; }
  .book-pg-photo { order: -1; padding: .8rem .8rem 0; } .hero-book-page { min-height: 0; aspect-ratio: 1 / 1; }
}

/* (٣) «الدائرة والتحية»: صورة دائرية كبيرة، والتحية تدور حولها على مسار */
.hero-ring { margin: 0; width: min(100%, 430px); }
.hero-ring svg { width: 100%; height: auto; display: block; overflow: visible; }
.ring-line { fill: none; stroke: var(--gold); stroke-width: 1.2; }
.ring-text { font: 500 21px var(--f-display); fill: var(--text); letter-spacing: 0; direction: ltr; unicode-bidi: plaintext; }
.ring-spin { transform-origin: 260px 260px; animation: ring-turn 90s linear infinite; }
@keyframes ring-turn { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .ring-spin { animation: none; } }

/* (٤) «اللوحة المعلّقة»: إطار رقيق داكن، وحاشية ورقية عريضة، وخيط ذهبي، كلوحة في متحف */
.hero-frame { margin: 0; width: min(100%, 400px); padding: 10px; background: #2a2622; box-shadow: 0 2px 0 rgba(255,255,255,.04) inset, 0 40px 60px -35px rgba(0,0,0,.55), 0 4px 10px rgba(0,0,0,.12); }
.frame-mat { display: block; padding: clamp(18px, 4vw, 34px); background: #f4efe4; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), inset 0 3px 8px rgba(0,0,0,.08); }
.frame-fillet { display: block; padding: 3px; background: linear-gradient(135deg, #c9ab70, #8e7442 50%, #c9ab70); }
.frame-fillet img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 38% 50%; }
html[data-theme="dark"] .frame-mat { background: #ebe4d6; }


/* ——— القائمة البريدية ——— */
.newsletter { border-block: 1px solid var(--line); padding: 1.75rem 0; margin: 1.5rem 0 1rem; }
.nl-title { font-family: var(--f-display); font-size: 1.45rem; font-weight: 700; margin: 0 0 .25rem; line-height: 1.4; }
.nl-text { margin: 0 0 1rem; color: var(--muted); font-size: 1.02rem; }
.nl-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; }
.nl-form input[type=email] { flex: 1 1 15rem; min-width: 0; font: 1rem var(--f-ui); padding: .75rem .9rem; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); color: var(--text); text-align: right; }
.nl-form input[type=email]::placeholder { text-align: right; color: var(--muted); }
.nl-form button, .btn { font: 500 1rem var(--f-ui); padding: .72rem 1.4rem; background: var(--text); color: var(--bg); border: 1px solid var(--text); border-radius: var(--radius); cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.4; }
.nl-form button:hover, .btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); }
.form-msg { flex-basis: 100%; margin: .25rem 0 0; font: .95rem/1.7 var(--f-ui); min-height: 1.2em; }
.form-msg.ok { color: var(--green); } .form-msg.err { color: #b3261e; }
html[data-theme="dark"] .form-msg.err { color: #f2a39d; }
.newsletter.compact { margin-top: 3rem; }

/* ——— عناوين الأقسام ——— */
.block { margin: 3rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.section-title { font-family: var(--f-display); font-weight: 700; font-size: 1.55rem; margin: 0; line-height: 1.4; }
.more-link { margin: 1.5rem 0 0; font-family: var(--f-ui); }
.more-link a { text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: .15rem; }

/* ——— عناصر قوائم المقالات ——— */
.post-list { display: flex; flex-direction: column; }
.post-item { padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.post-item:last-child { border-bottom: 0; }
.post-thumb { display: block; margin-bottom: 1rem; overflow: hidden; border-radius: var(--radius); background: var(--surface); aspect-ratio: 16 / 10; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.post-thumb:hover img { transform: scale(1.015); }
.post-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.3rem, 3.6vw, 1.5rem); line-height: 1.5; margin: 0 0 .4rem; }
.post-title a { text-decoration: none; color: var(--text); }
.post-title a:hover { color: var(--accent); }
.post-excerpt { margin: 0 0 .55rem; color: var(--text-2); font-size: 1.04rem; line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { margin: 0; font: .9rem/1.6 var(--f-ui); color: var(--muted); display: flex; flex-wrap: wrap; gap: .1rem .45rem; }
.dot { color: var(--line-2); }
mark { background: var(--mark); color: inherit; padding: 0 .1em; border-radius: 2px; }
.empty { color: var(--muted); font-family: var(--f-ui); padding: 2rem 0; }

/* ——— صفحات الأقسام ——— */
.page-head { padding: clamp(2.2rem, 7vw, 3.5rem) 0 1.25rem; }
.page-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem, 6vw, 2.5rem); line-height: 1.3; margin: 0 0 .5rem; }
.page-sub { margin: 0; color: var(--muted); font-size: 1.08rem; }
.page-sub a { color: var(--muted); }
.filters { margin: .5rem 0 1rem; }
.filter-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .45rem; font-family: var(--f-ui); font-size: .92rem; }
.filter-list a { display: inline-block; padding: .35rem .85rem; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; color: var(--text-2); line-height: 1.5; }
.filter-list a:hover { border-color: var(--text); color: var(--text); }
.filter-list a[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter-list small { opacity: .7; margin-inline-start: .2rem; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font: .92rem var(--f-ui); color: var(--muted); padding: .75rem 0; border-bottom: 1px solid var(--line); }
.list-tools select, .list-tools input, .search-form input, .search-form select, .archive-filters select, .archive-filters input {
  font: .95rem var(--f-ui); padding: .5rem .7rem; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.list-tools input[type=search] { flex: 1 1 12rem; margin-inline-start: auto; }
.review-filters { border-bottom: 0; padding-top: 0; }
.places { font: .95rem/1.9 var(--f-ui); color: var(--muted); margin-bottom: .5rem; }
.places ul { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.tax-label { color: var(--muted); font-family: var(--f-ui); margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; margin: 2rem 0; font-family: var(--f-ui); }
.load-more { font: 500 1rem var(--f-ui); padding: .7rem 1.6rem; border: 1px solid var(--text); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.load-more:hover { background: var(--text); color: var(--bg); }
.load-more.loading { opacity: .5; pointer-events: none; }
.pager-info { color: var(--muted); font-size: .9rem; }
.list-area.loading { opacity: .45; transition: opacity .15s; }
.post-item.appear { animation: appear .4s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ——— صفحة المقال ——— */
.progress { position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transform-origin: right; }
.article-head { padding: clamp(2.2rem, 7vw, 3.75rem) 0 1.25rem; }
.kicker { margin: 0 0 .9rem; font: .92rem var(--f-ui); color: var(--muted); }
.kicker a { color: var(--muted); text-decoration: none; }
.kicker a:hover { color: var(--accent); }
.article-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem, 6.2vw, 2.75rem); line-height: 1.35; margin: 0 0 .75rem; text-wrap: balance; }
.article-sub { font-family: var(--f-text); font-size: clamp(1.15rem, 3vw, 1.3rem); color: var(--muted); margin: 0 0 1rem; line-height: 1.8; }
.article-meta { font: .93rem/1.7 var(--f-ui); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .55rem; margin: 0; }
.byline { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-2); }
.byline-photo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.reading-tools { display: flex; flex-wrap: wrap; gap: .15rem; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.reading-tools button, .share a, .share button {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 0; background: none; color: var(--muted); border-radius: 50%; cursor: pointer; }
.reading-tools button:hover, .share a:hover, .share button:hover { background: var(--surface); color: var(--text); }
.reading-tools button[aria-pressed="true"] { color: var(--accent); }
.reading-tools .ic { width: 1.2rem; height: 1.2rem; }
.t-sun { display: none; } html[data-theme="dark"] .t-sun { display: block; } html[data-theme="dark"] .t-moon { display: none; }
.article-cover { margin: .5rem 0 2rem; }
.article-cover img { width: 100%; border-radius: var(--radius); }
.resume { margin: 0 0 1rem; } .resume button { font: .92rem var(--f-ui); background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: .5rem 1rem; border-radius: 999px; cursor: pointer; }
.preview-banner { background: #fff3cd; color: #5c4400; text-align: center; font-family: var(--f-ui); padding: .6rem; margin: 0; }

/* ——— المتن ——— */
.prose { font-size: calc(1.2rem * var(--fs)); line-height: 2.05; color: var(--text); overflow-wrap: break-word; }
.prose > * { margin-top: 0; margin-bottom: 1.35em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--f-display); font-weight: 700; line-height: 1.5; margin: 2em 0 .7em; scroll-margin-top: 1.5rem; }
.prose h2 { font-size: 1.45em; } .prose h3 { font-size: 1.22em; } .prose h4 { font-size: 1.08em; }
.prose strong { font-weight: 700; }
.prose a { color: var(--text); text-decoration-color: var(--line-2); }
.prose a:hover { color: var(--accent); text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--muted); }
.prose hr { border: 0; text-align: center; margin: 2.5em 0; }
.prose hr::before { content: "⁂"; color: var(--muted); letter-spacing: .5em; }
.prose blockquote { margin-inline: 0; padding: .2em 1.2em .2em 0; border-inline-start: 2px solid var(--line-2); color: var(--text-2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.block-source { display: block; font: normal .85rem/1.7 var(--f-ui); color: var(--muted); margin-top: .6em; font-style: normal; }
.block-source::before { content: "— "; }
/* الآيات: أخضر رصين بالرسم العثماني، دون مساس بالنص */
.ayah { font-family: var(--f-ayah); color: var(--green); font-weight: 500; }
.prose .ayah-block { border: 0; background: var(--green-soft); color: var(--green); padding: 1.1em 1.3em; border-radius: var(--radius); text-align: center; }
.ayah-block p { font-family: var(--f-ayah); font-weight: 500; font-size: 1.15em; line-height: 2.05; margin: 0 0 .4em; }
.ayah-block .block-source { text-align: center; color: var(--green); }
.prose .hadith-block { border-inline-start: 2px solid var(--hadith); color: var(--hadith); padding-inline-start: 1.2em; }
.hadith-block p { font-weight: 500; }
.prose .naql-block { border-inline-start: 2px solid var(--line-2); background: var(--surface); padding: 1em 1.2em; border-radius: var(--radius) 0 0 var(--radius); font-size: .95em; }
.prose .literary-block { border: 0; text-align: center; font-family: var(--f-display); font-size: 1.12em; color: var(--text); padding: .5em 1.5em; }
.prose .literary-block::before, .prose .literary-block::after { content: "❝"; display: block; color: var(--line-2); font-size: 1.6em; line-height: 1; }
.prose .literary-block::after { content: "❞"; }
.note-block { background: var(--surface); border: 1px solid var(--line); padding: 1em 1.2em; border-radius: var(--radius); font-size: .95em; }
/* الشعر بشطريه */
.poem { margin: 2em auto; max-width: 31em; text-align: center; font-family: var(--f-text); }
.bayt { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3em; margin-bottom: .55em; }
.shatr { display: block; text-align: center; }
.bayt.single { grid-template-columns: 1fr; } .bayt.single .shatr { text-align: center; text-align-last: center; }
@media (max-width: 560px) {
  .bayt { grid-template-columns: 1fr; gap: 0; margin-bottom: 1em; }
  .bayt .shatr { text-align: start; text-align-last: auto; }
  .bayt .shatr + .shatr { text-align: end; text-align-last: auto; padding-inline-start: 2em; }
}
/* الحواشي */
.footnote-ref a { text-decoration: none; font: 700 max(.7em, 12px) var(--f-ui); color: var(--accent); padding: 0 .15em; }
.footnotes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); font-size: .9em; line-height: 1.9; color: var(--text-2); }
.prose .footnotes-title { font-family: var(--f-ui); font-size: 1rem; font-weight: 500; color: var(--muted); margin: 0 0 .75em; }
.footnotes-list { padding-inline-start: 1.6em; list-style: arabic-indic; }
.footnote-item:target { background: var(--mark); border-radius: 2px; }
.prose .footnote-backref { text-decoration: underline; text-underline-offset: .2em; margin-inline-start: .3em; color: var(--accent); }
:target { scroll-margin-top: 2rem; }
/* الجداول والصور والوسائط */
.table-wrap { overflow-x: auto; margin-bottom: 1.5em; -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; width: 100%; font: .9em/1.8 var(--f-ui); }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .6em .8em; text-align: start; vertical-align: top; }
.prose th { font-weight: 700; border-bottom-color: var(--line-2); }
.figure { margin: 2em 0; }
.figure img, .prose img { border-radius: var(--radius); margin-inline: auto; }
.figure figcaption, .media-audio figcaption, .media-video figcaption { font: .88rem/1.7 var(--f-ui); color: var(--muted); text-align: center; margin-top: .6em; }
.media-audio audio { width: 100%; }
.media-video video { width: 100%; border-radius: var(--radius); }
.yt-lite { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; }
.yt-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { font: 500 1rem var(--f-ui); background: rgba(255, 255, 255, .92); color: #111; border: 0; padding: .7rem 1.3rem; border-radius: 999px; cursor: pointer; }
.media-file a { font-family: var(--f-ui); display: inline-flex; gap: .4rem; align-items: center; padding: .55rem 1rem; border: 1px solid var(--line-2); border-radius: var(--radius); text-decoration: none; }
.media-file a::before { content: "↓"; }

/* بيانات الرحلة والكتاب */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem 1.5rem; font: .93rem/1.6 var(--f-ui); margin: 0 0 1.75rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .85rem; } .facts dd { margin: 0; }
.book-card { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.75rem; }
.book-card img { width: 96px; border-radius: 2px; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); }
.book-card .facts { flex: 1; margin: 0; }
.book-link { font-family: var(--f-ui); font-size: .92rem; }
.rating { color: var(--accent); letter-spacing: .15em; }
.series-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 2rem; font: .95rem/1.9 var(--f-ui); }
.series-box ol { margin: .25rem 0 0; padding-inline-start: 1.25rem; }
.series-name { margin: 0; color: var(--muted); }

/* نهاية المقال */
.article-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--f-ui); font-size: .95rem; }
.taxonomy p { margin: 0 0 .6rem; }
.tag { display: inline-block; padding: .15rem .7rem; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; font-size: .85rem; margin: .1rem 0; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; margin: 1.25rem 0; }
.share-label { color: var(--muted); margin-inline-end: .5rem; }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0 1rem; }
.prev-next a { display: block; text-decoration: none; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.prev-next a:hover { border-color: var(--text); color: var(--text); }
.prev-next small { display: block; color: var(--muted); margin-bottom: .25rem; }
.prev-next span { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; line-height: 1.5; }
.pn-prev { text-align: left; }
.back-link a, .related-books a { color: var(--muted); }
.related .post-item { padding: 1.1rem 0; }
.related .post-title { font-size: 1.2rem; }
.to-top { position: fixed; inset-inline-end: 1.25rem; bottom: 1.25rem; width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); display: grid; place-items: center; cursor: pointer; z-index: 30; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.to-top[hidden] { display: none; }
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translate(-50%, 1rem); max-width: 90vw; background: var(--text); color: var(--bg); font: .95rem var(--f-ui); padding: .6rem 1.2rem; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 70; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ——— المؤلفات ——— */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2rem 1.5rem; margin-top: 1rem; }
.book-item { text-decoration: none; display: flex; flex-direction: column; gap: .35rem; }
.book-cover { display: block; aspect-ratio: 2 / 3; background: var(--surface); border-radius: 2px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 18px rgba(0, 0, 0, .06); margin-bottom: .5rem; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-blank { display: grid; place-items: center; height: 100%; padding: 1rem; text-align: center; font-family: var(--f-display); font-weight: 700; border: 1px solid var(--line); }
.book-title { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; line-height: 1.5; }
.book-sub { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.book-status { font: .82rem var(--f-ui); color: var(--accent); }
.book-head { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; align-items: start; padding: clamp(2.2rem, 7vw, 3.5rem) 0 1rem; }
.book-head-cover { width: 100%; border-radius: 2px; box-shadow: 0 8px 28px rgba(0, 0, 0, .12); }
.book-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.book-section { margin: 2.5rem 0; }
.book-section h2 { font-family: var(--f-display); font-size: 1.35rem; margin: 0 0 .75rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; } .gallery figcaption { font: .85rem var(--f-ui); color: var(--muted); }
.files { font-family: var(--f-ui); }
.book-spot-inner { display: flex; gap: 1.25rem; align-items: center; text-decoration: none; padding: 1rem 0; }
.book-spot-inner img { width: 90px; border-radius: 2px; box-shadow: 0 4px 14px rgba(0, 0, 0, .1); }
.book-spot-inner > span { display: flex; flex-direction: column; gap: .2rem; }
.book-spot-title { font-family: var(--f-display); font-size: 1.3rem; }
.book-spot-sub { color: var(--muted); } .book-spot-text { color: var(--text-2); font-size: 1rem; } .book-spot-status { font: .85rem var(--f-ui); color: var(--accent); }
@media (max-width: 600px) { .book-head { grid-template-columns: 1fr; } .book-head-cover { max-width: 200px; } }

/* ——— الإحصاءات العامة ——— */
.stats { border-top: 1px solid var(--line); padding-top: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.5rem; margin: 1.25rem 0 0; }
.stats-grid div { display: flex; flex-direction: column-reverse; }
.stats-grid dd { margin: 0; font: 700 2rem/1.2 var(--f-display); }
.stats-grid dt { font: .92rem var(--f-ui); color: var(--muted); margin-top: .25rem; }

/* ——— البحث والأرشيف ——— */
.search-form { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.search-form input[type=search] { font-size: 1.15rem; padding: .85rem 1rem; }
.search-filters, .archive-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.archive-filters { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.archive-filters input[type=search] { flex: 1 1 10rem; }
.results-count { font: .92rem var(--f-ui); color: var(--muted); }
.archive-year { margin: 2rem 0; }
.archive-y { font: 700 1.5rem var(--f-display); margin: 0 0 .5rem; color: var(--muted); }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.archive-list a { font-family: var(--f-display); font-weight: 500; text-decoration: none; font-size: 1.1rem; }
.archive-meta { font: .85rem var(--f-ui); color: var(--muted); }

/* ——— صفحات ثابتة ونماذج ——— */
.page-static .page-head .avatar { margin-bottom: 1.25rem; }
.about-links { font-family: var(--f-ui); color: var(--muted); }
.social-about { margin: 1.5rem 0 .5rem; }
.contact-form { margin-top: 2rem; font-family: var(--f-ui); }
.field { margin: 0 0 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .95rem; color: var(--text-2); }
.field input, .field select, .field textarea { font: 1rem/1.7 var(--f-ui); padding: .7rem .85rem; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); color: var(--text); width: 100%; }
.field textarea { font-family: var(--f-text); font-size: 1.05rem; resize: vertical; }
.message-page { padding: clamp(3rem, 10vw, 6rem) var(--gap); text-align: center; }
.message-page form { display: flex; justify-content: center; gap: .5rem; margin: 1.5rem 0; }
.big-404 { font: 700 5rem/1 var(--f-display); color: var(--muted); margin: 0 0 1rem; }
.page-404 .search-form { flex-direction: row; max-width: 30rem; margin-inline: auto; }
.page-404 .search-form input { flex: 1; min-width: 0; width: auto; }
.page-404 .search-form .btn { flex: none; }

/* ——— التذييل ——— */
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2.5rem 0 3rem; font-family: var(--f-ui); font-size: .92rem; color: var(--muted); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; }
.footer-brand { font: 700 1.15rem var(--f-display); text-decoration: none; color: var(--text); }
.footer-links { margin: 0; } .footer-links a { color: var(--muted); text-decoration: none; } .footer-links a:hover { color: var(--text); }
.copyright, .footer-note { margin: 0; }

/* ——— الطباعة وحفظ PDF ——— */
@media print {
  @page { margin: 2cm 1.8cm; }
  html, body { background: #fff !important; color: #000 !important; }
  .site-header, .site-footer, .reading-tools, .share, .prev-next, .related, .newsletter, .to-top, .toast, .progress, .resume, .back-link, .skip { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .prose { font-size: 12.5pt; line-height: 1.9; }
  .article-title { font-size: 22pt; }
  .prose a { text-decoration: none; color: #000; }
  .ayah, .ayah-block, .hadith-block { color: #1d4f37 !important; background: none !important; }
  .prose h2, .prose h3 { break-after: avoid; } .figure, .poem, .table-wrap, blockquote { break-inside: avoid; }
  .article::after { content: "المصدر: " attr(data-url); display: block; margin-top: 2em; font-size: 9pt; color: #555; }
}


/* ═══════════════════════════════════════════════════════════
   «التوقيع»: لغة واحدة تسري في المنصة كلها
   أصلها حلية الشعار (خط–نقطة–خط): خطٌّ ذهبي رفيع ينقطع ليحلّ التوقيع أو نقطته في موضعه.
   الصورة: حلقة تنقطع أسفل اليسار للتوقيع. العناوين: الحلية تحتها.
   فواصل المقالات: خط ينتهي بنقطة في جهة اليسار. خاتمة المقال والتذييل: يمتدّ الخط حتى يتّصل بحلية الشعار نفسها.
   ═══════════════════════════════════════════════════════════ */
:root { --sig: var(--logo-gold); --rule-w: 1.2px; }

/* (١) الصورة في الحلقة المنقطعة */
.hero-sign { position: relative; margin: 0 auto; width: min(100%, 440px); aspect-ratio: 1; }
.hero-photo { position: absolute; inset: 7.5%; border-radius: 50%; overflow: hidden; background: transparent; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; transition: transform 1.2s ease; }
.hero-sign:hover .hero-photo img { transform: scale(1.04); }
.hero-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hero-ring circle { fill: none; stroke: var(--sig); stroke-width: 1.1; }
.hero-sig { position: absolute; left: -14%; bottom: -10%; width: 50%; height: auto; aspect-ratio: 3720 / 1300; overflow: visible; }
.intro-sign { padding-bottom: 4rem; }
@media (max-width: 820px) { .hero-sign { width: min(80vw, 340px); } .hero-sig { left: -8%; } .intro-sign > figure { margin-bottom: 2.5rem; } }

/* (٢) العناوين: حلية الشعار تحت كل عنوان قسم وصفحة */
.section-head { justify-content: center; text-align: center; margin-bottom: 1rem; }
.section-title, .page-title { text-align: center; }
.section-title::after, .page-title::after {
  content: ""; display: block; width: 6.5rem; height: 7px; margin: .55rem auto 0;
  background:
    linear-gradient(var(--sig), var(--sig)) left center / 40% var(--rule-w) no-repeat,
    linear-gradient(var(--sig), var(--sig)) right center / 40% var(--rule-w) no-repeat,
    radial-gradient(circle, var(--sig) 2.4px, transparent 2.9px) center / 7px 7px no-repeat;
}
.page-title::after { width: 8rem; margin-top: .8rem; }
.page-head { text-align: center; }
.page-sub { max-width: 38rem; margin-inline: auto; }
.filters .filter-list { justify-content: center; }
.stats { border-top: 0; text-align: center; }
.stats-grid div { align-items: center; }

/* (٣) فواصل المقالات: الخط ينتهي قبل اليسار، وفي موضع التوقيع نقطته */
.post-item { position: relative; border-bottom: 0; }
.post-item::after { content: ""; position: absolute; bottom: 0; right: 0; left: 1.6rem; height: 1px; background: var(--line); }
.post-item::before { content: ""; position: absolute; bottom: -2.5px; left: .35rem; width: 6px; height: 6px; border-radius: 50%; background: var(--sig); }
.post-item:last-child::after, .post-item:last-child::before { display: none; }
.archive-list li { border-bottom-style: solid; }

/* (٤) خاتمة المقال: خطٌّ يجري من آخر السطر حتى يتّصل بحلية التوقيع */
.prose .signature { width: auto; display: flex; align-items: flex-end; margin: 2.8em 0 1.2em; }
.prose .signature::before {
  content: ""; flex: 1; height: var(--rule-w); border-radius: 1px;
  margin-bottom: calc(4.6rem * .045 - var(--rule-w) / 2); margin-inline-end: calc(4.6rem * 2.862 * -.298);
  background: linear-gradient(to right, var(--sig) 55%, transparent);
}
.prose .signature .logo-sign { position: relative; }

/* (٥) التذييل: الخطّ يمتدّ من الجانبين ويتّصل بحلية الشعار، فيصير الشعار فاصلَ الصفحة */
.site-footer { border-top: 0; }
.footer-brand { display: flex; align-items: flex-end; width: min(100%, 720px); }
.footer-brand::before, .footer-brand::after {
  content: ""; flex: 1; height: var(--rule-w); border-radius: 1px;
  margin-bottom: calc(4.2rem * .045 - var(--rule-w) / 2);
}
.footer-brand::before { margin-inline-end: calc(4.2rem * 2.862 * -.298); background: linear-gradient(to right, var(--sig) 35%, transparent); }
.footer-brand::after { margin-inline-start: calc(4.2rem * 2.862 * -.297); background: linear-gradient(to left, var(--sig) 35%, transparent); }
.footer-brand .logo-foot { position: relative; }
/* صفحات الأقسام ومقالاتها: الشعار في الرأس، فلا يتكرّر في التذييل؛ ويبقى خطٌّ رفيع فاصلًا */
body.in-sec .footer-brand { display: none; }
body.in-sec .site-footer .footer-inner { border-top: 1px solid var(--line); padding-top: 2rem; }

/* (٦) فاصل المتن: الحلية بدل النجوم */
.prose hr { height: 7px; width: 6.5rem; margin: 2.5em auto;
  background:
    linear-gradient(var(--sig), var(--sig)) left center / 40% var(--rule-w) no-repeat,
    linear-gradient(var(--sig), var(--sig)) right center / 40% var(--rule-w) no-repeat,
    radial-gradient(circle, var(--sig) 2.4px, transparent 2.9px) center / 7px 7px no-repeat; }
.prose hr::before { content: none; }

/* (٧) زر العودة إلى الأعلى: حلقة صغيرة تنقطع أسفل اليسار */
.to-top { border: 0; position: fixed; }
.to-top::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--sig) 0 200deg, transparent 200deg 250deg, var(--sig) 250deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.2px), #000 calc(100% - 1px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 1.2px), #000 calc(100% - 1px)); }
.to-top::after { content: ""; position: absolute; left: 3px; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--sig); }

@media (prefers-reduced-motion: reduce) { .hero-photo img { transition: none; } }
@media print { .post-item::before, .prose .signature::before { display: none; } }


/* ═══════════════════════════════════════════════════════════
   «الأبواب»: عرض «على مُكث» فصولًا كأبواب كتاب، على لغة «التوقيع» نفسها:
   تحت رأس كل باب خطٌّ رمادي ينتهي قبل اليسار بنقطة ذهبية، وأرقام الأجزاء في دوائر رفيعة من ذهب الشعار.
   ═══════════════════════════════════════════════════════════ */
.chapters-index .filter-list a { border-color: var(--line); }
.chapters-tools { justify-content: center; border-bottom: 0; padding-top: 0; }
.chapters-tools input[type=search] { flex: 0 1 22rem; margin-inline-start: 0; }
.view-switch, .view-back a { font: .9rem var(--f-ui); color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.view-switch:hover, .view-back a:hover { color: var(--text); border-color: var(--sig); }
.view-back { text-align: center; margin: 0 0 .5rem; }
.chapters { display: grid; gap: clamp(2.6rem, 6vw, 3.6rem); margin: 2.2rem 0 1rem; }
.chapter { scroll-margin-top: 6rem; }
.chapter-head { position: relative; padding-bottom: 1rem; margin-bottom: .4rem; }
.chapter-head::after { content: ""; position: absolute; bottom: 0; right: 0; left: 1.6rem; height: 1px; background: var(--line); }
.chapter-head::before { content: ""; position: absolute; bottom: -2.5px; left: .35rem; width: 6px; height: 6px; border-radius: 50%; background: var(--sig); }
.chapter-kicker { margin: 0 0 .25rem; font: 500 .82rem var(--f-ui); color: var(--sig); letter-spacing: 0; }
.chapter-title { margin: 0; font: 700 clamp(1.45rem, 3.4vw, 1.8rem)/1.35 var(--f-display); }
.chapter-title a { color: var(--text); text-decoration: none; }
.chapter-title a:hover { color: var(--gold); }
.chapter-desc { margin: .35rem 0 0; font: .95rem/1.8 var(--f-ui); color: var(--muted); max-width: 40rem; }
.ch-list { list-style: none; margin: 0; padding: 0; }
.ch-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.25rem; align-items: baseline; padding: .95rem 0; border-bottom: 1px dashed var(--line); }
.ch-item:last-child { border-bottom: 0; }
.ch-main { min-width: 0; }
.ch-title { display: inline; margin: 0; font: 700 1.14rem/1.6 var(--f-display); color: var(--text); text-decoration: none; }
a.ch-title:hover { color: var(--gold); }
.ch-sub { margin: .15rem 0 0; font: .95rem/1.7 var(--f-text); color: var(--text-2); }
.ch-meta { margin: 0; font: .82rem var(--f-ui); color: var(--muted); white-space: nowrap; }
.ch-meta .dot { margin: 0 .35rem; }
.ch-parts { grid-column: 1 / -1; list-style: none; margin: .6rem 0 0; padding: 0 1.1rem 0 0; border-inline-start: var(--rule-w) solid var(--sig); }
.ch-parts li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.ch-parts a { font: 500 1rem/1.7 var(--f-text); color: var(--text); text-decoration: none; display: inline-flex; align-items: baseline; gap: .55rem; }
.ch-parts a:hover { color: var(--gold); }
.ch-part-n { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border: var(--rule-w) solid var(--sig); border-radius: 50%; font: 500 .74rem/1 var(--f-ui); color: var(--sig); flex: none; transform: translateY(-1px); }
@media (max-width: 600px) {
  .ch-item { grid-template-columns: 1fr; }
  .ch-item > .ch-meta { margin-top: .3rem; }
  .ch-parts { padding-inline-start: .8rem; }
  .ch-parts li { flex-direction: column; gap: 0; }
}
@media print { .chapter-head::before, .chapters-tools { display: none; } }


/* ═══════════════════════════════════════════════════════════
   ألوان الأقسام — لوحة «ألوان الأرض» (اعتُمدت في ٣ ديسمبر ٢٠٢٦)
   اللون إشارة لا طلاء: خط القائمة، ونقطة التصنيف، و«الباب…» ونقطته، واسم القسم أعلى المقال، ونقطة التصنيف في القوائم.
   التصنيفات تأخذ لون قسمها. وعناصر «التوقيع» (الشعار والحلقات والتذييل) تبقى على ذهب الشعار.
   ═══════════════════════════════════════════════════════════ */
:root {
  --sec-mukth: #A0784A; --sec-books: #5E7F6E; --sec-maseer: #A45D46; --sec-asdaa: #4E6B85; --sec-kitaba: #7D6B4F;
  --sec: var(--sig);
}
html[data-theme="dark"] {
  --sec-mukth: #D2AE80; --sec-books: #93B5A3; --sec-maseer: #D39380; --sec-asdaa: #8EAACB; --sec-kitaba: #BFAE91;
}
[data-sec="mukth"] { --sec: var(--sec-mukth); }
[data-sec="books"] { --sec: var(--sec-books); }
[data-sec="maseer"] { --sec: var(--sec-maseer); }
[data-sec="asdaa"] { --sec: var(--sec-asdaa); }
[data-sec="kitaba"] { --sec: var(--sec-kitaba); }

.nav-list a[data-sec]:hover { border-bottom-color: color-mix(in srgb, var(--sec) 45%, transparent); }
.nav-list a[data-sec][aria-current="page"] { border-bottom-color: var(--sec); }
@media (max-width: 820px) {
  .nav-list a[data-sec][aria-current="page"] { color: var(--text); border-bottom-color: var(--line); box-shadow: inset -3px 0 0 var(--sec); padding-inline-start: .8rem; }
  .nav-list a[data-sec]:hover { border-bottom-color: var(--line); }
}

.filter-list a { display: inline-flex; align-items: center; gap: .45rem; border-color: color-mix(in srgb, var(--sec) 32%, var(--line)); }
.filter-list a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sec); flex: none; }
.filter-list a:hover { border-color: var(--sec); color: var(--text); }
.filter-list a[aria-current="page"] { background: color-mix(in srgb, var(--sec) 14%, transparent); border-color: var(--sec); color: var(--text); }

.chapter-kicker { color: var(--sec); }
.chapter-head::before { background: var(--sec); }
.chapter-title a:hover, a.ch-title:hover, .ch-parts a:hover { color: var(--sec); }

.page-article .kicker a:first-child { color: var(--sec); }

.post-item .meta-cat { display: inline-flex; align-items: center; gap: .35rem; }
.post-item .meta-cat::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--sec); flex: none; }
@media print { .filter-list a::before, .post-item .meta-cat::before { display: none; } }

/* أسماء الأقسام في القائمة بألوانها (طلب ٣ ديسمبر ٢٠٢٦)، والقسم الحالي يزيد بخطه تحته */
.nav-list a[data-sec], .nav-list a[data-sec]:hover { color: var(--sec); }
.nav-list a[data-sec][aria-current="page"] { color: var(--sec); font-weight: 700; }
@media (max-width: 820px) { .nav-list a[data-sec][aria-current="page"] { color: var(--sec); } }


/* ═══════════════════════════════════════════════════════════
   «عائلات المعنى»: تدرّج ألوان أبواب «على مُكث» (اعتُمد في ٣ ديسمبر ٢٠٢٦)
   لكل تصنيف لونه الثابت من عائلته (القيم في src/catcolors.js)، ويظهر في: «الباب…» ونقطته،
   ونقطة التصنيف في فهرس الأبواب وأزرار التصنيفات وقوائم المقالات، واسم التصنيف أعلى المقال.
   ═══════════════════════════════════════════════════════════ */
.has-cat { --cat: var(--cat-l); }
html[data-theme="dark"] .has-cat { --cat: var(--cat-d); }
.chapter.has-cat .chapter-kicker { color: var(--cat); }
.chapter.has-cat .chapter-head::before { background: var(--cat); }
.chapter.has-cat .chapter-title a:hover, .chapter.has-cat a.ch-title:hover, .chapter.has-cat .ch-parts a:hover { color: var(--cat); }
.chapter.has-cat .ch-parts { border-inline-start-color: var(--cat); }
.chapter.has-cat .ch-part-n { border-color: var(--cat); color: var(--cat); }
.filter-list a.has-cat::before { background: var(--cat); }
.filter-list a.has-cat { border-color: color-mix(in srgb, var(--cat) 32%, var(--line)); }
.filter-list a.has-cat:hover { border-color: var(--cat); }
.filter-list a.has-cat[aria-current="page"] { background: color-mix(in srgb, var(--cat) 14%, transparent); border-color: var(--cat); }
.post-item .meta-cat.has-cat::before { background: var(--cat); }
.page-article .kicker a.has-cat { color: var(--cat); }

/* الرئيسية بلا شعار علوي: يكفي التوقيع في موضع انقطاع الحلقة بجانب الصورة (٣ ديسمبر ٢٠٢٦) */
.header-row.no-brand { min-height: 3.4rem; }
.header-row.no-brand .header-tools { margin-inline-start: auto; }


/* ═══════════════════════════════════════════════════════════
   الحلقة بانقطاعين (٣ ديسمبر ٢٠٢٦): أعلى اليمين كلمة «مدونة» في الفراغ، وأسفل اليسار التوقيع،
   وتحت التوقيع حساب تليجرام برمزه في دائرة صغيرة بخيط الذهب.
   ═══════════════════════════════════════════════════════════ */
.hero-label { position: absolute; left: 87%; top: 10%; width: calc(50% * 1812 / 3720); height: auto; aspect-ratio: 1812 / 790; transform: translate(-50%, -50%); overflow: visible; pointer-events: none; }
.hero-tg { position: absolute; left: -14%; width: 50%; top: calc(110% + .9rem); display: flex; direction: ltr; justify-content: center; align-items: center; gap: .5rem; text-decoration: none; color: var(--muted); white-space: nowrap; z-index: 2; }
.hero-tg-ico { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--logo-ink); flex: none; }
.hero-tg-ico::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: var(--rule-w) solid var(--sig); }
.hero-tg-ico svg { width: 1rem; height: 1rem; transform: translateX(-1px); }
.hero-tg-handle { font: 500 .9rem var(--f-ui); letter-spacing: .01em; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.hero-tg:hover { color: var(--text); }
.hero-tg:hover .hero-tg-handle { border-bottom-color: var(--sig); }
.hero-tg:hover .hero-tg-ico::before { border-width: 1.6px; }
.intro-sign { padding-bottom: 6.5rem; }
.page-home .social-head { display: none; }
@media (max-width: 820px) {
  .hero-tg { left: -8%; }
  .intro-sign > figure { margin-bottom: 5rem; }
}

/* الأقسام ظاهرة مباشرة في الجوال: صفٌّ أفقي تحت الرأس بدل القائمة المنسدلة (٣ ديسمبر ٢٠٢٦) */
@media (max-width: 760px) {
  .menu-toggle, .menu-close, .social-nav { display: none !important; }
  .social-head { display: flex; }
  .page-home .social-head { display: none; }
  .site-nav, .site-nav.open { position: static; inset: auto; opacity: 1; visibility: visible; transform: none; transition: none; overflow: visible; background: transparent; border-top: 1px solid var(--line); z-index: auto; }
  .nav-inner { flex-direction: row; align-items: center; padding-top: 0; padding-bottom: 0; }
  .nav-list { flex-direction: row; flex-wrap: nowrap; justify-content: space-between; gap: 0 .75rem; margin: 0; width: 100%; overflow-x: auto; scrollbar-width: none; font-family: var(--f-ui); font-size: .86rem; font-weight: 500; -webkit-overflow-scrolling: touch; }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-list li { flex: none; }
  .nav-list a, .nav-list a[data-sec][aria-current="page"] { padding: .7rem 0 .6rem; border-bottom: 2px solid transparent; margin: 0 0 -1px; box-shadow: none; padding-inline-start: 0; }
  .nav-list a[data-sec][aria-current="page"] { border-bottom-color: var(--sec); }
  body.nav-open { overflow: auto; }
}
@media (max-width: 440px) { .nav-list { font-size: .8rem; gap: 0 .6rem; } }
@media (max-width: 380px) { .nav-list { font-size: .75rem; gap: 0 .42rem; } }


/* ═══ الخلفية المتحركة «الكسوف والتدرّج النقطي» ═══ */
.sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.site-header { background: transparent; }
@media print { .sky { display: none !important; } }
/* في الجوال يتنحّى الشعار عن الزاوية قليلًا حتى لا يزاحمه الكسوف الصغير */
@media (max-width: 760px) { .header-row .brand { margin-inline-start: 2.4rem; } }


/* ═══ المؤلفات: الغلافان، وبطاقة «اقرأ من الكتاب» (٣ ديسمبر ٢٠٢٦) ═══ */
.book-covers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); }
.book-covers figure { margin: 0; text-align: center; }
.book-covers a { display: block; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 28px -12px rgba(0,0,0,.28); transition: transform .3s ease; }
.book-covers a:hover { transform: translateY(-3px); }
.book-covers img { display: block; width: 100%; height: auto; }
.book-covers figcaption { margin-top: .7rem; font: 500 .88rem var(--f-ui); color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; }
.book-covers figcaption::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--sec, var(--sig)); }
.read-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; margin-bottom: .8rem; border-radius: 10px; }
.read-card::before { content: ""; position: absolute; inset: 0; border-radius: 10px; border: var(--rule-w) solid color-mix(in srgb, var(--sec, var(--sig)) 55%, transparent); pointer-events: none; }
.read-card-ico { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; color: var(--sec, var(--sig)); border: var(--rule-w) solid var(--sec, var(--sig)); }
.read-card-ico svg { width: 1.35rem; height: 1.35rem; }
.read-card-title { margin: 0; font: 700 1.1rem/1.5 var(--f-display); }
.read-card-meta { margin: .1rem 0 0; font: .85rem var(--f-ui); color: var(--muted); }
.read-card-actions { margin: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 600px) { .read-card { grid-template-columns: auto minmax(0, 1fr); } .read-card-actions { grid-column: 1 / -1; } .book-covers { gap: .8rem; } }
@media print { .book-covers a { box-shadow: none; } }

/* ================= «مصمم المقالات» — الختم في الأبواب، والشريط في رأس المقال =================
   (ب) الختم: صورة المقال بلونين على لون عائلة الباب، في حلقة التوقيع المفتوحة ونقطتها — هدوء فهرس الكتاب.
   (أ) الشريط: الصورة بألوانها الأصلية في رأس المقال، تختمها نقطة مضيئة وخطٌّ ينتهي بنقطة. */
.ch-item.has-seal { grid-template-columns: minmax(0, 1fr) auto 4.6rem; align-items: center; }
.ch-item.has-seal > .ch-main { grid-column: 1; grid-row: 1; }
.ch-item.has-seal > .ch-meta { grid-column: 2; grid-row: 1; }
.ch-item.has-seal > .ch-parts { grid-column: 1 / 3; grid-row: 2; }
.ch-seal { grid-column: 3; grid-row: 1 / span 2; align-self: start; position: relative; display: block; width: 4.6rem; height: 4.6rem; }
.ch-seal img { position: absolute; inset: 14%; width: 72%; height: 72%; border-radius: 50%; object-fit: cover; transition: transform .5s ease, filter .5s ease; }
.ch-seal-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ch-seal-ring path { fill: none; stroke: var(--cat, var(--sec, var(--sig))); stroke-width: 2.2; stroke-linecap: round; }
.ch-seal-ring circle { fill: var(--cat, var(--sec, var(--sig))); }
.ch-item:hover .ch-seal img { transform: scale(1.04); }
[data-theme="dark"] .ch-seal img { filter: brightness(.92) contrast(1.05); }
@media (max-width: 760px) {
  .ch-item.has-seal { grid-template-columns: minmax(0, 1fr) 3.8rem; column-gap: .9rem; }
  .ch-item.has-seal > .ch-meta { grid-column: 1; grid-row: 2; margin-top: .3rem; }
  .ch-item.has-seal > .ch-parts { grid-column: 1 / -1; grid-row: 3; }
  .ch-seal { grid-column: 2; grid-row: 1 / span 2; width: 3.8rem; height: 3.8rem; }
}

.article-cover.is-banner { position: relative; margin: .5rem 0 2.2rem; }
.article-cover.is-banner img { display: block; width: 100%; aspect-ratio: 1440 / 400; object-fit: cover; border-radius: var(--radius); }
.banner-glow { position: absolute; inset-inline-end: 1.2rem; top: 1.1rem; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--logo-gold, #C9B48A); box-shadow: 0 0 0 .3rem rgb(255 255 255 / .16), 0 0 1.6rem .45rem rgb(201 180 138 / .55); }
.banner-rule { position: relative; display: block; height: var(--rule-w, 1px); margin-top: 1rem;
  background: linear-gradient(to left, var(--cat, var(--sec, var(--sig))) 0%, color-mix(in srgb, var(--cat, var(--sec, var(--sig))) 30%, transparent) 55%, transparent 100%); }
.banner-rule::before { content: ''; position: absolute; inset-inline-start: 0; top: 50%; width: .42rem; height: .42rem; margin-top: -.21rem; border-radius: 50%; background: var(--cat, var(--sec, var(--sig))); }
.post-thumb.is-banner { aspect-ratio: 1440 / 400; }
@media (max-width: 760px) { .article-cover.is-banner img { aspect-ratio: 1440 / 560; } .banner-glow { top: .8rem; inset-inline-end: .9rem; } }

/* ================= «قلم التحديد» — العناوين الفرعية في المقالات (٣ ديسمبر ٢٠٢٦) =================
   لونٌ خفيف يقع خلف النصف السفلي من كلمات العنوان، كأن القارئ مرّ عليه بقلم.
   اللون لون باب المقال (عائلات المعنى)، وإن لم يكن للتصنيف لون فلون القسم. */
.article-body { --hl: var(--cat, var(--sec, var(--sig))); }
.article-body h2 > .hl, .article-body h3 > .hl {
  --hl-a: 22%;
  background: linear-gradient(transparent 56%, color-mix(in srgb, var(--hl) var(--hl-a), transparent) 56% 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .25em; }
.article-body h3 > .hl { --hl-a: 15%; }
html[data-theme="dark"] .article-body h2 > .hl { --hl-a: 26%; }
html[data-theme="dark"] .article-body h3 > .hl { --hl-a: 18%; }
@media print { .article-body h2 > .hl, .article-body h3 > .hl { background: none; padding: 0; } }

/* ================= «الشارة المائلة» — العنوان الفرعي للمقال (٣ ديسمبر ٢٠٢٦) =================
   العنوان الفرعي في شارة مائلة قليلًا بلون باب المقال، كأنها ختمٌ وُضع على الصفحة.
   اللون لون الباب (عائلات المعنى)، وإلا فلون القسم. */
.page-article .article-head .article-title { margin-bottom: .85rem; }
.article-stamp { --st: var(--cat, var(--sec, var(--sig)));
  display: inline-block; max-width: calc(100% - .4rem); margin: 0 .2rem 1.15rem 0; transform: rotate(-1.6deg); transform-origin: right center;
  background: color-mix(in srgb, var(--st) 12%, transparent); color: var(--st);
  border: 1px solid color-mix(in srgb, var(--st) 45%, transparent); border-radius: .35rem;
  padding: .3rem .9rem .38rem; font: 600 clamp(1rem, 2.6vw, 1.1rem)/1.65 var(--f-text);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--st) 18%, transparent); text-wrap: balance; }
html[data-theme="dark"] .article-stamp { background: color-mix(in srgb, var(--st) 14%, transparent); border-color: color-mix(in srgb, var(--st) 40%, transparent); }
@media print { .article-stamp { transform: none; box-shadow: none; } }

/* «الشارة المائلة» في كل مكان: القوائم، والأبواب، والأرشيف، والمؤلفات */
.stamp { --st: var(--cat, var(--sec, var(--sig)));
  display: inline-block; max-width: calc(100% - .4rem); transform: rotate(-1.4deg); transform-origin: right center;
  background: color-mix(in srgb, var(--st) 12%, transparent); color: var(--st);
  border: 1px solid color-mix(in srgb, var(--st) 45%, transparent); border-radius: .3rem;
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--st) 18%, transparent);
  font: 600 .92rem/1.6 var(--f-text); padding: .12rem .65rem .18rem; margin-inline-start: .15rem; text-wrap: balance; }
.stamp-sm { font-size: .9rem; }
.stamp-xs { font-size: .78rem; font-weight: 500; padding: .02rem .5rem .08rem; margin-inline: .6rem .2rem; transform: rotate(-1.2deg); vertical-align: .1em; }
.stamp-books, .article-stamp.stamp-books { --st: var(--sec-books); }
html[data-theme="dark"] .stamp { background: color-mix(in srgb, var(--st) 14%, transparent); border-color: color-mix(in srgb, var(--st) 40%, transparent); }
.post-stamp { margin: .1rem 0 .65rem; }
.ch-sub .stamp { margin-top: .3rem; }
.ch-series-n { font-size: .85rem; color: var(--muted); }
.book-sub, .book-spot-sub { display: block; margin: .35rem 0 .2rem; }
.book-sub .stamp { font-size: .82rem; }
@media print { .stamp { transform: none; box-shadow: none; } }
.archive-t { display: inline-flex; flex-wrap: wrap; align-items: center; row-gap: .25rem; min-width: 0; }

/* تلوين روابط الذيل وعبارة الحقوق بألوان الأرض (٣ ديسمبر ٢٠٢٦) */
.footer-links a { font-weight: 600; transition: color .2s, opacity .2s; }
.footer-links a.fl-contact { color: var(--sec-asdaa); }
.footer-links a.fl-archive { color: var(--sec-mukth); }
.footer-links a.fl-saved { color: var(--sec-maseer); }
.footer-links a.fl-random { color: var(--sec-books); }
.footer-links a:hover { color: var(--text); }
.footer-links span { color: var(--sig); }
.site-footer .copyright { color: var(--sig); font-weight: 500; }
.site-footer .copyright span { opacity: .7; }

/* ================= «رفوف أَصداء الكتب» (٣ ديسمبر ٢٠٢٦) =================
   المراجعات مرتّبة رفوفًا موضوعية، لكل رفٍّ لونه. وبجانب كل مراجعة كعبُ كتاب بلون رفّه،
   عرضُه على قدر صفحات الكتاب، تعلوه نقطة التوقيع؛ فيبدو الرفّ كأنه رفّ مكتبة. */
.ch-spine-wrap { display: flex; align-items: flex-end; justify-content: center; }
.ch-spine { position: relative; display: block; width: var(--sw, 1.3rem); height: 4.2rem; margin-top: .1rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cat, var(--sec)) 78%, #000) 0, var(--cat, var(--sec)) 22%, var(--cat, var(--sec)) 78%, color-mix(in srgb, var(--cat, var(--sec)) 70%, #000) 100%);
  border-radius: 2px 2px 1px 1px; box-shadow: 0 1px 0 rgb(0 0 0 / .08), 2px 3px 8px rgb(0 0 0 / .10); transition: transform .35s ease; }
.ch-spine::before, .ch-spine::after { content: ''; position: absolute; inset-inline: 14%; height: 1.5px; background: color-mix(in srgb, #fff 55%, transparent); }
.ch-spine::before { top: .55rem; } .ch-spine::after { bottom: .55rem; }
.ch-spine i { position: absolute; left: 50%; top: 1.15rem; width: .34rem; height: .34rem; margin-left: -.17rem; border-radius: 50%; background: var(--logo-gold, #C9B48A); }
.ch-item:hover .ch-spine { transform: translateY(-3px) rotate(-2deg); }
.chapter.has-cat .ch-spine-wrap::after { content: ''; position: absolute; inset-inline: .3rem; bottom: -.15rem; height: 2px; border-radius: 1px; background: color-mix(in srgb, var(--cat) 35%, transparent); }
html[data-theme="dark"] .ch-spine::before, html[data-theme="dark"] .ch-spine::after { background: color-mix(in srgb, #000 35%, transparent); }
.book-card.has-cat { border-inline-start: 3px solid var(--cat); padding-inline-start: 1rem; }
.book-card.has-cat .facts dt { color: var(--cat); }

/* «ما جرى به القلم»: الكتب في منتصف الصفحة (٣ ديسمبر ٢٠٢٦) */
.page-books .books-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.2rem 2.4rem; }
.page-books .book-item { width: clamp(150px, 26vw, 210px); align-items: center; text-align: center; }
.page-books .book-item .book-cover { width: 100%; }
.page-books .book-sub .stamp { transform-origin: center; }

/* صور الكتب في «أَصداء الكتب»: في بطاقة المراجعة، وصغيرةً بجانب المراجعة في القوائم */
.book-card.has-photo { align-items: stretch; }
.book-card .book-photo { flex: none; width: clamp(120px, 30%, 200px); display: block; }
.book-card .book-photo img { width: 100%; height: 100%; max-height: 270px; object-fit: cover; border-radius: var(--radius); box-shadow: 0 2px 14px rgb(0 0 0 / .12); }
@media (max-width: 560px) { .book-card.has-photo { flex-direction: column; } .book-card .book-photo { width: 62%; margin-inline: auto; } .book-card .book-photo img { max-height: 320px; } }
.post-item.has-book { display: grid; grid-template-columns: minmax(0, 1fr) 5.2rem; column-gap: 1.1rem; }
.post-item.has-book > * { grid-column: 1; }
.post-item.has-book > .post-book { grid-column: 2; grid-row: 1 / span 4; align-self: start; }
.post-book img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); box-shadow: 0 2px 10px rgb(0 0 0 / .1); }

/* الرفوف: صورة الكتاب بدل الكعب (٣ ديسمبر ٢٠٢٦) — تقف مائلةً قليلًا على حافة بلون الرفّ،
   وتستقيم وتكبر عند المرور. الكتاب الذي لا صورة له يبقى كعبًا. */
.ch-item.has-seal:has(.ch-book) { grid-template-columns: minmax(0, 1fr) auto 5.4rem; }
.ch-book { width: 5.4rem; height: auto; display: flex; justify-content: center; padding-bottom: .35rem; }
.ch-book img { position: static; inset: auto; width: 4.3rem; height: 5.7rem; object-fit: cover; border-radius: 3px 5px 5px 3px;
  transform: rotate(-3deg); transform-origin: bottom center; box-shadow: -1px 0 0 rgb(0 0 0 / .06), 3px 5px 12px rgb(0 0 0 / .16);
  transition: transform .35s ease, box-shadow .35s ease; }
.ch-book::after { content: ''; position: absolute; inset-inline: .25rem; bottom: 0; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--cat, var(--sec)) 55%, transparent); }
.ch-item:hover .ch-book img { transform: rotate(0) scale(1.06); box-shadow: 4px 8px 18px rgb(0 0 0 / .2); }
html[data-theme="dark"] .ch-book img { filter: brightness(.94); }
@media (max-width: 760px) {
  .ch-item.has-seal:has(.ch-book) { grid-template-columns: minmax(0, 1fr) 4.4rem; }
  .ch-book { width: 4.4rem; } .ch-book img { width: 3.6rem; height: 4.8rem; }
}

/* ================= «رفّ القراءة» (٣ ديسمبر ٢٠٢٦) =================
   تحت مراجعات كل رفّ: أغلفة الكتب التي قرأها الكاتب ولم يكتب عنها بعد، واقفةً متجاورة على حافة بلون الرفّ
   كرفّ مكتبة حقيقي. عند المرور أو التركيز يرتفع الغلاف قليلًا ويظهر فوقه اسمه ومؤلفه. */
.ch-library { margin-top: 1.1rem; }
.ch-library-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .7rem; margin: 0 0 .9rem; font: 700 .95rem var(--f-text); color: var(--cat, var(--sec)); }
.ch-library-label span { font: 400 .85rem var(--f-ui); color: var(--muted); }
.ch-library { overflow-x: clip; overflow-y: visible; padding-top: 4.5rem; margin-top: -3.4rem; }
.ch-covers { list-style: none; margin: 0; padding: 0 .45rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.3rem .55rem; }
.ch-covers li { position: relative; outline: none; padding-bottom: 5px; }
.ch-covers li::after { content: ''; position: absolute; bottom: 0; inset-inline: -.3rem; height: 5px; background: color-mix(in srgb, var(--cat, var(--sec)) 55%, var(--bg)); }
.ch-covers li:first-child::after { inset-inline-start: -.45rem; border-start-start-radius: 2px; } .ch-covers li:last-child::after { inset-inline-end: -.45rem; }
.ch-cover { display: block; width: 3.7rem; height: 5.6rem; border-radius: 2px 4px 4px 2px; overflow: hidden; background: var(--surface);
  box-shadow: -1px 0 0 rgb(0 0 0 / .08), 2px 3px 8px rgb(0 0 0 / .14); transition: transform .3s ease; }
.ch-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-covers li:nth-child(5n+2) .ch-cover { transform: rotate(-2deg); } .ch-covers li:nth-child(7n+4) .ch-cover { transform: rotate(1.5deg); }
.ch-covers li:hover .ch-cover, .ch-covers li:focus-visible .ch-cover { transform: translateY(-8px) rotate(0); }
.ch-cover-cap { position: absolute; bottom: calc(100% + .7rem); left: 50%; z-index: 5; width: max-content; max-width: 15rem; transform: translate(-50%, 4px);
  background: var(--text); color: var(--bg); border-radius: 8px; padding: .5rem .75rem; font: .82rem/1.6 var(--f-ui); text-align: center;
  pointer-events: none; display: none; flex-direction: column; }
.ch-cover-cap strong { font-weight: 700; } .ch-cover-cap em { font-style: normal; opacity: .75; }
.ch-covers li:hover .ch-cover-cap, .ch-covers li:focus-visible .ch-cover-cap { display: flex; transform: translate(-50%, 0); }
.ch-covers li:first-child .ch-cover-cap { left: auto; right: -.4rem; transform: none; } .ch-covers li:last-child .ch-cover-cap { left: -.4rem; transform: none; }
@media (max-width: 760px) { .ch-covers { gap: 1rem .45rem; } .ch-cover { width: 3.2rem; height: 4.8rem; } .ch-cover-cap { max-width: 11rem; } }

/* زرّ «تصفّح كالمعرض» في أصداء الكتب */
.view-switch.view-gallery { color: var(--sec); border-color: color-mix(in srgb, var(--sec) 45%, transparent); font-weight: 600; margin-inline-end: 1.1rem; }
.view-switch.view-gallery:hover { color: var(--text); border-color: var(--sec); }
.ch-stars { color: var(--logo-gold, #B09A72); letter-spacing: .08em; font-size: .9em; }
.ch-stars span { opacity: .3; }

/* ================= «ركن الشذرات» (٣ ديسمبر ٢٠٢٦؛ docs/05-shatharat-order.md) ================= */
:root { --sec-shatharat: #46557A; }
html[data-theme="dark"] { --sec-shatharat: #A7B6D6; }
[data-sec="shatharat"] { --sec: var(--sec-shatharat); }
.sh-card, .sh-paper { --cc: var(--sec-shatharat); } /* الشذرات بلا تصنيف: لونٌ واحد هو لون القسم */
[data-bab="allah"] { --cc: #A0784A; } [data-bab="nafs"] { --cc: #5E7F6E; } [data-bab="nas"] { --cc: #A45D46; } [data-bab="ilm"] { --cc: #4E6B85; } [data-bab="umr"] { --cc: #7D6B4F; }
html[data-theme="dark"] [data-bab="allah"] { --cc: #D2AE80; } html[data-theme="dark"] [data-bab="nafs"] { --cc: #93B5A3; } html[data-theme="dark"] [data-bab="nas"] { --cc: #D39380; }
html[data-theme="dark"] [data-bab="ilm"] { --cc: #8EAACB; } html[data-theme="dark"] [data-bab="umr"] { --cc: #BFAE91; }
.sh-stamp { background: var(--cc); color: #fff; font: 500 .75rem/1 var(--f-ui); padding: .45rem .7rem; border-radius: 3px; }
html[data-theme="dark"] .sh-stamp { color: #151515; }
.sh-act { display: flex; justify-content: center; gap: .6rem 1rem; flex-wrap: wrap; margin-top: 1.2rem; }
.sh-act .btn { font-size: .92rem; padding: .55rem 1.05rem; min-height: 44px; }
.sh-act .btn[aria-pressed="true"] { border-color: var(--logo-gold); color: var(--logo-gold); }
.orn { width: 84px; height: 10px; display: block; margin: .5rem auto 0; }
/* بطاقة الخاطرة في الرئيسية */
.sh-home .sh-head { text-align: center; margin: 0 0 1.6rem; }
.sh-home .sh-head .section-title { margin: 0; }
.sh-card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--cc); border-radius: 4px; padding: 2.2rem 1.6rem 1.2rem;
  max-width: 30rem; margin: 1rem auto 0; position: relative; transition: opacity .45s, transform .45s; }
.sh-card.out { opacity: 0; transform: translateY(6px); }
.sh-card .sh-stamp { position: absolute; top: -.95rem; inset-inline-start: 1.2rem; }
.sh-text { font: 400 calc(1.2rem * var(--fs, 1))/2 var(--f-text); margin: 0 0 1.6rem; color: var(--text); white-space: pre-line; }
.sh-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.sh-date { font: .8rem var(--f-ui); color: var(--muted); }
.sh-logo { width: 104px; height: auto; display: block; }
/* صفحة «شذرات» */
.sh-page .page-head { text-align: center; }
.sh-chips { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; margin: 1rem 0 0; }
.sh-chip { font: 500 .8rem/1 var(--f-ui); padding: .6rem .85rem; border: 1px solid var(--line-2, var(--line)); border-radius: 99px; color: var(--text-2);
  display: inline-flex; gap: .35rem; align-items: center; min-height: 38px; background: var(--surface); cursor: pointer; transition: all .2s; }
.sh-chip i { font-style: normal; color: var(--muted); font-weight: 400; }
.sh-chip[data-bab=""][aria-pressed="true"] { --cc: var(--text); }
.sh-chip[aria-pressed="true"] { background: var(--cc); border-color: var(--cc); color: #fff; }
html[data-theme="dark"] .sh-chip[aria-pressed="true"] { color: #151515; }
.sh-chip[aria-pressed="true"] i { color: inherit; opacity: .8; }
.sh-paper { max-width: 34rem; margin: 1.4rem auto 0; background: #fffdf8; border-radius: 3px; position: relative; cursor: pointer; min-height: 23rem;
  box-shadow: 0 1px 0 #e8e0d0, 0 24px 50px -34px rgba(60, 45, 20, .5); padding: 2.2rem 1.6rem 1.4rem; display: flex; flex-direction: column;
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(2.2rem - .42rem), var(--sh-rule, #efe6d4) calc(2.2rem - .42rem) calc(2.2rem - .42rem + 1px), transparent calc(2.2rem - .42rem + 1px) 2.2rem); background-position: 0 4.6rem; outline: none; }
.sh-paper:focus-visible { box-shadow: 0 0 0 2px var(--logo-gold), 0 24px 50px -34px rgba(60, 45, 20, .5); }
.sh-paper .sh-meta { display: flex; justify-content: space-between; align-items: center; min-height: 1.6rem; opacity: 0; transition: opacity .8s; }
.sh-paper.done .sh-meta { opacity: 1; }
.sh-writing { font: 500 calc(clamp(1.2rem, 4.6vw, 1.45rem) * var(--fs, 1))/2.2rem var(--f-display); color: #24324f; margin: .8rem 0 1.2rem; flex: 1;
  transition: color 1.6s, opacity .9s, filter .9s; white-space: pre-line; min-height: 13.2rem; }
.sh-paper.done .sh-writing { color: var(--text); }
.sh-paper.fade .sh-writing { opacity: 0; filter: blur(4px); }
.sh-nib { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--logo-gold); margin-inline-start: .25rem; vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(176, 154, 114, .2); animation: sh-nib .9s ease-in-out infinite; }
@keyframes sh-nib { 50% { transform: translateY(-3px); } }
.sh-paper.done .sh-nib, .sh-paper.paused .sh-nib { animation: none; opacity: .5; }
.sh-paper.done .sh-nib { opacity: 0; }
.sh-paper .sh-sig { display: flex; justify-content: flex-end; opacity: 0; transition: opacity .8s .3s; }
.sh-paper.done .sh-sig { opacity: 1; }
.sh-paper .sh-sig .sh-logo { width: 100px; }
.sh-state { position: absolute; top: .7rem; inset-inline-end: 1rem; font: 500 .75rem var(--f-ui); color: var(--muted); opacity: 0; transition: opacity .3s; }
.sh-paper.paused .sh-state { opacity: 1; }
.sh-prog { text-align: center; font: .8rem var(--f-ui); color: var(--muted); margin-top: .5rem; }
.sh-plain { max-width: 34rem; margin: 1.5rem auto; padding: 0; list-style: none; }
.sh-plain li { border-bottom: 1px solid var(--line); padding: 1rem 0; } .sh-plain blockquote { margin: 0 0 .3rem; font: 1.1rem/2 var(--f-text); }
html[data-theme="dark"] .sh-paper { background: var(--surface); box-shadow: 0 1px 0 #262626, 0 24px 50px -34px rgba(0, 0, 0, .8); --sh-rule: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .sh-writing { color: #aebfe0; }
html[data-theme="dark"] .sh-paper.done .sh-writing { color: var(--text); }
@media (max-width: 420px) { .sh-paper { padding: 2rem 1.1rem 1.2rem; min-height: 21rem; background-position: 0 4.4rem; } .sh-card { padding: 2.1rem 1.15rem 1.1rem; } .sh-logo { width: 92px; } }
@media (prefers-reduced-motion: reduce) { .sh-card, .sh-writing, .sh-paper .sh-meta, .sh-paper .sh-sig { transition: none; } .sh-nib { display: none; } }

/* ضبط الجوال (٣٦٠px فما فوق) */
@media (max-width: 600px) {
  .intro-sign { padding-bottom: 1.5rem; }                       /* لا فراغ كبير بين التحية و«آخر ما كتبت» */
  .book-head > :first-child { justify-self: center; }            /* غلاف الكتاب في الوسط */
  .book-head-cover { display: block; margin-inline: auto; }
  .archive-list li { flex-direction: column; align-items: flex-start; } /* التاريخ تحت العنوان دائمًا */
  .archive-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .archive-filters > * { width: 100%; min-width: 0; }
  .search-filters { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
  .search-filters > * { width: 100%; min-width: 0; margin: 0; }
  .search-filters select[name=section], .search-filters .btn { grid-column: 1 / -1; }
  .archive-filters select[name=sort], .archive-filters input[type=search], .archive-filters button { grid-column: 1 / -1; }
}

/* خاتمة القسم (٤ ديسمبر ٢٠٢٦): الطريق لم ينتهِ — أثرٌ متقطّع يمتدّ من آخر مقال، ينتهي بمحطة مفرغة لم نبلغها بعد،
   ثم الوعد بلون القسم، وتحت «موعدٌ مع الكتابة» خطّ كأنما رسمته يدٌ مسافرة. */
.sec-closing { --cc: var(--sig); display: flex; flex-direction: column; align-items: center; gap: 0; margin: .5rem auto 1.5rem; max-width: 34rem; text-align: center; }
.sc-trail { width: 0; height: 3.6rem; border-inline-start: 2px dashed color-mix(in srgb, var(--cc) 55%, transparent); mask: linear-gradient(transparent, #000 35%); -webkit-mask: linear-gradient(transparent, #000 35%); }
.sc-stop { position: relative; width: .95rem; height: .95rem; border-radius: 50%; border: 2px solid var(--cc); background: var(--bg); margin-bottom: 1.1rem; }
.sc-stop::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--cc); opacity: 0; animation: sc-pulse 2.8s ease-out infinite; }
.sc-text { font: 400 1.32rem/1.9 var(--f-display); color: var(--cc); letter-spacing: 0; }
.sc-text em { font-style: normal; color: var(--text); padding-bottom: .1em; background: linear-gradient(transparent 82%, color-mix(in srgb, var(--cc) 35%, transparent) 82%, color-mix(in srgb, var(--cc) 35%, transparent) 94%, transparent 94%); }
@keyframes sc-pulse { 0% { transform: scale(.6); opacity: .7; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sc-stop::after { animation: none; } }
@media (max-width: 600px) { .sc-text { font-size: 1.18rem; } .sc-trail { height: 3rem; } }

/* توازن الواجهة في الجوال (٤ ديسمبر ٢٠٢٦): الشعار القُطري يُزاح يمينًا حتى يتساوى الفراغ على الجانبين،
   ومعرّف تليجرام ينتقل إلى محور الدائرة فيصل الشعار بالتحية. */
@media (max-width: 820px) {
  .hero-sign { translate: 4.4% 0; }
  .hero-tg { left: 50%; width: auto; transform: translateX(-50%); top: calc(110% + 1.6rem); }
  .intro-sign > figure { margin-bottom: 6.25rem; }
}
