/* ============================================================
   Kutub Library — Main Stylesheet v6
   Modern 2025 Design: Glass, Gradients, Animations, RTL
   ============================================================ */

/* ── 1. Design Tokens ────────────────────────────────────── */
:root {
  /* Brand Colors - Modern Emerald & Indigo Mix */
  --c-primary:     #059669; /* Emerald 600 */
  --c-primary-dark:#065f46; /* Emerald 800 */
  --c-primary-light:#34d399; /* Emerald 400 */
  --c-accent:      #6366f1; /* Indigo 500 */
  --c-accent-dark: #4338ca; /* Indigo 700 */
  --c-accent-light:#a5b4fc; /* Indigo 300 */

  /* Semantic */
  --primary:       var(--c-primary);
  --primary-dark:  var(--c-primary-dark);
  --primary-light: var(--c-primary-light);
  --accent:        var(--c-accent);
  --accent-dark:   var(--c-accent-dark);
  --accent-light:  var(--c-accent-light);

  /* Surfaces */
  --bg:            #f8fafc; /* Slate 50 */
  --bg-alt:        #f1f5f9; /* Slate 100 */
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --glass:         rgba(255,255,255,.72);
  --glass-border:  rgba(255,255,255,.55);
  --glass-dark:    rgba(13,31,53,.72);

  /* Text */
  --text:          #0d1117;
  --text-2:        #4b5563;
  --text-3:        #9ca3af;
  --text-inv:      #ffffff;

  /* UI */
  --border:        rgba(0,0,0,.08);
  --border-strong: rgba(0,0,0,.14);
  --success:       #10b981;
  --error:         #ef4444;

  /* Shadows — navy-tinted */
  --shadow-xs:   0 1px 3px rgba(13,31,53,.08);
  --shadow-sm:   0 2px 8px rgba(13,31,53,.10);
  --shadow:      0 4px 16px rgba(13,31,53,.12);
  --shadow-lg:   0 8px 32px rgba(13,31,53,.16);
  --shadow-xl:   0 16px 48px rgba(13,31,53,.20);
  --shadow-gold: 0 8px 32px rgba(245,158,11,.30);
  --shadow-card: 0 2px 12px rgba(13,31,53,.08);
  --shadow-card-h: 0 12px 36px rgba(13,31,53,.16);

  /* Radii */
  --r-xs:  4px;
  --r-sm:  8px;
  --r:     12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --r-pill:100px;

  /* Typography */
  --font:  'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --fw-light:  300;
  --fw-normal: 400;
  --fw-mid:    600;
  --fw-bold:   700;
  --fw-black:  900;

  /* Animation */
  --ease:     cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,.55,.45,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --t-fast:   .15s;
  --t:        .22s;
  --t-slow:   .4s;

  /* Layout */
  --container: 1280px;
  --gutter:    clamp(16px, 4vw, 32px);
}

/* ── 2. Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; color-scheme: light; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
h1,h2,h3,h4,h5,h6 {
  line-height: 1.3;
  font-weight: var(--fw-bold);
  text-wrap: balance;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ── 3. Typography Utilities ──────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.text-gradient--accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* ── 4. Skip Link ─────────────────────────────────────────── */
.skip-link { position: absolute; top: -999px; left: -999px; z-index: 9999; }
.skip-link:focus {
  top: 8px; left: 8px; padding: 8px 16px;
  background: var(--c-navy); color: #fff; border-radius: var(--r-sm);
}

/* ── 5. Container & Layout ────────────────────────────────── */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(48px, 7vw, 96px); }
.section--alt { background: var(--bg-alt); }
.section--dark {
  background: var(--c-navy);
  color: var(--text-inv);
}

/* Section Header */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: clamp(28px, 4vw, 48px);
}
.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: var(--fw-black);
  position: relative;
  padding-bottom: 12px;
  color: var(--c-navy);
}
.section-title::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 40px; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--r-pill);
}
.section-more {
  color: var(--c-navy-light); font-weight: var(--fw-mid); font-size: .88rem;
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 6px 14px; border: 1.5px solid var(--border-strong);
  border-radius: var(--r-pill); transition: all var(--t) var(--ease);
}
.section-more:hover {
  background: var(--c-navy); color: #fff; border-color: var(--c-navy);
}
.section-badge {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  padding: 4px 14px; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: var(--fw-black); letter-spacing: .02em;
}

/* ── 6. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--r-pill);
  font-size: .9rem; font-weight: var(--fw-bold); font-family: var(--font);
  border: 2px solid transparent; cursor: pointer; white-space: nowrap;
  transition: all var(--t) var(--ease);
  position: relative; overflow: hidden;
  text-decoration: none; user-select: none;
}
/* Shine sweep on hover */
.btn::after {
  content: ''; position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-20deg);
  transition: left .5s var(--ease);
}
.btn:hover::after { left: 160%; }

.btn--primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--primary:active { transform: translateY(0); }

.btn--download {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
}
.btn--download:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold); }

.btn--outline {
  background: transparent;
  color: var(--c-navy-mid);
  border-color: var(--border-strong);
}
.btn--outline:hover { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }

