/* ==========================================================================
   Dr. Feng Feng's Books — Editorial Storybook Stylesheet
   Zero external CDN dependencies for fast LCP and strict CSP compliance.
   ========================================================================== */

:root {
  --bg: #FAF6F0;
  --bg-alt: #F2EAE0;
  --surface: #FFFFFF;
  --surface-tint: #FDFBF8;
  --ink: #2B211B;
  --ink-soft: #5D4E45;
  --ink-muted: #7C6D63;
  --border: #E6DDD2;
  --border-strong: #D4C7B8;

  --accent: #B84A27;
  --accent-hover: #963A1D;
  --accent-soft: #FDF0EB;
  --sage: #2F5D4A;
  --sage-soft: #EBF4F0;
  --gold: #C68A1E;
  --amazon: #E88B14;
  --amazon-hover: #CA760C;

  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, Cambria, serif;
  --font-sans: "Avenir Next", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(43, 33, 27, 0.05);
  --shadow-md: 0 10px 28px rgba(43, 33, 27, 0.08);
  --shadow-book: 6px 10px 22px rgba(43, 33, 27, 0.16), 2px 3px 6px rgba(43, 33, 27, 0.08);
  --max-width: 1180px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--bg-alt);
  color: var(--ink);
}

.site-nav .nav-cta {
  background: var(--ink);
  color: #fff;
  margin-left: 6px;
}

.site-nav .nav-cta:hover {
  background: var(--accent);
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-amazon {
  background: var(--amazon);
  color: #1F1610;
}

.btn-amazon:hover {
  background: var(--amazon-hover);
  color: #1F1610;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-alt);
  color: var(--ink);
  border-color: var(--ink-muted);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.87rem;
}

/* Hero Section — Soft Watercolor Storybook Wash (inspired by Amazon series covers) */
.hero {
  padding: 52px 0 40px;
  background:
    radial-gradient(ellipse 52% 60% at 86% 18%, rgba(169, 211, 187, 0.34), transparent 65%),
    radial-gradient(ellipse 46% 52% at 62% 85%, rgba(246, 224, 165, 0.32), transparent 68%),
    radial-gradient(ellipse 42% 55% at 10% 78%, rgba(190, 219, 241, 0.28), transparent 65%),
    radial-gradient(ellipse 35% 40% at 32% 12%, rgba(235, 208, 227, 0.22), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.95fr);
  gap: 36px;
  align-items: center;
}

.hero-visual-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cover-fan {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 0 6px;
  min-height: 220px;
}

.fan-book {
  width: 136px;
  aspect-ratio: 3 / 4;
  border-radius: 4px 10px 10px 4px;
  padding: 0;
  display: block;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(43, 33, 27, 0.22);
  border: 1px solid rgba(43, 33, 27, 0.14);
  transition: transform 0.2s ease;
  background: var(--surface);
}

.fan-book img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fan-book-left {
  transform: rotate(-7deg) translateX(20px) translateY(10px);
  z-index: 1;
}

.fan-book-center {
  width: 156px;
  transform: translateY(-4px);
  z-index: 3;
}

.fan-book-right {
  transform: rotate(7deg) translateX(-20px) translateY(10px);
  z-index: 2;
}

.fan-book:hover {
  z-index: 5;
  transform: translateY(-8px) scale(1.04);
}

.fan-series {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.fan-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.fan-sub {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Quotable GEO Summary Box */
.geo-tldr {
  background: linear-gradient(135deg, #FFFFFF 0%, #FAF7F0 100%);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--sage);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 20px;
  margin: 0 0 22px;
  box-shadow: var(--shadow-sm);
}

.geo-tldr-label {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 6px;
}

.geo-tldr p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--ink);
}

/* Editions Comparison Grid */
.edition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.edition-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edition-card-featured {
  border-color: var(--sage);
  background: linear-gradient(180deg, #FFFFFF 0%, #F4FAF6 100%);
}

.edition-price {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.edition-price-sub {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sage);
}

.edition-note {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--sage);
}

.edition-list {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.edition-list li {
  margin-bottom: 5px;
}

.asin-chip {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  background: var(--bg-alt);
  color: var(--ink-soft);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.2;
  margin-top: 0;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.25rem);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-label {
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* AI-Friendly Summary Card ("Quick Series Facts") */
.summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.summary-box h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--ink);
}

.summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.summary-list li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  font-size: 0.92rem;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--border);
}

