/* ============================================================
   AVERAGE STUDENT — Design System (based on Urban Guru)
   "Books designed for average student"
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── TOKENS ── */
:root {
  --cream:       #FFFFFF;
  --cream-deep:  #F3F6FB;
  --ink:         #0B1B33;
  --ink-muted:   #46536A;
  --ink-light:   #7D8AA0;
  --saffron:     #B07D00;
  --saffron-lt:  #FFF7DB;
  --yellow:      #FFC31F;
  --yellow-deep: #F2AE00;
  --maroon:      #0B2545;
  --maroon-deep: #071A33;
  --gold:        #E0A500;
  --gold-lt:     #FFF4D1;
  --border:      #DCE3EE;
  --border-dark: #B9C4D6;
  --white:       #FFFFFF;
  --shadow-sm:   0 2px 8px rgba(8,31,62,0.06);
  --shadow-md:   0 8px 32px rgba(8,31,62,0.10);
  --shadow-lg:   0 20px 60px rgba(8,31,62,0.14);
  --shadow-hover:0 12px 40px rgba(8,31,62,0.16);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-sm:   2px;
  --radius-md:   3px;
  --radius-lg:   4px;

  --transition:  0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width:   1240px;
  --content-width: 720px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }

/* ── SCROLL ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(253,250,244,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
  padding: 0 40px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo-img {
  height: 44px;
  width: auto;
  display: block;
}
.nav-logo-mark {
  width: 36px; height: 36px;
  background: var(--maroon);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -1px;
  box-shadow: 0 2px 8px rgba(107,20,20,0.3);
}
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: -0.5px;
  line-height: 1;
}
.nav-logo-text span {
  color: var(--saffron);
  font-style: italic;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.3px;
  position: relative;
  transition: color var(--transition);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--yellow);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--maroon); font-weight: 600; }
.nav-links a.active::after { width: 100%; background: var(--maroon); }
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-cart-btn {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: background var(--transition);
  font-size: 20px;
}
.nav-cart-btn:hover { background: var(--cream-deep); }
.cart-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 18px; height: 18px;
  background: var(--yellow);
  color: var(--maroon);
  font-size: 10px;
  font-weight: 600;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.nav-cta {
  background: var(--maroon);
  color: white;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: background var(--transition), transform var(--transition);
}
.nav-cta:hover { background: var(--maroon-deep); transform: translateY(-1px); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,26,51,0.5);
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}
.mobile-nav-overlay.active { opacity: 1; pointer-events: all; }
.mobile-nav-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 78%;
  max-width: 320px;
  height: 100vh;
  background: var(--cream);
  z-index: 1500;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  padding: 24px 0;
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(7,26,51,0.2);
}
.mobile-nav-drawer.open { transform: translateX(0); }
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.mobile-nav-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cream-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--ink-muted);
  border: none;
  cursor: pointer;
}
.mobile-nav-links { list-style: none; padding: 8px 0; }
.mobile-nav-links a {
  display: block;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.mobile-nav-links a.active { color: var(--maroon); font-weight: 700; }
.mobile-nav-cta { padding: 20px 24px; }

/* ── SEARCH BAR — PROMINENT ── */
.search-section {
  background: var(--maroon);
  padding: 20px 40px;
  margin-top: 68px;
}
.search-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 20px;
  font-size: 18px;
  color: var(--ink-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  font-family: var(--font-body);
  font-size: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: white;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition);
}
.search-input::placeholder { color: var(--ink-light); }
.search-input:focus { box-shadow: 0 0 0 3px rgba(232,135,26,0.3), var(--shadow-md); }
.search-clear {
  position: absolute;
  right: 16px;
  color: var(--ink-muted);
  font-size: 18px;
  cursor: pointer;
  display: none;
  padding: 4px;
}
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
  display: none;
}
.search-results-dropdown.active { display: block; }
.search-result-group { padding: 12px 0; }
.search-result-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 0 20px 8px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--cream); }
.search-result-thumb {
  width: 32px; height: 48px;
  background: var(--cream-deep);
  border-radius: 2px;
  flex-shrink: 0;
  object-fit: cover;
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 12px;
  color: var(--ink-light);
  margin-top: 2px;
}
.search-result-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.tag-book { background: var(--gold-lt); color: var(--gold); }
.tag-read { background: var(--saffron-lt); color: var(--saffron); }
.search-no-results {
  padding: 24px 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--maroon);
  color: white;
}
.btn-primary:hover {
  background: var(--maroon-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(107,20,20,0.3);
}
.btn-secondary {
  background: transparent;
  color: var(--maroon);
  border: 1.5px solid var(--maroon);
}
.btn-secondary:hover {
  background: var(--maroon);
  color: white;
  transform: translateY(-2px);
}
.btn-saffron {
  background: var(--yellow);
  color: var(--maroon);
}
.btn-saffron:hover {
  background: #D4780F;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(232,135,26,0.35);
}
.btn-amazon {
  background: #FF9900;
  color: var(--ink);
}
.btn-amazon:hover {
  background: #E88A00;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255,153,0,0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }

/* ── HERO ── */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 80px 40px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 70% 50%, rgba(196,154,42,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 30%, rgba(107,20,20,0.04) 0%, transparent 70%);
}
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: repeating-linear-gradient(
    0deg, var(--ink) 0px, var(--ink) 1px, transparent 1px, transparent 40px
  ),
  repeating-linear-gradient(
    90deg, var(--ink) 0px, var(--ink) 1px, transparent 1px, transparent 40px
  );
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  width: 32px; height: 1.5px;
  background: var(--yellow);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 5vw, 76px);
  font-weight: 600;
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 24px;
  letter-spacing: -1px;
}
.hero-title em {
  font-style: italic;
  color: var(--maroon);
}
.hero-subtitle {
  font-size: 17px;
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 480px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--maroon);
  line-height: 1;
}
.hero-stat-label {
  font-size: 12px;
  color: var(--ink-light);
  margin-top: 4px;
}
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-book-stack {
  position: relative;
  width: 280px;
  height: 360px;
}
.hero-book {
  position: absolute;
  width: 200px;
  height: 280px;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}
