/* Font */
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap");

/* Global reset (very light) */
* {
  box-sizing: border-box;
}

/* Base page styles */
body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 23px;
  line-height: 1.7;
  color: #0f1b2b;
}

/* Header styling */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #f7f9fc;
  border-right: 1px solid #d4deef;
}

.nav-toggle {
  position: absolute;
  left: -9999px;
}

.nav-toggle-btn {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 20px;
  font-weight: 700;
  color: #0f1b2b;
  background: #f7f9fc;
  border: none;
  width: 100%;
  cursor: pointer;
}

.burger {
  position: relative;
  width: 22px;
  height: 2px;
  background: #0f1b2b;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #0f1b2b;
  transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.burger::before {
  top: -7px;
}

.burger::after {
  top: 7px;
}

.nav-toggle:checked + .nav-toggle-btn .burger {
  background: transparent;
}

.nav-toggle:checked + .nav-toggle-btn .burger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle:checked + .nav-toggle-btn .burger::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-header nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 32px 18px;
}

.site-header a {
  text-decoration: none;
  color: #0f1b2b;
  font-weight: 700;
  font-size: 28px;
  padding: 6px 10px;
  border-radius: 10px;
  transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.site-header a:hover {
  color: #1f4f87;               /* blue hover */
}

.site-header a.active {
  color: #0d3f6d;               /* blue active */
  font-weight: 700;
  background: #e5edfa;
  /* border: 1px solid #1f4f87; */
  box-shadow: 0 4px 10px rgba(17, 56, 112, 0.12);
}

/* Main content area */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px;
  margin-left: 280px; /* space for sidebar */
}

/* Footer (optional later) */
footer {
  border-top: 1px solid #ddd;
  padding: 20px 16px;
  font-size: 0.9rem;
  text-align: center;
  margin-left: 280px;
  color: #666;
}

/* People page */
.people-section {
  margin: 0 auto 40px auto;
  max-width: 1200px;
}

.people-section h1 {
  margin: 0 0 16px 0;
  font-size: 28px;
  font-weight: 700;
  color: #0f1b2b;
}

.people-section h2 {
  margin: 0 0 16px 0;
  font-size: 24px;
  font-weight: 700;
  color: #0f1b2b;
}

.people-section .subsection {
  margin-top: 18px;
}

.people-section .subsection h3 {
  margin: 0 0 12px 0;
  font-size: 22px;
  font-weight: 600;
  color: #0f1b2b;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* ~4 cards per row at 1200px */
  gap: 16px;
  justify-items: start;
}

.person-card {
  /* background: #f7f9fc; */
  /* border: 1px solid #d4deef; */
  padding: 12px;
  text-align: center;
}

.pi-grid {
  width: fit-content;
  max-width: 220px;
  grid-template-columns: repeat(1, minmax(200px, 220px));
  justify-content: start;
  justify-items: start;
}

.msc-grid {
  width: fit-content;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 16px;
  justify-content: start;
  justify-items: start;
}

.person-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.person-photo {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
  background: #e3e9f3;
  /* border: 1px solid #d4deef; */
}

#former .person-photo {
  display: none;
}

#former .person-link {
  gap: 4px;
}

.former-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
  justify-content: start;
  width: 100%;
  max-width: 1200px;
}

.former-list {
  margin: 0;
  padding-left: 18px;
  /* font-size: 20px; */
  list-style: disc;
  list-style-position: outside;
}

.former-list li + li {
  margin-top: 6px;
}

.former-postdocs .two-column {
  columns: 2;
  column-gap: 18px;
  list-style-position: outside;
}

.former-postdocs .two-column li {
  break-inside: avoid;
  margin-bottom: 4px;
}

.former-list a {
  text-decoration: none;
  color: #1f4f87; /* blue to indicate link */
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.video-grid.single {
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  justify-content: start;
}

.video-grid.four-up {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.video-card {
  padding: 12px;
  background: #f7f9fc;
  border: 1px solid #d4deef;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.video-section {
  margin-bottom: 24px;
}

.video-section h2 {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: #0f1b2b;
}

.notes-accordion {
  border: 1px solid #d4deef;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f7f9fc;
}

.notes-accordion summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 24px;
  color: #0f1b2b;
  list-style: none;
  position: relative;
  padding-left: 28px;
}

.notes-accordion summary::-webkit-details-marker {
  display: none;
}

.notes-accordion summary::after {
  content: "▼";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 22px;
  transition: transform 0.2s ease;
}

.notes-accordion[open] {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.notes-accordion[open] summary {
  margin-bottom: 10px;
}

.notes-accordion[open] summary::after {
  transform: rotate(180deg);
}

.notes-hero {
  display: flex;
  justify-content: center;
  margin: 10px 0 16px 0;
}

.notes-hero-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.notes-hero img {
  width: 120px;
  height: 120px;
  display: block;
}

.notes-hero-caption {
  font-size: 15px;
  color: #1f4f87;
  font-weight: 600;
}

.notes-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0 16px 0;
}

.notes-preview-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid #d4deef;
  border-radius: 10px;
  background: #f7f9fc;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.notes-preview-card img {
  width: 100%;
  height: 240px;
  object-fit: contain;
}

.notes-preview-placeholder {
  width: 100%;
  height: 240px;
  display: grid;
  place-items: center;
  background: #e3e9f3;
  color: #425776;
  font-size: 13px;
  text-align: center;
  border-radius: 8px;
  border: 1px dashed #d4deef;
}

