/* ===== Base ===== */
:root {
  --text: #1f2328;
  --muted: #59636e;
  --accent: #7a0019;      /* deep maroon accent — change to taste */
  --rule: #d9dee3;
  --bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Header ===== */
header {
  border-bottom: 3px solid var(--accent);
  padding: 2.25rem 0 0.5rem;
}

header h1 {
  font-size: 1.9rem;
  font-weight: normal;
  letter-spacing: 0.02em;
}

header h1 a { color: var(--text); text-decoration: none; }

header .tagline {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0.2rem;
}

/* ===== Navigation ===== */
nav {
  margin-top: 1rem;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 1.5rem;
  padding-bottom: 0.25rem;
}

nav a:hover { color: var(--accent); }

nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ===== Main content ===== */
main {
  padding: 2.5rem 0 3rem;
  flex: 1 0 auto;   /* grow to push the footer to the bottom on short pages */
}

main h2 {
  font-size: 1.4rem;
  font-weight: normal;
  margin-bottom: 1.25rem;
}

main h3 {
  font-size: 1.15rem;
  font-family: Helvetica, Arial, sans-serif;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin: 2rem 0 0.75rem;
}

/* Don't add extra top gap when a heading is the first thing on the page */
main .container > :first-child { margin-top: 0; }

main p { margin-bottom: 1rem; }

main a { color: var(--accent); }

main ul { margin: 0 0 1rem 1.25rem; }

main li { margin-bottom: 0.5rem; }

/* Publication / working-paper entries */
.pub {
  margin-bottom: 1.5rem;
}

.pub .title { font-weight: normal; }

.pub .venue { font-style: italic; color: var(--muted); }

.pub .links {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
}

/* CV embed */
.cv-embed {
  width: 100%;
  height: 900px;
  border: 1px solid var(--rule);
  margin-bottom: 0.75rem;
}

.cv-fallback {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Courses — styled to match the research (.pub) entries exactly */
.course { margin-bottom: 1.5rem; }
.course .name { font-weight: normal; }
.course .term,
.course .award {
  font-style: italic;
  color: var(--muted);
}

/* Home page portrait */
.home-grid {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.home-grid .bio { flex: 1 1 380px; }

.home-grid .bio p { text-align: justify; }

.portrait {
  width: 300px;
  max-width: 100%;
  border: 1px solid var(--rule);
}

/* Contact block */
.contact-block { line-height: 2; }
.contact-block p:last-child { margin-bottom: 0; }

.contact-grid {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.map-wrap {
  flex: 0 0 auto;
  width: 500px;
  max-width: 100%;
  height: 260px;               /* fallback height when stacked on narrow screens */
}

.map {
  width: 100%;
  height: 100%;
  display: block;
  border: 1px solid var(--rule);
}

/* On wider screens, keep the map beside the text and match its height */
@media (min-width: 700px) {
  .contact-grid {
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .map-wrap { height: auto; align-self: stretch; }
  .contact-block { flex: 1 1 auto; }
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: Helvetica, Arial, sans-serif;
}

footer nav { margin: 0 0 0.75rem; font-size: 0.75rem; }

/* ===== Small screens ===== */
@media (max-width: 540px) {
  nav a { margin-right: 1rem; }
  header { padding-top: 1.5rem; }
}