.hero-book-1 {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  top: 0; left: 40px;
  transform: rotate(-6deg);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: white;
}
.hero-book-2 {
  background: linear-gradient(135deg, #2C5F2E 0%, #1A3D1B 100%);
  top: 20px; left: 80px;
  transform: rotate(2deg);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: white;
}
.hero-book-3 {
  background: linear-gradient(135deg, #1A3A5C 0%, #0D2238 100%);
  top: 10px; left: 20px;
  transform: rotate(8deg);
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: white;
}
.hero-book-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 8px;
}
.hero-book-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}
.hero-book-author {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 8px;
}
.hero-badge {
  position: absolute;
  bottom: -20px;
  right: 0;
  background: var(--yellow);
  color: var(--maroon);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
  z-index: 10;
  white-space: nowrap;
}

/* ── SECTION COMMON ── */
.section { padding: 80px 40px; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-header { margin-bottom: 48px; }
.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow::before {
  content: '';
  width: 24px; height: 1.5px;
  background: var(--yellow);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.section-subtitle {
  font-size: 16px;
  color: var(--ink-muted);
  margin-top: 12px;
  max-width: 600px;
  line-height: 1.7;
}
.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* ── CATEGORY PILLS ── */
.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.pill {
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid var(--border);
  color: var(--ink-muted);
  background: white;
}
.pill:hover { border-color: var(--maroon); color: var(--maroon); }
.pill.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: white;
}

/* ── BOOKS GRID — COMPACT ── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
/* Home page grids — 6 per row, smaller cards */
#home-books-grid, #home-free-reads {
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 12px !important;
}
#home-books-grid .book-title, #home-free-reads .article-title { font-size: 12px !important; }
#home-books-grid .book-category-tag, #home-free-reads .article-cat { font-size: 8px !important; }
#home-books-grid .book-price { font-size: 14px !important; }
#home-books-grid .book-info { padding: 8px 10px 10px !important; }
#home-free-reads .article-card-body { padding: 8px 10px 10px !important; }
#home-free-reads .article-excerpt { display: none !important; }
#home-free-reads .article-card-img { aspect-ratio: 2/3 !important; }
@media (max-width: 1400px) { #home-books-grid, #home-free-reads { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 900px) { #home-books-grid, #home-free-reads { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 560px) { #home-books-grid, #home-free-reads { grid-template-columns: repeat(2, 1fr) !important; } }
.book-card {
  background: white;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.book-cover-wrap {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--cream-deep);
  flex-shrink: 0;
}
.book-cover-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.book-card:hover .book-cover-img { transform: scale(1.04); }
.book-cover-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
}
.book-cover-placeholder .book-icon {
  font-size: 22px;
  margin-bottom: 6px;
  opacity: 0.7;
}
.book-cover-placeholder .placeholder-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
  opacity: 0.9;
}
.book-badge-coming {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--gold);
  color: white;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}