.btn--ghost {
  background: rgba(255,255,255,.12);
  color: #fff; border-color: rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: rgba(255,255,255,.22); }

.btn--disabled { background: var(--bg-alt); color: var(--text-3); border-color: transparent; cursor: not-allowed; }
.btn--disabled::after { display: none; }

.btn--sm  { padding: 7px 16px; font-size: .82rem; }
.btn--lg  { padding: 14px 30px; font-size: 1rem; }
.btn--icon { min-width: 44px; justify-content: center; }

/* Bookmark saved state */
.bookmark-btn.is-saved {
  background: linear-gradient(135deg, var(--c-gold) 0%, var(--c-gold-light) 100%);
  color: var(--c-navy); border-color: transparent;
}

/* ── 7. Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: var(--fw-black); letter-spacing: .03em;
  text-decoration: none;
}
.badge--primary { background: var(--primary); color: #fff; }
.badge--primary:hover { background: var(--accent); color: #fff; }
.badge--format {
  background: var(--bg-alt); color: var(--text-2);
  border: 1.5px solid var(--border-strong); font-weight: var(--fw-mid);
}
.badge--cat {
  background: rgba(124,58,237,.1);
  color: var(--c-violet);
}

/* ── 8. Topbar ────────────────────────────────────────────── */
.topbar {
  background: var(--c-navy);
  color: rgba(255,255,255,.75);
  font-size: .8rem; padding: 7px 0;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar__social { display: flex; gap: 8px; }
.topbar__social-link {
  color: rgba(255,255,255,.55); font-size: .88rem;
  transition: color var(--t); padding: 2px 4px;
}
.topbar__social-link:hover { color: var(--c-gold); }

/* ── 9. Site Header ───────────────────────────────────────── */
.site-header {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 1000;
  transition: background var(--t), box-shadow var(--t), border-color var(--t);
}
.site-header.is-scrolled {
  background: rgba(255,255,255,.98);
  border-bottom-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}
.header__inner {
  display: flex; align-items: center; gap: 20px;
  padding-block: 14px; min-height: 68px;
}
.header__brand { flex-shrink: 0; }
.header__logo-text {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.2rem; font-weight: var(--fw-black); color: var(--c-navy);
}
.logo-icon { font-size: 1.4rem; }
.header__nav { flex: 1; }
.nav-menu {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
}
.nav-menu li a {
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: .88rem; font-weight: var(--fw-mid); color: var(--text-2);
  transition: all var(--t); display: block;
}
.nav-menu li a:hover,
.nav-menu li.current-menu-item > a,
.nav-menu li.current-cat > a {
  color: var(--primary); background: rgba(5,150,105,.07);
}
/* Sub-menu */
.nav-menu li { position: relative; }
.nav-menu .sub-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 210px; background: var(--glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg); border-radius: var(--r-lg);
  border: 1px solid var(--glass-border); z-index: 200;
  flex-direction: column; padding: 8px;
}
.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu { display: flex; }
.nav-menu .sub-menu li a {
  padding: 9px 14px; border-radius: var(--r-sm);
  font-size: .86rem; white-space: nowrap;
}

/* Header Actions */
.header__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header__search-toggle, .header__menu-toggle {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); color: var(--text-2);
  transition: all var(--t);
}
.header__search-toggle:hover, .header__menu-toggle:hover {
  background: var(--c-navy); color: #fff;
}
.header__menu-toggle { display: none; flex-direction: column; gap: 5px; padding: 10px; }
.burger {
  display: block; width: 20px; height: 2px; background: currentColor;
  border-radius: 2px; transition: all var(--t);
}

/* Search Bar (header) */
.header__search-bar {
  background: var(--surface-2); border-top: 1px solid var(--border);
  padding: 14px 0; animation: slideDown .2s var(--ease-out);
}
.header__search-bar[hidden] { display: none; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }

.search-form__input-wrap { position: relative; }
.search-form__input {
  width: 100%; padding: 12px 48px 12px 16px;
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-pill); font-size: .94rem; color: var(--text);
  outline: none; transition: all var(--t);
}
.search-form__input:focus { border-color: var(--c-navy-light); box-shadow: 0 0 0 3px rgba(45,90,138,.12); }
.search-form__btn { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); transition: color var(--t); }
.search-form__btn:hover { color: var(--c-navy); }

/* Autocomplete */
.search-autocomplete {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xl); overflow: hidden;
  max-height: 420px; overflow-y: auto;
}
.search-autocomplete[hidden] { display: none; }
.autocomplete-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  cursor: pointer; transition: background var(--t);
}
.autocomplete-item:hover { background: var(--bg); }
.autocomplete-item img { width: 42px; height: 58px; object-fit: cover; border-radius: var(--r-xs); flex-shrink: 0; }
.autocomplete-item__title { font-weight: var(--fw-bold); font-size: .88rem; }
.autocomplete-item__cat   { font-size: .76rem; color: var(--text-3); margin-top: 2px; }
.autocomplete-loading, .autocomplete-none { padding: 16px; text-align: center; color: var(--text-3); font-size: .88rem; }

/* ── 10. Hero Section ─────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(64px, 10vw, 120px) 0;
  color: #fff;
  /* Gradient mesh */
  background:
    radial-gradient(ellipse at 80% 20%, rgba(99,102,241,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(5,150,105,.12) 0%, transparent 50%),
    linear-gradient(135deg, #064e3b 0%, #065f46 60%, #059669 100%);
}
/* Animated mesh blobs */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255,255,255,.04) 0%, transparent 70%);
}
/* Noise texture overlay */
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px;
}

