/*
 * VetBooksy — assets/css/main.css
 * Loaded via wp_enqueue_style() in functions.php.
 * Font stack: Inter, system-ui, sans-serif
 *
 * Table of Contents
 * ─────────────────────────────────────────────
 *  0.  Design Tokens
 *  1.  Reset & Base
 *  2.  Typography
 *  3.  Skip Link & Accessibility
 *  4.  Site Wrapper & Two-Column Layout
 *  5.  Container
 *  6.  Site Header (sticky wrapper)
 *  7.  Row 1 — Topbar
 *  8.  Hamburger Button
 *  9.  Mobile Search Bar
 * 10.  Row 2 — Desktop Navigation
 * 11.  Row 3 — Desktop Search Bar
 * 12.  Site Logo
 * 13.  Auth Links
 * 14.  Premium Button
 * 15.  Mobile Search Toggle
 * 16.  Mobile Drawer Overlay
 * 17.  Mobile Drawer Panel
 * 18.  Search Form (shared)
 * 19.  Breadcrumbs
 * 20.  Archive Header Block
 * 21.  Filter Bar
 * 22.  Book Cards Grid
 * 23.  Single Book Page
 * 24.  Zoom Modal
 * 25.  Sidebar & Widgets
 * 26.  Sidebar Book Items
 * 27.  Sidebar Category List
 * 28.  Pagination
 * 29.  No-Results State
 * 30.  Stats Bar
 * 31.  Category Chip Rail
 * 32.  Site Footer
 * 33.  Buttons
 * 34.  WordPress Core Compatibility
 * 35.  Utilities
 * 36.  Responsive
 */

/* ═══════════════════════════════════════════
   0.  DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  /* Brand */
  --navy:        #2b3f66;
  --navy-mid:    #3a5080;
  --teal:        #4fb6b2;
  --teal-dark:   #3a9a96;
  --teal-pale:   #e8f6f5;

  /* Neutrals */
  --white:       #ffffff;
  --bg:          #ffffff;
  --bg-soft:     #f8fafc;
  --bg-mid:      #f1f5f9;
  --text:        #1e293b;
  --muted:       #64748b;
  --light:       #94a3b8;
  --border:      #e5e7eb;
  --border-mid:  #d1d5db;

  /* Typography */
  --font:        'Inter', system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, sans-serif;
  --serif:       'Playfair Display', Georgia, 'Times New Roman', serif;

  /* Font sizes */
  --sz-xs:   11px;
  --sz-sm:   13px;
  --sz-base: 15px;
  --sz-md:   16px;
  --sz-lg:   18px;
  --sz-xl:   22px;
  --sz-2xl:  28px;
  --sz-3xl:  36px;

  /* Spacing scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --s12: 48px; --s16: 64px;

  /* Radii */
  --r-sm:   6px;
  --r:      8px;
  --r-md:   10px;
  --r-pill: 100px;

  /* Shadows */
  --sh-sm: 0 1px 3px rgba(30,46,80,.08), 0 1px 2px rgba(30,46,80,.05);
  --sh-md: 0 4px 12px rgba(30,46,80,.10), 0 2px 6px rgba(30,46,80,.06);
  --sh-lg: 0 10px 30px rgba(30,46,80,.14), 0 4px 10px rgba(30,46,80,.08);
  --sh-xl: 0 20px 50px rgba(30,46,80,.18);

  /* Layout */
  --container:    1200px;
  --sidebar-w:    280px;
  --gap:          20px;

  /* Header heights – used by JS for sidebar scroll offset */
  --h-topbar:  62px;
  --h-nav:     48px;
  --h-search:  58px;
  --h-total:   168px; /* sum, mobile overrides below */
}

/* ═══════════════════════════════════════════
   1.  RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--sz-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:focus-visible {
  outline: 2.5px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
p { margin-bottom: var(--s4); }
p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════
   2.  TYPOGRAPHY
═══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: clamp(22px, 4vw, var(--sz-3xl)); }
h2 { font-size: clamp(19px, 3vw, var(--sz-2xl)); }
h3 { font-size: clamp(16px, 2.5vw, var(--sz-xl)); }
h4 { font-size: var(--sz-lg); }
h5 { font-size: var(--sz-md); font-family: var(--font); font-weight: 600; }

/* ═══════════════════════════════════════════
   3.  SKIP LINK & ACCESSIBILITY
═══════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--s4);
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  font-size: var(--sz-sm);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 0 0 var(--r) var(--r);
  transition: top .18s ease;
}
.skip-link:focus { top: 0; }
/* Site-main receives focus from skip link */
#site-main-wrap:focus { outline: none; }

/* ═══════════════════════════════════════════
   4.  SITE WRAPPER & TWO-COLUMN LAYOUT
═══════════════════════════════════════════ */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-main { flex: 1; }

.layout {
  display: flex;
  align-items: flex-start;
  gap: var(--s8);
  padding-top: var(--s8);
  padding-bottom: var(--s16);
}
.layout__content { flex: 1; min-width: 0; }
.layout__content--full { flex: 1; }
.layout__sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  align-self: flex-start;
  will-change: transform;
}