.book-badge-new {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--yellow);
  color: var(--maroon);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}
.book-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7,26,51,0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity var(--transition);
  padding: 10px;
}
.book-card:hover .book-overlay { opacity: 1; }
.book-overlay .btn { width: 100%; font-size: 11px; padding: 6px 8px; }
.book-info {
  padding: 8px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.book-category-tag {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 3px;
}
.book-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-author {
  font-size: 10px;
  color: var(--ink-light);
  margin-bottom: 4px;
}
.book-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 4px;
}
.stars { color: var(--gold); font-size: 9px; letter-spacing: 1px; }
.rating-count { font-size: 9px; color: var(--ink-light); }
.book-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.book-price {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--maroon);
}
.book-price-original {
  font-size: 10px;
  color: var(--ink-light);
  text-decoration: line-through;
  margin-left: 3px;
}
.book-cart-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--maroon);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.book-cart-btn:hover {
  background: var(--maroon-deep);
  transform: scale(1.1);
}

/* ── COMING SOON CARD ── */
.book-card.coming-soon .book-cover-wrap {
  filter: grayscale(30%);
}
.notify-form {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--border);
}
.notify-input {
  flex: 1;
  padding: 6px 8px;
  font-family: var(--font-body);
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--cream);
  transition: border-color var(--transition);
}
.notify-input:focus { border-color: var(--saffron); }
.notify-btn {
  padding: 6px 10px;
  background: var(--yellow);
  color: var(--maroon);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.notify-btn:hover { background: #D4780F; }

/* ── FREE READS SECTION ── */
/* ── FREE READS GRID — Cover Image Optimized ── */
.free-reads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.article-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.article-card-img {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--maroon);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.article-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--cream);
  transition: transform 0.4s ease;
}
.article-card:hover .article-card-cover { transform: scale(1.02); }
.article-card-img-overlay {
  display: none;
}
.article-card-img-emoji {
  display: none;
}
.article-card-body {
  padding: 16px 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.article-cat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 6px;
}
.article-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 8px;
}
.article-excerpt {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-light);
}
.article-meta-left { display: flex; align-items: center; gap: 12px; }
.article-likes { display: flex; align-items: center; gap: 4px; }

.article-card-img-bg {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background: var(--maroon);
}

