/*
 * Yaqinly Islamic Library — Design System
 * Dark spiritual theme with gold accents, Amiri Arabic typography
 */

/* ========================================
   CSS Variables — Design Tokens
   ======================================== */
:root {
    /* Colors */
    --bg-deep: #070A12;
    --bg-primary: #0B0E18;
    --bg-surface: #12162A;
    --bg-elevated: #1A1F38;
    --bg-hover: #222845;
    --border: #2A3055;
    --border-light: #353B60;

    /* Accents */
    --gold: #D4A574;
    --gold-light: #E8C9A0;
    --gold-dim: #A07C52;
    --blue: #5B8DEF;
    --blue-light: #7DA8F7;
    --green: #4ADE80;
    --rose: #F472B6;

    /* Text */
    --text-primary: #E8E6E3;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-dim: #4B5563;

    /* Typography */
    --font-arabic: 'Amiri', 'Traditional Arabic', 'Noto Naskh Arabic', serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Menlo', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration: 300ms;
    --duration-slow: 500ms;

    /* Reader font size (overridden by JS) */
    --reader-font-size: 1.25rem;
    --reader-font-size-ar: 1.6rem;

    /* Theme-aware composite tokens (header / glass / shadows) */
    --header-bg: rgba(7, 10, 18, 0.85);
    --header-border: rgba(42, 48, 85, 0.5);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.5);
    --gold-tint-soft: rgba(212, 165, 116, 0.1);
}

body[data-theme="light"] {
    --bg-deep: #F4F7FD;
    --bg-primary: #FFFFFF;
    --bg-surface: #F8FAFF;
    --bg-elevated: #EEF3FD;
    --bg-hover: #E5ECFA;
    --border: #D8E2F4;
    --border-light: #C1CFE8;
    --gold: #B6844A;
    --gold-light: #9B6F3F;
    --gold-dim: #9B6F3F;
    --blue: #2E62CA;
    --blue-light: #3F78E8;
    --text-primary: #1A2236;
    --text-secondary: #405170;
    --text-muted: #65738E;
    --text-dim: #7C8AA5;
    --header-bg: rgba(255, 255, 255, 0.88);
    --header-border: rgba(120, 140, 180, 0.22);
    --shadow-soft: 0 8px 30px rgba(60, 80, 130, 0.10);
    --shadow-strong: 0 12px 40px rgba(60, 80, 130, 0.18);
    --gold-tint-soft: rgba(182, 132, 74, 0.12);
}

/* ========================================
   Reset
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
select {
    font: inherit;
    color: inherit;
}

/* ========================================
   Layout
   ======================================== */
.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

#main-content {
    flex: 1;
}

/* ========================================
   Animations
   ======================================== */
@keyframes breathe {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.015);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 15px) scale(0.98);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.fade-in {
    animation: fadeInUp var(--duration-slow) var(--ease) both;
}

.breathe {
    animation: breathe 6s ease-in-out infinite;
}

/* ========================================
   Navigation
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--header-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--header-border);
    transition: border-color var(--duration) var(--ease);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1080px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.25rem;
    font-weight: 600;
    transition: opacity var(--duration) var(--ease);
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-logo-icon {
    color: var(--gold);
    font-size: 1.1rem;
}

.nav-logo-text {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--gold-light);
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    opacity: 0.7;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
    background: var(--gold-tint-soft);
}

.nav-link.active {
    color: var(--gold-light);
}

.nav-link-ar {
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    line-height: 1.2;
}

.nav-link-en {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.nav-icon {
    display: inline-block;
}

.nav-menu-toggle {
    display: none;
    padding: var(--space-xs);
    color: var(--text-secondary);
}

.nav-mobile {
    display: none;
    flex-direction: column;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
}

.nav-mobile-link {
    padding: var(--space-md) 0;
    font-family: var(--font-arabic);
    font-size: 1.1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    transition: color var(--duration) var(--ease);
}

.nav-mobile-link:hover {
    color: var(--gold-light);
}

.nav-mobile-link.active {
    color: var(--gold-light);
    border-bottom-color: var(--gold-dim);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-menu-toggle {
        display: block;
    }

    .nav-mobile[data-open="true"] {
        display: flex;
    }
}

/* ========================================
   Hero (Home)
   ======================================== */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--space-4xl) var(--space-lg);
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.hero-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--gold-dim) 0%, transparent 70%);
    top: 10%;
    left: 20%;
}