/* ═══════════════════════════════════════════
   5.  CONTAINER
═══════════════════════════════════════════ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s8);
}

/* ═══════════════════════════════════════════
   6.  SITE HEADER
═══════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
}

/* ═══════════════════════════════════════════
   7.  ROW 1 — TOPBAR
═══════════════════════════════════════════ */
.header-topbar {
  height: var(--h-topbar);
  background: var(--navy);
  box-shadow: 0 2px 16px rgba(0,0,0,.22);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 160px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 160px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   8.  HAMBURGER BUTTON  (hidden on desktop)
═══════════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px; height: 40px;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: var(--r-sm);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.hamburger:hover { background: rgba(255,255,255,.10); }

.ham-bar {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transform-origin: center;
  transition: transform .24s ease, opacity .2s ease, width .2s ease;
}

.hamburger.is-open .ham-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open .ham-bar:nth-child(2) { opacity: 0; width: 0; }
.hamburger.is-open .ham-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════
   9.  MOBILE SEARCH BAR  (hidden on desktop)
═══════════════════════════════════════════ */
.mobile-search-bar {
  display: none;
  background: var(--navy);
  overflow: hidden;
  max-height: 0;
  transition: max-height .26s ease, padding .26s ease;
}
.mobile-search-bar.is-open {
  max-height: 80px;
  padding-top: var(--s3);
  padding-bottom: var(--s3);
}
.mobile-search-bar__inner { width: 100%; }

/* Override search form colours for dark background */
.mobile-search-bar .search-form__inner {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}
.mobile-search-bar .search-form__inner:focus-within {
  border-color: var(--teal);
  background: rgba(255,255,255,.15);
}
.mobile-search-bar .search-form__input   { color: #fff; }
.mobile-search-bar .search-form__input::placeholder { color: rgba(255,255,255,.45); }
.mobile-search-bar .search-form__icon   { color: rgba(255,255,255,.50); }

/* ═══════════════════════════════════════════
   10. ROW 2 — DESKTOP NAVIGATION
═══════════════════════════════════════════ */
.header-nav-bar {
  height: var(--h-nav);
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.header-nav-bar .container { height: 100%; }

.primary-nav { height: 100%; display: flex; align-items: center; }

.primary-nav__list {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
}

.primary-nav__item {
  display: flex;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 17px;
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
  transition: color .18s;
}

/* Teal underline indicator */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2.5px;
  background: var(--teal);
  border-radius: 2px 2px 0 0;
  transition: left .22s ease, right .22s ease;
}

.nav-link:hover,
.nav-link.is-active,
.primary-nav__item.current-menu-item > .nav-link,
.primary-nav__item.current_page_item > .nav-link,
.primary-nav__item.current-menu-ancestor > .nav-link {
  color: var(--navy);
  font-weight: 600;
}
.nav-link:hover::after,
.nav-link.is-active::after,
.primary-nav__item.current-menu-item > .nav-link::after,
.primary-nav__item.current_page_item > .nav-link::after,
.primary-nav__item.current-menu-ancestor > .nav-link::after {
  left: 12px; right: 12px;
}

.nav-link--more {
  margin-left: auto;
  color: var(--teal-dark);
  font-weight: 600;
}
.nav-link--more:hover { color: var(--navy); }

/* ═══════════════════════════════════════════
   11. ROW 3 — DESKTOP SEARCH BAR
═══════════════════════════════════════════ */
.header-search-row {
  height: var(--h-search);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.header-search-wrap {
  max-width: 100%;
  margin: 0;
  width: 100%;
}

/* ═══════════════════════════════════════════
   12. SITE LOGO
═══════════════════════════════════════════ */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--teal);
  border-radius: var(--r);
  font-size: 16px;
  flex-shrink: 0;
}
.site-logo__wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
  white-space: nowrap;
}
.site-logo__wordmark strong { color: var(--teal); font-weight: 700; }

/* Custom logo image */
.site-logo .custom-logo-link {
  display: flex;
  align-items: center;
  line-height: 0;
}
.site-logo .custom-logo {
  max-height: 44px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
/* Hide text wordmark when custom logo image is set */
.site-logo .custom-logo-link ~ .site-logo__wordmark { display: none; }

/* Footer logo */
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
}
.footer-logo__icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--teal);
  border-radius: var(--r-sm);
  font-size: 14px; flex-shrink: 0;
}
.footer-logo__wordmark {
  font-family: var(--serif);
  font-size: 19px; font-weight: 700;
  color: var(--navy);
}
.footer-logo__wordmark strong { color: var(--teal); }

/* Drawer logo */
.drawer-logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none;
}
.drawer-logo__mark {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--teal);
  border-radius: var(--r-sm);
  font-size: 14px;
}
.drawer-logo__wordmark {
  font-family: var(--serif);
  font-size: 18px; font-weight: 700;
  color: #fff;
}
.drawer-logo__wordmark strong { color: var(--teal); }

/* ═══════════════════════════════════════════
   13. AUTH LINKS  (desktop topbar)
═══════════════════════════════════════════ */
.auth-links {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.auth-link {
  font-size: var(--sz-sm);
  font-weight: 500;
  color: rgba(255,255,255,.70);
  transition: color .15s;
}
.auth-link:hover { color: #fff; }
.auth-divider { color: rgba(255,255,255,.25); font-size: var(--sz-xs); }

/* ═══════════════════════════════════════════
   14. PREMIUM BUTTON  (desktop topbar)
═══════════════════════════════════════════ */
.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 7px 20px;
  font-size: var(--sz-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79,182,178,.40);
  transition: transform .18s, box-shadow .18s;
}
.btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79,182,178,.50);
  color: #fff;
}
.btn-premium svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════
   15. MOBILE SEARCH TOGGLE  (hidden desktop)
═══════════════════════════════════════════ */
.mobile-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.75);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}
.mobile-search-toggle:hover,
.mobile-search-toggle.is-active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* ═══════════════════════════════════════════
   16. MOBILE DRAWER OVERLAY
═══════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ═══════════════════════════════════════════
   17. MOBILE DRAWER PANEL
═══════════════════════════════════════════ */
.sidebar-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 300px;
  max-width: 88vw;
  background: var(--white);
  z-index: 700;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 28px rgba(30,46,80,.20);
  will-change: transform;
}
.sidebar-drawer.is-open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  background: var(--navy);
  flex-shrink: 0;
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: rgba(255,255,255,.10);
  border: none;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.70);
  transition: background .15s, color .15s;
}
.drawer-close:hover { background: rgba(255,255,255,.20); color: #fff; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s3) 0 var(--s4);
}

.drawer-section-label {
  padding: var(--s3) var(--s5) var(--s2);
  font-size: var(--sz-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--light);
}

.drawer-nav__list { list-style: none; }

