@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ==========================================================================
   KAHU LEARNING DESIGN SYSTEM - CENTRAL TOKENS
   ========================================================================== */
:root {
  /* Brand Palette */
  --kahu-blue: #1d4ed8;
  --kahu-blue-dark: #1e40af;
  --kahu-blue-light: #eff6ff;
  --kahu-blue-50: #f0f7ff;
  --kahu-teal: #0d9488;
  --kahu-teal-dark: #0f766e;
  --kahu-teal-light: #f0fdfa;
  --kahu-orange: #ea580c;
  --kahu-orange-light: #fff7ed;
  --kahu-yellow: #ca8a04;
  --kahu-yellow-light: #fefce8;
  --kahu-success: #16a34a;
  --kahu-success-light: #f0fdf4;
  --kahu-danger: #dc2626;
  --kahu-danger-light: #fef2f2;
  --kahu-purple: #7c3aed;
  --kahu-purple-light: #f5f3ff;

  /* Neutral & Surfaces */
  --kahu-text: #0f172a;
  --kahu-muted: #64748b;
  --kahu-light: #94a3b8;
  --kahu-surface: #ffffff;
  --kahu-background: #f8fafc;
  --kahu-border: #e2e8f0;
  --kahu-border-light: #f1f5f9;

  /* Backward Compatibility Aliases */
  --primary: var(--kahu-blue);
  --primary-hover: var(--kahu-blue-dark);
  --primary-light: var(--kahu-blue-light);
  --secondary: var(--kahu-teal);
  --secondary-hover: var(--kahu-teal-dark);
  --secondary-light: var(--kahu-teal-light);
  --accent: var(--kahu-orange);
  --accent-light: var(--kahu-orange-light);
  --surface: var(--kahu-surface);
  --surface-alt: #f1f5f9;
  --background: var(--kahu-background);
  --text-main: var(--kahu-text);
  --text-muted: var(--kahu-muted);
  --text-light: var(--kahu-light);
  --border: var(--kahu-border);

  /* Shadows - Soft & Premium */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.09), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-book: 6px 14px 28px rgba(15, 23, 42, 0.16), 0 2px 4px rgba(15, 23, 42, 0.06);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --line-height-base: 1.65;
  --line-height-tight: 1.25;

  /* Layout dimensions */
  --header-height: 72px;
  --header-height-mobile: 64px;
  --container-max: 1200px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   CSS RESET & ACCESSIBILITY BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: var(--line-height-base);
  background-color: var(--kahu-background);
  color: var(--kahu-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* Accessibility: Focus Visible */
:focus-visible {
  outline: 2px solid var(--kahu-blue);
  outline-offset: 2px;
}

/* Accessibility: Skip to Content */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--kahu-blue);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 1000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

a {
  color: var(--kahu-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--kahu-blue-dark);
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--kahu-text);
  font-weight: 700;
  line-height: var(--line-height-tight);
}