.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center;
}
.hero__content { max-width: 620px; min-width: 0; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-pill); padding: 6px 16px;
  font-size: .8rem; font-weight: var(--fw-mid); margin-bottom: 20px;
  backdrop-filter: blur(8px);
}
.hero__eyebrow::before { content: '✦'; color: var(--c-gold); }
.hero__title {
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  font-weight: var(--fw-black); line-height: 1.15; margin-bottom: 18px;
}
.hero__title strong { color: var(--accent-light); font-weight: inherit; }
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem); color: rgba(255,255,255,.8);
  margin-bottom: 36px; line-height: 1.8;
}

/* Hero Search */
.hero__search { margin-bottom: 36px; }
.hero__search-wrap {
  display: flex; max-width: 560px;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--r-xl); overflow: hidden;
  backdrop-filter: blur(12px);
  transition: border-color var(--t), box-shadow var(--t);
}
.hero__search-wrap:focus-within {
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 0 0 4px rgba(255,255,255,.08);
}
.hero__search-input {
  flex: 1; padding: 16px 20px; background: transparent;
  border: none; outline: none; color: #fff; font-size: .97rem; font-family: var(--font);
}
.hero__search-input::placeholder { color: rgba(255,255,255,.5); }
.hero__search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff; font-weight: var(--fw-black); font-size: .9rem;
  border: none; cursor: pointer; font-family: var(--font);
  white-space: nowrap; transition: all var(--t);
}
.hero__search-btn:hover { background: var(--c-gold-dark); color: #fff; }

/* Hero Stats */
.hero__stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero__stat { text-align: center; }
.hero__stat strong {
  display: block; font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: var(--fw-black); color: var(--accent-light); line-height: 1;
}
.hero__stat span { font-size: .78rem; color: rgba(255,255,255,.65); margin-top: 3px; display: block; }

/* Hero Books Deco */
.hero__deco { position: relative; width: 280px; flex-shrink: 0; }
.hero__books-stack { position: relative; height: 340px; }
.hero__book-img {
  position: absolute; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.hero__book-img img { width: 100%; height: auto; display: block; }
.hero__book-img--1 { right: 60px; top: 0;  width: 150px; transform: rotate(-4deg) translateZ(0); z-index: 3; }
.hero__book-img--2 { right: 0;   top: 40px; width: 135px; transform: rotate(3deg)  translateZ(0); z-index: 2; }
.hero__book-img--3 { right: 110px; top: 55px; width: 125px; transform: rotate(-8deg) translateZ(0); z-index: 1; opacity: .65; }

/* ── 11. Category Cards ───────────────────────────────────── */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 12px; background: var(--surface); border-radius: var(--r-lg);
  border: 1.5px solid var(--border); text-align: center;
  transition: all var(--t) var(--ease); color: var(--text); text-decoration: none;
  position: relative; overflow: hidden;
}
.cat-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--c-navy) 0%, var(--c-navy-light) 100%);
  opacity: 0; transition: opacity var(--t);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; color: #fff; }
.cat-card:hover::before { opacity: 1; }
.cat-card__icon { font-size: 1.9rem; position: relative; z-index: 1; transition: transform var(--t) var(--ease-spring); }
.cat-card:hover .cat-card__icon { transform: scale(1.2) rotate(-5deg); }
.cat-card__name  { font-size: .88rem; font-weight: var(--fw-bold); position: relative; z-index: 1; }
.cat-card__count { font-size: .76rem; opacity: .7; position: relative; z-index: 1; }

/* ── 12. Book Card ────────────────────────────────────────── */
.books-grid { display: grid; gap: 20px; }
.books-grid--4 { grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }
.books-grid--6 { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }

.book-card {
  background: var(--surface); border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  overflow: hidden; display: flex; flex-direction: column;
  position: relative;
}
.book-card:hover { transform: translateY(-6px) scale(1.01); box-shadow: var(--shadow-card-h); }

/* Cover */
.book-card__cover {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #e8e8e4 0%, #d8d8d4 100%);
  display: block;
  padding-bottom: 140%;
}
@supports (aspect-ratio: 1) {
  .book-card__cover { padding-bottom: 0; aspect-ratio: 10/14; }
}
.book-card__cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .4s var(--ease);
}
@supports (aspect-ratio: 1) {
  .book-card__cover img { position: static; height: 100%; }
}
.book-card:hover .book-card__cover img { transform: scale(1.06); }

/* Category badge on cover */
.book-card__cat-badge {
  position: absolute; bottom: 10px; right: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .72rem; font-weight: var(--fw-black); z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* Cover overlay on hover */
.book-card__cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,31,53,.6) 0%, transparent 50%);
  opacity: 0; transition: opacity var(--t); z-index: 1;
}
.book-card:hover .book-card__cover::after { opacity: 1; }

/* No cover fallback */
.book-card__no-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: var(--text-3); padding: 20px; text-align: center; font-size: .8rem;
}