.hero-orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(91, 141, 239, 0.4) 0%, transparent 70%);
    bottom: 10%;
    right: 15%;
    animation-delay: -7s;
}

.hero-orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 60%;
    animation-delay: -13s;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
}

.hero-bismillah {
    font-family: var(--font-arabic);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: var(--gold-light);
    margin-bottom: var(--space-xl);
    line-height: 1.8;
    direction: rtl;
}

.hero-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    color: #0B0E18;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-xl);
    transition: all var(--duration) var(--ease);
    box-shadow: 0 4px 20px rgba(212, 165, 116, 0.25);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 165, 116, 0.35);
}

/* ========================================
   Home Blocks
   ======================================== */
.home-block {
    padding: var(--space-3xl) 0;
}

.block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.block-title {
    font-size: 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
}

.block-icon {
    font-size: 1rem;
}

.block-link {
    font-size: 0.85rem;
    color: var(--gold);
    opacity: 0.8;
    transition: opacity var(--duration) var(--ease);
}

.block-link:hover {
    opacity: 1;
}

/* Wisdom Card */
.wisdom-card {
    display: block;
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}

.wisdom-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.wisdom-arabic {
    font-family: var(--font-arabic);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    line-height: 2.2;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    direction: rtl;
}

.wisdom-translation {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
    font-style: italic;
}