h1 { font-size: clamp(1.85rem, 3.5vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 0.75rem;
}

p:last-child {
  margin-bottom: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

.section {
  padding: 3.5rem 0;
}

@media (max-width: 768px) {
  .section {
    padding: 2.25rem 0;
  }
}

/* ==========================================================================
   BUTTON SYSTEM (Min 44px height for primary buttons)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  min-height: 44px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--kahu-blue);
  color: #ffffff !important;
  border-color: var(--kahu-blue);
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}

.btn-primary:hover {
  background-color: var(--kahu-blue-dark);
  border-color: var(--kahu-blue-dark);
  box-shadow: 0 4px 8px rgba(29, 78, 216, 0.28);
}

.btn-secondary {
  background-color: var(--kahu-teal);
  color: #ffffff !important;
  border-color: var(--kahu-teal);
}

.btn-secondary:hover {
  background-color: var(--kahu-teal-dark);
  border-color: var(--kahu-teal-dark);
}

.btn-outline {
  background-color: transparent;
  color: var(--kahu-text) !important;
  border-color: var(--kahu-border);
}

.btn-outline:hover {
  background-color: var(--kahu-blue-light);
  border-color: var(--kahu-blue);
  color: var(--kahu-blue) !important;
}

.btn-store {
  background-color: #0f172a;
  color: #ffffff !important;
  border-color: #0f172a;
}

.btn-store:hover {
  background-color: #1e293b;
  border-color: #1e293b;
}

.btn-sm {
  min-height: 38px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}

.btn-lg {
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   BADGE SYSTEM (Min font 12px)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem; /* 12px min */
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  line-height: 1.35;
  white-space: nowrap;
}

.badge-blue {
  background-color: var(--kahu-blue-light);
  color: var(--kahu-blue);
  border: 1px solid #bfdbfe;
}

.badge-teal {
  background-color: var(--kahu-teal-light);
  color: var(--kahu-teal-dark);
  border: 1px solid #99f6e4;
}

.badge-orange {
  background-color: var(--kahu-orange-light);
  color: var(--kahu-orange);
  border: 1px solid #fed7aa;
}

.badge-purple {
  background-color: var(--kahu-purple-light);
  color: var(--kahu-purple);
  border: 1px solid #ddd6fe;
}

.badge-success {
  background-color: var(--kahu-success-light);
  color: var(--kahu-success);
  border: 1px solid #bbf7d0;
}

.badge-muted {
  background-color: #f1f5f9;
  color: var(--kahu-muted);
  border: 1px solid var(--kahu-border);
}

/* ==========================================================================
   CARD SYSTEM
   ========================================================================== */
.card {
  background: var(--kahu-surface);
  border: 1px solid var(--kahu-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* ==========================================================================
   SITE HEADER - DESKTOP & MOBILE
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--kahu-border);
  transition: all var(--transition-fast);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* Brand Logo */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.site-logo:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.site-logo-img {
  height: 46px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.08));
}

.site-logo-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--kahu-blue);
  background: var(--kahu-blue-light);
  border: 1px solid rgba(29, 78, 216, 0.18);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  line-height: 1;
}

.logo-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.logo-text .brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--kahu-text);
  letter-spacing: -0.4px;
}

.logo-text .brand-sub {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--kahu-blue);
  letter-spacing: -0.2px;
}

/* Desktop Navigation (Single line >= 1024px) */
.desktop-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .nav-links {
    gap: 0.5rem;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--kahu-muted);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--kahu-text);
  background-color: var(--kahu-background);
}

.nav-link.active {
  color: var(--kahu-blue);
  font-weight: 700;
  background-color: var(--kahu-blue-light);
}

/* Dropdown Menu */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: var(--kahu-surface);
  border: 1px solid var(--kahu-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  z-index: 110;
  animation: dropdownFadeIn 0.18s ease-out;
}

.nav-dropdown-wrapper:hover .nav-dropdown-menu,
.nav-dropdown-wrapper:focus-within .nav-dropdown-menu,
.nav-dropdown-menu.show {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  font-size: 0.75rem; /* 12px min */
  font-weight: 700;
  text-transform: uppercase;
  color: var(--kahu-light);
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem 0.25rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--kahu-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--kahu-blue-light);
  color: var(--kahu-blue);
}

.dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--kahu-background);
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--kahu-border);
  margin: 0.35rem 0.5rem;
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--kahu-background);
  border: 1px solid var(--kahu-border);
  color: var(--kahu-text);
}

.user-profile-btn:hover {
  border-color: var(--kahu-blue);
  color: var(--kahu-blue);
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--kahu-background);
  border: 1px solid var(--kahu-border);
  color: var(--kahu-text);
  cursor: pointer;
}

.mobile-menu-btn:hover {
  background: var(--kahu-blue-light);
  color: var(--kahu-blue);
}

/* Mobile Drawer */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 199;
}

.mobile-nav-backdrop.show {
  display: block;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: var(--kahu-surface);
  z-index: 200;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--kahu-border);
  margin-bottom: 1rem;
}

.mobile-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--kahu-background);
  border: 1px solid var(--kahu-border);
  color: var(--kahu-text);
  cursor: pointer;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--kahu-text);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background-color: var(--kahu-blue-light);
  color: var(--kahu-blue);
  font-weight: 700;
}

@media (max-width: 1023px) {
  .desktop-nav,
  .d-none-mobile {
    display: none !important;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
  }
  .site-header {
    height: var(--header-height-mobile);
  }
  .header-container {
    gap: 0.75rem;
  }
  .header-actions {
    gap: 0.5rem;
  }
  .site-logo-img {
    height: 38px;
    width: auto;
  }
  .site-logo-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }
}

