/* المكتبة الطيبة — تصميم بنّي صحراوي بهوية الواحة */

:root {
    --bg: #ead7a8;
    --bg-elevated: #f8eecf;
    --bg-subtle: #d8c393;
    --text: #2a1810;
    --text-muted: #6b4423;
    --text-soft: #8b7355;
    --border: #c4a366;
    --border-strong: #a88547;

    --brown: #6b4423;
    --brown-deep: #3a2412;
    --brown-glow: #8b5a2b;
    --sand: #d4b888;
    --sand-light: #f5e6c8;
    --sand-deep: #a88547;
    --gold: #b8941f;
    --gold-soft: rgba(184,148,31,.12);
    --gold-glow: #d4af37;
    --palm: #5a7a3a;
    --palm-deep: #3d5a26;
    --sky: #c8a572;

    --primary: var(--brown);
    --primary-hover: var(--brown-glow);
    --primary-soft: rgba(107,68,35,.10);
    --accent: var(--gold);
    --accent-soft: var(--gold-soft);

    --shadow-sm: 0 1px 2px rgba(58,28,7,.08), 0 1px 3px rgba(58,28,7,.10);
    --shadow-md: 0 4px 8px -1px rgba(58,28,7,.12), 0 2px 4px -2px rgba(58,28,7,.08);
    --shadow-lg: 0 10px 25px -5px rgba(58,28,7,.18), 0 8px 10px -6px rgba(58,28,7,.10);
    --shadow-xl: 0 25px 50px -12px rgba(58,28,7,.30);
    --shadow-gold: 0 8px 30px rgba(184,148,31,.30);

    --grad-hero: linear-gradient(180deg, #c8a572 0%, #b88a4d 40%, #8b5a2b 80%, #5a3a1a 100%);
    --grad-gold: linear-gradient(135deg, #b8941f 0%, #d4af37 50%, #f5d76e 100%);
    --grad-cover: linear-gradient(160deg, #5a3a1a 0%, #3a2412 50%, #1a0f08 100%);
    --grad-title: linear-gradient(120deg, #d4af37 0%, #f5d76e 45%, #d4af37 100%);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-full: 999px;

    --max-width: 1240px;
    --header-height: 72px;
    --transition: 200ms cubic-bezier(.4,0,.2,1);
    --transition-slow: 400ms cubic-bezier(.4,0,.2,1);

    --pattern-dots: radial-gradient(circle, rgba(107,68,35,.10) 1.2px, transparent 1.2px);
}

[data-theme="dark"] {
    --bg: #1a0f08;
    --bg-elevated: #2a1d12;
    --bg-subtle: #1f1409;
    --text: #f5e6c8;
    --text-muted: #c4a378;
    --text-soft: #8b7355;
    --border: rgba(212,175,55,.18);
    --border-strong: rgba(212,175,55,.35);

    --brown: #d4af37;
    --brown-glow: #e8c454;
    --primary: var(--gold-glow);
    --primary-hover: #f5d76e;
    --primary-soft: rgba(212,175,55,.12);
    --accent: var(--palm);
    --accent-soft: rgba(90,122,58,.15);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow-md: 0 4px 10px rgba(0,0,0,.55);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.6);
    --shadow-xl: 0 25px 60px rgba(0,0,0,.7);
    --shadow-gold: 0 8px 35px rgba(212,175,55,.4);

    --grad-hero: linear-gradient(180deg, #2a1f12 0%, #1f1409 30%, #1a0f08 100%);
    --grad-cover: linear-gradient(160deg, #5a3a1a 0%, #3a2412 50%, #1a0f08 100%);
    --pattern-dots: radial-gradient(circle, rgba(212,175,55,.10) 1.2px, transparent 1.2px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    background-image: var(--pattern-dots);
    background-size: 22px 22px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition), color var(--transition);
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -.005em; }
::selection { background: var(--gold-soft); color: var(--gold); }

.container { max-width: var(--max-width); margin-inline: auto; padding-inline: 1.25rem; }

.flag-strip {
    height: 4px;
    background: linear-gradient(to right, #006b3c 0%, #006b3c 32%, #111 32%, #111 36%, #ce1126 36%, #ce1126 40%, #111 40%, #111 44%, #111 56%, #111 60%, #ce1126 60%, #ce1126 64%, #111 64%, #111 68%, #006b3c 68%, #006b3c 100%);
    position: sticky; top: 0; z-index: 60;
}

.site-header {
    position: sticky; top: 4px; z-index: 50;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}
.header-inner {
    display: flex; align-items: center; gap: 1rem;
    height: var(--header-height); padding-inline: 1.25rem; flex-wrap: nowrap;
}
.logo { display: inline-flex; align-items: center; gap: .75rem; color: var(--text) !important; flex-shrink: 0; }
.logo:hover { color: var(--text) !important; }
.logo-mark {
    display: grid; place-items: center;
    width: 48px; height: 48px; border-radius: 12px;
    background: linear-gradient(180deg, #f5d76e 0%, #d4af37 30%, #b8941f 65%, #8b5a2b 100%);
    box-shadow: 0 4px 14px rgba(107,68,35,.35), inset 0 0 0 1px rgba(255,255,255,.2);
    transition: transform var(--transition);
    position: relative; cursor: pointer; user-select: none;
}
.logo-mark svg { width: 36px; height: 36px; }
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.06); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title {
    font-family: 'Aref Ruqaa', 'Amiri', serif;
    font-weight: 700; font-size: 1.32rem;
    background: var(--grad-title);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-tag {
    font-size: .65rem; color: var(--text-soft);
    letter-spacing: .22em; font-weight: 700;
}

.search-box {
    flex: 1; min-width: 0; max-width: 580px;
    display: flex; align-items: center; gap: .5rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: .6rem 1.1rem;
    transition: all var(--transition);
}
.search-box:focus-within {
    border-color: var(--gold); background: var(--bg-elevated);
    box-shadow: 0 0 0 4px var(--gold-soft);
}
.search-icon { color: var(--text-soft); flex-shrink: 0; }
.search-box input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font-family: inherit; font-size: .95rem; color: var(--text); padding: .15rem 0;
}
.search-box input::placeholder { color: var(--text-soft); }
.search-kbd {
    font-family: inherit; font-size: .7rem; padding: .15rem .45rem;
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-muted); background: var(--bg-elevated);
}

.theme-toggle {
    width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--bg-subtle);
    color: var(--text); display: grid; place-items: center;
    transition: all var(--transition); flex-shrink: 0;
}
.theme-toggle:hover {
    border-color: var(--gold); background: var(--gold-soft);
    color: var(--gold); transform: translateY(-1px);
}
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.vip-badge {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .25rem .55rem; border-radius: 999px;
    background: linear-gradient(135deg, #5a7a3a, #b8941f);
    color: #fff; font-size: .7rem; font-weight: 700;
    box-shadow: var(--shadow-gold);
    flex-shrink: 0;
}

.link-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text); padding: .55rem 1rem; border-radius: 10px;
    font-size: .9rem; font-weight: 600; transition: all var(--transition);
    text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
}
.link-btn:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); text-decoration: none; }

/* === HERO — Sahara desert with oasis === */
.hero {
    position: relative; overflow: hidden;
    background: var(--grad-hero); color: #f5e6c8;
    padding: 3rem 0 8rem; text-align: center; isolation: isolate;
    border-bottom: 1px solid var(--border);
}
.hero::before {
    content: ''; position: absolute;
    top: -180px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(245,215,110,.55), rgba(184,148,31,.20) 35%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}
.hero::after {
    content: ''; position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 160px;
    background: linear-gradient(180deg, transparent 0%, rgba(58,36,18,.22) 30%, rgba(26,15,8,.80) 100%);
    clip-path: polygon(
        0 100%,
        0 70%,
        6% 58%, 14% 72%, 22% 50%, 32% 65%, 40% 45%, 48% 60%,
        50% 30%, 52% 60%,
        58% 50%, 66% 65%, 74% 48%, 82% 62%, 90% 50%, 100% 65%,
        100% 100%
    );
    z-index: -1;
    pointer-events: none;
}

.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .30; animation: float 16s ease-in-out infinite; }
.orb-1 { width: 480px; height: 480px; background: #f5d76e; top: -160px; left: 50%; transform: translateX(-50%); opacity: .25; }
.orb-2 { width: 320px; height: 320px; background: var(--palm); bottom: 60px; left: 38%; opacity: .35; animation-delay: -6s; }
.orb-3 { width: 280px; height: 280px; background: #8b5a2b; top: 40%; right: 18%; opacity: .25; animation-delay: -9s; }
@keyframes float {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(36px,-36px) scale(1.10); }
    66% { transform: translate(-24px,24px) scale(.95); }
}

/* النخلة / الواحة — شعار الموقع المرئي في الـhero */
.hero-oasis {
    display: block;
    margin: 0 auto 1.5rem;
    width: clamp(190px, 30vw, 300px);
    height: auto;
    filter: drop-shadow(0 14px 35px rgba(0,0,0,.55));
    animation: palmSway 6s ease-in-out infinite;
    transform-origin: bottom center;
    position: relative;
    z-index: 1;
}
@keyframes palmSway {
    0%, 100% { transform: rotate(-1.2deg); }
    50% { transform: rotate(1.5deg); }
}

.hero-inner { position: relative; z-index: 2; animation: fadeUp .9s var(--transition-slow); }
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .5rem 1.2rem;
    background: rgba(58,36,18,.45);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212,175,55,.45);
    border-radius: var(--radius-full);
    color: #f5d76e;
    font-size: .9rem; font-weight: 700; margin-bottom: 1.6rem;
    box-shadow: var(--shadow-gold);
}
.hero-title {
    font-family: 'Aref Ruqaa', 'Amiri', 'Cairo', serif;
    font-size: clamp(2.1rem, 6.5vw, 4rem);
    font-weight: 700;
    margin: 0 0 1rem; line-height: 1.18; letter-spacing: -.015em;
    text-shadow: 0 4px 30px rgba(0,0,0,.4);
}
.hero-grad {
    background: var(--grad-title);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 2px 8px rgba(212,175,55,.4));
}
.hero-subtitle {
    margin: 0 0 1rem; font-size: 1.15rem;
    opacity: .94; font-weight: 500;
    max-width: 720px; margin-inline: auto;
}
.hero-tagline {
    margin: 0 0 2.5rem;
    font-family: 'Aref Ruqaa', 'Amiri', serif;
    font-size: 1rem; color: var(--gold-glow);
    letter-spacing: .04em;
    opacity: .92;
}
.hero-tagline::before, .hero-tagline::after {
    content: ' ◆ '; opacity: .55; font-size: .7em;
}