/* Body */
.book-card__body {
  padding: 14px 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 5px;
}
.book-card__title {
  font-size: .9rem; font-weight: var(--fw-bold); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card__title a { color: var(--text); transition: color var(--t); }
.book-card__title a:hover { color: var(--c-navy-mid); }
.book-card__author { font-size: .78rem; color: var(--text-3); }
.book-card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.book-card__views { font-size: .74rem; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.book-card__btn {
  background: var(--c-navy); color: #fff; padding: 5px 12px;
  border-radius: var(--r-pill); font-size: .76rem; font-weight: var(--fw-bold);
  transition: all var(--t);
}
.book-card__btn:hover { background: var(--accent); color: #fff; }

/* ── 13. Tabs ─────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.tab-btn {
  padding: 10px 18px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  font-size: .88rem; font-weight: var(--fw-bold); color: var(--text-2);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all var(--t);
}
.tab-btn:hover { color: var(--c-navy); background: rgba(26,58,92,.05); }
.tab-btn.is-active { color: var(--primary); border-bottom-color: var(--accent); background: var(--surface); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel__footer { margin-top: 24px; text-align: center; }

/* ── 14. Featured Grid ────────────────────────────────────── */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.featured-card {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-card); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow var(--t);
  border: 1px solid var(--border);
}
.featured-card:hover { box-shadow: var(--shadow-xl); }
.featured-card__cover { height: 210px; overflow: hidden; }
.featured-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.featured-card:hover .featured-card__cover img { transform: scale(1.05); }
.featured-card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.featured-card__cat { font-size: .76rem; font-weight: var(--fw-black); color: var(--c-gold-dark); text-transform: uppercase; letter-spacing: .05em; }
.featured-card__title { font-size: 1.05rem; font-weight: var(--fw-black); line-height: 1.3; }
.featured-card__title a { color: var(--text); transition: color var(--t); }
.featured-card__title a:hover { color: var(--c-navy-mid); }
.featured-card__author { font-size: .84rem; color: var(--text-3); }
.featured-card__excerpt { font-size: .86rem; color: var(--text-2); line-height: 1.7; margin-top: auto; }

/* ── 15. Breadcrumbs ──────────────────────────────────────── */
.breadcrumbs {
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  padding: 11px 0; font-size: .82rem; color: var(--text-3);
}
.breadcrumbs .container { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--c-navy-light); transition: color var(--t); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--border-strong); }
.breadcrumbs .current { color: var(--text-2); font-weight: var(--fw-mid); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 16. Reading Progress ─────────────────────────────────── */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  width: 0; transition: width .1s linear; transform-origin: left;
}

/* ── 17. Book Hero (Single) ───────────────────────────────── */
.book-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: clamp(36px, 5vw, 64px) 0;
}
.book-hero__inner {
  display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start;
}
.book-hero__cover-wrap {}
.book-hero__cover { position: relative; }
.book-hero__img {
  width: 100%; border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,.05);
  display: block;
}
.book-hero__no-img {
  aspect-ratio: 3/4.2; background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-radius: var(--r-xl); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; color: var(--text-3);
}
.book-hero__badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.book-hero__title {
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: var(--fw-black); line-height: 1.2; color: var(--primary-dark); margin-bottom: 12px;
}
.book-hero__author {
  display: flex; align-items: center; gap: 8px;
  font-size: .94rem; color: var(--text-2); margin-bottom: 14px; font-weight: var(--fw-mid);
}
.book-hero__rating { margin-bottom: 12px; }

/* Stats Bar */
.book-stats-bar {
  display: flex; gap: 0; flex-wrap: wrap;
  background: var(--bg); border-radius: var(--r-lg);
  padding: 12px 16px; margin-bottom: 20px; gap: 16px;
}
.book-stat-item { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-2); }

/* Summary */
.book-hero__summary { color: var(--text-2); font-size: .93rem; line-height: 1.85; margin-bottom: 20px; }

/* Meta Table */
.book-meta-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: .86rem; border-radius: var(--r-lg); overflow: hidden; }
.book-meta-table th, .book-meta-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: right; }
.book-meta-table th { background: var(--bg); color: var(--text-2); font-weight: var(--fw-bold); width: 42%; }
.book-meta-table td { color: var(--text); }
.book-meta-table tr:last-child th, .book-meta-table tr:last-child td { border-bottom: none; }

/* Actions */
.book-hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Mobile CTA */
.mobile-dl-cta {
  display: none; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff; padding: 13px 16px;
  border-radius: var(--r-pill); font-weight: var(--fw-black); font-size: .9rem;
  text-decoration: none; transition: all var(--t);
}
.mobile-dl-cta:hover { box-shadow: var(--shadow-gold); transform: translateY(-1px); }

/* Content Layout */
.book-content-wrap { background: var(--bg); padding: clamp(28px, 4vw, 52px) 0; }
.book-content-inner { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.book-main { display: flex; flex-direction: column; gap: 28px; }

/* Sections */
.book-section {
  background: var(--surface); border-radius: var(--r-xl);
  padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}
.book-section__title {
  font-size: 1.1rem; font-weight: var(--fw-black); color: var(--c-navy);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-alt);
  display: flex; align-items: center; gap: 8px;
}

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--t);
}
.faq-item:has(.faq-question[aria-expanded="true"]) { border-color: var(--c-navy-light); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; font-weight: var(--fw-bold); font-size: .92rem;
  text-align: right; color: var(--text); background: var(--surface); transition: all var(--t);
}
.faq-question:hover, .faq-question[aria-expanded="true"] { background: var(--bg); color: var(--c-navy); }
.faq-icon { flex-shrink: 0; transition: transform var(--t); color: var(--text-3); }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(180deg); color: var(--c-navy); }
.faq-answer { padding: 14px 18px; background: var(--bg); border-top: 1px solid var(--border); }
.faq-answer[hidden] { display: none; }
.faq-answer p { font-size: .9rem; color: var(--text-2); line-height: 1.85; }

