/* ==========================================================================
   كتب مقترح — الأنماط الرئيسية
   ========================================================================== */

:root {
	--c-primary: #1f3a5f;
	--c-secondary: #c8811f;
	--c-dark: #14263f;
	--c-success: #1f9d55;
	--c-bg: #fbf8f3;
	--c-bg-alt: #f3ece1;
	--c-surface: #fff;
	--c-text: #3b3a36;
	--c-heading: #1b1a17;
	--c-muted: #77736a;
	--c-footer: #14263f;
	--c-footer-text: #c9d3e0;
	--btn-bg: #1f3a5f;
	--btn-text: #fff;
	--btn2-bg: #fff;
	--btn2-text: #1f3a5f;
	--btn-radius: 10px;
	--f-body: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
	--f-heading: 'Readex Pro', Tahoma, Arial, sans-serif;
	--fs-base: 16px;
	--fs-h1: 50px;
	--fs-h2: 34px;
	--fs-h3: 20px;
	--container: 1200px;
	--sec-space: 84px;
	--logo-w: 46px;
	--logo-w-m: 38px;
	--scale-h: 1;
	--scale-s: 1;
	--gutter: clamp(16px, 4vw, 28px);
	--radius: 16px;
	--radius-sm: 10px;
	--border: color-mix(in srgb, var(--c-heading) 10%, transparent);
	--shadow: 0 10px 30px rgba(40, 30, 10, .07);
	--shadow-lg: 0 24px 60px rgba(40, 30, 10, .13);
	--header-h: 76px;
}

@media (max-width: 1279px) { :root { --scale-h: .94; --scale-s: .92; } }
@media (max-width: 1023px) { :root { --scale-h: .84; --scale-s: .82; --header-h: 68px; } }
@media (max-width: 767px)  { :root { --scale-h: .72; --scale-s: .7; } }
@media (max-width: 479px)  { :root { --scale-h: .64; --scale-s: .62; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 10px); }
body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--f-body);
	font-size: var(--fs-base);
	line-height: 1.85;
	direction: rtl;
	text-align: right;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-secondary); }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; font-family: var(--f-heading); color: var(--c-heading); line-height: 1.45; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: calc(var(--fs-h1) * var(--scale-h)); }