.summary-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.summary-key {
  font-weight: 700;
  color: var(--ink-muted);
}

.summary-val {
  color: var(--ink);
}

/* Finder / Filter Controls */
.catalog-section {
  padding: 44px 0 60px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  margin-bottom: 6px;
}

.section-sub {
  color: var(--ink-soft);
  margin: 0;
  max-width: 65ch;
}

.finder-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.finder-top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 12px 42px 12px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--ink);
}

.search-input:focus {
  border-color: var(--accent);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(184, 74, 39, 0.14);
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  right: 10px;
  background: var(--bg-alt);
  border: none;
  color: var(--ink-soft);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.search-clear[hidden] {
  display: none;
}

.sort-select {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

.count-pill {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 9px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  align-items: center;
}

.alpha-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-right: 6px;
}

.alpha-btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.alpha-btn:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.alpha-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

/* Book Grid & Cards */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.book-card[hidden] {
  display: none;
}

.book-cover-link {
  display: block;
  text-decoration: none;
  border-radius: 10px;
}

.book-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
  max-width: 210px;
  margin: 0 auto;
  border-radius: 4px 12px 12px 4px;
  padding: 18px 16px 16px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  box-shadow: var(--shadow-book);
  border: 1px solid rgba(43, 33, 27, 0.12);
  overflow: hidden;
}

.book-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: rgba(25, 18, 14, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}

.book-cover-frame {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  padding: 12px 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.book-cover-series {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.85;
}

.book-cover-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.22;
  font-weight: 700;
}

.book-cover-name {
  display: block;
  font-size: 1.45rem;
  margin: 2px 0;
}

.book-cover-motif {
  width: 34px;
  height: 34px;
  opacity: 0.92;
}

.book-cover-author {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.book-cover-img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin: 0 auto;
  border-radius: 4px 12px 12px 4px;
  box-shadow: var(--shadow-book);
  border: 1px solid rgba(43, 33, 27, 0.1);
}

.book-hero .book-cover-img {
  max-width: 270px;
}

/* 8 Curated Watercolor Storybook Cover Palettes (inspired by Amazon Name Adventures covers) */
.theme-sage {
  background:
    radial-gradient(circle at 22% 18%, rgba(254, 248, 210, 0.85), transparent 55%),
    radial-gradient(circle at 82% 82%, rgba(154, 204, 174, 0.72), transparent 58%),
    linear-gradient(155deg, #E8F3EC 0%, #CBE3D4 100%);
  color: #1B3B2E;
}
.theme-terracotta {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 245, 224, 0.85), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(242, 187, 158, 0.68), transparent 58%),
    linear-gradient(155deg, #FDECE2 0%, #F4CEBB 100%);
  color: #4A1F11;
}
.theme-plum {
  background:
    radial-gradient(circle at 18% 20%, rgba(252, 238, 248, 0.85), transparent 55%),
    radial-gradient(circle at 85% 82%, rgba(206, 178, 224, 0.68), transparent 58%),
    linear-gradient(155deg, #F4EAF7 0%, #E1CEE9 100%);
  color: #391D46;
}
.theme-sky {
  background:
    radial-gradient(circle at 24% 16%, rgba(254, 248, 228, 0.82), transparent 52%),
    radial-gradient(circle at 82% 84%, rgba(167, 206, 238, 0.72), transparent 58%),
    linear-gradient(155deg, #E9F3FC 0%, #C8E0F4 100%);
  color: #19344E;
}
.theme-ochre {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 252, 236, 0.88), transparent 55%),
    radial-gradient(circle at 82% 82%, rgba(238, 205, 134, 0.68), transparent 58%),
    linear-gradient(155deg, #FCF5DF 0%, #F2DFAF 100%);
  color: #4A320C;
}
.theme-rose {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 246, 240, 0.85), transparent 55%),
    radial-gradient(circle at 82% 84%, rgba(238, 182, 198, 0.65), transparent 58%),
    linear-gradient(155deg, #FCEBEF 0%, #F2CDD6 100%);
  color: #4D1B28;
}
.theme-forest {
  background:
    radial-gradient(circle at 22% 18%, rgba(246, 249, 226, 0.82), transparent 54%),
    radial-gradient(circle at 84% 82%, rgba(154, 196, 166, 0.7), transparent 58%),
    linear-gradient(155deg, #E3EFE6 0%, #C3DAC8 100%);
  color: #183623;
}
.theme-navy {
  background:
    radial-gradient(circle at 22% 16%, rgba(238, 228, 248, 0.72), transparent 52%),
    radial-gradient(circle at 84% 84%, rgba(168, 188, 224, 0.72), transparent 58%),
    linear-gradient(155deg, #E6ECF6 0%, #CAD5EA 100%);
  color: #1A2844;
}

.book-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--ink-soft);
}

