/* Clean white academic template, modeled on the AcademicPages layout */

:root {
  --bg: #ffffff;
  --text: #494e52;      /* body text */
  --muted: #7a8288;     /* nav and footer */
  --border: #f2f3f3;    /* masthead and footer lines */
  --link: #4682b4;      /* links */
  --button: #1f3a5f;    /* buttons (dark navy) */
  --button-hover: #2c5282;
  --heading: #1f3a5f;   /* section headings (same navy as the button) */
  --heading-line: #d3dce8; /* line under section headings */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

/* ---------- Top bar ---------- */
.masthead {
  border-bottom: 1px solid var(--border);
}
.masthead nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 3.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
}
.masthead a {
  color: var(--muted);
  font-size: 0.9rem;
}
.masthead a:hover { color: var(--text); text-decoration: none; }
.masthead .site-title {
  font-weight: 700;
  margin-right: 2rem;
}
.masthead a[aria-current="page"] { color: var(--text); }

/* ---------- Page content ---------- */
main {
  max-width: 740px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

h1 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
}
h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--heading-line);
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}
p { margin: 0 0 1.3em; }

/* Home: centered photo above the bio */
.profile-photo {
  display: block;
  width: 390px;
  max-width: 100%;
  margin: 0 auto 3rem;
}

/* Home: justified bio paragraphs below the photo */
.profile-photo ~ p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Lists of papers, grants, etc. */
.entry { margin-bottom: 1.5rem; }
.entry .title { font-weight: 700; }

/* Contact: wide photo and three columns */
.wide-photo { margin: 0 0 2.5rem; }
.wide-photo img { display: block; width: 100%; }
.wide-photo figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
}
.contact-grid h2 { margin-top: 0; }
.contact-grid .contact-next { margin-top: 2rem; }
.contact-grid p, .contact-grid address {
  margin: 0;
  font-style: normal;
  font-size: 0.95rem;
  overflow-wrap: break-word;
}
@media (max-width: 700px) {
  .contact-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .contact-grid h2 { margin-top: 1.5rem; }
}

/* Placeholder note for pages in progress */
.coming-soon {
  margin-bottom: 2rem;
  color: var(--muted);
  font-style: italic;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--heading-line);
  background: #f7f9fb;
}

/* Teaching: one block per course */
.course {
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--border);
}
.course:last-of-type { border-bottom: 0; }
.course-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.course-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}
.terms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  padding: 0;
}
.terms li {
  font-size: 0.8rem;
  color: var(--heading);
  background: #eef2f7;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

/* Quick links at the top of the Data page */
.jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-bottom: 2rem;
}

/* CV viewer: a scrolling window with the PDF pages inside */
.cv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.cv-download {
  display: inline-block;
  background: var(--button);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 4px;
}
.cv-download:hover { background: var(--button-hover); text-decoration: none; }

.cv-viewer {
  height: 75vh;
  min-height: 480px;
  overflow-y: auto;
  background: #f2f3f3;
  border: 1px solid #e3e5e6;
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.cv-page {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.cv-status { color: var(--muted); margin: auto; }
.cv-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .masthead nav { padding: 1rem 1.25rem; }
  .masthead nav { gap: 0.4rem 1rem; }
  .masthead a { font-size: 0.85rem; }
  .masthead .site-title { width: 100%; margin-right: 0; font-size: 0.95rem; }
  main { padding-top: 2.5rem; }
}