.drawer-link {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 12px var(--s5);
  font-size: var(--sz-base);
  font-weight: 500;
  color: var(--text);
  border-left: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.drawer-link:hover {
  background: var(--bg-soft);
  border-left-color: var(--teal);
  color: var(--navy);
}
.drawer-link--active {
  background: var(--teal-pale);
  border-left-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 600;
}
.drawer-link--premium { color: var(--teal-dark); font-weight: 600; }
.drawer-link--premium:hover { background: var(--teal-pale); border-left-color: var(--teal); }

.drawer-link__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
  font-size: 15px;
  color: var(--light);
}
.drawer-link__icon svg { stroke: currentColor; width: 16px; height: 16px; }

.drawer-divider {
  height: 1px;
  background: var(--border);
  margin: var(--s3) var(--s5);
}

/* ═══════════════════════════════════════════
   18. SEARCH FORM  (shared across all contexts)
═══════════════════════════════════════════ */
.search-form { width: 100%; }

.search-form__inner {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: var(--r-pill);
  padding: 5px 5px 5px 18px;
  box-shadow: var(--sh-sm);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search-form__inner:focus-within {
  border-color: var(--teal);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(79,182,178,.12), var(--sh-md);
}

.search-form__icon {
  font-size: 14px;
  color: var(--light);
  margin-right: var(--s2);
  flex-shrink: 0;
  line-height: 1;
}

.search-form__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  padding: 6px 0;
  min-width: 0;
}
.search-form__input::placeholder { color: #aab8cc; }

.search-form__btn {
  flex-shrink: 0;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 24px;
  font-size: var(--sz-sm);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s;
}
.search-form__btn:hover { background: var(--navy); }

/* ═══════════════════════════════════════════
   19. BREADCRUMBS
═══════════════════════════════════════════ */
.breadcrumbs-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.breadcrumbs__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  list-style: none;
  font-size: 12.5px;
}
.breadcrumbs__item a { color: var(--muted); transition: color .15s; }
.breadcrumbs__item a:hover { color: var(--teal-dark); }
.breadcrumbs__item--current span { color: var(--text); font-weight: 500; }
.breadcrumbs__sep { color: var(--border-mid); padding: 0 2px; }

/* ═══════════════════════════════════════════
   20. ARCHIVE HEADER BLOCK
═══════════════════════════════════════════ */
.archive-header {
  padding: var(--s8) 0 var(--s6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s6);
}
.archive-header__title {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.archive-header__title::before {
  content: '';
  display: block;
  width: 4px; height: 28px;
  background: var(--teal);
  border-radius: 2px;
  flex-shrink: 0;
}
.archive-header__desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 600px;
  margin-bottom: var(--s3);
}
.archive-header__count { font-size: var(--sz-sm); color: var(--muted); }
.archive-header__count strong { color: var(--text); }

/* ═══════════════════════════════════════════
   21. FILTER BAR
═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.filter-bar__count { font-size: var(--sz-sm); color: var(--muted); }
.filter-bar__sort  { display: flex; align-items: center; gap: var(--s2); }
.sort-select {
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--white);
  font-size: var(--sz-sm);
  font-family: var(--font);
  color: var(--text);
  padding: 5px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color .18s;
}
.sort-select:focus { border-color: var(--teal); }

/* ═══════════════════════════════════════════
   22. BOOK CARDS GRID
═══════════════════════════════════════════ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
  margin-bottom: var(--s8);
}

.book-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }

.book-card__cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  position: relative;
  overflow: hidden;
}
.book-card__img { width: 100%; height: 100%; object-fit: cover; }

/* Placeholder gradient fills */
.book-card__cover-noise {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg,
    rgba(255,255,255,.035) 0, rgba(255,255,255,.035) 1px,
    transparent 0, transparent 50%);
  background-size: 12px 12px;
}
.book-card__cover-ring {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 50%;
}
.book-card__cover-ring::after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 50%;
}
.book-card__cover-label {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  font-family: var(--serif);
  font-size: 8.5px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* Badges */
.book-card__badge {
  position: absolute;
  top: 8px; left: 8px;
  font-size: var(--sz-xs);
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  color: #fff;
}
.book-card__badge--new     { background: var(--teal); }
.book-card__badge--popular { background: var(--navy); }

/* Hover overlay */
.book-card__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.62);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  opacity: 0;
  transition: opacity .2s ease;
}
.book-card:hover .book-card__overlay { opacity: 1; }

.book-card__ov-btn {
  display: block;
  width: 112px;
  padding: 8px 0;
  text-align: center;
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  font-family: var(--font);
  text-decoration: none;
  transition: background .15s, transform .12s;
}
.book-card__ov-btn:hover { transform: scale(1.03); }
.book-card__ov-btn--view { background: var(--teal); color: #fff; }
.book-card__ov-btn--view:hover { background: var(--navy); color: #fff; }
.book-card__ov-btn--dl {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.42);
}
.book-card__ov-btn--dl:hover { background: var(--navy); border-color: var(--navy); }

/* Card body */
.book-card__info { padding: 10px 12px 12px; }
.book-card__title {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.book-card__title a { color: inherit; }
.book-card__title a:hover { color: var(--teal-dark); }
.book-card__meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.book-card__year { font-size: 11px; color: var(--light); font-weight: 500; }
.book-card__format {
  font-size: 9.5px; font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-pale);
  padding: 2px 6px;
  border-radius: var(--r-pill);
}

/* ═══════════════════════════════════════════
   23. SINGLE BOOK PAGE
═══════════════════════════════════════════ */
.book-single__cover-wrap {
  float: right;
  margin: 0 0 var(--s6) var(--s8);
  width: 190px;
}
.book-single__cover {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-lg);
  cursor: zoom-in;
  position: relative;
}
.book-single__cover img { width: 100%; height: 100%; object-fit: cover; }
.book-single__clearfix::after { content: ''; display: table; clear: both; }

.book-single__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-size: var(--sz-xs);
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  margin-bottom: var(--s3);
}

.book-single__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s4);
}
.book-single__meta-pill {
  font-size: var(--sz-xs);
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 3px 11px;
  border-radius: var(--r-pill);
}