.wisdom-source {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.wisdom-sep {
    opacity: 0.4;
}

/* ========================================
   Book Cards
   ======================================== */
.book-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.book-grid-home {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.book-card {
    display: block;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.8;
}

.book-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.book-card-full {
    padding: var(--space-2xl);
}

.book-card-title-ar {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.8;
    margin-bottom: var(--space-xs);
}

.book-card-title-en {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.book-card-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.book-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.book-card-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stat-sep {
    opacity: 0.4;
}

.book-card-sections {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.section-tag-count {
    font-weight: 600;
    color: var(--gold-dim);
}

.book-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* Book gradient accents */
.gradient-nahj::before {
    background: linear-gradient(90deg, #2D6A4F, #40916C, #52B788);
}

.gradient-sahifa::before {
    background: linear-gradient(90deg, #5B21B6, #7C3AED, #8B5CF6);
}

.gradient-kafi::before {
    background: linear-gradient(90deg, #1E3A5F, #2563EB, #3B82F6);
}

.gradient-bihar::before {
    background: linear-gradient(90deg, #92400E, #D97706, #F59E0B);
}

.gradient-mafatih::before {
    background: linear-gradient(90deg, #9D174D, #DB2777, #EC4899);
}

.gradient-default::before {
    background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}

/* Hero variants for book/section pages */
.book-hero,
.section-hero {
    position: relative;
    padding: var(--space-3xl) 0 var(--space-2xl);
    overflow: hidden;
}

.book-hero::after,
.section-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--bg-deep), transparent);
}

.book-hero>.container,
.section-hero>.container {
    position: relative;
    z-index: 1;
}

.book-hero-title-ar,
.section-hero-title-ar {
    font-family: var(--font-arabic);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.8;
    direction: rtl;
    margin-bottom: var(--space-xs);
}

.book-hero-title-en,
.section-hero-title-en {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.book-hero-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.book-hero-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: var(--space-lg);
}

.book-hero-stats,
.section-hero-stats {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.book-stat-complete {
    color: var(--green);
}

.book-stat-sep {
    opacity: 0.4;
}

.section-hero-book {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* ========================================
   Section Cards
   ======================================== */
.sections-heading {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: var(--space-2xl) 0 var(--space-lg);
}

.section-grid {
    display: grid;
    gap: var(--space-md);
}

.section-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}

.section-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    transform: translateX(4px);
}

.section-card-title-ar {
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 2px;
}

.section-card-title-en {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.section-card-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.section-card-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--duration) var(--ease);
}

.section-card:hover .section-card-arrow {
    transform: translateX(4px);
    color: var(--gold);
}

/* ========================================
   Entry Cards (Section listing + Search)
   ======================================== */
.entry-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.entry-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid transparent;
    transition: all var(--duration) var(--ease);
}

.entry-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border);
}

.entry-card-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
    margin-top: 2px;
}

.entry-card-body {
    flex: 1;
    min-width: 0;
}

.entry-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.entry-card-title-ar {
    font-family: var(--font-arabic);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.entry-card-excerpt {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.entry-card-excerpt-ar {
    font-family: var(--font-arabic);
    font-size: 0.9rem;
    line-height: 1.9;
    color: var(--text-muted);
}

.entry-card-source {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: var(--space-xs);
}

.entry-card-sep {
    opacity: 0.4;
}

.entry-card-arrow {
    color: var(--text-dim);
    flex-shrink: 0;
    margin-top: 8px;
    transition: all var(--duration) var(--ease);
}

.entry-card:hover .entry-card-arrow {
    color: var(--gold);
    transform: translateX(3px);
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-3xl) 0;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all var(--duration) var(--ease);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    min-width: 40px;
    color: var(--text-secondary);
}

.pagination-btn:hover,
.pagination-page:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.pagination-current {
    background: var(--gold);
    color: var(--bg-deep);
    font-weight: 600;
    border-color: var(--gold);
}

.pagination-dots {
    color: var(--text-dim);
    padding: 0 var(--space-xs);
}

.pagination-pages {
    display: flex;
    gap: var(--space-xs);
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
    padding: var(--space-md) 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(42, 48, 85, 0.3);
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--duration) var(--ease);
}

.breadcrumb a:hover {
    color: var(--gold-light);
}

.breadcrumb-sep {
    margin: 0 var(--space-sm);
    opacity: 0.4;
}

.breadcrumb-current {
    color: var(--text-primary);
}

/* ========================================
   Reader
   ======================================== */
.reader-controls {
    position: sticky;
    top: 57px;
    /* below header */
    z-index: 50;
    background-color: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(42, 48, 85, 0.4);
    padding: var(--space-sm) 0;
}

.reader-controls-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.reader-controls-left,
.reader-controls-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.reader-controls-center {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.reader-position {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.reader-btn {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.reader-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.reader-btn.active {
    background: var(--gold);
    color: var(--bg-deep);
    border-color: var(--gold);
}

.reader-nav-btn {
    font-size: 0.8rem;
    color: var(--gold);
    opacity: 0.8;
    transition: opacity var(--duration) var(--ease);
}

.reader-nav-btn:hover {
    opacity: 1;
}

/* Reader Content */
.reader-article {
    padding-bottom: var(--space-3xl);
}

.reader-container {
    max-width: 760px;
}

.reader-header {
    position: relative;
    padding: var(--space-3xl) 0 var(--space-2xl);
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.reader-title-ar {
    font-family: var(--font-arabic);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    line-height: 2;
    direction: rtl;
    margin-bottom: var(--space-xs);
}

.reader-title-en {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.reader-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reader-meta-sep {
    opacity: 0.4;
}

/* Text sections */
.reader-text {
    padding: var(--space-xl) 0;
    line-height: 2;
    font-size: var(--reader-font-size);
    transition: font-size var(--duration) var(--ease);
}

.reader-text-ar {
    font-family: var(--font-arabic);
    font-size: var(--reader-font-size-ar);
    line-height: 2.4;
    direction: rtl;
    text-align: right;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.reader-text-en {
    color: var(--text-secondary);
    line-height: 1.9;
}

.reader-text-fr {
    color: var(--text-muted);
    line-height: 1.9;
    font-style: italic;
}

/* Bottom Navigation */
.reader-bottom-nav {
    padding: var(--space-xl) 0 var(--space-3xl);
    border-top: 1px solid var(--border);
}

.reader-bottom-nav-inner {
    display: flex;
    justify-content: space-between;
    gap: var(--space-lg);
}

.reader-bottom-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    max-width: 48%;
    transition: all var(--duration) var(--ease);
}

.reader-bottom-link:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.reader-bottom-prev {
    align-items: flex-start;
}

.reader-bottom-next {
    align-items: flex-end;
    margin-left: auto;
}

.reader-bottom-label {
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 500;
}

.reader-bottom-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========================================
   Search Page
   ======================================== */
.search-hero {
    padding: var(--space-3xl) 0 var(--space-xl);
}

.search-form {
    margin-top: var(--space-xl);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--duration) var(--ease);
    outline: none;
}

.search-input:focus {
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-clear {
    position: absolute;
    right: var(--space-md);
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color var(--duration) var(--ease);
}

.search-clear:hover {
    color: var(--text-primary);
}

.search-filters {
    margin-top: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.search-filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-filter-select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    outline: none;
}

.search-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.search-empty,
.search-prompt {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.search-empty-title,
.search-prompt-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.search-empty-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-suggestions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: var(--space-lg);
}

.search-suggestion-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-suggestion {
    font-size: 0.85rem;
    padding: var(--space-xs) var(--space-md);
    border-radius: 100px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all var(--duration) var(--ease);
}

.search-suggestion:hover {
    background: var(--bg-elevated);
    border-color: var(--gold-dim);
    color: var(--gold-light);
}

/* ========================================
   Page Headings (Library, Search)
   ======================================== */
.page-heading {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.page-heading-ar {
    font-family: var(--font-arabic);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
    direction: rtl;
    line-height: 1.8;
}

.page-heading-en {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 300;
    color: var(--text-secondary);
}

.page-subheading {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* ========================================
   404 Page
   ======================================== */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-container {
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    color: var(--gold-dim);
    margin-bottom: var(--space-xl);
    opacity: 0.6;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: var(--space-md);
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.error-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
}

.error-link {
    color: var(--gold);
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity var(--duration) var(--ease);
}

.error-link:hover {
    opacity: 1;
}

/* ========================================
   Continue Reading Card (JS-populated)
   ======================================== */
.continue-card-wrapper .continue-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}

.continue-card-wrapper .continue-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

/* ========================================
   Footer — Premium Global (.yaq-footer)
   Theme-aware via CSS variables
   ======================================== */
.yaq-footer {
    margin-top: auto;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.yaq-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-lg) var(--space-xl);
}

.yaq-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--border);
}

.yaq-footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.yaq-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    color: var(--gold);
    text-decoration: none;
    transition: opacity var(--duration) var(--ease);
}

.yaq-footer-logo:hover {
    opacity: 0.85;
}

.yaq-footer-logo-icon {
    color: var(--gold);
    font-size: 1.1rem;
}

.yaq-footer-logo-text {
    font-family: var(--font-arabic);
    font-size: 1.7rem;
    color: var(--gold-light);
    line-height: 1;
}

.yaq-footer-desc {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-top: 4px;
    max-width: 320px;
}

.yaq-footer-light {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
    max-width: 320px;
}

.yaq-footer-col h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: var(--space-md);
}

.yaq-footer-col a {
    display: block;
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}

.yaq-footer-col a:hover {
    color: var(--gold-light);
    transform: translateX(2px);
}

.yaq-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.yaq-footer-copy {
    flex: 1 1 auto;
}

.yaq-footer-made {
    color: var(--text-dim);
    font-style: italic;
}

.yaq-footer-noor {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gold-dim);
    font-weight: 600;
}

.yaq-footer-noor-star {
    color: var(--gold);
}

@media (max-width: 900px) {
    .yaq-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }

    .yaq-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .yaq-footer-grid {
        grid-template-columns: 1fr;
    }

    .yaq-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Footer (legacy .site-footer — kept for compatibility)
   ======================================== */
.site-footer {
    margin-top: auto;
    padding: var(--space-3xl) 0;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.footer-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-logo {
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    color: var(--gold-dim);
}

.footer-tagline {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm) var(--space-lg);
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color var(--duration) var(--ease);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-meta {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.footer-copy {
    margin-top: 4px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .hero {
        min-height: 60vh;
        padding: var(--space-3xl) var(--space-lg);
    }

    .book-grid {
        grid-template-columns: 1fr;
    }

    .book-grid-home {
        grid-template-columns: repeat(2, 1fr);
    }

    .reader-controls-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .reader-controls-left,
    .reader-controls-right {
        display: none;
    }

    .reader-bottom-nav-inner {
        flex-direction: column;
    }

    .reader-bottom-link {
        max-width: 100%;
    }

    .reader-bottom-next {
        margin-left: 0;
        align-items: flex-start;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-meta {
        text-align: center;
    }

    .pagination {
        gap: var(--space-xs);
    }
}

@media (max-width: 480px) {
    .book-grid-home {
        grid-template-columns: 1fr;
    }

    .hero-bismillah {
        font-size: 1.5rem;
    }

    .section-card {
        padding: var(--space-md);
    }

    .entry-card {
        padding: var(--space-md);
    }

    .entry-card-num {
        display: none;
    }

    .reader-text-ar {
        font-size: 1.3rem;
    }

    .reader-text-en {
        font-size: 1rem;
    }
}

/* ========================================
   Print
   ======================================== */
@media print {

    .site-header,
    .site-footer,
    .reader-controls,
    .reader-bottom-nav,
    .breadcrumb {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .reader-text-ar {
        color: black;
        font-size: 14pt;
    }

    .reader-text-en {
        color: #333;
        font-size: 11pt;
    }
}

/* ========================================
   Language Switcher
   ======================================== */
.lang-switcher {
    position: relative;
    z-index: 100;
}

.theme-switcher,
.nav-mobile-theme {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.theme-option {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 999px;
    padding: 5px 9px;
    transition: all var(--duration-fast) var(--ease);
}

.theme-option:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.theme-option.theme-option-active {
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
}

body[data-theme="light"] .theme-option.theme-option-active {
    color: white;
}

/* Icon-only theme buttons (compact pill) */
.theme-option--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    line-height: 1;
}

.theme-option--icon svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.theme-option--icon:hover svg {
    transform: scale(1.08);
}

.theme-option--icon svg {
    transition: transform var(--duration-fast) var(--ease);
}

.lang-switcher-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.lang-switcher-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.lang-chevron {
    transition: transform var(--duration) var(--ease);
}

.lang-switcher-btn[aria-expanded="true"] .lang-chevron {
    transform: rotate(180deg);
}

.lang-dropdown {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 110;
}

.lang-dropdown:not([hidden]) {
    display: flex;
}

.lang-option {
    display: block;
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    text-decoration: none;
}

.lang-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.lang-option.lang-active {
    color: var(--gold);
    font-weight: 600;
}

/* Mobile language bar */
.nav-mobile-langs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
}

.nav-mobile-theme {
    margin: var(--space-md) var(--space-lg) 0;
    width: fit-content;
}

.nav-mobile-lang {
    padding: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.nav-mobile-lang:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-mobile-lang.lang-active {
    color: var(--gold);
    border-color: var(--gold-dim);
    background: rgba(212, 165, 116, 0.08);
}

/* ========================================
   RTL Support
   ======================================== */
[dir="rtl"] body {
    font-family: var(--font-arabic);
}

[dir="rtl"] .nav-container {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .breadcrumb .container {
    direction: rtl;
}

[dir="rtl"] .breadcrumb-sep {
    transform: scaleX(-1);
}

[dir="rtl"] .entry-card {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .entry-card-arrow,
[dir="rtl"] .section-card-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .reader-controls-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .reader-bottom-nav-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-container {
    direction: rtl;
}

[dir="rtl"] .footer-meta {
    text-align: left;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .hero-cta svg {
    transform: scaleX(-1);
}

/* ========================================
   Module Pages
   ======================================== */
.module-hero {
    padding: var(--space-4xl) 0;
    text-align: center;
}

.module-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-lg);
}

.module-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    margin-bottom: var(--space-md);
}

.module-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--gold);
    margin-bottom: var(--space-lg);
}

.module-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.module-desc {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto var(--space-md);
    font-size: 0.95rem;
}

.module-app-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.module-others {
    padding: var(--space-3xl) 0;
}

.module-others-title {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
    max-width: 800px;
    margin: 0 auto;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--duration) var(--ease);
    border: 1px solid transparent;
}

.module-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.module-card-icon {
    font-size: 1.8rem;
}

.module-card-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ========================================
   NOOR Assistant (Phase 4 placeholder)
   ======================================== */
.noor-trigger {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--gold);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 200;
    transition: all var(--duration) var(--ease);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.noor-trigger:hover {
    background: var(--bg-hover);
    border-color: var(--gold-dim);
    transform: scale(1.05);
}

[dir="rtl"] .noor-trigger {
    right: auto;
    left: var(--space-xl);
}

@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .theme-switcher {
        display: none;
    }

    .noor-trigger {
        bottom: var(--space-lg);
        right: var(--space-lg);
    }

    [dir="rtl"] .noor-trigger {
        right: auto;
        left: var(--space-lg);
    }
}

/* ========================================
   Local Search Results (Client-side filtering)
   ======================================== */
.local-search-results {
    width: min(100%, 880px);
    margin: var(--space-md) auto 0;
    padding: 1rem 1.1rem;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
        var(--bg-elevated);
    border: 1px solid rgba(232, 201, 160, 0.14);
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.24);
    backdrop-filter: blur(12px);
    animation: fadeIn var(--duration) var(--ease);
}

