/* =================================================================
   Sitewide typography — applied on top of Minimal Mistakes defaults.
   Goal: editorial readability across Publications, Teaching, CV, etc.
   ================================================================= */

/* Smooth in-page anchor jumps — pairs with scroll-margin-top below so the
   Research nav and any other #fragment link eases into place. */
html {
  scroll-behavior: smooth;
}

/* Anchor-jump buffer: masthead is position:fixed at 70px, so #anchor
   links would otherwise land the heading flush under the bar. */
h1, h2, h3, h4, h5, h6 {
  scroll-margin-top: 90px;
}

/* Editorial Forest: soft sage-tinted page background + faint paper grain.
   Body background-image is the texture; it's disabled on small screens to
   keep retina rendering clean. The masthead reads --global-bg-color, so
   overriding it below keeps the bar in sync with the page tone. */
body {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.07  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
}

@media (max-width: 600px) {
  body {
    background-image: none;
  }
}

/* Kraft/oak masthead — autumnal warmth that gives the fixed bar a clear
   edge against the sage page. Loaded after main.css so this wins over the
   theme's --global-bg-color binding. The inner nav wrapper and individual
   menu items also have hardcoded backgrounds tied to --global-bg-color in
   _navigation.scss / _masthead.scss; making them transparent lets the
   kraft bg show through instead of painting sage rectangles over it. */
.masthead {
  background: #d8cdb0;
  border-bottom: 1px solid rgba(31, 29, 26, 0.12);
}

.masthead .greedy-nav,
.masthead__menu-item {
  background: transparent;
}

:root {
  /* Sage-tinted page tone — overrides MM default of #fff. */
  --global-bg-color: #eff1e7;
  /* Editorial palette — forest + bone, canonical site-wide variables. */
  --ink: #1f1d1a;
  --ink-soft: #4a463f;
  --paper: #f6f3ec;             /* bone */
  --rule: #a8a294;              /* warm gray — visible against sage page and white cards */
  --accent: #2d5d4f;            /* deep evergreen */
  --accent-soft: #4a7d6f;       /* sage, for hover/secondary */
  --accent-deep: #1f4338;       /* darker forest, for button hover */
  --accent-rgb: 45, 93, 79;     /* for rgba() link underlines */
  --navy: #2e4858;
  --clay: #9d5a35;              /* warm contrast for theme card 2 */
  --gold: #a8924a;

  /* Three-step text scale — use these instead of ad-hoc em values. */
  --text-body: 1em;
  --text-small: 0.92em;
  --text-micro: 0.72em;

  /* Sitewide serif stack — Source Serif 4 with Georgia/Iowan fallbacks. */
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Iowan Old Style", "Palatino Linotype", "Palatino", serif;
}

/* ---------- Body content area ---------- */
.page__content {
  font-family: var(--font-serif);
  font-size: 1.04em;
  line-height: 1.65;
  color: var(--ink);
}

.page__content p {
  margin-top: 0.6em;
  margin-bottom: 1em;
  line-height: 1.65;
}

/* Readable measure for long-form prose pages */
.page__content > p,
.page__content > ul,
.page__content > ol,
.page__content > blockquote {
  max-width: 42em;
}

/* ---------- Headings ---------- */
.page__content h1,
.page__title {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page__content h2 {
  font-family: var(--font-serif);
  font-size: 1.55em;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2.4em;
  margin-bottom: 1em;
  letter-spacing: -0.005em;
}
.page__content h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--accent);
  margin-top: 0.45em;
}

.page__content h3 {
  font-family: var(--font-serif);
  font-size: 1.2em;
  font-weight: 600;
  color: var(--accent);
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

.page__content h4 {
  font-family: var(--font-serif);
  font-size: 1.05em;
  font-weight: 600;
  color: var(--ink);
  margin-top: 1.3em;
  margin-bottom: 0.4em;
}

/* ---------- Lists ---------- */
.page__content ul,
.page__content ol {
  line-height: 1.6;
  margin-bottom: 1em;
}

.page__content li {
  margin-bottom: 0.35em;
}

.page__content li > ul,
.page__content li > ol {
  margin-top: 0.3em;
  margin-bottom: 0.3em;
}

/* ---------- Links ---------- */
.page__content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.3);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.page__content a:hover {
  border-bottom-color: var(--accent);
  background-color: rgba(var(--accent-rgb), 0.05);
}

/* ---------- Strong / em ---------- */
.page__content strong {
  color: var(--ink);
  font-weight: 700;
}

.page__content em {
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Sidebar bio readability ---------- */
.author__bio {
  font-family: var(--font-serif);
  line-height: 1.35;
  font-size: 0.95em;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 0.15em;
}

.author__research-areas {
  list-style: none;
  padding: 0.35em 0 0;
  margin: 0.3em 0 0.2em;
  border-top: 1px solid var(--rule);
}

.author__research-areas li {
  font-family: var(--font-serif);
  font-size: 0.78em;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  padding: 0.12em 0;
  line-height: 1.3;
}

/* ---------- Page title ---------- */
.page__title {
  font-size: 2em;
  margin-bottom: 0.4em;
}

/* ---------- Responsive bumps ---------- */
@media (min-width: 80em) {
  .page__content {
    font-size: 1.08em;
  }
}

@media (max-width: 700px) {
  .page__content {
    font-size: 1em;
    line-height: 1.6;
  }
  .page__content h2 {
    font-size: 1.35em;
  }
  .page__title {
    font-size: 1.7em;
  }
}
