/* Right Reading Order - Core Styles */
/* Optimized for speed: ~3KB minified */

:root {
  --bg: #fefcf9;
  --bg-alt: #f7f4ef;
  --text: #2c2416;
  --text-muted: #6b5c4c;
  --accent: #c45d3a;
  --accent-dark: #a34829;
  --border: #e5ddd0;
  --shadow: rgba(44, 36, 22, 0.08);
  --font-display: 'Literata', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, sans-serif;
}

*, *::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-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3 { 
  font-family: var(--font-display); 
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.25rem, 3vw, 1.625rem); margin: 2rem 0 1rem; }
h3 { font-size: 1.125rem; margin: 1.5rem 0 0.75rem; }

p { margin-bottom: 1rem; }

a { 
  color: var(--accent); 
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--accent-dark); text-decoration: underline; }

/* Layout */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { color: var(--accent); text-decoration: none; }

.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { 
  color: var(--text-muted); 
  font-size: 0.9375rem;
}
.site-nav a:hover { color: var(--accent); }

main { padding: 2rem 0 3rem; }

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links { 
  display: flex; 
  gap: 1.5rem; 
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.footer-links a { color: var(--text-muted); }

/* Quick Answer Box */
.quick-answer {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  border-radius: 0 8px 8px 0;
}

.quick-answer strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--accent-dark);
}

/* Book Lists */
.book-list {
  list-style: none;
  counter-reset: book;
  margin: 1rem 0 2rem;
}

.book-list li {
  counter-increment: book;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.book-list li::before {
  content: counter(book);
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.book-title {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.buy-btn:hover {
  background: var(--accent-dark);
  color: white;
}

.buy-btn::before {
  content: '🛒';
  font-size: 1rem;
}

.book-year {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* FAQ Section */
.faq-section { margin: 2.5rem 0; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.faq-answer { color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }

/* Series Grid (Homepage) */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.series-card {
  display: block;
  padding: 1.25rem;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.series-card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 12px var(--shadow);
  text-decoration: none;
}

.series-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.series-card-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Search Box */
.search-box {
  margin: 1.5rem 0 2rem;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  transition: border-color 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs span { margin: 0 0.5rem; }

/* Affiliate Disclosure */
.affiliate-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* CTA Button */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.15s;
}

.btn:hover { 
  background: var(--accent-dark); 
  color: white;
  text-decoration: none;
}

/* Related Series */
.related-series {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: var(--bg-alt);
  border-radius: 8px;
}

.related-series h3 { margin-top: 0; }

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  list-style: none;
}

.related-list a {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text);
}

.related-list a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 600px) {
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: 0.875rem; }
  
  .book-list li { 
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .book-title {
    flex: 1 1 100%;
  }
  
  .buy-btn {
    margin-left: 3rem;
  }
  
  .book-year { 
    width: 100%;
    margin-left: 3rem;
    margin-top: -0.25rem;
  }
  
  .series-grid {
    grid-template-columns: 1fr;
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .search-box, .btn { display: none; }
  .book-list li { break-inside: avoid; }
}