/* ── PDF STYLED READER ── */
.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(7,26,51,0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.reader-overlay.active { display: flex; }
.reader-container {
  width: 100%;
  max-width: 860px;
  background: #F0E8D8;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.reader-toolbar {
  background: var(--maroon);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.reader-toolbar-left { display: flex; align-items: center; gap: 16px; }
.reader-toolbar-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-toolbar-right { display: flex; align-items: center; gap: 8px; }
.reader-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
}
.reader-btn:hover { background: rgba(255,255,255,0.2); }
.reader-close {
  background: rgba(255,255,255,0.15);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
}
.reader-close:hover { background: rgba(255,0,0,0.3); }
.reader-progress {
  height: 3px;
  background: rgba(255,255,255,0.15);
}
.reader-progress-bar {
  height: 100%;
  background: var(--yellow);
  transition: width 0.3s ease;
  width: 0%;
}
.reader-pages { padding: 32px 40px; flex: 1; }
.reader-page {
  background: white;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  padding: 56px 64px;
  margin-bottom: 24px;
  position: relative;
  min-height: 600px;
}
.reader-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--maroon) 0%, var(--saffron) 100%);
  border-radius: 2px 2px 0 0;
}
.reader-watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  color: rgba(107,20,20,0.04);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 4px;
}
.reader-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.reader-logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--maroon);
}
.reader-logo span { color: var(--saffron); }
.reader-chapter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-light);
}
.reader-content h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: var(--maroon);
  line-height: 1.2;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}
.reader-content h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 32px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--saffron);
}
.reader-content h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--maroon);
  margin: 24px 0 10px;
}
.reader-content p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 18px;
}
.reader-content p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  color: var(--maroon);
  float: left;
  line-height: 0.85;
  margin: 4px 10px 0 0;
}
.reader-content ul, .reader-content ol {
  margin: 0 0 18px 20px;
}
.reader-content li {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 6px;
}
.reader-content strong { color: var(--maroon); font-weight: 600; }
.reader-content .callout {
  background: var(--saffron-lt);
  border-left: 4px solid var(--saffron);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  font-size: 15px;
  color: var(--ink);
}
.reader-content .pull-quote {
  font-family: var(--font-display);
  font-size: 24px;
  font-style: italic;
  color: var(--maroon);
  text-align: center;
  padding: 28px 32px;
  margin: 32px 0;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  line-height: 1.4;
}
.reader-content .chapter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 8px;
}
.reader-content .table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.reader-content table.reader-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14px;
}
.reader-content table.reader-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.reader-content table.reader-table td:last-child { border-right: none; }
.reader-content table.reader-table tr:first-child td {
  background: var(--maroon);
  color: white;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.3px;
}
.reader-content table.reader-table tr:nth-child(even) td { background: var(--cream); }
.reader-content table.reader-table tr:first-child:nth-child(even) td { background: var(--maroon); }
.reader-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink-light);
}
.reader-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: var(--cream-deep);
  border-top: 1px solid var(--border);
}
.reader-page-info {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  min-width: 80px;
  text-align: center;
}

/* ── BOOK AD BANNER ── */
.book-ad-banner {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  position: relative;
  overflow: hidden;
}
.book-ad-banner::before {
  content: '📚';
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  opacity: 0.08;
}
.book-ad-cover {
  width: 70px;
  height: 100px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}
.book-ad-cover-placeholder {
  width: 70px;
  height: 100px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.book-ad-info { flex: 1; min-width: 0; }
.book-ad-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 6px;
}
.book-ad-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: white;
  line-height: 1.2;
  margin-bottom: 8px;
}
.book-ad-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}
.book-ad-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* ── ARTICLE PAGE LAYOUT ── */
.article-page { padding-top: 68px; }
.article-hero {
  background: var(--maroon);
  padding: 60px 40px 40px;
  color: white;
}
.article-hero-inner { max-width: var(--content-width); margin: 0 auto; }
.article-hero-cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 16px;
}
.article-hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.article-hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  flex-wrap: wrap;
}
.article-hero-author {
  display: flex;
  align-items: center;
  gap: 8px;
}
.author-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.article-body-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 40px;
}

