

/* ===== Base typography and page layout ===== */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 16px;
  color: #333333;
  background-color: #f9fafb;
}

.page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.page-narrow {
  max-width: 880px;
}

/* ===== Header + intro ===== */
.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-bottom: 0.4rem;
  color: #1f2933;
}

.page-intro,
.page-intro-audio-label {
  font-size: 0.95rem;
  color: #4b5563;
  margin: 0.25rem 0 0.5rem;
}

/* Audio player under title */
.chapter-audio {
  display: block;
  margin: 0.4rem 0 0.75rem;
  width: 100%;
  max-width: 420px;
}

/* ===== Table of contents ===== */
.toc {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background-color: #f3f4ff;
  border: 1px solid #e5e7eb;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.toc a {
  display: block;
  margin-bottom: 4px;
  color: #2563eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.toc a:hover {
  text-decoration: underline;
}

/* ===== Headings & text ===== */
h2, h3, h4 {
  color: #2c3e50;
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}

p {
  margin: 0.25rem 0 0.5rem;
}

/* ===== Lists ===== */
ul, ol {
  margin: 0.25rem 0 0.75rem 1.2rem;
  padding: 0;
}

li {
  margin-bottom: 0.25rem;
}

/* ===== Tables ===== */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0 1rem;
  font-size: 0.9rem;
}

th,
td {
  border: 1px solid #dddddd;
  padding: 8px;
  text-align: left;
}

th {
  background-color: #f4f4f4;
  font-weight: 600;
}

/* ===== Links ===== */
a {
  color: #2980b9;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Code / pre blocks ===== */
pre {
  background-color: #f9f9f9;
  padding: 10px;
  overflow-x: auto;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 640px) {
  body {
    padding: 12px;
  }
}