.hero-stats {
    display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 0;
    background: rgba(26,15,8,.65);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212,175,55,.4);
    border-radius: var(--radius-lg);
    padding: 1.35rem 0;
    box-shadow: var(--shadow-gold);
}
.hero-stats .stat { padding-inline: 2.2rem; border-inline-end: 1px solid rgba(212,175,55,.25); }
.hero-stats .stat:last-child { border-inline-end: 0; }
.hero-stats b {
    display: block; font-size: 1.85rem; font-weight: 900;
    margin-bottom: .15rem; color: var(--gold-glow);
    font-family: 'Aref Ruqaa', 'Cairo', serif;
}
.hero-stats span { display: block; font-size: .85rem; opacity: .88; font-weight: 600; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.section { padding: 3.75rem 0; }
.section.highlight {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
    border-block: 1px solid var(--border);
}
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 1.85rem; gap: 1rem; flex-wrap: wrap;
    position: relative; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.section-head::after {
    content: ''; position: absolute; bottom: -1px; right: 0;
    width: 100px; height: 2px; background: var(--grad-gold);
    border-radius: 2px;
}
.section-head h2 {
    margin: 0 0 .25rem; font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 700; font-family: 'Aref Ruqaa', 'Amiri', serif;
    color: var(--text);
}
.section-head h2 .gold-icon { color: var(--gold); margin-inline-end: .35rem; }
.section-sub { margin: 0; color: var(--text-muted); font-size: .95rem; font-weight: 500; }

.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .9rem; }
.category-card {
    position: relative; background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.55rem 1rem; text-align: center; cursor: pointer;
    color: var(--text) !important; transition: all var(--transition);
    text-decoration: none !important; overflow: hidden; isolation: isolate;
}
.category-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--gold-soft) 100%);
    opacity: 0; transition: opacity var(--transition); z-index: -1;
}
.category-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--grad-gold); opacity: 0;
    transition: opacity var(--transition);
}
.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: var(--shadow-lg);
}
.category-card:hover::before { opacity: 1; }
.category-card:hover::after { opacity: 1; }
.category-icon {
    font-size: 2.3rem; display: block; margin-bottom: .55rem;
    transition: transform var(--transition);
    filter: drop-shadow(0 2px 4px rgba(58,28,7,.15));
}
.category-card:hover .category-icon { transform: scale(1.18) rotate(-4deg); }
.category-name { font-weight: 700; font-size: .98rem; display: block; margin-bottom: .2rem; }
.category-count { color: var(--text-muted); font-size: .8rem; font-weight: 600; }

