/* ── Typography ─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #1a1a2e;
  background-color: #fafafa;
}

/* ── Headings ────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a2e;
}

h1 { font-size: 2rem; border-bottom: 3px solid #c9a84c; padding-bottom: 0.4rem; }
h2 { font-size: 1.4rem; color: #2c2c54; border-left: 4px solid #c9a84c; padding-left: 0.75rem; }
h3 { font-size: 1.1rem; color: #444; font-weight: 500; }

/* ── Title banner ────────────────────────────────────────────────────────────── */
/* Target every possible selector the Quarto/Bootstrap theme might use */
.quarto-title-banner,
.quarto-title-banner.column-screen,
div.quarto-title-banner,
header.quarto-title-banner,
.quarto-title-block .quarto-title-banner,
body > header,
#title-block-header,
.page-header {
  background: #1a1a2e !important;
  background-color: #1a1a2e !important;
  background-image: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
  color: white !important;
  padding: 3rem 2rem !important;
  border-bottom: 4px solid #c9a84c !important;
}

/* Force text white in every banner child element */
.quarto-title-banner *,
.quarto-title-banner p,
.quarto-title-banner h1,
.quarto-title-banner h2,
.quarto-title-banner .title,
.quarto-title-banner .subtitle,
.quarto-title-banner .quarto-title,
#title-block-header *,
#title-block-header h1.title,
#title-block-header .author,
#title-block-header .date {
  color: white !important;
}

/* Flatly theme uses .navbar for the top bar - keep it dark too */
.navbar {
  background-color: #1a1a2e !important;
  border-color: #c9a84c !important;
}

.quarto-title-banner .title {
  font-size: 2.2rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: white !important;
}

.quarto-title-banner .quarto-title-meta {
  color: rgba(255,255,255,0.75) !important;
}

.quarto-title-banner .quarto-title-meta-heading {
  color: #c9a84c !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

/* ── TOC ─────────────────────────────────────────────────────────────────────── */
#TOC {
  border-left: 3px solid #c9a84c;
  padding-left: 1rem;
  font-size: 0.85rem;
}

#TOC a {
  color: #2c2c54;
  text-decoration: none;
}

#TOC a:hover { color: #c9a84c; }

/* ── Code blocks ─────────────────────────────────────────────────────────────── */
pre, code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 0.82rem !important;
}

.sourceCode { border-radius: 6px; border: 1px solid #e8e8e8; }

details summary {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: background 0.2s;
}

details summary:hover { background: #ebebeb; }

/* ── Tables (gt) ─────────────────────────────────────────────────────────────── */
.gt_table {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.88rem !important;
  border-top: 2px solid #1a1a2e !important;
}

.gt_heading {
  background-color: #1a1a2e !important;
  color: white !important;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.gt_title {
  color: white !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.1rem !important;
}

.gt_subtitle {
  color: rgba(255,255,255,0.7) !important;
  font-size: 0.78rem !important;
  padding-bottom: 0.75rem !important;
}

.gt_col_heading {
  background-color: #2c2c54 !important;
  color: white !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gt_col_headings { border-bottom: none !important; }

.gt_row { border-bottom: 1px solid #f0f0f0 !important; }
.gt_row:hover { background-color: #faf8f2 !important; }

.gt_footnote {
  font-size: 0.76rem !important;
  color: #777 !important;
  border-top: 1px solid #e8e8e8 !important;
}

/* ── Callout (AI statement) ──────────────────────────────────────────────────── */
.callout {
  border-radius: 6px;
  border-left: 4px solid #c9a84c !important;
  background: #fdf8ee !important;
}

.callout-title { color: #1a1a2e !important; font-weight: 600 !important; }

/* ── Section dividers ────────────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid #e8e8e0;
  margin: 2.5rem 0;
}

/* ── Inline values (bold highlights) ────────────────────────────────────────── */
strong { color: #1a1a2e; }

/* ── Page layout ─────────────────────────────────────────────────────────────── */
.content { max-width: 900px; }

/* ── Figures ─────────────────────────────────────────────────────────────────── */
figure { margin: 1.5rem 0; }
figcaption {
  font-size: 0.8rem;
  color: #777;
  text-align: center;
  margin-top: 0.4rem;
  font-style: italic;
}
