/* Shared CSS for Blindfold Chess Book */
:root {
  --bg-color: #080808;
  --bg-surface: #121212;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(30, 144, 255, 0.4);
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --accent-blue: #1e90ff;
  --accent-cyan: #38bdf8;
  --accent-glow: rgba(30, 144, 255, 0.35);
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Compact, stylish top bar */
.book-top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.book-top-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.book-btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.book-btn-nav:hover {
  background: #1a1a1a;
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
  text-decoration: none;
}

.book-top-badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}

/* Main Reader Container */
.book-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem 1.25rem;
}

/* Headings */
h1.chapter-title {
  font-size: clamp(1.75rem, 4.5vw, 2.3rem);
  font-weight: 700;
  color: var(--accent-blue);
  text-shadow: 0 0 16px var(--accent-glow);
  line-height: 1.25;
  margin: 0 0 1.2em 0;
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(30, 144, 255, 0.25);
}

h2, h3, h4 {
  color: #f8fafc;
  line-height: 1.35;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3em;
}

h3 {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
}

/* Content paragraphs */
.book-content p {
  font-size: clamp(1.02rem, 2.2vw, 1.12rem);
  margin-bottom: 1.4em;
  color: #cbd5e1;
}

/* Links inside content */
.book-content a {
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px dashed rgba(56, 189, 248, 0.4);
  transition: all 0.2s ease;
}

.book-content a:hover {
  color: #7dd3fc;
  border-bottom-style: solid;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

/* Blockquotes */
.book-content blockquote {
  margin: 2em 0;
  padding: 1.1em 1.5em;
  border-left: 4px solid var(--accent-blue);
  background: linear-gradient(90deg, rgba(30, 144, 255, 0.12) 0%, rgba(30, 144, 255, 0.02) 100%);
  border-radius: 0 8px 8px 0;
  color: #93c5fd;
  font-size: 1.15em;
  font-weight: 500;
  font-style: italic;
  box-shadow: inset 0 0 20px rgba(30, 144, 255, 0.05);
}

.book-content blockquote p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

/* Images: ALWAYS CENTERED with vmin sizing */
.book-content img,
.book-image {
  display: block;
  margin: 2.5em auto;
  max-width: min(85vmin, 700px);
  max-height: 60vmin;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

/* Lists */
.book-content ul,
.book-content ol {
  padding-left: 1.4em;
  margin-bottom: 1.4em;
  color: #cbd5e1;
}

.book-content li {
  margin-bottom: 0.5em;
}

/* Bottom Chapter Navigation */
.book-nav-bottom {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.book-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.book-nav-btn:hover {
  background: #181818;
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
  text-decoration: none;
}

.book-nav-btn.toc-btn {
  background: rgba(30, 144, 255, 0.08);
  border-color: rgba(30, 144, 255, 0.3);
  color: #93c5fd;
}

.book-nav-btn.toc-btn:hover {
  background: rgba(30, 144, 255, 0.16);
  border-color: var(--accent-blue);
  color: #fff;
}

.book-nav-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Table of Contents Index Page Styling */
.toc-header {
  text-align: center;
  margin-bottom: 3rem;
}

.toc-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0.5rem auto 0 auto;
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chapter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.25s ease;
}

.chapter-card:hover {
  border-color: var(--accent-blue);
  background: #161616;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
  transform: translateY(-1px);
  text-decoration: none;
}

.chapter-card-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chapter-number {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.chapter-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.chapter-card-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.chapter-card:hover .chapter-card-arrow {
  color: var(--accent-blue);
  transform: translateX(4px);
}

@media (max-width: 600px) {
  .book-top-bar {
    padding: 0.5rem 0.8rem;
  }
  .book-btn-nav {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
  .book-container {
    padding: 1.8rem 1rem 3rem 1rem;
  }
  .book-nav-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  .book-nav-btn {
    justify-content: center;
  }
  .book-notice {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Sources & Scientific References */
.sources-section {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.sources-section h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: #64748b;
  border: none;
  font-weight: 600;
}

.sources-section ol,
.sources-section ul {
  padding-left: 1.2rem;
  margin: 0;
  color: var(--text-muted);
}

.sources-section li {
  margin-bottom: 0.4rem;
}

.sources-section em {
  color: #cbd5e1;
}

.interlude {
  border-left: 4px solid var(--accent-blue);
  padding-left: 18px
}