.download-box {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s5) var(--s6);
  margin-top: var(--s6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  box-shadow: var(--sh-sm);
}
.download-box__info { font-size: var(--sz-sm); color: var(--muted); }
.download-box__info strong { color: var(--text); }
.download-box__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 11px 26px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(79,182,178,.38);
  transition: opacity .18s, transform .18s;
}
.download-box__btn:hover { opacity: .9; transform: translateY(-1px); color: #fff; }

/* ═══════════════════════════════════════════
   24. ZOOM MODAL
═══════════════════════════════════════════ */
.zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.zoom-modal.is-open { opacity: 1; pointer-events: all; }
.zoom-modal__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: var(--sh-xl);
  transform: scale(.9);
  transition: transform .22s ease;
}
.zoom-modal.is-open .zoom-modal__img { transform: scale(1); }
.zoom-modal__close {
  position: absolute;
  top: var(--s5); right: var(--s5);
  width: 44px; height: 44px;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.zoom-modal__close:hover { background: rgba(255,255,255,.25); }

/* ═══════════════════════════════════════════
   25. SIDEBAR & WIDGETS
═══════════════════════════════════════════ */
.sidebar { }

.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s5);
  box-shadow: var(--sh-sm);
  margin-bottom: var(--s5);
}
.widget:last-child { margin-bottom: 0; }

.widget__title {
  font-family: var(--font);
  font-size: var(--sz-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--navy);
  margin-bottom: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 2px solid var(--teal-pale);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.widget__title > span {
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--teal);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   26. SIDEBAR BOOK ITEMS
═══════════════════════════════════════════ */
.sidebar-books { display: flex; flex-direction: column; }

/* sidebar.php outputs .sidebar-book
   inc/template-tags.php outputs .sb-book
   — style both identically */
.sidebar-book,
.sb-book {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-book:first-child,
.sb-book:first-of-type { padding-top: 0; }
.sidebar-book:last-child,
.sb-book:last-of-type  { border-bottom: none; padding-bottom: 0; }

.sidebar-book__cover,
.sb-book__cover {
  width: 42px;
  aspect-ratio: 2/3;
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.sidebar-book__cover img,
.sb-book__cover img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-book__info,
.sb-book__info { flex: 1; min-width: 0; }

.sidebar-book__title,
.sb-book__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  transition: color .15s;
}
.sidebar-book__title:hover,
.sb-book__title:hover { color: var(--teal-dark); }

.sidebar-book__year,
.sb-book__year {
  display: block;
  font-size: 11px;
  color: var(--light);
  margin-top: 3px;
}

/* ═══════════════════════════════════════════
   27. SIDEBAR CATEGORY LIST
═══════════════════════════════════════════ */
.sidebar-cats { display: flex; flex-direction: column; }

.sidebar-cats__item { border-bottom: 1px solid var(--border); }
.sidebar-cats__item:last-child { border-bottom: none; }

.sidebar-cats__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13px;
  color: var(--muted);
  transition: color .15s;
}
.sidebar-cats__link:hover { color: var(--teal-dark); }

.sidebar-cats__count {
  font-size: var(--sz-xs);
  font-weight: 600;
  color: var(--light);
  background: var(--bg-mid);
  border-radius: var(--r-pill);
  padding: 2px 8px;
}

/* ═══════════════════════════════════════════
   28. PAGINATION
═══════════════════════════════════════════ */
.pagination { display: flex; justify-content: center; padding-bottom: var(--s4); }
.pagination__inner { display: flex; gap: 4px; align-items: center; }

.pg-item .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--white);
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font);
  transition: border-color .15s, background .15s, color .15s;
}
.pg-item .page-numbers:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-pale);
}
.pg-item .page-numbers.current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 700;
}
.pg-item .page-numbers.dots {
  border: none;
  background: none;
  cursor: default;
  color: var(--light);
}

/* ═══════════════════════════════════════════
   29. NO-RESULTS STATE
═══════════════════════════════════════════ */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px var(--s5);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
.no-results__icon { font-size: 50px; margin-bottom: var(--s5); opacity: .55; }
.no-results__title { margin-bottom: var(--s2); }
.no-results__sub { font-size: 14px; color: var(--muted); margin-bottom: var(--s6); }

/* ═══════════════════════════════════════════
   30. STATS BAR
═══════════════════════════════════════════ */
.stats-bar {
  background: var(--navy);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,.06);
}
.stats-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--s4) var(--s8);
  border-right: 1px solid rgba(255,255,255,.08);
}
.stats-bar__item:last-child { border-right: none; }
.stats-bar__value {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}
.stats-bar__label {
  font-size: var(--sz-xs);
  color: rgba(255,255,255,.55);
  font-weight: 500;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════
   31. CATEGORY CHIP RAIL
═══════════════════════════════════════════ */
.cat-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--muted);
  transition: background .15s, border-color .15s, color .15s;
}
.cat-chip:hover { background: var(--teal-pale); border-color: var(--teal); color: var(--teal-dark); }

.cat-chip__count {
  font-size: var(--sz-xs);
  font-weight: 700;
  color: var(--light);
  background: var(--border);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  transition: background .15s, color .15s;
}
.cat-chip:hover .cat-chip__count { background: rgba(79,182,178,.18); color: var(--teal-dark); }

/* ═══════════════════════════════════════════
   32. SITE FOOTER
═══════════════════════════════════════════ */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Optional widget row */
.footer-widgets {
  padding: var(--s10) 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.footer-widgets .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s8);
}

/* Main footer row */
.footer-main { padding: var(--s8) 0 var(--s6); }
.footer-main__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s8);
  flex-wrap: wrap;
}

.footer-tagline {
  font-size: var(--sz-sm);
  color: var(--muted);
  margin-top: var(--s2);
  max-width: 280px;
  line-height: 1.6;
}

/* Footer nav */
.footer-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s6);
  list-style: none;
  align-items: center;
}
.footer-nav__link {
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--muted);
  transition: color .15s;
}
.footer-nav__link:hover { color: var(--teal-dark); }