.badge-origin {
  background: var(--sage-soft);
  color: var(--sage);
}

.book-card h3 {
  font-size: 1.15rem;
  margin: 0;
}

.book-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.book-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.book-meaning {
  font-size: 0.91rem;
  color: var(--ink-soft);
  margin: 0;
  flex-grow: 1;
}

.book-meaning strong {
  color: var(--ink);
}

.book-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 6px;
}

.book-actions .btn-sm {
  padding: 8px 10px;
  font-size: 0.83rem;
  text-align: center;
  white-space: nowrap;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  margin-top: 20px;
}

.empty-state[hidden] {
  display: none;
}

/* Feature Bands & Collection Cards */
.band {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.band-alt {
  background: var(--bg-alt);
}

.band-white {
  background: var(--surface);
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-card h3 {
  font-size: 1.18rem;
  margin: 0;
}

.info-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.collection-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.collection-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.collection-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Comparison Table (AI-Citation Friendly) */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table.facts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.facts-table th,
table.facts-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.facts-table tr:last-child th,
table.facts-table tr:last-child td {
  border-bottom: none;
}

table.facts-table th {
  background: var(--surface-tint);
  color: var(--ink);
  font-weight: 700;
  width: 32%;
}

/* FAQ Accordions */
.faq-list {
  display: grid;
  gap: 12px;
}

details.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

details.faq-item summary {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

details.faq-item[open] summary::after {
  content: "−";
}

details.faq-item .faq-answer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
}

details.faq-item .faq-answer p {
  margin: 0;
}

/* Book Detail Page */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.breadcrumb li::after {
  content: "›";
  margin-left: 8px;
  color: var(--ink-muted);
}

.breadcrumb li:last-child::after {
  content: "";
  margin-left: 0;
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.book-hero {
  padding: 36px 0 48px;
  border-bottom: 1px solid var(--border);
}

.book-hero-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.book-hero .book-cover {
  max-width: 265px;
  padding: 22px 20px 20px 28px;
}

.book-hero .book-cover-name {
  font-size: 1.85rem;
}

.book-hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  margin-bottom: 10px;
}

.book-subtitle {
  font-size: 1.12rem;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.meaning-callout {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.meaning-callout strong {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

.book-buy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.format-note {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0;
}

.prose-section {
  padding: 40px 0;
}

.prose-section h2 {
  font-size: 1.55rem;
  margin-bottom: 12px;
}

.prose-section p {
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag-pill {
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--ink);
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
}

.tag-pill:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Footer */
.site-footer {
  background: #231A15;
  color: #E8DDD4;
  padding: 48px 0 32px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer h2, .site-footer h3 {
  color: #FFFFFF;
  font-size: 1.08rem;
  margin-bottom: 12px;
}

.site-footer p {
  color: #CFC1B6;
  font-size: 0.92rem;
  margin: 0 0 12px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: #E8DDD4;
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #F7C278;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: #B4A498;
}

/* Utility Spacing Classes (avoids inline styles for strict CSP) */
.actions-center {
  justify-content: center;
  margin-bottom: 0;
}

.actions-compact {
  margin-bottom: 0;
  margin-top: 8px;
}

.mb-lg {
  margin-bottom: 32px;
}

.mt-lg {
  margin-top: 28px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid,
  .book-hero-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .book-hero .book-cover {
    margin: 0;
  }

  .finder-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .book-actions {
    grid-template-columns: 1fr;
  }

  .summary-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
