/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.7;
  color: #cdd6f4;
  background: #1e1e2e;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Headings ── */
h1 { font-size: 2rem; margin-bottom: 0.5rem; border-bottom: 2px solid #313244; padding-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p, li { margin-bottom: 0.5rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }

/* ── Code ── */
code {
  background: #11111b;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-family: "Fira Code", "Cascadia Code", "JetBrains Mono",
               "SF Mono", Consolas, monospace;
  font-size: 0.9em;
  color: #cdd6f4;
}
pre {
  background: #11111b;
  color: #cdd6f4;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}
pre code { background: transparent; padding: 0; border-radius: 0; font-size: 0.85em; color: inherit; }

/* ── Blockquotes ── */
blockquote {
  border-left: 4px solid #b4befe;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: #181825;
  border-radius: 0 6px 6px 0;
}

/* ── Tables ── */
table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { border: 1px solid #313244; padding: 0.5rem; text-align: left; }
th { background: #181825; }
td { background: transparent; }
img { max-width: 100%; border-radius: 4px; }

/* ── Links ── */
a { color: #b4befe; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation bar (chapter pages) ── */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #313244;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nav-bar select {
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid #313244;
  border-radius: 4px;
  background: #181825;
  color: #cdd6f4;
  max-width: 280px;
}
.course-title {
  font-size: 0.85rem;
  color: #a6adc8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Prev / Next footer (chapter pages) ── */
.nav-prevnext {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #313244;
}
.nav-prev, .nav-next { font-weight: 500; }
.nav-disabled { color: #585b70; }

/* ── Content links (chapter pages) ── */
.content a { color: #fab387; }
.content a code { color: inherit; }
.content a:hover { text-decoration: underline; }

/* ── Back link (glossary page) ── */
.back-link { margin-bottom: 1.5rem; display: block; font-size: 0.9rem; color: #a6adc8; }

/* ── Index page specifics ── */
.index-page { max-width: 700px; padding: 3rem 1.5rem; }
.index-page h1 { border-bottom: none; font-size: 2.2rem; }
.index-page h2 { font-size: 1.4rem; }
.index-page ul { list-style: none; padding: 0; }
.index-page li { padding: 0.6rem 0; border-bottom: 1px solid #313244; }
.index-page li:last-child { border-bottom: none; }
.subtitle { font-size: 1.1rem; color: #a6adc8; margin-bottom: 2rem; }
.footer { margin-top: 3rem; font-size: 0.85rem; color: #585b70; }