/* Sidebar */
.book-sidebar { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - 90px); overflow-y: auto; }
.sidebar-widget {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 20px; box-shadow: var(--shadow-xs); border: 1px solid var(--border);
}
.widget-title {
  font-size: .94rem; font-weight: var(--fw-black); color: var(--c-navy);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--bg-alt);
}
.widget-title span { border-bottom: 3px solid var(--c-gold); padding-bottom: 10px; }
.books-list-small { display: flex; flex-direction: column; gap: 12px; }
.books-list-small__link {
  display: flex; align-items: center; gap: 10px; color: var(--text); transition: color var(--t);
}
.books-list-small__link:hover { color: var(--c-navy-mid); }
.books-list-small__link img { width: 44px; height: 60px; object-fit: cover; border-radius: var(--r-xs); flex-shrink: 0; }
.books-list-small__title { display: block; font-size: .84rem; font-weight: var(--fw-bold); line-height: 1.4; }
.books-list-small__views { display: block; font-size: .74rem; color: var(--text-3); margin-top: 2px; }
.sidebar-widget__more-link {
  display: block; margin-top: 14px; font-size: .84rem; font-weight: var(--fw-bold);
  color: var(--c-navy-light); text-align: center; padding: 8px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm); transition: all var(--t);
}
.sidebar-widget__more-link:hover { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }

/* Content area */
.book-content { line-height: 1.9; font-size: .96rem; color: var(--text); }
.book-content p { margin-bottom: 1em; }
.book-content h2, .book-content h3 { color: var(--c-navy); margin: 1.5em 0 .5em; }
.book-content a { color: var(--c-navy-light); text-decoration: underline; }

/* Related books */
.related-books { background: var(--bg-alt); }
.books-scroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px,1fr)); gap: 16px; }

/* ── 18. Archive Page ─────────────────────────────────────── */
.archive-hero {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(124,58,237,.15) 0%, transparent 50%),
    linear-gradient(135deg, var(--c-navy) 0%, var(--c-navy-mid) 60%, var(--c-navy-light) 100%);
  color: #fff; padding: clamp(40px, 6vw, 72px) 0; position: relative; overflow: hidden;
}
.archive-hero__pretitle { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; opacity: .6; margin-bottom: 8px; }
.archive-hero__title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: var(--fw-black); line-height: 1.15; margin-bottom: 10px; }
.archive-hero__title em { color: var(--c-gold-light); font-style: normal; }
.archive-hero__desc { opacity: .82; font-size: .96rem; max-width: 580px; margin-bottom: 16px; }
.archive-hero__meta { display: flex; gap: 12px; flex-wrap: wrap; }
.archive-hero__pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  padding: 6px 14px; border-radius: var(--r-pill); font-size: .82rem;
}

/* Toolbar */
.books-toolbar {
  background: var(--glass); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 10px 0; position: sticky; top: 68px; z-index: 100;
  transition: all var(--t);
}
.books-toolbar.is-scrolled { background: rgba(255,255,255,.97); border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.books-toolbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.books-toolbar__count { font-size: .86rem; color: var(--text-3); white-space: nowrap; }
.books-toolbar__right { display: flex; align-items: center; gap: 10px; }

/* Sort */
.sort-wrap { display: flex; align-items: center; gap: 8px; }
.sort-wrap__label { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--text-2); white-space: nowrap; }
.sort-select {
  border: 1.5px solid var(--border-strong); border-radius: var(--r-pill);
  padding: 7px 28px 7px 12px; font-size: .82rem; font-family: var(--font);
  background: var(--surface); color: var(--text); cursor: pointer; outline: none;
  transition: all var(--t); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 10px center;
}
.sort-select:focus { border-color: var(--c-navy-light); box-shadow: 0 0 0 3px rgba(45,90,138,.1); }

