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

:root {
  --color-bg: #faf9f6;
  --color-text: #2c2c2c;
  --color-text-muted: #666;
  --color-link: #1a5276;
  --color-link-hover: #0e3a5c;
  --color-border: #e0ddd8;
  --color-blockquote-bg: #f5f3ef;
  --color-header-bg: #2c2c2c;
  --color-header-text: #faf9f6;
  --color-code-bg: #eee;
  --max-width: 750px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-text: #d8d4cf;
    --color-text-muted: #999;
    --color-link: #6db3d9;
    --color-link-hover: #8ec8e8;
    --color-border: #3a3a3a;
    --color-blockquote-bg: #242424;
    --color-header-bg: #111;
    --color-header-text: #d8d4cf;
    --color-code-bg: #2a2a2a;
  }
}

html {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: Georgia, 'Times New Roman', serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.site-header {
  background: var(--color-header-bg);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-title {
  color: var(--color-header-text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}

p { margin-bottom: 1rem; }

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

blockquote {
  background: var(--color-blockquote-bg);
  border-left: 4px solid var(--color-link);
  padding: 0.8rem 1.2rem;
  margin: 1rem 0;
  font-style: italic;
}

.passage-tabs blockquote { font-style: normal; }

blockquote p { margin-bottom: 0.4rem; }
blockquote p:last-child { margin-bottom: 0; }
blockquote strong { font-style: normal; }

blockquote blockquote {
  background: none;
  border-left: none;
  padding: 0;
  margin: 0.4rem 0;
}

code {
  background: var(--color-code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.book-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.book-list li a {
  display: block;
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.book-list li a:hover {
  background: var(--color-blockquote-bg);
  text-decoration: none;
}

.chapter-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
}

.chapter-list li a {
  display: block;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  text-align: center;
  transition: background 0.15s;
}

.chapter-list li a:hover {
  background: var(--color-blockquote-bg);
  text-decoration: none;
}

.chapter-nav-section { margin-top: 2rem; }
.chapter-nav-section h2 { font-size: 1.3rem; margin-bottom: 0.75rem; }

.chapter-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
}

sup.v {
  font-size: 0.65em;
  color: var(--color-text-muted);
  font-weight: bold;
  margin-right: 0.2em;
  vertical-align: super;
  font-style: normal;
  scroll-margin-top: 4rem;
}

.hear {
  color: var(--color-link);
  border-bottom: 1px dotted var(--color-link);
  cursor: pointer;
  font-style: normal;
}

.passage-tabs { margin: 1rem 0; }

.tab-buttons {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--color-border);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--color-text); }

.tab-btn.active {
  color: var(--color-link);
  border-bottom-color: var(--color-link);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

ol.chapter-summaries {
  list-style: none;
  padding-left: 0;
}

ol.chapter-summaries li {
  display: flex;
  gap: 0.0rem;
  margin-bottom: 0.4rem;
  align-items: baseline;
}

a.ch-num {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 1.8rem;
  flex-shrink: 0;
  text-align: right;
  margin-right: 0.5rem;
}
