/* ── FOUNDATIONS OF THE FAITH — Shared Chapter Styles ── */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #1a1208;
  --parchment: #f5f0e8;
  --cream: #faf7f2;
  --gold: #b8860b;
  --gold-light: #d4a843;
  --rust: #8b3a2a;
  --sage: #4a5e4a;
  --warm-gray: #7a7265;
  --border: #d6cdb8;
  --chapter-bg: #ffffff;
  --sidebar-width: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Italic text (Playfair/Source Serif) slants far enough right that the
   final letter can collide with a following character - quotes,
   parentheses, question marks. A little breathing room after every
   italic run prevents that overlap everywhere it appears. */
em, i, cite, .ch-subtitle em {
  padding-right: 0.06em;
}

body {
  font-family: 'Source Serif 4', Georgia, serif;
  background-color: var(--cream);
  color: var(--ink);
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--ink);
  color: var(--parchment);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.sidebar-logo {
  display: block;
  text-decoration: none;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(245,240,232,0.12);
}

.sidebar-logo-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}

.sidebar-logo-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--parchment);
  line-height: 1.2;
}

.sidebar-logo-title em {
  font-style: italic;
  color: var(--gold-light);
}

.sidebar-nav-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.35);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.sidebar-nav {
  list-style: none;
  margin-bottom: 2rem;
}

.sidebar-nav li a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.5rem;
  border-radius: 2px;
  text-decoration: none;
  font-size: 0.82rem;
  color: rgba(245,240,232,0.6);
  line-height: 1.3;
  transition: color 0.15s, background 0.15s;
}

.sidebar-nav li a:hover {
  color: var(--parchment);
  background: rgba(245,240,232,0.06);
}

.sidebar-nav li a.active {
  color: var(--gold-light);
  background: rgba(184,134,11,0.12);
}

.sidebar-nav li a .ch-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--gold);
  flex-shrink: 0;
  min-width: 2rem;
}

.sidebar-nav li a.active .ch-num {
  color: var(--gold-light);
}

/* ── MAIN CONTENT ── */
main {
  grid-column: 2;
  max-width: 780px;
  padding: 3rem 3rem 5rem;
}

/* ── CHAPTER HEADER ── */
.chapter-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.ch-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.ch-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.ch-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--warm-gray);
  margin-bottom: 1.5rem;
}

.ch-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ch-meta-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.6rem;
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--warm-gray);
}

/* ── SECTION HEADERS ── */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 3rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.subsection-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
}

/* ── BODY TEXT ── */
p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  color: #2a2218;
}

/* ── SCRIPTURE CALLOUT ── */
.scripture-block {
  background: var(--parchment);
  border-left: 3px solid var(--gold);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 2px 2px 0;
}

.scripture-block blockquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.scripture-block cite {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--gold);
}

/* ── KEY IDEA BOX ── */
.key-idea {
  background: var(--ink);
  color: var(--parchment);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 2px;
  position: relative;
}

.key-idea::before {
  content: 'KEY IDEA';
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.25em;
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.6rem;
}

.key-idea p {
  color: rgba(245,240,232,0.85);
  font-size: 1rem;
  margin: 0;
  line-height: 1.7;
}

/* ── VOCAB SECTION ── */
.vocab-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.vocab-item {
  background: var(--chapter-bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.1rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1rem;
  align-items: start;
}

.vocab-term {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.95rem;
  grid-column: 1;
  grid-row: 1;
  color: var(--gold);
  min-width: 8rem;
}

.vocab-pronunciation {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--warm-gray);
  grid-column: 1;
  grid-row: 2;
  padding-top: 0.2rem;
}

.vocab-def {
  font-size: 0.9rem;
  line-height: 1.75;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
  color: var(--ink);
}

/* ── REVIEW QUESTIONS ── */
.review-section {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2rem;
  margin-top: 3rem;
}

.review-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.review-list {
  list-style: none;
  counter-reset: review-counter;
}

.review-list li {
  counter-increment: review-counter;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.85;
}

.review-list li::before {
  content: counter(review-counter);
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gold);
  background: rgba(184,134,11,0.12);
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── SCRIPTURE LIST ── */
.scripture-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}

.scripture-list li {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.7rem;
  background: var(--chapter-bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--sage);
  cursor: default;
}

/* ── CALLOUT NOTE ── */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  padding: 1.1rem 1.5rem;
  margin: 2rem 0;
  background: #fff9f7;
  border-radius: 0 2px 2px 0;
}

.callout-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--rust);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.callout p {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.65;
}

/* ── CHAPTER NAV ── */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.ch-nav-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--chapter-bg);
  color: var(--ink);
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ch-nav-btn:hover {
  background: var(--parchment);
  border-color: var(--gold);
  color: var(--gold);
}

.ch-nav-btn.next {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
  font-weight: 500;
}

.ch-nav-btn.next:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: white;
}

/* ── FOOTER ── */
footer {
  grid-column: 2;
  padding: 1.5rem 3rem;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--warm-gray);
  display: flex;
  justify-content: space-between;
}

/* ── MOBILE ── */
@media (max-width: 800px) {
  body { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    grid-row: auto;
    display: flex;
    flex-direction: column;
  }
  main { grid-column: 1; padding: 2rem 1.25rem 4rem; }
  footer { grid-column: 1; }
  .vocab-item { grid-template-columns: 1fr; }
  .vocab-def { grid-column: 1; grid-row: auto; }
}