/* ==========================================================================
   HOMEPAGE HERO SECTION (Balanced 2 columns)
   ========================================================================== */
.hero-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--kahu-border);
  padding: 3.5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  align-items: center;
  gap: 3rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--kahu-blue-light);
  color: var(--kahu-blue);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--kahu-text);
  letter-spacing: -0.025em;
}

.hero-highlight {
  color: var(--kahu-blue);
}

.hero-desc {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--kahu-muted);
  max-width: 540px;
}

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.hero-benefits {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--kahu-border);
  width: 100%;
  margin-top: 0.75rem;
}

.benefit-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--kahu-muted);
}

.benefit-item svg {
  color: var(--kahu-success);
  flex-shrink: 0;
}

.hero-illustration-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-illustration-col img,
.hero-illustration-col svg {
  max-width: 520px;
  width: 100%;
  height: auto;
}

@media (max-width: 991px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .hero-section {
    padding: 2.5rem 0 3rem;
  }

  .hero-desc {
    max-width: 100%;
  }

  .hero-illustration-col {
    order: 2;
  }
}

/* ==========================================================================
   4 MAIN TOOLS GRID
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.section-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--kahu-blue);
  background-color: var(--kahu-blue-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.section-title {
  margin-bottom: 0.65rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--kahu-muted);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1100px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

.tool-card {
  background: var(--kahu-surface);
  border: 1px solid var(--kahu-border);
  border-radius: var(--radius-xl);
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  position: relative;
  text-decoration: none;
  color: inherit;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.tool-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.tool-icon-box.blue { background-color: var(--kahu-blue-light); color: var(--kahu-blue); }
.tool-icon-box.teal { background-color: var(--kahu-teal-light); color: var(--kahu-teal); }
.tool-icon-box.purple { background-color: var(--kahu-purple-light); color: var(--kahu-purple); }
.tool-icon-box.orange { background-color: var(--kahu-orange-light); color: var(--kahu-orange); }

.tool-card-body h3 {
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--kahu-text);
}

.tool-card-body p {
  font-size: 0.94rem;
  color: var(--kahu-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--kahu-border-light);
  font-size: 0.88rem;
  font-weight: 600;
}

.tool-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--kahu-blue);
  font-weight: 700;
}

/* ==========================================================================
   BOOK CATALOG & GRID SYSTEM
   ========================================================================== */
.books-filter-bar {
  background: var(--kahu-surface);
  border: 1px solid var(--kahu-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.grade-chips-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.grade-chips-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .grade-chips-scroll {
    flex-wrap: wrap;
    gap: 0.35rem;
    overflow-x: visible;
  }
}

.grade-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--kahu-background);
  color: var(--kahu-muted);
  border: 1px solid var(--kahu-border);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.grade-chip:hover {
  color: var(--kahu-text);
  border-color: #cbd5e1;
}

.grade-chip.active {
  background: var(--kahu-blue);
  color: #ffffff;
  border-color: var(--kahu-blue);
}

.books-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr auto;
  gap: 0.85rem;
  align-items: flex-end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 768px) {
  .books-filter-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--kahu-muted);
  font-weight: 700;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 350px) {
  .book-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.book-card {
  background: var(--kahu-surface);
  border: 1px solid var(--kahu-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-book);
  border-color: #cbd5e1;
}

.book-card-cover-wrapper {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #f1f5f9;
  overflow: hidden;
}

.book-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.book-card:hover .book-card-cover {
  transform: scale(1.03);
}

.book-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.book-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.book-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--kahu-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

/* ==========================================================================
   SITE FOOTER (Streamlined 4 Columns)
   ========================================================================== */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  border-top: 1px solid #1e293b;
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 991px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-brand .site-logo .brand-name {
  color: #ffffff;
}

.footer-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-top: 0.85rem;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  margin-bottom: 1.15rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-link {
  font-size: 0.92rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

/* ==========================================================================
   READER STYLES (PRESERVED & STREAMLINED)
   ========================================================================== */
.reader-viewport {
  position: relative;
  background-color: #0b1329;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-toolbar {
  background: #0f172a;
  color: #ffffff;
  height: 60px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.reader-mode-switch .mode-switch-btn {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
}

.reader-mode-switch .mode-switch-btn.active {
  background: var(--kahu-blue);
  color: #ffffff;
}

/* Detail Layout Responsive */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
