:root {
  --reading-size: 22px;
  --line-height: 1.65;
  --max-width: 44rem;

  --bg: #fbfaf6;
  --bg-elev: #ffffff;
  --bg-box: #f1ede2;
  --text: #1d1c1a;
  --text-muted: #66635c;
  --border: #d9d4c4;
  --rule: #ccc6b2;
  --accent: #9a5a1f;
  --bible-bg: #f7f1e2;
  --shadow: 0 8px 28px rgba(40, 30, 10, 0.18);
}

html[data-theme="dark"] {
  --bg: #16181c;
  --bg-elev: #1d1f24;
  --bg-box: #23262d;
  --text: #e7e3da;
  --text-muted: #9a948a;
  --border: #353841;
  --rule: #2c2f37;
  --accent: #d2a36b;
  --bible-bg: #1e2128;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Iowan Old Style", "Charter", "Source Serif Pro", Cambria, Georgia, serif;
  font-size: var(--reading-size);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 4rem;
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 14px;
}
.topbar a.home {
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.topbar a.home:hover { background: var(--bg-box); }
.topbar .title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .controls { display: flex; gap: 6px; }
.btn {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 10px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--bg-box); }
.btn.icon { width: 32px; padding: 4px 0; text-align: center; font-weight: 600; }
a.btn.icon { display: inline-block; line-height: 1.5; text-decoration: none; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}
main p { margin: 0.7em 0; text-align: justify; hyphens: auto; }
main a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
main a:hover {
  color: color-mix(in srgb, var(--accent) 75%, white);
  border-bottom-style: solid;
}

/* MacArthur NTC chapter / section styling */
.ntc-chapter-number {
  display: block;
  font-size: 1em;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 0.4em;
}
.ntc-chapter-title {
  display: block;
  font-size: 1.8em;
  font-weight: 700;
  line-height: 1.25;
  margin: 0.6em 0 0.4em;
  text-align: center;
  color: var(--text);
}
.ntc-chapter-subtitle {
  display: block;
  font-size: 1em;
  font-weight: 600;
  font-style: italic;
  color: var(--accent);
  margin: 0 0 2em;
  text-align: center;
}
.ntc-chapter-subtitle blockquote {
  margin: 0;
  padding: 0;
  border: 0;
}
.ntc-subhead {
  display: block;
  font-size: 1.05em;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 1.8em 0 0.5em;
  text-align: center;
}
.ntc-subhead * {
  font-size: inherit !important;
  line-height: inherit !important;
  font-variant: inherit !important;
  letter-spacing: inherit !important;
  color: inherit !important;
}

/* Bold verse-quote paragraph -- tinted bible block with verse-ref tag. */
.ntc-verse-quote {
  position: relative;
  background: var(--bible-bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.4em 1.2em 1em 1.2em;
  margin: 1.8em 0 1.5em;
  text-indent: 0;
  text-align: left;
  font-size: 1em;
  line-height: 1.55;
}
.ntc-verse-quote::before {
  content: attr(data-verse-prefix) " " attr(data-verse-ref);
  position: absolute;
  top: -0.6em;
  left: 0.8em;
  background: var(--accent);
  color: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}
.ntc-verse-quote .calibre20, .ntc-verse-quote strong { font-weight: 700; }
.ntc-verse-quote em, .ntc-verse-quote .calibre5 { font-style: italic; }

.ntc-attribution {
  display: block;
  text-align: right;
  font-style: italic;
  color: var(--text-muted);
  margin: 0.4em 0 1.6em;
}
.ntc-centered { text-align: center; }

blockquote {
  margin: 1em 0 1em 1.5em;
  padding: 0.3em 0 0.3em 1em;
  border-left: 2px solid var(--rule);
  color: var(--text-muted);
}
blockquote blockquote { border-left: none; padding-left: 0; margin-left: 0; }

.calibre20 { font-weight: 700; }
.calibre5  { font-style: italic; }
.calibre13 { line-height: 1.2; }
.calibre14 { font-size: 0.6em; font-variant: small-caps; letter-spacing: 0.04em; }

img { max-width: 100%; height: auto; display: block; margin: 1.2em auto; border-radius: 6px; }

/* index page */
.index-wrap { max-width: 50rem; margin: 0 auto; padding: 2.5rem 1.25rem; }
.index-wrap h1 { font-size: 2.2em; margin: 0 0 0.15em; }
.index-wrap .subtitle { color: var(--text-muted); font-style: italic; margin: 0 0 2em; }
.index-wrap h2.section-head {
  font-size: 1em;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 2em 0 0.5em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}
.index-wrap a {
  color: var(--accent);
  text-decoration: none;
}
.chapter-list { list-style: none; padding: 0; margin: 0; }
.chapter-list li a {
  display: flex; flex-direction: column;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.chapter-list li a:hover { background: var(--bg-box); }
.chapter-list .ttl { font-weight: 600; color: var(--accent); font-size: 1em; }
.chapter-list .ref { color: var(--text-muted); font-size: 0.88em; font-style: italic; margin-top: 2px; }

@media (max-width: 640px) {
  .topbar { font-size: 12px; padding: 0.5rem 0.75rem; }
  main { padding: 1.5rem 1rem 4rem; }
}