/* Copyright bar */
.footer-bar {
  border-top: 1px solid var(--border);
  padding: var(--s4) 0;
  background: var(--bg-soft);
}
.footer-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
}
.footer-copy,
.footer-note { font-size: 12px; color: var(--light); margin: 0; }
.footer-note a { color: var(--light); }
.footer-note a:hover { color: var(--teal-dark); }

/* ═══════════════════════════════════════════
   33. BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 24px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: all .18s;
}
.btn--teal {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(79,182,178,.38);
}
.btn--teal:hover {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  box-shadow: 0 5px 18px rgba(43,63,102,.30);
  transform: translateY(-1px);
  color: #fff;
}
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-mid); color: #fff; }
.btn--outline {
  background: transparent;
  border: 1.5px solid var(--border-mid);
  color: var(--muted);
}
.btn--outline:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-pale);
}

/* ═══════════════════════════════════════════
   34. WORDPRESS CORE COMPATIBILITY
═══════════════════════════════════════════ */
.alignleft   { float: left;  margin: 0 var(--s5) var(--s4) 0; }
.alignright  { float: right; margin: 0 0 var(--s4) var(--s5); }
.aligncenter { text-align: center; margin: 0 auto var(--s4); display: block; }
.alignwide   { max-width: calc(var(--container) + 120px); margin-left: auto; margin-right: auto; }
.alignfull   { width: 100%; max-width: none; }

.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: var(--sz-sm); color: var(--muted); text-align: center; margin-top: var(--s1); }

.gallery { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.gallery-item { overflow: hidden; border-radius: var(--r-sm); }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════════════════════════
   35. UTILITIES
═══════════════════════════════════════════ */
.clearfix::after { content: ''; display: table; clear: both; }
.text-center  { text-align: center; }
.text-muted   { color: var(--muted); }
.mt-0         { margin-top: 0; }
.mb-0         { margin-bottom: 0; }

/* ═══════════════════════════════════════════
   36. RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════ */

/* Large desktop: 4-col grid */
@media (max-width: 1100px) {
  .books-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet ≤900px — switch to mobile header */
@media (max-width: 900px) {
  :root { --h-total: 62px; }

  /* Hide desktop header rows */
  .header-nav-bar,
  .header-search-row { display: none; }

  /* Hide desktop topbar elements */
  .auth-links,
  .btn-premium { display: none; }

  /* Reveal mobile controls */
  .hamburger            { display: flex; }
  .mobile-search-toggle { display: flex; }
  .mobile-search-bar    { display: block; }
  .sidebar-overlay      { display: block; }

  /* Single-column layout */
  .layout { flex-direction: column; gap: var(--s6); padding-top: var(--s6); }
  .layout__sidebar { width: 100%; }

  /* 3-col grid */
  .books-grid { grid-template-columns: repeat(3, 1fr); }

  /* Book single: un-float cover */
  .book-single__cover-wrap {
    float: none;
    margin: 0 auto var(--s5);
    width: 150px;
    display: block;
  }

  .footer-main__inner { flex-direction: column; gap: var(--s5); }
}

/* Mobile ≤640px */
@media (max-width: 640px) {
  .container { padding: 0 var(--s4); }

  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .stats-bar__item { padding: var(--s3) var(--s5); }

  .footer-bar__inner { flex-direction: column; align-items: flex-start; gap: var(--s2); }

  .layout { padding-top: var(--s5); padding-bottom: var(--s10); }

  .sidebar-drawer { width: 280px; }
}

/* Very small ≤380px */
@media (max-width: 380px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .site-logo__wordmark { font-size: 18px; }
}

/* ═══════════════════════════════════════════
   PART 3 ADDITIONS
   Components added in Part 3 (template files).
   Appended to main.css.
═══════════════════════════════════════════ */

/* ──────────────────────────────────────────
   HOME — Stats bar wrap + section head
────────────────────────────────────────── */
.stats-bar-wrap {
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--s8);
  box-shadow: var(--sh-md);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
.section-head__title {
  font-size: var(--sz-xl);
  font-family: var(--serif);
  color: var(--navy);
}
.section-head__page {
  font-size: var(--sz-sm);
  color: var(--light);
  font-weight: 500;
}

/* ──────────────────────────────────────────
   SINGLE BOOK PAGE
────────────────────────────────────────── */

/* Meta pills label */
.meta-label {
  display: inline-block;
  font-size: var(--sz-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--light);
  margin-right: 4px;
}

/* Content area typography */
.book-single__content.entry-content {
  margin-top: var(--s6);
  font-size: 15px;
  line-height: 1.78;
  color: var(--muted);
}
.book-single__content.entry-content p  { margin-bottom: var(--s4); }
.book-single__content.entry-content h2,
.book-single__content.entry-content h3 { color: var(--navy); margin: var(--s6) 0 var(--s3); }
.book-single__content.entry-content ul,
.book-single__content.entry-content ol { padding-left: var(--s6); margin-bottom: var(--s4); }
.book-single__content.entry-content li { margin-bottom: var(--s2); }

/* ──────────────────────────────────────────
   SHARE BUTTONS
────────────────────────────────────────── */
.book-share {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  padding: var(--s5) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--s6) 0;
}

.book-share__label {
  font-size: var(--sz-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

.book-share__links {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: var(--sz-sm);
  font-weight: 500;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
  white-space: nowrap;
}
.share-btn:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: transparent;
}
.share-btn svg { flex-shrink: 0; }

.share-btn--facebook:hover { background: #1877f2; }
.share-btn--twitter:hover  { background: #000; }
.share-btn--whatsapp:hover { background: #25d366; }
.share-btn--telegram:hover { background: #0088cc; }
.share-btn--copy:hover     { background: var(--navy); }

/* ──────────────────────────────────────────
   TAGS BLOCK
────────────────────────────────────────── */
.book-tags {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s6);
}

.book-tags__label {
  font-size: var(--sz-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  padding-top: 6px;
}

.book-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.book-tag {
  display: inline-block;
  padding: 5px 14px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--navy);
  transition: background .15s, border-color .15s, color .15s;
}
.book-tag:hover {
  background: var(--teal-pale);
  border-color: var(--teal);
  color: var(--teal-dark);
}

/* ──────────────────────────────────────────
   CTA BLOCK
────────────────────────────────────────── */
.book-cta {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--r-md);
  padding: var(--s8);
  margin: var(--s6) 0;
}

.book-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s6);
  flex-wrap: wrap;
}

.book-cta__title {
  font-family: var(--serif);
  font-size: var(--sz-xl);
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--s2);
}

.book-cta__desc {
  font-size: 14px;
  color: rgba(255,255,255,.70);
  line-height: 1.65;
  max-width: 420px;
  margin: 0;
}

.book-cta__actions {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Override btn--outline colours inside the dark CTA */
.book-cta .btn--outline {
  border-color: rgba(255,255,255,.35);
  color: rgba(255,255,255,.80);
  background: transparent;
}
.book-cta .btn--outline:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,.10);
}