.notes-preview-card span {
  font-size: 14px;
  color: #0f1b2b;
  text-align: center;
  word-break: break-word;
}

.video-card h3 {
  margin: 0;
  font-size: 18px;
  color: #0f1b2b;
}

.video-meta {
  margin: 0;
  font-size: 15px;
  color: #425776;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #e3e9f3;
  border-radius: 8px;
  overflow: hidden;
}

.video-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-frame--placeholder {
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #425776;
}

.research-section h1 {
  margin: 0 0 20px 0;
  font-size: 36px;
  color: #0f1b2b;
}

.research-intro {
  margin: 0 0 20px 0;
  font-size: 22px;
  line-height: 1.6;
  color: #1f2d3f;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); /* target ~3 cards per row at 1200px */
  gap: 20px;
}

.research-card {
  background: #f7f9fc;
  border: 1px solid #d4deef;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  text-decoration: none;
  color: inherit;
}

.research-thumb {
  height: 220px;
  background: #fff;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #d4deef;
  border-radius: 6px;
}

.research-card h3 {
  margin: 0;
  font-size: 20px;
  color: #0f1b2b;
}

.research-card p {
  margin: 0;
  font-size: 16px;
  color: #1f2d3f;
  line-height: 1.5;
}

.research-detail {
  margin: 24px 0;
  border: 1px solid #d4deef;
  padding: 16px;
  background: #f7f9fc;
}

.research-detail h2 {
  margin: 0 0 12px 0;
  font-size: 28px;
  color: #0f1b2b;
}
.research-detail h3 {
  margin: 0 0 12px 0;
  font-size: 22px;
  color: #0f1b2b;
}

.image-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 12px 0;
}

.research-figure {
  height: 120px;
  border: 1px dashed #d4deef;
  background: #e3e9f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #425776;
}

.paper-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  list-style-position: outside;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.paper-list li + li {
  margin-top: 8px;
}

.paper-list a {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.person-name {
  font-weight: 600;
  font-size: 18px;
  color: #0f1b2b;
}

.person-role {
  font-size: 14px;
  color: #425776;
}

.person-link:hover .person-name {
  color: #1f4f87;
}

/* Home page image collage */
.collage {
  position: relative;
  max-width: 1200px;            /* align with site width */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.collage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.collage img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  justify-self: center;
  align-self: center;
  padding: 10px;
  box-sizing: border-box;
  background: #f7f9fc;
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 0 1px #d4deef;
  display: block;
}

/* Text block overlaying collage */
.collage-text {
  position: static;
  transform: none;
  width: 100%;
  background: rgba(254, 254, 254, 0.9);
  border-radius: 0;
  padding: 18px 20px;
  box-shadow: none; /* square edges, no soft rounding */
  font-size: 22px;
  line-height: 1.6;
}

.collage-text h1 {
  margin: 2px 0 8px 0;
  font-size: 32px;
  color: #1f2114;
}

.collage-text p {
  margin: 0 0 15px 0;
}

.collage-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin: 0;
}

.collage-columns ul {
  margin: 0;
  padding: 12px 16px 12px 26px;
  list-style: disc;
  list-style-position: outside;
  background: rgba(225, 233, 245, 0.7);
  border: 1px solid #d4deef;
  border-radius: 0;
}

.collage-columns li + li {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .collage {
    column-gap: 8px;
    row-gap: 120px;
  }

  .collage-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .collage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .collage-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile header */
@media (max-width: 900px) {
  .site-header {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #d4deef;
    z-index: 999;
  }

  .nav-toggle-btn {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 52px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d4deef;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    background: #f7f9fc;
  }

  .nav-toggle-btn .nav-title {
    display: none;
  }

  .site-header nav {
    display: none;
    width: 100%;
    padding: 8px 16px 16px 16px;
    background: #f7f9fc;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.05);
    position: absolute;
    top: 64px;
    left: 0;
  }

  .nav-toggle:checked ~ nav {
    display: flex;
  }

  .site-header a {
    font-size: 20px;
    padding: 6px 0;
  }

  main {
    margin-left: 0;
    padding-top: 120px; /* leave room for fixed header button */
  }

  footer {
    margin-left: 0;
  }
}

/* Publications page */
.publications-section {
  max-width: 1000px;
}

.publications-section h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.publications-note {
  font-size: 18px;
  margin-bottom: 24px;
}

/* Contain legacy HTML */
#publications-list {
  font-size: 18px;
  line-height: 1.6;
}

#publications-list hr {
  border: none;
  border-top: 1px solid #d4deef;
  margin: 14px 0;
}

#publications-list li {
  list-style: none;
  margin-bottom: 10px;
}

#publications-list a {
  color: #1f4f87;
  text-decoration: none;
}

#publications-list a:hover {
  text-decoration: underline;
}

/* CV-specific styles */
#cv-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

#cv-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

#cv-content h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 0.3rem;
}

#cv-content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 1.5rem 0;
}

#cv-content .cv-block {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

#cv-content ul {
  margin: 0.5rem 0 1.5rem 0;
  padding-left: 1.5rem;
}

#cv-content li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

#cv-content strong {
  color: #2c3e50;
  font-weight: 600;
}

#cv-content a {
  color: #3498db;
  text-decoration: none;
}

#cv-content a:hover {
  text-decoration: underline;
}