.local-search-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.local-search-count {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.local-search-count::before {
    content: '';
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    box-shadow: 0 0 0 5px rgba(212, 165, 116, 0.12);
}

.local-search-global-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.95rem;
    background: rgba(212, 165, 116, 0.12);
    color: var(--gold-light);
    border: 1px solid rgba(212, 165, 116, 0.22);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.local-search-global-link::after {
    content: '↗';
    font-size: 0.9rem;
}

.local-search-global-link:hover {
    background: rgba(212, 165, 116, 0.2);
    border-color: rgba(232, 201, 160, 0.42);
    color: var(--text-primary);
    transform: translateX(2px);
}

[dir="rtl"] .local-search-global-link:hover {
    transform: translateX(-2px);
}

.local-search-empty {
    text-align: center;
    padding: 1.2rem;
    border: 1px dashed rgba(125, 168, 247, 0.22);
    border-radius: 16px;
    background: rgba(91, 141, 239, 0.05);
}

.local-search-empty-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.9rem;
}

.local-search-global-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.15rem;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}

.local-search-global-btn::after {
    content: '→';
}

.local-search-global-btn:hover {
    background: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3);
}

.book-hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-xl);
}

.book-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 0.9rem 1.4rem;
    border-radius: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.book-hero-btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    color: var(--bg-deep);
    box-shadow: 0 12px 30px rgba(212, 165, 116, 0.24);
}