/* ──────────────────────────────────────────
   RELATED BOOKS
────────────────────────────────────────── */
.related-books {
  margin-top: var(--s10);
  padding-top: var(--s8);
  border-top: 1px solid var(--border);
}

.related-books__title {
  font-size: var(--sz-xl);
  margin-bottom: var(--s5);
}
.related-books__title span { color: var(--teal-dark); }

.books-grid--related {
  grid-template-columns: repeat(4, 1fr);
}

.related-books__more {
  margin-top: var(--s5);
  text-align: right;
}

/* ──────────────────────────────────────────
   TAG ARCHIVE — distinctive header
────────────────────────────────────────── */
.archive-header--tag .archive-header__title::before { display: none; }
.archive-header--tag { padding-top: var(--s8); }

.archive-header__pill {
  display: inline-block;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-size: var(--sz-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  margin-bottom: var(--s3);
}

.archive-header__term { color: var(--teal-dark); }

/* ──────────────────────────────────────────
   SEARCH — no results
────────────────────────────────────────── */
.no-results__search {
  width: 100%;
  max-width: 520px;
  margin: 0 auto var(--s5);
}

.no-results__suggestions { margin-top: var(--s4); }

.no-results__sugg-label {
  font-size: var(--sz-sm);
  color: var(--muted);
  font-weight: 500;
  margin-bottom: var(--s3);
}

/* ──────────────────────────────────────────
   404 PAGE
────────────────────────────────────────── */
.error-404 {
  padding: var(--s12) 0;
}

.error-404__hero {
  text-align: center;
  max-width: 560px;
  margin: 0 auto var(--s12);
}

.error-404__num {
  font-family: var(--serif);
  font-size: clamp(80px, 16vw, 150px);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--s4);
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-404__title {
  font-size: var(--sz-2xl);
  margin-bottom: var(--s4);
}

.error-404__desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: var(--s6);
}

.error-404__search {
  margin: 0 auto var(--s6);
  max-width: 500px;
}

.error-404__actions {
  display: flex;
  gap: var(--s3);
  justify-content: center;
  flex-wrap: wrap;
}

.error-404__books { }
.error-404__books-title {
  font-size: var(--sz-xl);
  margin-bottom: var(--s5);
  text-align: center;
}

.books-grid--404 { grid-template-columns: repeat(4, 1fr); }

.error-404__browse {
  text-align: center;
  margin-top: var(--s6);
}

/* ──────────────────────────────────────────
   STATIC PAGE (page.php)
────────────────────────────────────────── */
.layout--page { justify-content: center; }

.layout__content--page {
  max-width: 740px;
  width: 100%;
}

.page-single__header {
  margin-bottom: var(--s8);
  padding-bottom: var(--s5);
  border-bottom: 2px solid var(--teal-pale);
}

.page-single__title {
  font-size: clamp(24px, 4vw, var(--sz-3xl));
}

.page-single__content.entry-content {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--text);
}
.page-single__content.entry-content p  { margin-bottom: var(--s5); }
.page-single__content.entry-content h2 { margin: var(--s8) 0 var(--s4); font-size: var(--sz-xl); }
.page-single__content.entry-content h3 { margin: var(--s6) 0 var(--s3); font-size: var(--sz-lg); }
.page-single__content.entry-content ul,
.page-single__content.entry-content ol { padding-left: var(--s6); margin-bottom: var(--s5); }
.page-single__content.entry-content li { margin-bottom: var(--s2); }
.page-single__content.entry-content blockquote {
  border-left: 4px solid var(--teal);
  padding: var(--s4) var(--s5);
  margin: var(--s5) 0;
  background: var(--bg-soft);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--muted);
  font-style: italic;
}
.page-single__content.entry-content a { color: var(--teal-dark); text-decoration: underline; }
.page-single__content.entry-content a:hover { color: var(--navy); }

/* Page links (paginated pages) */
.page-links {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: var(--s6) 0;
  font-size: var(--sz-sm);
}
.page-links__label { color: var(--muted); font-weight: 600; }
.page-links__item a,
.page-links__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--muted);
  background: var(--white);
  transition: border-color .15s, color .15s;
}
.page-links__item a:hover { border-color: var(--teal); color: var(--teal-dark); }

/* ──────────────────────────────────────────
   DISABLED BUTTON STATE
────────────────────────────────────────── */
.btn.is-disabled,
.is-disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ──────────────────────────────────────────
   PART 3 RESPONSIVE ADDITIONS
────────────────────────────────────────── */
@media (max-width: 900px) {
  .books-grid--related { grid-template-columns: repeat(3, 1fr); }
  .books-grid--404     { grid-template-columns: repeat(3, 1fr); }

  .book-cta__inner { flex-direction: column; gap: var(--s4); }
  .book-cta__actions { width: 100%; }

  .book-share { gap: var(--s2); }
}

@media (max-width: 640px) {
  .books-grid--related { grid-template-columns: repeat(2, 1fr); }
  .books-grid--404     { grid-template-columns: repeat(2, 1fr); }

  .error-404__actions { flex-direction: column; align-items: center; }
  .error-404__actions .btn { width: 100%; justify-content: center; max-width: 280px; }

  .book-cta { padding: var(--s5); }

  .share-btn span { display: none; }
  .share-btn { padding: 8px; border-radius: 50%; width: 38px; height: 38px; justify-content: center; }

  .book-tags { flex-direction: column; gap: var(--s2); }

  .related-books__more { text-align: center; }
}