/* ── YOUTUBE STYLE ACTION BAR ── */
.action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 32px 0;
  flex-wrap: wrap;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--cream-deep);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.action-btn:hover {
  background: var(--cream-deep);
  border-color: var(--border-dark);
  color: var(--ink);
}
.action-btn.liked {
  background: var(--saffron-lt);
  border-color: var(--saffron);
  color: var(--saffron);
}
.action-btn.subscribed {
  background: var(--maroon);
  border-color: var(--maroon);
  color: white;
}
.action-divider {
  width: 1px; height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* ── COMMENTS ── */
.comments-section { margin-top: 48px; }
.comments-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}
.comment-input-wrap {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}
.comment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cream-deep);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.comment-input-area { flex: 1; }
.comment-input {
  width: 100%;
  padding: 12px 0;
  font-family: var(--font-body);
  font-size: 15px;
  border: none;
  border-bottom: 1.5px solid var(--border);
  background: transparent;
  outline: none;
  color: var(--ink);
  transition: border-color var(--transition);
}
.comment-input:focus { border-bottom-color: var(--maroon); }
.comment-input::placeholder { color: var(--ink-light); }
.comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.comment-item {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.comment-body { flex: 1; }
.comment-author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.comment-date {
  font-size: 12px;
  color: var(--ink-light);
  margin-bottom: 8px;
}
.comment-text { font-size: 14px; color: var(--ink-muted); line-height: 1.6; }
.comment-reply-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-light);
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}
.comment-reply-btn:hover { color: var(--maroon); }

/* ── SIGN IN GATE ── */
.signin-gate {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.signin-gate-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--maroon);
  margin-bottom: 10px;
}
.signin-gate-sub {
  font-size: 15px;
  color: var(--ink-muted);
  margin-bottom: 28px;
}
.signin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 360px;
  margin: 0 auto;
}
.signin-input {
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  outline: none;
  transition: border-color var(--transition);
  color: var(--ink);
}
.signin-input:focus { border-color: var(--maroon); }

/* ── CART DRAWER ── */
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -8px 0 48px rgba(7,26,51,0.15);
  z-index: 3000;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,26,51,0.5);
  z-index: 2999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}
.cart-overlay.active { opacity: 1; pointer-events: all; }
.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--maroon);
}
.cart-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cream-deep);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ink-muted);
  transition: all var(--transition);
}
.cart-close:hover { background: var(--border); color: var(--ink); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-cover {
  width: 52px;
  height: 72px;
  border-radius: 2px;
  object-fit: cover;
  background: var(--cream-deep);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.3;
}
.cart-item-type { font-size: 12px; color: var(--ink-light); margin-bottom: 8px; }
.cart-item-price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--maroon);
}
.cart-item-remove {
  font-size: 12px;
  color: var(--ink-light);
  cursor: pointer;
  transition: color var(--transition);
}
.cart-item-remove:hover { color: red; }
.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--cream);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cart-total-label { font-size: 15px; font-weight: 500; }
.cart-total-amount {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--maroon);
}
.cart-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-muted);
}
.cart-empty-icon { font-size: 48px; margin-bottom: 16px; }
.cart-empty-text { font-size: 15px; }

/* ── FOOTER ── */
.footer {
  background: var(--maroon-deep);
  color: rgba(255,255,255,0.7);
  padding: 64px 40px 32px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand {}
.footer-logo-img {
  height: 56px;
  width: auto;
  display: block;
  margin-bottom: 14px;
  
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}
.footer-logo span { color: var(--saffron); }
.footer-tagline {
  font-style: italic;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
  font-family: var(--font-display);
}
.footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
  max-width: 280px;
}
.footer-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--saffron);
  margin-bottom: 16px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}
.footer-links a:hover { color: white; }
.footer-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 24px;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
  gap: 12px;
}

