/*
Theme Name: بوابة (Bawaba)
Theme URI: https://example.com/bawaba
Author: Bawaba
Description: قالب عربي (من اليمين إلى اليسار) لمواقع العلماء والدعاة: دروس صوتية ومرئية، فتاوى، مقالات، كتب، سلاسل علمية، بحث، وتحكم بحجم الخط.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bawaba
Tags: rtl-language-support, blog, education, accessibility-ready, custom-logo, custom-menu, featured-images, translation-ready
*/

/* ───────── المتغيرات ───────── */
:root {
  --accent: #1b4d3e;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--bg));
  --gold: #8f6a1f;
  --bg: #f5eedc;
  --surface: #fcf8ec;
  --text: #2b2218;
  --muted: #6b5f4e;
  --line: #ddd0b0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 6px 18px rgba(20, 40, 30, .06);
  --font-body: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-head: "Amiri", "Traditional Arabic", "Times New Roman", serif;
  --wrap: 1140px;
}

/* ───────── الأساس ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs, 18px); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); line-height: 1.85; font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.45; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 10px 10px; transition: top .2s;
}
.skip:focus { top: 0; }

/* ───────── الرأس ───────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 18px; min-height: 68px; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand-logo { width: 46px; height: 46px; object-fit: contain; }
.brand-text strong { display: block; font-family: var(--font-head); font-size: 1.3rem; line-height: 1.3; }
.brand-name { line-height: 0; }
.brand-name img { display: block; height: 54px; width: auto; max-width: none; margin-top: 4px; }
.brand-text .brand-pre { font-size: .8rem; line-height: 1.4; margin-bottom: 0; }
.brand-text small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.4; }

.nav { flex: 1; }
.nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.nav .menu a {
  display: block; padding: 8px 14px; border-radius: 999px; color: var(--text);
  text-decoration: none; font-weight: 500; font-size: .95rem;
}
.nav .menu a:hover, .nav .current-menu-item > a { background: var(--accent-soft); color: var(--accent); }
.nav .sub-menu { list-style: none; margin: 0; padding: 6px; position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: none; min-width: 180px; }
.nav .menu li { position: relative; }
.nav .menu li:hover > .sub-menu, .nav .menu li:focus-within > .sub-menu { display: block; }

.tools { display: flex; gap: 6px; align-items: center; }
.tool {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  min-width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  font: inherit; font-size: .85rem; font-weight: 700; padding: 0 8px;
}
.tool:hover { border-color: var(--accent); color: var(--accent); }
.tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.menu-toggle { display: none; }

.search-panel { border-top: 1px solid var(--line); padding: 14px 0; background: var(--surface); }

/* ───────── نموذج البحث ───────── */
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.search-form input[type="search"] {
  flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
}
.search-form select {
  height: 48px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
.search-form button {
  height: 48px; padding: 0 26px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700;
}
.search-form input:focus, .search-form select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* ───────── البحث الحي ───────── */
.search-form { position: relative; }
.live-results {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--surface); color: var(--text); text-align: start;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(20, 30, 25, .22);
  max-height: min(70vh, 540px); overflow-y: auto; overscroll-behavior: contain;
}
.live-results[hidden] { display: none; }
.live-status { padding: 10px 16px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); line-height: 1.5; }
.live-status:empty { display: none; }
.live-status.is-loading::after {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-inline-start: 8px; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: live-spin .7s linear infinite;
}
@keyframes live-spin { to { transform: rotate(360deg); } }
.live-results ul { list-style: none; margin: 0; padding: 6px; }
.live-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; line-height: 1.5; }
.live-item.is-active, .live-item:hover { background: var(--accent-soft); }
.live-thumb {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.live-thumb img, .live-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; background: #000; }
.live-thumb .type-icon { width: 24px; height: 24px; }
.live-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.live-title { font-weight: 700; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-ex { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-meta { font-size: .78rem; color: var(--gold); }
.live-results mark { background: color-mix(in srgb, #c9a24d 38%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.live-all { justify-content: center; font-weight: 700; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .live-status.is-loading::after { animation: none; } }

/* ───────── البطل ───────── */
.hero {
  position: relative; z-index: 1; color: #fff; padding: 54px 0 46px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23c9a24d' stroke-opacity='.22' stroke-width='1'%3E%3Crect x='14' y='14' width='36' height='36'/%3E%3Crect x='14' y='14' width='36' height='36' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 100%, #000 18%), var(--accent) 55%, color-mix(in srgb, var(--accent) 80%, #fff 20%));
}
/* شريط الإحصاءات يتداخل مع البطل؛ وعند فتح نتائج البحث ترتفع طبقة البطل فوقه */
.hero:has(.live-results:not([hidden])) { z-index: 7; }
.hero::before, .hero::after { content: ""; position: absolute; inset-inline: 0; height: 6px; border-block: 1px solid rgba(201, 162, 77, .7); pointer-events: none; }
.hero::before { top: 10px; }
.hero::after { bottom: 10px; }
.hero-in { display: flex; align-items: center; gap: 40px; position: relative; z-index: 1; }
.hero-text { flex: 1; min-width: 0; }
.hero h1 { color: #fff; margin-bottom: .4em; }
.hero p { font-family: var(--font-head); font-size: clamp(1.05rem, 2.4vw, 1.3rem); line-height: 1.9; color: #f1e3bd; max-width: none; white-space: pre-line; }
.hero-photo { flex: 0 0 min(34%, 300px); }
.hero-photo img { border-radius: 24px; border: 4px solid rgba(255, 255, 255, .25); box-shadow: 0 14px 40px rgba(0, 0, 0, .3); width: 100%; object-fit: cover; aspect-ratio: 4/5; }
.hero-search { max-width: 640px; margin-block: 18px 6px; }
.hero .search-form input, .hero .search-form select { border-color: transparent; }
.hero .search-form button { background: #c9a24d; color: #1d1a10; }
.quick { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.quick a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .13); color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem;
  border: 1px solid rgba(255, 255, 255, .22);
}
.quick a:hover { background: rgba(255, 255, 255, .24); }
.quick .type-icon { width: 20px; height: 20px; }

/* ───────── الإحصاءات ───────── */
.stats { margin-top: -26px; position: relative; z-index: 2; }
.stats-in {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px;
  background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.stat { background: var(--surface); text-align: center; padding: 16px 8px; text-decoration: none; color: var(--text); }
.stat b { display: block; font-family: var(--font-head); font-size: 1.7rem; color: var(--accent); line-height: 1.3; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat:hover { background: var(--accent-soft); }

/* ترويسة بصورة */
.hero.has-img {
  padding: 78px 0 70px; min-height: 380px; display: flex; align-items: center;
  background:
    linear-gradient(to left, rgba(14, 38, 30, .94) 0%, rgba(14, 38, 30, .86) 34%, rgba(14, 38, 30, .4) 62%, rgba(14, 38, 30, 0) 100%),
    var(--hero-img) left center / cover no-repeat;
}
.hero.has-img .hero-in { width: min(100% - 32px, var(--wrap)); }
.hero.has-img .hero-text { flex: 0 1 540px; }
.hero.has-img .hero-photo { display: none; }
@media (max-width: 760px) {
  .brand-name img { height: 44px; }
  .hero.has-img { padding: 48px 0 44px; background: linear-gradient(rgba(14, 38, 30, .84), rgba(14, 38, 30, .88)), var(--hero-img) 22% center / cover no-repeat; }
  .hero.has-img .hero-text { flex-basis: 100%; }
}

/* أيقونات الأقسام */
.h-ico { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); flex: none; vertical-align: middle; margin-inline-end: 12px; }
.h-ico .type-icon { width: 22px; height: 22px; }
.sec-head h2 { display: flex; align-items: center; }
.page-head h1 { display: flex; align-items: center; }
.page-head.center h1 { justify-content: center; }
.badge .type-icon { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 5px; }

/* ───────── الأقسام والشبكات ───────── */
.home-section { padding: 42px 0 6px; }
.sec-head { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 22px; }
.sec-head h2 { margin: 0; }
.sec-head::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 4px; border-block: 1px solid var(--gold); opacity: .75; }
.sec-head::before {
  content: ""; position: absolute; inset-inline-start: 14px; bottom: -2px; width: 10px; height: 10px;
  background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 0 4px var(--bg); z-index: 1;
}
.more { font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-books { grid-template-columns: repeat(4, 1fr); }

/* ───────── البطاقة ───────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { position: relative; display: block; aspect-ratio: 16/9; background: var(--accent-soft); overflow: hidden; }
.card-media.is-book { aspect-ratio: 3/4; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; background: #000; }
.media-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); opacity: .55; }
.media-ph .type-icon { width: 54px; height: 54px; }
.play {
  position: absolute; inset-inline-start: 12px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-size: 1.15rem; margin: 2px 0 2px; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); font-size: .92rem; margin: 0 0 4px; line-height: 1.8; }
.card-fatwa .card-body { padding: 18px 20px; border-inline-start: 4px solid var(--gold); }
.badge {
  align-self: flex-start; display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.meta { margin: auto 0 0; color: var(--muted); font-size: .8rem; line-height: 1.7; }
.meta .sep { margin-inline: 6px; opacity: .6; }

/* ───────── الشرائح (سلاسل، مواضيع) ───────── */
.chips { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  display: inline-flex; gap: 8px; align-items: center; padding: 7px 16px; border-radius: 999px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 500;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips em { font-style: normal; font-size: .78rem; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 8px; }
.chips.small a { padding: 3px 12px; font-size: .85rem; }

/* ───────── دعوة المتابعة ───────── */
.cta { margin-top: 54px; background: var(--accent); color: var(--accent-ink); padding: 44px 0; text-align: center; }
.cta h2 { color: #fff; }
.cta p { max-width: 56ch; margin-inline: auto; opacity: .92; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.social {
  padding: 9px 20px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff !important;
  text-decoration: none; font-weight: 700; border: 1px solid rgba(255, 255, 255, .28);
}
.social:hover { background: rgba(255, 255, 255, .26); }

/* ───────── التذييل ───────── */
.site-footer { background: #131c16; color: #cfc9b6; padding: 36px 0 24px; margin-top: 0; }
.site-footer a { color: #e5efeb; }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; padding-bottom: 24px; border-bottom: 1px solid rgba(255, 255, 255, .12); margin-bottom: 20px; }
.widget-title { color: #fff; font-size: 1.15rem; }
.footer-bottom { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.footer-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: center; }
.copy { margin: 0; font-size: .85rem; opacity: .8; }
.to-top {
  position: fixed; inset-inline-start: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); z-index: 40;
}
.to-top[hidden] { display: none; }

/* ───────── رأس الصفحات الداخلية ───────── */
.page-head { padding: 38px 0 16px; }
.page-head.center { text-align: center; }
.page-head .lead { color: var(--muted); max-width: 70ch; }
.page-head .hero-search { max-width: 640px; }
.page-head.center .hero-search { margin-inline: auto; }
.empty, .notice { padding: 24px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.results-count { color: var(--muted); }
.btn {
  display: inline-block; padding: 11px 26px; border-radius: 12px; background: var(--accent); color: var(--accent-ink) !important;
  text-decoration: none; font-weight: 700; border: 2px solid var(--accent); cursor: pointer; margin-inline-end: 8px;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--accent) !important; }
.btn.small { padding: 5px 16px; font-size: .85rem; border-radius: 999px; }

/* ───────── ترقيم الصفحات ───────── */
.pagination { margin: 34px 0 10px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.page-numbers {
  min-width: 42px; height: 42px; padding: 0 14px; display: grid; place-items: center; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text);
}
.page-numbers.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
a.page-numbers:hover { border-color: var(--accent); }
.page-numbers.dots { border: 0; background: none; }

/* ───────── المحتوى المفرد ───────── */
.single-wrap { padding: 26px 0 40px; max-width: 820px; }
.single-wrap.has-aside { max-width: var(--wrap); display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.single-main { min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.single-head { margin-bottom: 18px; }
.single-head h1 { margin: 6px 0 8px; }
.single-thumb { margin: 0 0 22px; border-radius: var(--radius); overflow: hidden; }

.entry { font-size: 1.08rem; line-height: 2.05; }
.entry h2, .entry h3 { margin-top: 1.6em; }
.entry img { border-radius: 10px; }
.entry blockquote {
  margin: 1.4em 0; padding: 14px 22px; border-inline-start: 4px solid var(--gold);
  background: var(--accent-soft); border-radius: 0 12px 12px 0; font-family: var(--font-head); font-size: 1.2rem;
}
.entry table { border-collapse: collapse; width: 100%; }
.entry th, .entry td { border: 1px solid var(--line); padding: 8px 12px; }
.entry .alignleft { float: left; margin: 0 0 1em 1.4em; }
.entry .alignright { float: right; margin: 0 1.4em 1em 0; }
.entry .aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { color: var(--muted); font-size: .85rem; text-align: center; }

.embed { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 22px; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-file { width: 100%; border-radius: var(--radius); margin-bottom: 22px; background: #000; }

.player { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; box-shadow: var(--shadow); }
.player audio { width: 100%; }
.player-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.player-tools .lbl { color: var(--muted); font-size: .85rem; margin-inline-end: 4px; }
.speed {
  border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px;
  padding: 2px 12px; cursor: pointer; font: inherit; font-size: .82rem;
}
.speed.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.player-tools .btn.small { margin-inline-start: auto; margin-inline-end: 0; }
.next-ep { margin-top: 12px; }

.series-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: sticky; top: 90px; }
.series-nav h2 { font-size: 1.15rem; margin-bottom: 8px; }
.series-nav ol { margin: 0; padding: 0; list-style: none; max-height: 60vh; overflow: auto; counter-reset: ep; }
.series-nav li { counter-increment: ep; border-top: 1px solid var(--line); }
.series-nav li a { display: flex; gap: 10px; padding: 8px 2px; text-decoration: none; color: var(--text); font-size: .92rem; line-height: 1.6; }
.series-nav li a::before { content: counter(ep); flex: 0 0 1.8em; color: var(--muted); font-size: .8rem; text-align: center; }
.series-nav li.current a { color: var(--accent); font-weight: 700; }

.share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 26px 0; padding: 14px 0; border-block: 1px solid var(--line); }
.share > span { color: var(--muted); font-size: .9rem; }
.share-btn {
  padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  text-decoration: none; font: inherit; font-size: .85rem; cursor: pointer;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.related { margin-top: 36px; }

/* فتوى */
.qa { border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px; }
.qa h2 { font-size: 1.2rem; margin-bottom: 8px; }
.qa h2 small { font-family: var(--font-body); color: var(--muted); font-weight: 400; font-size: .8rem; }
.qa-q { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.qa-q p { margin: 0; font-size: 1.08rem; }
.qa-a { background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--gold); }

/* كتاب */
.book-hero { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; margin-bottom: 26px; }
.book-cover { aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; background: var(--accent-soft); position: relative; box-shadow: var(--shadow); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.facts { margin: 14px 0 20px; display: grid; gap: 6px; }
.facts div { display: flex; gap: 10px; }
.facts dt { color: var(--muted); min-width: 7em; }
.facts dd { margin: 0; font-weight: 500; }

/* ───────── التجاوب ───────── */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-books { grid-template-columns: repeat(3, 1fr); }
  .single-wrap.has-aside { grid-template-columns: 1fr; }
  .series-nav { position: static; }
  .hero-photo { display: none; }
}
@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .bar { flex-wrap: wrap; padding-block: 8px; }
  .tools { margin-inline-start: auto; }
  .nav { order: 3; flex-basis: 100%; display: none; }
  .nav.open { display: block; }
  .nav .menu { flex-direction: column; }
  .nav .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding-inline-start: 18px; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-books { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 36px 0 40px; }
  .book-hero { grid-template-columns: 1fr; }
  .book-cover { max-width: 220px; }
  #font-up, #font-down { display: none; }
  .search-form select { flex: 1 1 100%; }
  .search-form button { flex: 1 1 100%; }
  .stats-in { grid-template-columns: repeat(2, 1fr); }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ───────── طباعة وحركة ───────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .share, .related, .to-top, .player-tools, .series-nav, .cta { display: none !important; }
  body { background: #fff; color: #000; }
  .single-wrap.has-aside { display: block; }
}