/* ═══════════════════════════════════════════
   PART 4 — SHORTCODE COMPONENTS
   [ve-book-info], [ve-cover], [ve-download]
═══════════════════════════════════════════ */

/* ──────────────────────────────────────────
   [ve-book-info] — Inline metadata row
   Author · Year displayed as labeled pills.
────────────────────────────────────────── */
.ve-book-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;                    /* Gap is handled by the separator */
  margin: var(--s4) 0 var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: var(--sz-sm);
  line-height: 1;
}

/* Each labeled field: "Author  Theresa Welch Fossum" */
.ve-book-info__author,
.ve-book-info__year {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) 0;
}

/* "Author" / "Year" label */
.ve-book-info__label {
  font-size: var(--sz-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--light);
  white-space: nowrap;
}

/* The actual value */
.ve-book-info__value {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

/* Dot separator between fields */
.ve-book-info__sep {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--border-mid);
  border-radius: 50%;
  margin: 0 var(--s4);
  flex-shrink: 0;
  vertical-align: middle;
}

/* ──────────────────────────────────────────
   [ve-cover] — Book cover image block
   Float-right on desktop, centered on mobile.
────────────────────────────────────────── */
.ve-cover {
  float: right;
  margin: var(--s1) 0 var(--s6) var(--s8);
  width: 200px;
  flex-shrink: 0;
  /* Reset figure default margins */
  display: block;
  max-width: 100%;
}

/* The clickable zoom wrapper — same base as .book-single__cover */
.ve-cover__zoom {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-lg);
  cursor: zoom-in;
  position: relative;
  /* Keyboard focus ring */
  outline-offset: 3px;
}
.ve-cover__zoom:focus-visible {
  outline: 2.5px solid var(--teal);
}

/* Subtle zoom hint on hover */
.ve-cover__zoom::after {
  content: '🔍';
  position: absolute;
  bottom: var(--s2);
  right: var(--s2);
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
.ve-cover__zoom:hover::after { opacity: 1; }

.ve-cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.ve-cover__zoom:hover .ve-cover__img { transform: scale(1.03); }

/* noscript fallback link */
.ve-cover__direct-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Clearfix for float — applied to the parent .entry-content */
.entry-content::after {
  content: '';
  display: table;
  clear: both;
}

/* ──────────────────────────────────────────
   [ve-download] — Download call-to-action box
   Visually consistent with download-box in
   single.php but owns its own class for
   shortcode-specific margin control.
────────────────────────────────────────── */
.ve-download {
  /* Inherits all visual styles from .download-box (single.php).
     Additional margin ensures good spacing inside post content. */
  clear: both;        /* Clears any floated .ve-cover above it */
  margin-top: var(--s6);
  margin-bottom: var(--s6);
}

/* Format label (bold "PDF") */
.ve-download__format {
  font-size: var(--sz-base);
  font-weight: 700;
  color: var(--navy);
  display: block;
  line-height: 1.2;
}

/* File size inline: "· 45 MB" */
.ve-download__size {
  font-size: var(--sz-sm);
  color: var(--muted);
  font-weight: 500;
}

/* "Free for registered users" subline */
.ve-download__sub {
  display: block;
  font-size: var(--sz-xs);
  color: var(--light);
  margin-top: 4px;
}

/* The CTA button — extends .btn .btn--teal from global buttons */
.ve-download__btn {
  /* Layout handled by .btn base class.
     Gap between icon and label: */
  gap: 7px;
}

/* ──────────────────────────────────────────
   ZOOM MODAL — also used by [ve-cover]
   Already defined in Part 2 CSS (.zoom-modal).
   No duplication needed — modal HTML is
   emitted by single.php and shared with the
   shortcode via the same #zoomModal element.
────────────────────────────────────────── */

/* ──────────────────────────────────────────
   PART 4 RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 900px) {
  .ve-cover {
    float: none;
    margin: 0 auto var(--s5);
    width: 160px;
    display: block;
  }
}

@media (max-width: 640px) {
  .ve-cover        { width: 130px; }

  .ve-book-info    { gap: var(--s3); flex-direction: column; align-items: flex-start; }
  .ve-book-info__sep { display: none; }

  .ve-download     { flex-direction: column; gap: var(--s4); }
  .ve-download__btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════
   PART 5 — SEO, A11Y, PERFORMANCE ADDITIONS
═══════════════════════════════════════════ */

/* ──────────────────────────────────────────
   BREADCRUMBS — SEO PLUGIN WRAPPERS
   When Yoast SEO or Rank Math outputs their
   own breadcrumb markup inside our .breadcrumbs
   <nav>, apply the same visual style.
────────────────────────────────────────── */

/* Yoast breadcrumb span chain */
.breadcrumbs--yoast .breadcrumb_last,
.breadcrumbs--rankmath ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Yoast uses inline spans with › separators via CSS content */
.breadcrumbs--yoast span > span::before {
  content: '›';
  display: inline-block;
  margin: 0 var(--s2);
  color: var(--light);
  font-size: var(--sz-sm);
}

/* Rank Math uses <li> list items */
.breadcrumbs--rankmath li {
  display: inline-flex;
  align-items: center;
  font-size: var(--sz-sm);
  color: var(--muted);
}
.breadcrumbs--rankmath li + li::before {
  content: '›';
  margin: 0 var(--s2);
  color: var(--light);
}
.breadcrumbs--rankmath a {
  color: var(--navy);
  transition: color .15s;
}
.breadcrumbs--rankmath a:hover { color: var(--teal-dark); }

/* ──────────────────────────────────────────
   HEADING HIERARCHY SAFETY RULES
   Ensure headings inside .entry-content and
   archive contexts stay visually consistent
   and do not accidentally overpower the H1.
────────────────────────────────────────── */

/* Entry content heading scale */
.entry-content h2 { font-size: var(--sz-xl);   margin: var(--s8) 0 var(--s4); color: var(--navy); }
.entry-content h3 { font-size: var(--sz-lg);   margin: var(--s6) 0 var(--s3); color: var(--navy); }
.entry-content h4 { font-size: var(--sz-base); margin: var(--s5) 0 var(--s2); color: var(--navy); font-weight: 700; }

/* Book card H3 titles must not compete visually with archive H1 */
.book-card__title { font-size: var(--sz-sm); }

/* ──────────────────────────────────────────
   ACCESSIBILITY — FOCUS STYLES
   Visible focus rings for keyboard users.
   Using :focus-visible to skip mouse clicks.
────────────────────────────────────────── */

/* Global default focus ring */
:focus-visible {
  outline: 2.5px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Override for elements that have their own outline handling */
.btn:focus-visible,
.book-card__ov-btn:focus-visible,
.share-btn:focus-visible {
  outline: 2.5px solid var(--teal);
  outline-offset: 2px;
}

/* Drawers and modals: focus moves inside — don't show outline on container */
#sidebarDrawer:focus,
.zoom-modal:focus {
  outline: none;
}

/* ──────────────────────────────────────────
   ACCESSIBILITY — SCREEN READER UTILITIES
────────────────────────────────────────── */

/* Reusable screen reader only class — visually hidden but accessible */
.sr-only,
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* When focused (skip link pattern), reveal it */
.screen-reader-text:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  white-space: normal !important;
  margin: 0 !important;
}

/* ──────────────────────────────────────────
   PERFORMANCE — LAYOUT STABILITY (CLS)
   Reserve space for images before they load.
   Prevents cumulative layout shift.
────────────────────────────────────────── */

/* Book cover images have a fixed aspect ratio.
   aspect-ratio is already set on .book-card__cover
   in the main design system. Confirm it here. */
.book-card__cover { aspect-ratio: 200 / 280; }  /* matches image size */
.sb-book__cover   { aspect-ratio: 80 / 112; }   /* sidebar thumb */
.book-single__cover { aspect-ratio: 320 / 450; } /* single page cover */

/* ──────────────────────────────────────────
   PERFORMANCE — PRINT MEDIA
   Hide non-essential elements in print view.
────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .book-share,
  .book-cta,
  .related-books,
  .pagination,
  .search-form,
  .breadcrumbs-bar,
  .error-404__search,
  .error-404__actions { display: none !important; }

  .book-single__cover { float: right; width: 140px; margin: 0 0 1rem 1rem; }
  .entry-content { font-size: 12pt; line-height: 1.6; }
  a { color: inherit; text-decoration: none; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #666; }
  a[href^="#"]::after { content: ''; } /* Skip anchors */
}


