/* ============================================================
   TYPOGRAPHY — Self-Actualization in the Age of Crisis
   Option B: Inter headings + Charter-family body
   ============================================================ */

:root {
  /* Font stacks */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-serif: Charter, 'Bitstream Charter', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --font-mono:  'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;

  /* Type scale */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 1.125rem;   /* 18px — body */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.375rem;   /* 22px */
  --text-2xl:  1.625rem;   /* 26px — H2 */
  --text-3xl:  2rem;       /* 32px */
  --text-4xl:  2.25rem;    /* 36px — H1 */

  /* Line heights */
  --leading-tight:   1.2;
  --leading-snug:    1.35;
  --leading-normal:  1.5;
  --leading-relaxed: 1.65;
  --leading-body:    1.7;

  /* Prose max-width */
  --prose-width: 720px;
}

/* ── Base ────────────────────────────────────────────── */
body {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Headings ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-heading);
}

h1 {
  font-size: var(--text-4xl);
  color: var(--color-ritual-green);
  margin-bottom: 24px;
  margin-top: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--text-2xl);
  margin-top: 64px;
  margin-bottom: 24px;
  letter-spacing: -0.005em;
}

h3 {
  font-size: var(--text-xl);
  margin-top: 40px;
  margin-bottom: 16px;
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

h5, h6 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--color-text-muted);
}

/* ── Prose container ─────────────────────────────────── */
.prose {
  max-width: var(--prose-width);
}

.prose p {
  margin-bottom: 1.25em;
}

/* ── Links ───────────────────────────────────────────── */
.prose a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.prose a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ── Inline styles ───────────────────────────────────── */
.prose strong { font-weight: 700; color: var(--color-heading); }
.prose em     { font-style: italic; }
.prose sup    { font-size: 0.7em; vertical-align: super; line-height: 0; }
.prose sub    { font-size: 0.7em; vertical-align: sub;   line-height: 0; }

/* ── Pull quotes ─────────────────────────────────────── */
.prose blockquote,
.pull-quote {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-text);
  border-left: 3px solid var(--color-ritual-green);
  padding-left: 20px;
  margin: 40px 0;
  line-height: var(--leading-relaxed);
}

.prose blockquote p:last-child { margin-bottom: 0; }

/* ── Lists ───────────────────────────────────────────── */
.prose ul,
.prose ol {
  margin-bottom: 1.25em;
  padding-left: 1.75em;
}

.prose li { margin-bottom: 0.4em; }
.prose li > ul,
.prose li > ol { margin-top: 0.4em; margin-bottom: 0; }

/* ── Code ────────────────────────────────────────────── */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.prose pre {
  background: var(--color-code-bg);
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
  border-radius: 2px;
}

.prose pre code { background: none; padding: 0; font-size: 0.9em; }

/* ── Footnotes ───────────────────────────────────────── */
.footnotes {
  margin-top: 4em;
  padding-top: 2em;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.footnotes h2 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: 1.25em;
}

.footnotes-list { list-style: decimal; padding-left: 1.5em; }
.footnotes-list li { margin-bottom: 0.625em; }

/* ── Figures ─────────────────────────────────────────── */
.prose figure {
  margin: 2.5em 0;
  text-align: center;
}

.prose figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: 2px;
}

.prose figcaption {
  margin-top: 0.625em;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  text-align: left;
}

/* ── Section anchor links ────────────────────────────── */
/* markdown-it-anchor headerLink mode wraps the full heading text in <a>.
   Make it look like a normal heading — inherit color, no underline. */
.header-anchor {
  color: inherit;
  text-decoration: none;
}

.header-anchor:hover {
  color: var(--color-ritual-green);
  text-decoration: none;
}

/* ── Points of Reflection ────────────────────────────── */
.prose h2:has(+ ol),
.prose h2:has(+ ul) {
  /* Points of Reflection lists render as clean numbered lists */
}

/* ── Horizontal rule ─────────────────────────────────── */
.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3em 0;
}

/* ── Tables ──────────────────────────────────────────── */
.prose table {
  width: 100%; border-collapse: collapse;
  margin: 2em 0; font-size: var(--text-sm);
}
.prose th, .prose td {
  padding: 0.75em 1em; border: 1px solid var(--color-border); text-align: left;
}
.prose th {
  font-family: var(--font-sans); font-weight: 600;
  background: var(--color-code-bg);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --text-base: 1.0625rem; }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-xl); margin-top: 48px; }
  h3 { font-size: var(--text-lg); margin-top: 32px; }

  .prose blockquote,
  .pull-quote { font-size: var(--text-base); margin: 32px 0; }
}