.book-hero-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.book-hero-btn:hover {
    transform: translateY(-2px);
}

.book-search,
.section-search {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.book-search-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: min(100%, 880px);
    margin: 0 auto;
    padding: 0.55rem 0.65rem 0.55rem 1.2rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        rgba(11, 14, 24, 0.9);
    border: 1px solid rgba(232, 201, 160, 0.12);
    border-radius: 24px;
    box-shadow: 0 26px 60px rgba(2, 6, 23, 0.28);
    overflow: hidden;
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.book-search-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(212, 165, 116, 0.07), transparent 38%, rgba(125, 168, 247, 0.08));
    pointer-events: none;
}

.book-search-container:focus-within {
    transform: translateY(-2px);
    border-color: rgba(232, 201, 160, 0.34);
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.4), 0 0 0 4px rgba(212, 165, 116, 0.08);
}

.book-search-input {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem 0;
    outline: none;
}

.book-search-input::placeholder {
    color: var(--text-muted);
}

.book-search-container .search-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    box-shadow: 0 12px 24px rgba(212, 165, 116, 0.28);
    flex: 0 0 auto;
}

.book-search-hint {
    width: min(100%, 880px);
    margin: 0.85rem auto 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .book-hero-actions {
        gap: var(--space-sm);
    }

    .book-hero-btn {
        width: 100%;
    }

    .book-search-container {
        padding-inline: 0.9rem 0.5rem;
        border-radius: 20px;
    }

    .book-search-input {
        font-size: 0.95rem;
        padding-block: 0.9rem;
    }

    .book-search-container .search-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .local-search-results {
        padding: 0.95rem;
        border-radius: 18px;
    }

    .local-search-info {
        align-items: stretch;
    }

    .local-search-global-link,
    .local-search-global-btn {
        width: 100%;
        justify-content: center;
    }
}