.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.35rem; }
.book-card {
    position: relative; background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    color: inherit !important; text-decoration: none !important;
    transition: all var(--transition); isolation: isolate;
}
.book-card:hover {
    transform: translateY(-7px);
    border-color: var(--gold);
    box-shadow: var(--shadow-xl);
}
.book-cover-frame {
    position: relative; aspect-ratio: 2/3; width: 100%;
    overflow: hidden; background: var(--bg-subtle);
}
.book-cover-fallback {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 1rem .85rem;
    background: var(--grad-cover);
    color: #f5e6c8;
    text-align: center;
    overflow: hidden;
    z-index: 1;
}
.book-cover-fallback::before {
    content: ''; position: absolute; inset: -10%;
    background-image: radial-gradient(circle, rgba(212,175,55,.18) 1px, transparent 1px);
    background-size: 14px 14px; opacity: .5; pointer-events: none;
}
.book-cover-fallback::after {
    content: ''; position: absolute;
    top: 7%; left: 7%; right: 7%; bottom: 7%;
    border: 1.5px solid rgba(212,175,55,.5);
    border-radius: 4px; pointer-events: none;
}
.cf-top, .cf-mid, .cf-bottom { position: relative; z-index: 2; }
.cf-icon { font-size: 1.7rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.cf-title {
    font-family: 'Aref Ruqaa', 'Amiri', serif;
    font-weight: 700; font-size: 1.05rem; line-height: 1.4;
    margin: 0; color: #f5d76e;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
    padding: 0 .25rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.cf-author {
    font-size: .75rem; font-weight: 600; opacity: .9;
    border-top: 1px solid rgba(212,175,55,.4);
    padding-top: .55rem; margin: 0 0 .3rem;
    color: #f5e6c8;
}
.cf-publisher {
    font-size: .55rem; letter-spacing: .2em;
    opacity: .7; margin: 0;
    font-family: 'Aref Ruqaa', serif;
    color: var(--gold-glow);
}
.book-cover {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 2;
    background: var(--bg-subtle);
    transition: transform var(--transition-slow);
}
.book-card:hover .book-cover { transform: scale(1.06); }
.book-body { padding: .95rem 1rem 1rem; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.book-title {
    font-weight: 700; font-size: 1rem; margin: 0; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.45;
}
.book-author { color: var(--text-muted); font-size: .85rem; margin: 0; font-weight: 500; }
.book-meta {
    margin-top: auto; padding-top: .7rem;
    border-top: 1px solid var(--border);
    display: flex; gap: .85rem; font-size: .75rem;
    color: var(--text-muted); font-weight: 600;
}
.book-meta span { display: inline-flex; align-items: center; gap: .25rem; }

.book-detail {
    display: grid; grid-template-columns: 320px 1fr; gap: 2.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem; margin: 2.25rem 0;
    box-shadow: var(--shadow-lg);
    animation: fadeUp .55s var(--transition-slow);
    position: relative; overflow: hidden;
}
.book-detail::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--grad-gold);
}
.book-detail-cover .cover-shine {
    position: relative; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: rotate(-1.5deg);
    transition: transform var(--transition-slow);
    aspect-ratio: 2/3;
}
.book-detail-cover .cover-shine::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.4) 50%, transparent 60%);
    opacity: 0; transition: opacity var(--transition); pointer-events: none; z-index: 5;
}
.book-detail-cover .cover-shine:hover { transform: rotate(0) scale(1.02); }
.book-detail-cover .cover-shine:hover::after { opacity: 1; }
.book-detail-info h1 {
    margin: .25rem 0 .5rem;
    font-size: clamp(1.55rem, 3vw, 2.1rem); font-weight: 700;
    font-family: 'Aref Ruqaa', 'Amiri', 'Cairo', serif;
    color: var(--text);
}
.book-detail-category {
    display: inline-block;
    background: var(--grad-gold);
    color: #2a1810;
    padding: .3rem 1rem; border-radius: var(--radius-full);
    font-size: .82rem; font-weight: 800; margin: 0 0 .85rem;
    box-shadow: 0 2px 8px rgba(184,148,31,.3);
}
.book-detail-author { color: var(--text-muted); margin: 0 0 1.5rem; font-size: 1rem; }
.book-meta-list {
    list-style: none; padding: 1.1rem 1.35rem; margin: 1.1rem 0 1.85rem;
    display: flex; gap: 1.6rem; flex-wrap: wrap;
    background: var(--bg-subtle); border-radius: var(--radius);
    border: 1px solid var(--border);
}
.book-meta-list li {
    font-size: .92rem; color: var(--text); font-weight: 600;
    display: inline-flex; align-items: center; gap: .4rem;
}
.meta-icon { font-size: 1.1rem; }
.book-actions { display: flex; gap: .9rem; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .95rem 1.85rem; border-radius: 12px;
    font-weight: 700; font-size: 1rem; border: 0; text-decoration: none; cursor: pointer;
    transition: all var(--transition); position: relative; overflow: hidden;
    font-family: inherit;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(135deg, #6b4423 0%, #8b5a2b 50%, #b8941f 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(107,68,35,.45);
    border: 1px solid var(--gold-soft);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(107,68,35,.6); }
.btn-secondary {
    background: var(--grad-gold); color: #2a1810;
    box-shadow: 0 4px 16px rgba(184,148,31,.4);
}
.btn-secondary:hover { box-shadow: 0 8px 26px rgba(184,148,31,.55); }

.book-text {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.85rem 2.1rem;
    margin-bottom: 1.65rem; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.book-text::before {
    content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%;
    background: var(--grad-gold);
}
.book-text h2 {
    margin: 0 0 .95rem;
    font-size: 1.25rem; font-weight: 700;
    font-family: 'Aref Ruqaa', 'Amiri', serif;
    color: var(--text);
}
.book-text p { margin: 0; white-space: pre-line; color: var(--text); line-height: 1.9; }

.empty-state { text-align: center; padding: 3.25rem 1rem; color: var(--text-muted); font-size: 1rem; }
.spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid var(--border); border-top-color: var(--gold);
    border-radius: 50%; animation: spin .8s linear infinite;
    margin-inline-end: .55rem; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem; margin-top: 4.5rem;
    position: relative;
}
.site-footer::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(to right, var(--brown) 0%, var(--gold) 50%, var(--palm) 100%);
    opacity: .65;
}
.footer-inner {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: .25rem; }
.footer-brand strong {
    font-family: 'Aref Ruqaa', 'Amiri', serif;
    font-size: 1.2rem; color: var(--gold);
}
.footer-brand span { color: var(--text-muted); font-size: .9rem; }
.footer-identity {
    font-size: .82rem; color: var(--text-soft);
    margin-top: .4rem;
    font-family: 'Aref Ruqaa', serif;
    letter-spacing: .03em;
}
.footer-copy { margin: 0; color: var(--text-muted); font-size: .85rem; }