/* ── NEWSLETTER ── */
.newsletter-section {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  padding: 64px 40px;
  text-align: center;
}
.newsletter-inner { max-width: 560px; margin: 0 auto; }
.newsletter-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}
.newsletter-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 28px;
  font-style: italic;
  font-family: var(--font-display);
}
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.newsletter-input {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  color: white;
  outline: none;
  transition: background var(--transition);
}
.newsletter-input::placeholder { color: rgba(255,255,255,0.4); }
.newsletter-input:focus { background: rgba(255,255,255,0.18); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: white;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── UTILITY ── */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .books-grid { grid-template-columns: repeat(3, 1fr); }
  .free-reads-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { display: none; }
  .free-reads-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 640px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .free-reads-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 20px; }
  .hero { padding: 48px 20px; }
  .search-section { padding: 16px 20px; }
  .newsletter-form { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer { padding: 40px 20px 24px; }
  .cart-drawer { width: 100%; }
  .book-ad-banner { flex-direction: column; text-align: center; }
  .book-ad-actions { flex-direction: row; justify-content: center; }
  .reader-page { padding: 32px 24px; }
  .article-body-wrap { padding: 32px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── SIDEBAR COUNTS ── */
.sidebar-count {
  font-size: 10px;
  color: var(--ink-light);
  font-weight: 500;
  margin-left: 4px;
}
.sidebar-sub-item.active .sidebar-count { color: var(--maroon); }

/* ── SERIES CARD ── */
.series-stack {
  position: relative;
}
.series-stack-back {
  position: absolute;
  inset: 0;
  transform: translate(6px, -6px) scale(0.96);
  filter: brightness(0.85);
  z-index: 1;
  border-radius: var(--radius-sm);
}
.series-stack-front {
  position: relative;
  z-index: 2;
  box-shadow: -4px 4px 0 rgba(255,255,255,0.6), 0 4px 16px rgba(8,31,62,0.15);
}
.series-vol-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.series-vol-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid var(--border-dark);
  background: var(--cream);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.series-vol-pill:hover {
  background: var(--maroon);
  border-color: var(--maroon);
  color: white;
}
.series-vol-pill.soon {
  opacity: 0.6;
  border-style: dashed;
}

/* ============================================================
   AVERAGE STUDENT — additions
   ============================================================ */
.signin-gate-backdrop { position: fixed; inset: 0; z-index: 4000; align-items: center; justify-content: center; padding: 24px; background: rgba(7,26,51,0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.signin-gate-backdrop .signin-gate { position: relative; max-width: 420px; width: 100%; background: #fff; }
.signin-close { position: absolute; top: 10px; right: 12px; font-size: 16px; color: var(--ink-light); padding: 6px; }
.signin-close:hover { color: var(--maroon); }
.signin-note { font-size: 12px; color: var(--ink-light); margin-top: 12px; }
.cart-note { font-size: 12px; color: var(--ink-muted); margin: 0 0 12px; line-height: 1.5; }
.cart-item-buy { display: inline-block; font-size: 12px; font-weight: 700; color: #1A1A1A; background: #FF9900; padding: 4px 10px; border-radius: 2px; margin: 6px 8px 4px 0; }
.cart-item-buy:hover { background: #E88A00; }
.hamburger { background: none; border: none; }
.nav-cta.active { background: var(--maroon-deep); }
.books-mobile-pills { display: none; }
@media (max-width: 900px) {
  .books-mobile-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; flex-wrap: nowrap; }
  .books-mobile-pills .pill { white-space: nowrap; }
  .books-mobile-pills .pill.active { background: var(--maroon); color: #fff; border-color: var(--maroon); }
}
.footer-logo-img { height: 52px; }
.footer-tagline { color: var(--yellow); }
.toast { background: var(--maroon); color: #fff; }
::selection { background: var(--yellow); color: var(--maroon); }
/* hide closed drawers' shadows */
.cart-drawer:not(.open), .mobile-nav-drawer:not(.open) { box-shadow: none; visibility: hidden; transition: transform var(--transition-slow), visibility 0s linear .5s; }
.cart-drawer.open, .mobile-nav-drawer.open { visibility: visible; transition: transform var(--transition-slow), visibility 0s; }