h2 { font-size: calc(var(--fs-h2) * var(--scale-h)); }
h3 { font-size: calc(var(--fs-h3) * max(var(--scale-h), .84)); }
h4 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
strong, b { color: var(--c-heading); font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: absolute; top: -60px; right: 12px; background: var(--c-primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { top: 10px; color: #fff; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-secondary) 55%, transparent); outline-offset: 2px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(860px + var(--gutter) * 2); }
.center { text-align: center; }
.muted { color: var(--c-muted); }
.small { font-size: .85rem; }
.hl { color: var(--c-secondary); }
.ic { flex: none; }

/* ---------- الأزرار ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border-radius: var(--btn-radius); border: 1.5px solid transparent;
	font-family: var(--f-heading); font-weight: 700; font-size: .95rem; line-height: 1.4;
	cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s; text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--btn-bg); color: var(--btn-text); box-shadow: 0 10px 24px color-mix(in srgb, var(--btn-bg) 26%, transparent); }
.btn--primary:hover { color: var(--btn-text); box-shadow: 0 14px 30px color-mix(in srgb, var(--btn-bg) 36%, transparent); }
.btn--ghost { background: var(--btn2-bg); color: var(--btn2-text); border-color: var(--border); }
.btn--ghost:hover { color: var(--btn2-text); border-color: var(--btn2-text); }
.btn--gold { background: var(--c-secondary); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--c-secondary) 30%, transparent); }
.btn--gold:hover { color: #fff; filter: brightness(.96); }
.btn--sm { padding: 9px 16px; font-size: .88rem; }
.btn--lg { padding: 14px 24px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: color-mix(in srgb, var(--c-secondary) 13%, var(--c-surface)); color: color-mix(in srgb, var(--c-secondary) 70%, #000); border: 1px solid color-mix(in srgb, var(--c-secondary) 30%, transparent); margin-bottom: 14px; }
.pill--light { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }

.card { background: var(--c-surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card--pad { padding: clamp(18px, 3vw, 30px); }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 16px; }
.card-title .ic { color: var(--c-secondary); }

/* ---------- الهيدر ---------- */
.site-header { position: relative; z-index: 100; background: color-mix(in srgb, var(--c-bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.has-sticky-header .site-header { position: sticky; top: 0; }
.admin-bar.has-sticky-header .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar.has-sticky-header .site-header { top: 0; } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--c-heading); min-width: 0; }
.brand:hover { color: var(--c-heading); }
.brand__logo { width: var(--logo-w); height: auto; flex: none; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font-family: var(--f-heading); font-weight: 700; font-size: 1.22rem; line-height: 1.5; white-space: nowrap; }
.brand__desc { font-size: .78rem; color: var(--c-muted); line-height: 1.5; white-space: nowrap; }

.main-nav .menu { list-style: none; display: flex; align-items: center; gap: 4px; }
.main-nav .menu > li { position: relative; }
.main-nav .menu a { display: block; padding: 8px 13px; border-radius: 10px; color: var(--c-heading); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.main-nav .menu a:hover, .main-nav .current-menu-item > a { color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 7%, transparent); }
.main-nav .menu-item-has-children > a::after { content: ""; display: inline-block; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-inline-start: 8px; vertical-align: 3px; }
.main-nav .sub-menu { list-style: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 210px; background: var(--c-surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s; z-index: 20; }
.main-nav .menu > li:hover > .sub-menu, .main-nav .menu > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--border); background: var(--c-surface); color: var(--c-heading); cursor: pointer; }
.icon-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }
.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 12px; background: var(--c-surface); color: var(--c-heading); cursor: pointer; }
.nav-toggle__close { display: none; }
.nav-open .nav-toggle__open { display: none; }
.nav-open .nav-toggle__close { display: inline-flex; }
.header-search { border-top: 1px solid var(--border); padding: 14px 0; background: var(--c-bg); }

@media (max-width: 1023px) {
	.nav-toggle { display: inline-flex; }
	.brand__logo { width: var(--logo-w-m); }
	.main-nav { position: fixed; inset: var(--header-h) 0 0 0; background: var(--c-bg); padding: 18px var(--gutter) 40px; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s; z-index: 99; }
	.admin-bar .main-nav { top: calc(var(--header-h) + 46px); }
	.nav-open .main-nav { transform: none; visibility: visible; }
	.nav-open { overflow: hidden; }
	.main-nav .menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.main-nav .menu a { padding: 12px 14px; font-size: 1.02rem; }
	.main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 16px 6px 0; background: transparent; min-width: 0; }
}
@media (max-width: 599px) {
	.header-cta span { display: none; }
	.header-cta { padding: 10px; }
	.brand__desc { display: none; }
}
@media (max-width: 379px) { .brand__name { font-size: 1.05rem; } }

/* ---------- البحث ---------- */
.search-form { width: 100%; display: flex; gap: 8px; background: var(--c-surface); border: 1.5px solid var(--border); border-radius: calc(var(--btn-radius) + 4px); padding: 6px; box-shadow: var(--shadow); max-width: 640px; }
.search-form:focus-within { border-color: var(--c-secondary); }
.search-form__input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 12px; outline: 0; font-size: 1rem; }
.search-form__btn { padding: 10px 18px; }
@media (max-width: 479px) { .search-form__btn span { display: none; } }
.search-bar { margin-top: 28px; }

/* ---------- الأقسام ---------- */
.section { padding-block: calc(var(--sec-space) * var(--scale-s)); }
.section--alt { background: var(--c-bg-alt); }
.sec-head { margin-bottom: calc(36px * var(--scale-s)); max-width: 720px; }
.sec-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; max-width: none; flex-wrap: wrap; }
.sec-head--center { text-align: center; margin-inline: auto; }
.sec-title { margin-bottom: 6px; }
.sec-text { color: var(--c-muted); margin: 0; }
.sec-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }

/* ---------- البطل ---------- */
.hero { position: relative; overflow: hidden; padding-block: calc(70px * var(--scale-s)) calc(80px * var(--scale-s)); background:
	radial-gradient(700px 400px at 0% 0%, color-mix(in srgb, var(--c-secondary) 14%, transparent), transparent 70%),
	radial-gradient(600px 400px at 100% 100%, color-mix(in srgb, var(--c-primary) 10%, transparent), transparent 70%); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--c-primary) 12%, transparent) 1.2px, transparent 1.3px); background-size: 24px 24px; mask-image: linear-gradient(180deg, #000, transparent 85%); pointer-events: none; }
.hero__grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.hero__grid > * { min-width: 0; }
.hero__title { margin-bottom: 16px; }
.hero__title .hl { display: block; }
.hero__lead { font-size: calc(1.08rem * max(var(--scale-h), .9)); color: var(--c-text); max-width: 620px; margin-bottom: 24px; }
.hero .search-form { margin-bottom: 20px; }
.hero__stats { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 34px; margin-top: 28px; }
.hero__stats strong { display: block; font-family: var(--f-heading); font-size: calc(30px * max(var(--scale-h), .8)); color: var(--c-primary); line-height: 1.2; }
.hero__stats span { color: var(--c-muted); font-size: .9rem; }
.hero__shelf { position: relative; height: clamp(320px, 38vw, 470px); }
.hero__book { position: absolute; bottom: 46px; width: 44%; transition: transform .3s; filter: drop-shadow(0 22px 26px rgba(30, 20, 5, .25)); }
.hero__book:hover { transform: translateY(-8px) rotate(0) !important; }
.hero__book--1 { right: 28%; z-index: 3; width: 46%; transform: translateY(-14px); }
.hero__book--2 { right: 2%; z-index: 2; transform: rotate(6deg); }
.hero__book--3 { left: 2%; z-index: 2; transform: rotate(-6deg); }
.hero__ledge { position: absolute; bottom: 26px; left: -4%; right: -4%; height: 22px; border-radius: 8px; background: linear-gradient(180deg, #a87445, #7c5230); box-shadow: 0 14px 22px rgba(60, 35, 10, .25); }
.hero__chip { position: absolute; z-index: 4; top: 6%; left: 0; display: inline-flex; align-items: center; gap: 8px; background: var(--c-surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px 14px; font-weight: 700; font-size: .85rem; box-shadow: var(--shadow-lg); color: var(--c-heading); }
.hero__chip .ic { color: var(--c-secondary); }
.hero__chip span { background: var(--c-primary); color: #fff; border-radius: 8px; padding: 0 8px; }
.hero__chip--2 { top: auto; bottom: 0; left: auto; right: 0; }
@media (max-width: 1023px) {
	.hero__grid { grid-template-columns: 1fr; }
	.hero__shelf { max-width: 520px; width: 100%; margin-inline: auto; height: clamp(300px, 70vw, 440px); }
}

/* ---------- الغلاف ---------- */
.cover { display: block; position: relative; aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; overflow: hidden; background: var(--c-bg-alt); box-shadow: inset 4px 0 0 rgba(0, 0, 0, .12); }
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 9%; background: linear-gradient(90deg, rgba(255, 255, 255, .18), rgba(0, 0, 0, .12) 60%, transparent); pointer-events: none; }
.cover__img { width: 100%; height: 100%; object-fit: cover; }
.cover--gen { background: linear-gradient(160deg, var(--cv-a), color-mix(in srgb, var(--cv-a) 72%, #000)); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 14% 12%; container-type: inline-size; }
.cover__band { position: absolute; top: 9%; left: 12%; right: 12%; height: 2px; background: var(--cv-b); box-shadow: 0 6px 0 var(--cv-b); opacity: .9; }
.cover__title { font-family: var(--f-heading); font-weight: 700; font-size: clamp(14px, 11cqi, 30px); line-height: 1.45; text-wrap: balance; }
.cover__author { margin-top: 8%; font-size: clamp(10px, 6.4cqi, 16px); color: var(--cv-b); line-height: 1.5; }
.cover__mark { position: absolute; bottom: 8%; color: var(--cv-b); opacity: .9; }

/* ---------- بطاقات الكتب ---------- */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: clamp(16px, 2.4vw, 28px); }
@media (max-width: 599px) { .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.book-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.book-card__cover { display: block; transition: transform .25s; filter: drop-shadow(0 12px 16px rgba(30, 20, 5, .14)); }
.book-card:hover .book-card__cover { transform: translateY(-5px); }
.book-card__body { min-width: 0; }
.book-card__cat { display: inline-block; font-size: .74rem; font-weight: 700; color: var(--c-secondary); margin-bottom: 2px; }
.book-card__title { font-size: 1.02rem; line-height: 1.55; margin: 0 0 2px; }
.book-card__title a { color: var(--c-heading); }
.book-card__title a:hover { color: var(--c-primary); }
.book-card__author { font-size: .86rem; color: var(--c-muted); margin: 0 0 6px; }
.book-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--c-muted); }
.book-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.book-row .book-card { flex-direction: row; align-items: center; background: var(--c-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; height: 100%; }
.book-row .book-card__cover { width: 96px; flex: none; }

/* ---------- التصنيفات ---------- */
.cats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.cat-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; background: var(--c-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--c-heading); transition: transform .2s, box-shadow .2s, border-color .2s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c-secondary) 40%, transparent); color: var(--c-heading); }
.cat-card__ic { grid-row: span 2; width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c-primary) 8%, transparent); color: var(--c-primary); }
.cat-card__name { font-family: var(--f-heading); font-weight: 700; line-height: 1.5; }
.cat-card__count { font-size: .82rem; color: var(--c-muted); }

/* ---------- المزايا ---------- */
.section--dark { background: radial-gradient(800px 400px at 100% 0%, color-mix(in srgb, var(--c-secondary) 22%, transparent), transparent 70%), var(--c-dark); color: color-mix(in srgb, #fff 82%, var(--c-dark)); }
.section--dark .sec-title, .section--dark h3 { color: #fff; }
.section--dark .sec-text { color: rgba(255, 255, 255, .72); }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.feat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 24px; }
.feat__ic { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--c-secondary); color: #fff; margin-bottom: 14px; }
.feat h3 { margin-bottom: 6px; }
.feat p { margin: 0; color: rgba(255, 255, 255, .72); }

/* ---------- من نحن ---------- */
.about > *, .contact > *, .book-hero__grid > * { min-width: 0; }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(26px, 5vw, 64px); align-items: center; }
.about__media img { width: 100%; border-radius: 24px; }
.checks { list-style: none; display: grid; gap: 10px; margin-top: 18px; }
.checks li { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--c-heading); }
.checks .ic { color: var(--c-success); }
@media (max-width: 1023px) { .about { grid-template-columns: 1fr; } .about__media { max-width: 560px; } }

/* ---------- التواصل ---------- */
.contact { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.contact__list { list-style: none; display: grid; gap: 12px; margin-top: 20px; }
.contact__list li { display: flex; align-items: center; gap: 10px; }
.contact__list .ic { color: var(--c-secondary); }
.contact__form { position: relative; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid label, .comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--c-heading); }
.req { color: #c2410c; }
.form-grid input, .form-grid select, .form-grid textarea, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 14px; background: var(--c-bg); transition: border-color .2s;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .comment-form input:focus, .comment-form textarea:focus { border-color: var(--c-secondary); outline: 0; }
.hp-wrap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.notice--ok { background: #e7f6ec; color: #166534; }
.notice--err { background: #fdecea; color: #9f1d1d; }
@media (max-width: 1023px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 599px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

/* ---------- المكتبة ---------- */
.page-hero { padding-block: calc(56px * var(--scale-s)); background: var(--c-bg-alt); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--c-primary) 10%, transparent) 1.2px, transparent 1.3px); background-size: 22px 22px; mask-image: linear-gradient(90deg, #000, transparent 60%); pointer-events: none; }
.page-hero .container { position: relative; }
.page-hero__title { margin: 0; font-size: calc(var(--fs-h2) * var(--scale-h)); }
.page-hero__sub { color: var(--c-muted); margin: 8px 0 0; max-width: 720px; }
.lib-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.lib-search { flex: 1 1 280px; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--c-surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 0 14px; color: var(--c-muted); }
.lib-search:focus-within { border-color: var(--c-secondary); }
.lib-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; outline: 0; color: var(--c-text); }
.lib-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.lib-select { border: 1.5px solid var(--border); background: var(--c-surface); border-radius: 12px; padding: 10px 12px; max-width: 100%; cursor: pointer; }

/* ---------- صفحة الكتاب ---------- */
.book-hero { padding-block: calc(36px * var(--scale-s)) calc(56px * var(--scale-s)); background: linear-gradient(180deg, var(--c-bg-alt), var(--c-bg)); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--c-muted); margin-bottom: 26px; }
.crumbs a { color: var(--c-muted); }
.crumbs a:hover { color: var(--c-primary); }
.book-hero__grid { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: clamp(24px, 5vw, 60px); align-items: start; }
.book-hero__cover { width: 100%; filter: drop-shadow(0 26px 30px rgba(30, 20, 5, .25)); }
.book-hero__title { margin-bottom: 10px; }
.book-hero__author { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 14px; }
.book-hero__author .ic { color: var(--c-secondary); }
.book-hero__excerpt { font-size: 1.05rem; max-width: 680px; }
.book-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 10px; }
.book-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.book-facts li { display: flex; align-items: center; gap: 10px; background: var(--c-surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 16px; }
.book-facts .ic { color: var(--c-secondary); }
.book-facts small { display: block; font-size: .74rem; color: var(--c-muted); line-height: 1.3; }
.book-facts span { font-weight: 700; color: var(--c-heading); line-height: 1.4; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--c-muted); font-size: .9rem; }
.share > span { display: inline-flex; align-items: center; gap: 6px; }
.share a, .share button { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--c-surface); color: var(--c-heading); cursor: pointer; }
.share a:hover, .share button:hover { color: var(--c-primary); border-color: var(--c-primary); }
.share .is-copied { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.book-body { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.book-main { display: grid; gap: 24px; min-width: 0; }
.book-side { position: sticky; top: calc(var(--header-h) + 20px); }
.toc-list { list-style: none; counter-reset: toc; display: grid; gap: 6px; }
.toc-list li { counter-increment: toc; }
.toc-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--c-bg); color: var(--c-heading); font-weight: 600; }
.toc-list a::before { content: counter(toc); flex: none; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--c-primary) 9%, transparent); color: var(--c-primary); display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.toc-list a span { flex: 1; min-width: 0; }
.toc-list a:hover { background: color-mix(in srgb, var(--c-secondary) 12%, var(--c-bg)); }
.book-table { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; }
.book-table dt, .book-table dd { margin: 0; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.book-table dt { color: var(--c-muted); padding-inline-end: 16px; white-space: nowrap; }
.book-table dd { font-weight: 600; color: var(--c-heading); text-align: left; }
@media (max-width: 1023px) { .book-body { grid-template-columns: 1fr; } .book-side { position: static; } }
@media (max-width: 767px) {
	.book-hero__grid { grid-template-columns: 1fr; }
	.book-hero__cover { max-width: 220px; margin-inline: auto; }
	.book-hero__info { text-align: center; }
	.book-hero__author, .book-actions, .book-facts, .share { justify-content: center; }
	.book-actions .btn { flex: 1 1 100%; }
}

/* ---------- المدونة ---------- */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.post-card { background: var(--c-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-card__body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.post-card__cat { display: inline-block; align-self: flex-start; font-size: .76rem; font-weight: 700; color: var(--c-secondary); margin-bottom: 6px; }
.post-card__title { font-size: 1.12rem; line-height: 1.6; margin-bottom: 8px; }
.post-card__title a { color: var(--c-heading); }
.post-card__title a:hover { color: var(--c-primary); }
.post-card__excerpt { color: var(--c-muted); font-size: .93rem; }
.post-card__foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; font-size: .85rem; color: var(--c-muted); padding-top: 12px; border-top: 1px solid var(--border); }
.post-card__foot time { display: inline-flex; align-items: center; gap: 6px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.pagination { margin-top: 40px; }
.pagination ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination a, .pagination span { display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--c-surface); color: var(--c-heading); font-weight: 600; }
.pagination .current { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.empty { text-align: center; padding: 48px 24px; color: var(--c-muted); }
.empty .ic { color: var(--c-secondary); margin: 0 auto 10px; }
.empty .search-form { margin: 18px auto 0; }

/* ---------- المقال والصفحة ---------- */
.page-hero--post { text-align: center; }
.page-hero--post .page-hero__title { max-width: 860px; margin-inline: auto; }
.post-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 14px; color: var(--c-muted); font-size: .9rem; }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.entry__thumb img { width: 100%; border-radius: 12px; margin-bottom: 24px; }
.entry__content { font-size: 1.04rem; overflow-wrap: anywhere; }
.entry__content > *:last-child { margin-bottom: 0; }
.entry__content h2, .entry__content h3 { margin-top: 1.4em; }
.entry__content ul, .entry__content ol { padding-inline-start: 1.4em; margin-bottom: 1em; }
.entry__content img { border-radius: 12px; height: auto; }
.entry__content blockquote { margin: 1.4em 0; padding: 14px 20px; border-inline-start: 4px solid var(--c-secondary); background: var(--c-bg-alt); border-radius: 0 12px 12px 0; }
.entry__content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry__content th, .entry__content td { border: 1px solid var(--border); padding: 8px 12px; }
.entry__content pre { overflow-x: auto; max-width: 100%; }
.entry__tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.entry__tags a { background: var(--c-bg-alt); padding: 4px 12px; border-radius: 999px; font-size: .85rem; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin: 24px 0; font-weight: 600; }
.section > .container--narrow > .entry + .comments, .comments { margin-top: 24px; }
.comment-list { list-style: none; }
.comment-list .children { list-style: none; padding-inline-start: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-author img { display: inline-block; border-radius: 50%; vertical-align: middle; margin-inline-end: 8px; }
.comment-metadata { font-size: .8rem; }
.comment-form p { margin-bottom: 14px; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }
.widget { margin-bottom: 24px; }
.notfound__code { font-family: var(--f-heading); font-size: calc(110px * var(--scale-h)); font-weight: 700; line-height: 1.1; color: var(--c-secondary); }
.notfound__search { margin: 22px auto; display: flex; justify-content: center; }

/* ---------- الفوتر ---------- */
.site-footer { background: var(--c-footer); color: var(--c-footer-text); padding-top: calc(64px * var(--scale-s)); }
.site-footer a { color: var(--c-footer-text); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; padding-bottom: 40px; }
.brand--footer, .brand--footer:hover { color: #fff; }
.brand--footer .brand__desc { color: var(--c-footer-text); }
.footer-about p { margin-top: 14px; font-size: .93rem; }
.footer-title { color: #fff; font-size: 1.05rem; margin-bottom: 16px; }
.footer-links { list-style: none; display: grid; gap: 8px; font-size: .94rem; }
.footer-contact { list-style: none; display: grid; gap: 14px; font-size: .92rem; }
.footer-contact li { display: flex; gap: 10px; }
.footer-contact small { display: block; color: color-mix(in srgb, var(--c-footer-text) 70%, transparent); font-size: .76rem; }
.fc-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); color: var(--c-secondary); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 18px; font-size: .86rem; }
.footer-bottom__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; }
.footer-bottom p { margin: 0; }
.site-footer .mq-credit a { color: var(--c-secondary); font-weight: 700; letter-spacing: .5px; }
.mq-credit-restore .mq-credit { margin: 0; }
@media (max-width: 1023px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } .footer-bottom__inner { justify-content: center; text-align: center; } }

/* ---------- الأزرار العائمة ---------- */
.floating { position: fixed; bottom: var(--fl-offset); z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.floating--left { left: var(--fl-offset); }
.floating--right { right: var(--fl-offset); }
.fl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 54px; height: 54px; padding: 0 14px; border-radius: 50%; color: #fff; box-shadow: 0 12px 26px rgba(0, 0, 0, .2); font-weight: 700; transition: transform .2s; }
.fl-btn:hover { color: #fff; transform: translateY(-3px); }
.fl-btn.has-label { border-radius: 999px; padding: 0 18px; }
.floating--rect .fl-btn { border-radius: var(--fl-radius); }
.fl-btn--wa { background: var(--fl-wa); }
.fl-btn--call { background: var(--fl-call); }
@media (max-width: 479px) { .fl-btn.has-label span { display: none; } .fl-btn.has-label { padding: 0; width: 54px; border-radius: 50%; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
