/* ---------------------------------------------------------------- */
/* Base                                                              */
/* ---------------------------------------------------------------- */

:root {
  --color-bg: #ffffff;
  --color-text: #222222;
  --color-muted: #5b6570;
  --color-accent: #23537a;
  --color-accent-light: #eef3f7;
  --color-border: #e2e6ea;
  --sidebar-width: 260px;
  --content-max-width: 760px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

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

a:hover,
a:focus {
  text-decoration: underline;
}

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

h1, h2, h3, h4 {
  line-height: 1.3;
}

/* ---------------------------------------------------------------- */
/* Top navigation                                                    */
/* ---------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: center;
}

.top-nav a {
  color: var(--color-text);
  font-weight: 500;
  padding: 0.25rem 0.1rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.top-nav a:hover,
.top-nav a:focus {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom-color: var(--color-accent);
}

/* ---------------------------------------------------------------- */
/* Page layout                                                       */
/* ---------------------------------------------------------------- */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

/* ---------------------------------------------------------------- */
/* Sidebar                                                            */
/* ---------------------------------------------------------------- */

.sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  position: sticky;
  top: 5.5rem;
  text-align: center;
}

.sidebar img {
  border-radius: 8px;
  width: 100%;
  margin-bottom: 1.1rem;
}

.sidebar h2 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
}

.sidebar .role {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0 0 1.1rem;
}

.sidebar .social-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------- */
/* Main content                                                       */
/* ---------------------------------------------------------------- */

.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--content-max-width);
}

.content h2:first-child {
  margin-top: 0;
}

.content ul {
  padding-left: 1.2rem;
}

.content > ul > li {
  margin-bottom: 0.6rem;
}

.paper-list {
  list-style: none;
  padding-left: 0;
}

.paper-list > li {
  margin-bottom: 0.6rem;
}

/* Research / teaching list items get a bit more breathing room */
h3 {
  margin-top: 2.2rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------- */
/* Accordions (paper abstracts)                                      */
/* ---------------------------------------------------------------- */

details {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.9rem;
  padding: 0.85rem 1rem;
  background-color: #fff;
  transition: background-color 0.15s ease;
}

details:hover {
  background-color: var(--color-accent-light);
}

details[open] {
  background-color: var(--color-accent-light);
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--color-accent);
  transition: transform 0.15s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

summary p,
summary em {
  font-weight: 400;
}

details > p {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- */
/* Responsive                                                         */
/* ---------------------------------------------------------------- */

@media (max-width: 760px) {
  .page {
    flex-direction: column;
    gap: 2rem;
    padding: 1.75rem 1.25rem 3rem;
  }

  .sidebar {
    position: static;
    width: 100%;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 1.25rem;
  }

  .sidebar img {
    width: 110px;
    flex: 0 0 auto;
    margin-bottom: 0;
  }

  .sidebar .social-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
  }

  .content {
    max-width: 100%;
  }

  .top-nav {
    justify-content: flex-start;
    gap: 0.3rem 1rem;
    padding: 0.75rem 1.25rem;
  }
}
