/* =================================================================
   AortaCFD — Distill-inspired design system
   Typography: Source Serif Pro (body) + Inter (UI) + JetBrains Mono
   Palette:    warm off-white bg, muted accents, academic feel
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;1,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-serif: 'Source Serif Pro', 'Charter', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --text-dark: rgba(0, 0, 0, 0.85);
  --text-body: rgba(0, 0, 0, 0.78);
  --text-muted: rgba(0, 0, 0, 0.5);
  --text-faint: rgba(0, 0, 0, 0.32);
  --border-soft: rgba(0, 0, 0, 0.08);
  --border-med: rgba(0, 0, 0, 0.14);
  --accent: #c8102e;
  --accent-soft: rgba(200, 16, 46, 0.05);
  --done: #065f46;
}

/* ---- Body typography (serif, distill-style) ---- */
.md-typeset {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}
[data-md-color-scheme="slate"] .md-typeset {
  color: rgba(255, 255, 255, 0.85);
}

/* ---- Content width (wider for equations) ---- */
.md-content__inner {
  max-width: 820px;
}

/* ---- Headings (Inter, tight) ---- */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.005em;
}
.md-typeset h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}
.md-typeset h2 {
  font-size: 1.5rem;
  margin: 3rem 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}
.md-typeset h3 {
  font-size: 1.2rem;
  margin: 2.2rem 0 0.6rem;
}
.md-typeset h4 {
  font-size: 1.02rem;
  margin: 1.6rem 0 0.4rem;
}
[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4 {
  color: rgba(255, 255, 255, 0.95);
}
[data-md-color-scheme="slate"] .md-typeset h2 {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

/* ---- Paragraphs and lists ---- */
.md-typeset p {
  margin: 0 0 1.15em;
}
.md-typeset li {
  margin-bottom: 0.35em;
  line-height: 1.68;
}
.md-typeset ul > li::marker {
  color: var(--text-faint);
}

/* ---- Inline code in serif body ---- */
.md-typeset code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.08em 0.35em;
  border-radius: 3px;
  color: var(--text-dark);
}
[data-md-color-scheme="slate"] .md-typeset code {
  background: rgba(255, 255, 255, 0.08);
}

/* ---- Code blocks ---- */
.md-typeset pre > code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ---- MathJax equation styling ---- */
.md-typeset mjx-container[display="true"] {
  margin: 1.5rem 0 !important;
  padding: 0.4rem 0;
  font-size: 1.08em !important;
  overflow-x: auto;
  overflow-y: hidden;
}
.md-typeset mjx-container {
  font-family: var(--font-serif) !important;
}
/* Inline math — slightly larger so x/y reads clearly */
.md-typeset mjx-container:not([display="true"]) {
  font-size: 1.04em !important;
}

/* ---- Horizontal rule — hair-thin ---- */
.md-typeset hr {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 2.8rem 0;
}

/* ---- Figure captions ---- */
.md-typeset figcaption,
.md-typeset img + em,
.md-typeset iframe + em,
.md-typeset p > em:only-child {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
  font-style: italic;
  display: block;
  margin-top: 0.4rem;
}

/* ---- Images and iframes — soft borders ---- */
.md-typeset img {
  border-radius: 4px;
  max-width: 100%;
}
.md-typeset iframe {
  border-radius: 6px;
}

/* ---- Tables — clean distill style ---- */
.md-typeset table:not([class]) {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  line-height: 1.55;
  border: none;
  box-shadow: none;
  margin: 1.5rem 0;
}
.md-typeset table:not([class]) th {
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-med);
  background: transparent;
  padding: 0.5rem 0.8rem;
  letter-spacing: 0.01em;
}
.md-typeset table:not([class]) td {
  border-bottom: 1px solid var(--border-soft);
  padding: 0.55rem 0.8rem;
}
.md-typeset table:not([class]) tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* ---- Blockquotes (for citation pull-quotes) ---- */
.md-typeset blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin: 1.3rem 0;
  color: var(--text-body);
  font-style: italic;
}

/* ---- Admonitions: quieter ---- */
.md-typeset .admonition {
  border-left-width: 3px;
  box-shadow: none;
  font-size: 0.9rem;
  border-radius: 0 4px 4px 0;
}

/* ---- Buttons ---- */
.md-typeset .md-button {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

/* ---- References list styling (for the central references page) ---- */
.md-typeset ol.refs,
.md-typeset .refs ol {
  font-size: 0.92rem;
  line-height: 1.65;
  padding-left: 2.2rem;
}
.md-typeset ol.refs li {
  margin-bottom: 0.65em;
  padding-left: 0.2em;
}
.md-typeset ol.refs li::marker {
  font-family: var(--font-sans);
  font-size: 0.82em;
  color: var(--text-muted);
}
.md-typeset ol.refs li:target {
  background: rgba(200, 16, 46, 0.08);
  border-radius: 3px;
  padding: 0.2em 0.4em;
  margin-left: -0.4em;
}

/* ---- Citation link style — author–year inline ---- */
.md-typeset a.cite {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted rgba(200, 16, 46, 0.35);
  font-style: italic;
  white-space: nowrap;
}
.md-typeset a.cite:hover {
  border-bottom-color: var(--accent);
}

/* ---- Hero section refinements (homepage) ---- */
.hero-section { background: transparent; }
.hero-text h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Link hover feel ---- */
.md-typeset a {
  text-decoration-color: rgba(200, 16, 46, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}
.md-typeset a:hover {
  text-decoration-color: var(--accent);
}

/* ---- Dark mode adjustments ---- */
[data-md-color-scheme="slate"] {
  --text-dark: rgba(255, 255, 255, 0.95);
  --text-body: rgba(255, 255, 255, 0.85);
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.35);
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-med: rgba(255, 255, 255, 0.14);
}