@media (max-width: 768px) {
    .header-inner { gap: .65rem; padding-inline: .85rem; height: 64px; }
    .logo-text { display: none; }
    .search-box { padding: .5rem .85rem; }
    .search-kbd { display: none; }
    .link-btn { padding: .45rem .8rem; font-size: .85rem; }
    .hero { padding: 1.8rem 0 5.5rem; }
    .hero-oasis { width: 200px; margin-bottom: 1rem; }
    .hero::after { height: 110px; }
    .hero-stats { grid-template-columns: repeat(3, 1fr); padding: 1.05rem 0; }
    .hero-stats .stat { padding-inline: .95rem; }
    .hero-stats b { font-size: 1.35rem; }
    .hero-stats span { font-size: .75rem; }
    .section { padding: 2.5rem 0; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: .9rem; }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .7rem; }
    .book-detail { grid-template-columns: 1fr; text-align: center; padding: 1.6rem 1.3rem; gap: 1.6rem; }
    .book-detail-cover .cover-shine { max-width: 230px; margin: 0 auto; transform: rotate(0); }
    .book-detail-info h1 { text-align: center; }
    .book-meta-list { justify-content: center; }
    .book-actions { justify-content: center; }
    .btn { flex: 1; min-width: 145px; padding: .9rem 1.3rem; }
    .book-text { padding: 1.3rem 1.3rem; }
    .footer-inner { flex-direction: column; text-align: center; gap: .65rem; }
    .cf-title { font-size: .92rem; }
    .cf-icon { font-size: 1.4rem; }
}
@media (max-width: 420px) {
    .hero-title { font-size: 1.85rem; }
    .hero-oasis { width: 170px; margin-bottom: .8rem; }
    .hero-badge { font-size: .8rem; }
    .hero-stats { grid-template-columns: 1fr; gap: .4rem; padding: .7rem 0; }
    .hero-stats .stat { border-inline-end: 0; border-bottom: 1px solid rgba(212,175,55,.22); padding-block: .55rem; }
    .hero-stats .stat:last-child { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .hero-orb { animation: none; }
    .hero-oasis { animation: none; }
}
