@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;450;500;600;700&display=swap');

:root {
  --text: #18212b;
  --muted: #66706f;
  --link: #244f7a;
  --link-hover: #12324f;
  --border: #ded8cd;
  --background: #f7f7f7;
  --card: #fffdf8;
  --accent: #7a4f32;
}

body {
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  font-weight: 400;
}

/* Centered Quarto navbar, with consistent dropdown font */

.navbar {
  font-family: "Montserrat", system-ui, sans-serif !important;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  padding-top: 0.22rem;
  padding-bottom: 0.22rem;
  min-height: 38px;
  box-shadow: none;
}

.navbar > .container-fluid {
  justify-content: center;
}

.navbar-collapse {
  flex-grow: 0;
  justify-content: center;
}

.navbar-nav {
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}

.navbar a,
.navbar .nav-link,
.navbar .dropdown-toggle {
  font-family: "Montserrat", system-ui, sans-serif !important;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-nav .nav-link {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

/* Keep the navbar as links, not a hamburger, on tablet/half-screen widths */

@media (min-width: 650px) {
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }

  .navbar-expand-lg .navbar-toggler {
    display: none !important;
  }

  .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Let it collapse only on genuinely narrow screens */

@media (max-width: 649px) {
  .navbar {
    font-size: 0.78rem;
  }

  .navbar-nav {
    text-align: center;
  }
}

/* More dropdown */

.navbar .dropdown-menu {
  font-family: "Montserrat", system-ui, sans-serif !important;
  font-size: 0.78rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  padding: 0.25rem 0;
  min-width: 9.5rem;
}

.navbar .dropdown-menu .dropdown-item {
  font-family: "Montserrat", system-ui, sans-serif !important;
  color: var(--text);
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
  background: #f4efe6;
  color: var(--link-hover);
}

/* Centered homepage header */

.home-header {
  max-width: 680px;
  margin: 1.4rem auto 1.35rem auto;
  text-align: center;
}

.home-header .portrait {
  width: 400px;
  height: auto;
  border-radius: 2px;
  margin-bottom: 0.95rem;
}

.home-header h1 {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.95rem;
  font-weight: 650;
  line-height: 1.05;
  margin-top: 0;
  margin-bottom: 0.35rem;
  letter-spacing: -0.045em;
}

.subtitle {
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

/* Profile buttons */

.profile-links {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.profile-links p {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.profile-links a {
  font-family: "Montserrat", system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  text-decoration: none;
  font-size: 0.76rem;
  line-height: 1.2;
  color: var(--link);
  font-weight: 450;
}

.profile-links a:hover {
  border-color: #c9bda9;
  color: var(--link-hover);
  background: #fffaf0;
}

.profile-icon {
  width: 0.95em;
  height: 0.95em;
  opacity: 0.82;
  vertical-align: -0.12em;
}

/* Main homepage text */

.home-main {
  max-width: 625px;
  margin: 0 auto 2.6rem auto;
}

.home-main p {
  margin-bottom: 0.75rem;
}

/* Headings */

h1, h2, h3 {
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--text);
  letter-spacing: -0.035em;
}

h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-top: 1.65rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.18rem;
  border-bottom: 1px solid var(--border);
}

/* Lists */

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.32rem;
}

/* Links */

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

/* Mobile */

@media (max-width: 760px) {
  .home-header {
    margin: 1.6rem 1rem 1.8rem 1rem;
  }

  .home-header .portrait {
    width: 140px;
  }

  .home-main {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  main.content {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

/* Subtle homepage text links */

.subtle-links a {
  color: var(--text);
  text-decoration: none;
}

.subtle-links a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Homepage recent updates links */

.recent-updates a {
  color: var(--text);
  text-decoration: none;
}

.recent-updates a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Papers page: compact bibliography style */

.pub-list {
  margin-bottom: 1.15rem;
}

.pub {
  display: grid;
  grid-template-columns: 0.85rem 1fr;
  column-gap: 0.45rem;
  font-size: 0.86rem;
  line-height: 1.42;
  margin-bottom: 0.62rem;
  padding-left: 0;
  text-indent: 0;
}

.pub::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.25rem;
  background-image: url("images/icons/paper-icon.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.72;
}

.pub p {
  margin-top: 0;
  margin-bottom: 0;
}

.pub p {
  margin-top: 0;
  margin-bottom: 0;
}

.pub strong {
  font-weight: 600;
}

.pub strong a {
  color: var(--text);
  text-decoration: none;
}

.pub strong a:hover {
  color: var(--link);
  text-decoration: underline;
}

.pub em {
  color: var(--text);
}

.pub-links {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--muted);
  text-indent: 0;
}

.pub-links a {
  text-decoration: none;
}

.pub-links a:hover {
  text-decoration: underline;
}

/* Tighter year headings on publication pages */

.papers-page h2 {
  font-size: 1rem;
  font-weight: 650;
  margin-top: 1.25rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
}

/* Talks page: use compact entry style */

.talks-page h2 {
  font-size: 1rem;
  font-weight: 650;
  margin-top: 1.25rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
}

/* Contact page */

.contact-page main.content {
  max-width: 620px;
}

.contact-page h1 {
  font-size: 1.75rem;
  margin-top: 1.6rem;
  margin-bottom: 1.2rem;
}

.contact-page h2 {
  font-size: 0.98rem;
  font-weight: 650;
  margin-top: 1.45rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
}

.contact-page p {
  margin-bottom: 0.7rem;
}

.contact-card {
  margin: 0.6rem 0 1.35rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contact-card p {
  margin: 0;
}

/* Left-align profile buttons on Contact page only */

.contact-page .profile-links,
.contact-page .profile-links p {
  justify-content: flex-start;
}

/* CV page */

.cv-page main.content {
  max-width: 650px;
}

.cv-page h1 {
  font-size: 1.8rem;
  margin-top: 1.6rem;
  margin-bottom: 1rem;
}

.cv-page h2 {
  font-size: 1rem;
  font-weight: 650;
  margin-top: 1.6rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.16rem;
  border-bottom: 1px solid var(--border);
}

.cv-page p {
  margin-bottom: 0.75rem;
}

.cv-download {
  margin: 0.9rem 0 1.5rem 0;
}

.cv-download a {
  display: inline-block;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--link);
}

.cv-download a:hover {
  color: var(--link-hover);
  background: #fffaf0;
  border-color: #c9bda9;
}

/* Talks page with video thumbnails */

.talks-page main.content {
  max-width: 680px;
}

.talks-page h2 {
  font-size: 1rem;
  font-weight: 650;
  margin-top: 1.25rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
}

.talk-list {
  margin-bottom: 1.2rem;
}

.talk {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

.talk-thumb {
  width: 130px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
}

.talk-text {
  font-size: 0.86rem;
  line-height: 1.42;
}

.talk-text p {
  margin: 0;
}

.talk-text strong a {
  color: var(--text);
  text-decoration: none;
}

.talk-text strong a:hover {
  color: var(--link);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .talk {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .talk-thumb {
    width: 150px;
  }
}

/* Media page */

.media-page main.content {
  max-width: 650px;
}

.media-page h1 {
  font-size: 1.75rem;
  margin-top: 1.6rem;
  margin-bottom: 1.1rem;
}

.media-page h2 {
  font-size: 1rem;
  font-weight: 650;
  margin-top: 1.25rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
}

/* Book review entries with fixed-size cover thumbnails */

.review {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.review p {
  margin: 0;
}

.review img.cover-thumb {
  width: 44px !important;
  height: 64px !important;
  max-width: 44px !important;
  max-height: 64px !important;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
  background: var(--card);
}

.review-text {
  font-size: 0.86rem;
  line-height: 1.42;
}

.review-text p {
  margin: 0;
}

.review-text strong a {
  color: var(--text);
  text-decoration: none;
}

.review-text strong a:hover {
  color: var(--link);
  text-decoration: underline;
}