/* ============================================================
   CV — Swiss / Modernist Grid
   Adapted for Quarto HTML output (pandoc markdown → HTML5)
   Fonts: Inter Tight · JetBrains Mono
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:     #f4f3ef;
  --ink:    #0e0e0e;
  --ink-2:  #2a2a2a;
  --muted:  #707070;
  --rule:   #d9d7d1;
  --accent: #ff3b00;
  --sans:   "Inter Tight", system-ui, sans-serif;
  --mono:   "JetBrains Mono", ui-monospace, monospace;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg) !important;
  color: var(--ink);
  font-family: var(--sans) !important;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Site nav ───────────────────────────────────────────────── */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 52px 18px;
  border-bottom: 1px solid var(--rule);
}

.site-nav-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.site-nav-name:hover { color: var(--accent); text-decoration: none; }

.site-nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.site-nav-links a {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.site-nav-links a:hover,
.site-nav-links a[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
}

/* suppress Quarto's default navbar and sidebar chrome */
nav.navbar,
.navbar,
#quarto-sidebar { display: none !important; }

/* ── Quarto chrome ─────────────────────────────────────────── */
#title-block-header,
.quarto-title-banner { display: none !important; }

#quarto-document-content {
  max-width: 980px !important;
  padding: 52px 52px 80px !important;
}

/* ── Section counter ───────────────────────────────────────── */
body { counter-reset: h2; }
h2   { counter-increment: h2; }

/* ── Name / H1 ─────────────────────────────────────────────── */
h1 {
  font-family: var(--sans) !important;
  font-weight: 500 !important;
  font-size: clamp(40px, 6vw, 68px) !important;
  line-height: 0.92 !important;
  letter-spacing: -0.032em !important;
  color: var(--ink) !important;
  border: none !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
}

/* Role + org line */
h1 + p {
  font-size: 15px !important;
  color: var(--ink-2) !important;
  line-height: 1.4;
  margin: 0 0 6px !important;
  font-weight: 400;
}

/* Contact line — mono, uppercase, ruled bottom */
h1 + p + p {
  font-family: var(--mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted) !important;
  margin: 0 !important;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--ink);
}

h1 + p + p a { color: var(--muted); text-decoration: none; }
h1 + p + p a:hover { color: var(--accent); }

/* ── Section headings / H2 ─────────────────────────────────── */
h2 {
  display: flex !important;
  align-items: baseline;
  gap: 14px;
  font-family: var(--sans) !important;
  font-weight: 500 !important;
  font-size: 22px !important;
  letter-spacing: -0.02em !important;
  color: var(--ink) !important;
  border-top: 1px solid var(--ink) !important;
  border-bottom: none !important;
  padding: 13px 0 8px !important;
  margin: 40px 0 4px !important;
  text-transform: none !important;
}

h2::before {
  content: "§ " counter(h2);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  align-self: center;
  padding-bottom: 1px;
}

/* ── Subsection headings / H3 ──────────────────────────────── */
h3 {
  font-family: var(--mono) !important;
  font-weight: 500 !important;
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  color: var(--muted) !important;
  margin: 24px 0 10px !important;
  padding: 0 !important;
  border: none !important;
}

/* ── Definition lists (dated entries) ─────────────────────── */
dl {
  display: grid !important;
  grid-template-columns: 155px 1fr !important;
  gap: 0 24px !important;
  margin: 0 0 8px !important;
}

dt {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 400;
  text-align: left;
  padding: 14px 0 8px;
  border-top: 1px solid var(--rule);
  line-height: 1.4;
}

dd {
  margin: 0;
  padding: 14px 0 8px;
  border-top: 1px solid var(--rule);
}

/* First row: no top rule */
dl > dt:first-child,
dl > dt:first-child + dd {
  border-top: none;
  padding-top: 4px;
}

/* DD content hierarchy */
dd > p { margin: 0 0 2px; }

dd > p:first-child {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

dd > p:nth-child(2) {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}

dd > p:nth-child(n+3) {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 4px;
}

/* Bullet lists nested in dd (Leadership entries) */
dd > ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

dd > ul > li {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  padding: 5px 0 5px 18px;
  border-top: 1px dotted var(--rule);
  position: relative;
}

dd > ul > li:first-child { border-top: none; }

dd > ul > li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 6px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
}

/* Bold labels inside bullets (e.g. **Accreditation & Quality:**) */
dd > ul > li > strong {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* ── Numbered lists — publications, grants, chapters ───────── */
.level2 > ol,
.level3 > ol {
  list-style: none !important;
  counter-reset: item;
  padding: 0 !important;
  margin: 0 !important;
}

.level2 > ol > li,
.level3 > ol > li {
  counter-increment: item;
  position: relative;
  padding: 9px 0 9px 38px !important;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.level2 > ol > li:first-child,
.level3 > ol > li:first-child { border-top: none; }

.level2 > ol > li::before,
.level3 > ol > li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 11px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
}

.level2 > ol > li strong,
.level3 > ol > li strong { color: var(--ink); font-weight: 500; }

.level2 > ol > li em,
.level3 > ol > li em { font-style: italic; }

/* ── Bullet lists — interests, advisees, affiliations ──────── */
.level2 > ul,
.level3 > ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}

.level2 > ul > li,
.level3 > ul > li {
  padding: 7px 0;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.level2 > ul > li:first-child,
.level3 > ul > li:first-child { border-top: none; }

.level2 > ul > li strong,
.level3 > ul > li strong { color: var(--ink); font-weight: 500; }

/* ── Section prose paragraphs ──────────────────────────────── */
.level2 > p,
.level3 > p {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 10px;
  line-height: 1.55;
}

/* Italic notes above publication lists */
.level3 > p > em,
.level2 > p > em {
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── Tables — service section ──────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 20px;
}

thead {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 6px 16px 6px 0;
  text-align: left;
}

tbody tr { border-top: 1px solid var(--rule); }

td {
  padding: 8px 16px 8px 0;
  color: var(--ink-2);
  vertical-align: top;
}

td:first-child {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ── Inline ─────────────────────────────────────────────────── */
strong { font-weight: 500; color: var(--ink); }

code {
  font-family: var(--mono);
  font-size: 12px;
  background: none;
  color: var(--muted);
  padding: 0;
}

/* ── HR + footer ───────────────────────────────────────────── */
hr {
  border: none;
  border-top: 2px solid var(--ink);
  margin: 52px 0 16px;
}

hr + p {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}

hr + p a { color: var(--muted); }
hr + p a:hover { color: var(--accent); }

/* ── Responsive nav ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-nav {
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
  }

  #quarto-document-content {
    padding: 32px 24px 64px !important;
  }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
  html, body { background: #fff !important; }

  #quarto-document-content { padding: 24px 32px 48px !important; }

  .cv-print-btn { display: none !important; }

  a { color: var(--ink-2) !important; text-decoration: none !important; }

  h1 + p + p { border-bottom-color: #000 !important; }

  h2 {
    border-top-color: #000 !important;
    page-break-after: avoid;
  }

  h3 { page-break-after: avoid; }

  dl, table { page-break-inside: avoid; }
}