/* View Toggle */
.view-toggle { display: flex; border: 1.5px solid var(--border-strong); border-radius: var(--r-pill); overflow: hidden; }
.view-toggle-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--text-3); background: transparent; transition: all var(--t); cursor: pointer; }
.view-toggle-btn:first-child { border-left: 1px solid var(--border-strong); }
.view-toggle-btn.is-active { background: var(--c-navy); color: #fff; }
.view-toggle-btn:hover:not(.is-active) { background: var(--bg); }

/* Archive layout */
.archive-section { padding-top: clamp(24px, 3vw, 40px); }
.archive-layout { display: grid; grid-template-columns: 1fr 272px; gap: 32px; align-items: start; }

/* List view */
.books-list-view { display: flex; flex-direction: column; gap: 14px; }
.books-list-view .book-card { flex-direction: row; max-height: none; min-height: 140px; }
.books-list-view .book-card__cover { width: 100px; min-width: 100px; flex-shrink: 0; padding-bottom: 0; }
@supports (aspect-ratio: 1) { .books-list-view .book-card__cover { aspect-ratio: auto; } }
.books-list-view .book-card__cover::after { display: none; }
.books-list-view .book-card__cover img { position: absolute; inset: 0; height: 100%; }
@supports (aspect-ratio: 1) { .books-list-view .book-card__cover img { position: static; } }
.books-list-view .book-card__body { flex: 1; padding: 16px; justify-content: center; }
.books-list-view .book-card__title { font-size: .96rem; -webkit-line-clamp: 2; }
.books-list-view .book-card__cat-badge { display: none; }

/* Filter Chips */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 14px; border-radius: var(--r-pill); font-size: .8rem; font-weight: var(--fw-bold);
  border: 1.5px solid var(--border-strong); color: var(--text-2); background: var(--surface);
  transition: all var(--t); cursor: pointer; text-decoration: none;
}
.filter-chip:hover, .filter-chip.is-active { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
.filter-chip--clear { border-color: var(--error); color: var(--error); }
.filter-chip--clear:hover { background: var(--error); color: #fff; border-color: var(--error); }

/* Cat List */
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-list li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: .86rem; color: var(--text-2); transition: all var(--t);
}
.cat-list li a:hover, .cat-list li.current-cat > a { background: var(--c-navy); color: #fff; }
.cat-list__count {
  font-size: .74rem; background: var(--bg-alt);
  padding: 2px 8px; border-radius: var(--r-pill); min-width: 24px; text-align: center;
}
.cat-list li a:hover .cat-list__count { background: rgba(255,255,255,.2); }

/* Load More */
.load-more-wrap { margin-top: clamp(24px, 4vw, 40px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn--load-more {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--c-navy-mid);
  border: 2px solid var(--c-navy-mid); border-radius: var(--r-pill);
  padding: 12px 32px; font-size: .94rem; font-weight: var(--fw-bold); font-family: var(--font);
  cursor: pointer; transition: all var(--t); position: relative; overflow: hidden;
}
.btn--load-more:hover { background: var(--c-navy); color: #fff; border-color: var(--c-navy); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--load-more::after { content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); transform: skewX(-20deg); transition: left .5s; }
.btn--load-more:hover::after { left: 160%; }
.load-more-spinner { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--text-3); }
.spinner-ring { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--c-navy-mid); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-more-progress { font-size: .8rem; color: var(--text-3); }

/* Archive Sidebar */
.archive-sidebar { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 130px); overflow-y: auto; }

/* ── 19. Search Page ──────────────────────────────────────── */
.search-hero {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(124,58,237,.15) 0%, transparent 50%),
    linear-gradient(135deg, var(--c-navy) 0%, var(--c-navy-mid) 100%);
  color: #fff; padding: clamp(40px, 6vw, 64px) 0;
}
.search-hero__inner { display: flex; flex-direction: column; gap: 22px; }
.search-hero__title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: var(--fw-black); }
.search-hero__term { color: var(--c-gold-light); font-style: normal; }
.search-hero__count { opacity: .7; font-size: .88rem; margin-top: 4px; }
.search-form-lg__wrap {
  display: flex; align-items: stretch; max-width: 620px;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.22);
  border-radius: var(--r-xl); overflow: hidden; backdrop-filter: blur(12px);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-form-lg__wrap:focus-within { border-color: rgba(255,255,255,.4); box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.search-form-lg__icon { flex-shrink: 0; margin: auto 14px; color: rgba(255,255,255,.55); }
.search-form-lg__input { flex: 1; padding: 15px 8px; background: transparent; border: none; outline: none; color: #fff; font-size: .96rem; font-family: var(--font); }
.search-form-lg__input::placeholder { color: rgba(255,255,255,.45); }
.search-form-lg__btn { padding: 12px 24px; background: linear-gradient(135deg, var(--c-gold) 0%, var(--c-gold-light) 100%); color: var(--c-navy); font-weight: var(--fw-black); font-size: .9rem; border: none; cursor: pointer; font-family: var(--font); white-space: nowrap; transition: background var(--t); }
.search-form-lg__btn:hover { background: var(--c-gold-dark); color: #fff; }
.search-cat-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.search-cat-filter__label { font-size: .82rem; color: rgba(255,255,255,.65); }
.recent-searches { background: var(--surface); border-radius: 0 0 var(--r-xl) var(--r-xl); border: 1.5px solid rgba(255,255,255,.22); border-top: none; max-width: 620px; overflow: hidden; }
.recent-searches__item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; color: var(--text); font-size: .88rem; transition: background var(--t); }
.recent-searches__item:hover { background: var(--bg-alt); }
.no-results__suggestions { margin-top: 24px; }
.no-results__suggestions > p { margin-bottom: 12px; font-size: .88rem; color: var(--text-3); }

/* ── 20. 404 Page ─────────────────────────────────────────── */
.error-404__inner { text-align: center; padding: clamp(48px, 8vw, 96px) 0; }
.error-404__animation { margin-bottom: 20px; display: inline-block; }
.error-404__book { font-size: 5rem; display: block; animation: float 3s ease-in-out infinite; }
.error-404__code { font-size: 5.5rem; font-weight: var(--fw-black); color: var(--c-navy); line-height: 1; opacity: .1; margin-bottom: 0; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.error-404__title { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--c-navy); margin-bottom: 12px; }
.error-404__text { color: var(--text-3); margin-bottom: 24px; }
.error-404__search { max-width: 500px; margin: 0 auto 28px; }
.error-404__search .search-form-lg__wrap { background: var(--surface); border-color: var(--border-strong); }
.error-404__search .search-form-lg__icon { color: var(--text-3); }
.error-404__search .search-form-lg__input { color: var(--text); }
.error-404__search .search-form-lg__input::placeholder { color: var(--text-3); }
.error-404__actions { margin-bottom: 44px; display: flex; gap: 12px; justify-content: center; }
.error-404__suggestions > p { font-size: .88rem; color: var(--text-3); margin-bottom: 16px; }

/* ── 21. Footer ───────────────────────────────────────────── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.8);
  padding-top: 60px;
}
.site-footer::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 80% 0%, rgba(124,58,237,.08) 0%, transparent 60%);
}
.footer__top { padding: clamp(48px, 7vw, 80px) 0; position: relative; z-index: 1; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
.footer__logo-text { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: var(--fw-black); color: var(--accent-light); margin-bottom: 14px; text-decoration: none; }
.footer__about-text { font-size: .86rem; color: rgba(255,255,255,.6); line-height: 1.85; margin-bottom: 20px; }
.footer__social { display: flex; gap: 10px; }
.footer__social-link { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.08); color: rgba(255,255,255,.6); transition: all var(--t); border: 1px solid rgba(255,255,255,.1); }
.footer__social-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.footer__col .widget-title span { color: rgba(255,255,255,.9); border-bottom-color: var(--c-gold); }
.footer__cats { display: flex; flex-direction: column; gap: 4px; }
.footer__cats li a { font-size: .86rem; color: rgba(255,255,255,.6); display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06); transition: color var(--t); }
.footer__cats li a:hover { color: var(--accent-light); }
.footer__cats li a span { color: rgba(255,255,255,.35); font-size: .76rem; }
.footer__recent { display: flex; flex-direction: column; gap: 12px; }
.footer__recent li a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.6); font-size: .84rem; transition: color var(--t); }
.footer__recent li a:hover { color: var(--accent-light); }
.footer__recent img { width: 40px; height: 54px; object-fit: cover; border-radius: var(--r-xs); flex-shrink: 0; }
.footer__widget-text { font-size: .86rem; color: rgba(255,255,255,.6); line-height: 1.85; margin-bottom: 14px; }
.footer__bottom { background: rgba(0,0,0,.25); padding: 16px 0; border-top: 1px solid rgba(255,255,255,.07); position: relative; z-index: 1; }
.footer__bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer__copy { font-size: .8rem; color: rgba(255,255,255,.45); }
.footer__nav-menu { display: flex; gap: 16px; flex-wrap: wrap; }
.footer__nav-menu li a { font-size: .8rem; color: rgba(255,255,255,.45); transition: color var(--t); }
.footer__nav-menu li a:hover { color: var(--accent-light); }

/* ── 22. Back to Top ──────────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 28px; left: 28px; z-index: 400;
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); transition: all var(--t); border: none;
}
.back-to-top:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }
.back-to-top[hidden] { display: none; }

/* ── 23. Toast ────────────────────────────────────────────── */
.kutub-toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: var(--primary-dark); color: #fff; padding: 12px 24px;
  border-radius: var(--r-pill); box-shadow: var(--shadow-xl);
  font-size: .87rem; font-weight: var(--fw-bold); z-index: 9000;
  opacity: 0; transition: all var(--t); white-space: nowrap; pointer-events: none;
}
.kutub-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.kutub-toast--success { background: var(--success); }
.kutub-toast--error   { background: var(--error); }

/* ── 24. Stars ────────────────────────────────────────────── */
.star-rating { display: flex; align-items: center; gap: 3px; }
.star { font-size: 1.05rem; line-height: 1; }
.star--full  { color: var(--c-gold); }
.star--half  { color: var(--c-gold); opacity: .55; }
.star--empty { color: var(--border-strong); }
.star-rating__count { font-size: .78rem; color: var(--text-3); margin-right: 4px; }

/* ── 25. Scroll Reveal ────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ── 26. Skeleton Loader ──────────────────────────────────── */
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
.book-card--skeleton .book-card__cover {
  background: linear-gradient(90deg, #f0ede8 25%, #e8e5e0 50%, #f0ede8 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.book-card--skeleton .book-card__title,
.book-card--skeleton .book-card__author { background: linear-gradient(90deg, #f0ede8 25%, #e8e5e0 50%, #f0ede8 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; color: transparent; }

/* ── 27. WordPress Classes ────────────────────────────────── */
.alignnone  { margin: 5px 20px 20px 0; }
.aligncenter { display: block; margin: 0 auto 20px; }
.alignright  { float: left;  margin: 5px 0 20px 20px; }
.alignleft   { float: right; margin: 5px 20px 20px 0; }
.wp-caption  { max-width: 100%; background: var(--bg-alt); border: 1px solid var(--border); padding: 8px; border-radius: var(--r-sm); }
.wp-caption-text { text-align: center; font-size: .8rem; color: var(--text-3); margin-top: 4px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 8px; }
.gallery-item img { width: 100%; height: auto; border-radius: var(--r-sm); }
.entry-content > * + * { margin-top: 1em; }
.entry-content img { max-width: 100%; border-radius: var(--r-sm); }
.entry-content a { color: var(--c-navy-light); text-decoration: underline; }

/* ── 28. Comments ─────────────────────────────────────────── */
.comments-area { margin-top: 8px; }
.comments-title, .comment-reply-title { font-size: 1.1rem; font-weight: var(--fw-black); color: var(--c-navy); margin-bottom: 20px; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-author img { border-radius: 50%; width: 48px; height: 48px; }
.comment-meta { font-size: .8rem; color: var(--text-3); margin-bottom: 8px; }
.comment-content p { font-size: .9rem; line-height: 1.8; }
.comment-respond { margin-top: 24px; }
.comment-form label { display: block; font-weight: var(--fw-bold); margin-bottom: 4px; font-size: .86rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm); font-family: var(--font); font-size: .9rem;
  outline: none; background: var(--surface); color: var(--text); transition: all var(--t);
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--c-navy-light); box-shadow: 0 0 0 3px rgba(45,90,138,.1); }
.comment-form textarea { height: 120px; resize: vertical; }
.comment-form .submit { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 10px 26px; border-radius: var(--r-pill); font-weight: var(--fw-bold); font-size: .9rem; border: none; cursor: pointer; transition: all var(--t); font-family: var(--font); }
.comment-form .submit:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ── 29. No Results ───────────────────────────────────────── */
.no-results { text-align: center; padding: clamp(48px, 8vw, 96px) 24px; }
.no-results__icon { font-size: 4rem; margin-bottom: 16px; }
.no-results__title { font-size: 1.5rem; color: var(--c-navy); margin-bottom: 12px; font-weight: var(--fw-black); }
.no-results__text { color: var(--text-3); margin-bottom: 24px; max-width: 480px; margin-inline: auto; }

/* ── 30. Page & Widget ────────────────────────────────────── */
.page-inner { display: grid; grid-template-columns: 1fr 272px; gap: 32px; align-items: start; }
.page-article { background: var(--surface); border-radius: var(--r-xl); padding: clamp(24px,4vw,40px); box-shadow: var(--shadow-xs); border: 1px solid var(--border); }
.page-article__title { font-size: clamp(1.5rem, 4vw, 2rem); color: var(--c-navy); margin-bottom: 24px; }
.page-article__content { line-height: 1.9; }
.page-article__content p { margin-bottom: 1em; }
.widget { background: var(--surface); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow-xs); margin-bottom: 16px; border: 1px solid var(--border); }

/* ── 31. Pagination ───────────────────────────────────────── */
.pagination, .nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: clamp(32px,4vw,48px); justify-content: center; }
.pagination .page-numbers, .nav-links .page-numbers { min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--surface); border: 1.5px solid var(--border); font-size: .86rem; font-weight: var(--fw-bold); color: var(--text-2); transition: all var(--t); }
.pagination .page-numbers:hover, .pagination .page-numbers.current, .nav-links .page-numbers:hover, .nav-links .page-numbers.current { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }
.pagination .prev, .pagination .next, .nav-links .prev, .nav-links .next { padding: 0 16px; }

/* ── 32. Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero__inner        { grid-template-columns: 1fr; }
  .hero__deco         { display: none; }
  .footer__grid       { grid-template-columns: 1fr 1fr; }
  .book-content-inner { grid-template-columns: 1fr; }
  .book-sidebar       { position: static; max-height: none; }
  .archive-layout     { grid-template-columns: 1fr 250px; gap: 24px; }
}
@media (max-width: 860px) {
  .archive-layout  { grid-template-columns: 1fr; }
  .archive-sidebar { display: none; }
  .page-inner      { grid-template-columns: 1fr; }
  .book-hero__inner { grid-template-columns: 1fr; }
  .book-hero__cover-wrap { max-width: 220px; }
}
@media (max-width: 768px) {
  .header__nav { display: none; position: fixed; inset: 0; top: 0; background: rgba(13,31,53,.97); backdrop-filter: blur(16px); z-index: 999; padding: 80px 24px 24px; flex-direction: column; overflow-y: auto; }
  .header__nav.is-open { display: flex; }
  .nav-menu { flex-direction: column; gap: 4px; }
  .nav-menu li a { color: rgba(255,255,255,.8); font-size: 1.1rem; padding: 12px 16px; }
  .nav-menu li a:hover { background: rgba(255,255,255,.1); color: #fff; }
  .header__menu-toggle { display: flex; position: relative; z-index: 1001; }
  .header__menu-toggle.is-open .burger:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .header__menu-toggle.is-open .burger:nth-child(2) { opacity: 0; }
  .header__menu-toggle.is-open .burger:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom-inner { flex-direction: column; text-align: center; }
  .books-grid--4 { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
  .hero__stats  { gap: 20px; }
  .cats-grid    { grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); }
  .mobile-dl-cta { display: flex; }
  .book-hero__actions .btn--lg { flex: 1; justify-content: center; }
  .books-toolbar { top: 0; }
  .books-list-view .book-card { flex-direction: column; max-height: none; }
  .books-list-view .book-card__cover { width: 100%; }
  .books-scroll { grid-template-columns: repeat(2,1fr); }
  .topbar { display: none; }
}
@media (max-width: 480px) {
  .books-grid--4  { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .books-grid--6  { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .cats-grid      { grid-template-columns: repeat(3,1fr); }
  .hero__search-wrap { flex-direction: column; border-radius: var(--r-lg); }
  .hero__search-input { padding: 14px 16px; }
  .hero__search-btn   { justify-content: center; padding: 13px 16px; }
  .back-to-top { left: 16px; bottom: 16px; width: 42px; height: 42px; }
  .sort-wrap__label { display: none; }
  .section-header { flex-direction: column; align-items: flex-start; }
}

/* ── 33. Print ────────────────────────────────────────────── */
@media print {
  .site-header, .topbar, .hero, .books-toolbar, .related-books, .site-footer, .back-to-top, .mobile-dl-cta, .book-hero__actions .btn--outline { display: none !important; }
  body { background: #fff; color: #000; }
  .book-meta-table { border: 1px solid #ccc; }
}