/* ═══════════════════════════════════════════
   WP DEFAULT WIDGETS — suppress unstyled output
   (sidebar-main fallback shows theme widgets instead)
═══════════════════════════════════════════ */
.widget_recent_entries,
.widget_recent_comments,
.widget_archive,
.widget_categories,
.widget_search,
.widget_meta {
  display: none !important;
}


/* ═══════════════════════════════════════════
   COMMENTS AREA
═══════════════════════════════════════════ */
.comments-area {
  margin-top: var(--s10);
  padding-top: var(--s8);
  border-top: 2px solid var(--border);
}

.comments-area__title,
.comment-reply-title {
  font-family: var(--serif);
  font-size: var(--sz-xl);
  color: var(--navy);
  margin-bottom: var(--s6);
}

.comments-area__count {
  color: var(--teal);
}

/* Comment list */
.comment-list,
.comment-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-item {
  margin-bottom: var(--s6);
  padding-bottom: var(--s6);
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
  border-bottom: none;
}

/* Nested replies */
.comment-item .children {
  margin-top: var(--s4);
  margin-left: var(--s8);
  padding-left: var(--s6);
  border-left: 3px solid var(--teal-pale);
}

.comment-body {}

.comment-meta {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.comment-avatar__img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.comment-meta__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment-author a,
.comment-author {
  font-weight: 600;
  font-size: var(--sz-sm);
  color: var(--navy);
}

.comment-date,
.comment-date a {
  font-size: var(--sz-xs);
  color: var(--muted);
}
.comment-date a:hover { color: var(--teal); }

.comment-awaiting-moderation {
  font-size: var(--sz-xs);
  color: var(--muted);
  font-style: italic;
}

.comment-content {
  font-size: var(--sz-sm);
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--s3);
}
.comment-content p { margin-bottom: var(--s2); }
.comment-content p:last-child { margin-bottom: 0; }

.comment-footer {
  display: flex;
  gap: var(--s3);
  font-size: var(--sz-xs);
}

.comment-reply a,
.comment-edit a {
  color: var(--teal);
  font-weight: 500;
}
.comment-reply a:hover,
.comment-edit a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

/* Comment navigation */
.comment-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--s6);
  font-size: var(--sz-sm);
}
.comment-nav a { color: var(--teal); }
.comment-nav a:hover { text-decoration: underline; }

/* Comment form */
.comment-form {
  margin-top: var(--s8);
}

.comment-form p {
  margin-bottom: var(--s4);
}

.comment-form label {
  display: block;
  font-size: var(--sz-sm);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--s1);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--sz-sm);
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
  box-sizing: border-box;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(79,182,178,.15);
}

.comment-form textarea {
  resize: vertical;
  min-height: 130px;
}

.comment-form-email__note {
  display: block;
  font-size: var(--sz-xs);
  color: var(--muted);
  margin-top: 4px;
}

.comment-submit-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 28px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: var(--sz-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.comment-submit-btn:hover { background: var(--teal-dark); }

/* Locked / no-comments state */
.comments-area--locked .comments-locked-msg {
  color: var(--muted);
  font-size: var(--sz-sm);
  font-style: italic;
}

/* Responsive */
@media (max-width: 640px) {
  .comment-item .children {
    margin-left: var(--s4);
    padding-left: var(--s3);
  }
}
