/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Bootstrap 4.4 default stack — matches https://archiki.github.io/ (uses Bootstrap, no custom fonts) */
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    'Noto Sans',
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol',
    'Noto Color Emoji';
}

:root {
  --container-padding-y: 36px;
  --font-body:
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    'Noto Sans',
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol',
    'Noto Color Emoji';
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #5c5c5c;
  /* Left-bar blocks — match .research-interests (3px solid #2a6099) */
  --accent-bar-width: 3px;
  --accent-bar-color: #2a6099;
  --accent-bar-bg: linear-gradient(180deg, #f0f5fa 0%, #fafcfd 55%, #ffffff 100%);
  --accent-bar-radius: 0 8px 8px 0;
  --accent-bar-shadow:
    0 1px 0 rgba(26, 58, 92, 0.06),
    0 2px 10px rgba(26, 58, 92, 0.06);
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--text-primary);
  background-color: #f7f7f5;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: #2a6099;
  text-decoration: underline dotted;
  transition: color 0.3s linear, text-decoration-color 0.3s linear;
}

a:hover {
  color: #c0562a;
  text-decoration: underline;
}

/* ===== PAGE HEADER: scrolls away with the page (not sticky) ===== */
.page-header {
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 14px rgba(30, 60, 100, 0.1);
}

.banner-image-wrap {
  width: 100%;
  height: clamp(96px, 14vw, 200px);
  overflow: hidden;
  background: #1a3a5c;
  line-height: 0;
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Crop away the top of the photo; anchor to bottom */
  object-position: center bottom;
  display: block;
}

/* ===== MAIN LAYOUT ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 32px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* ===== SIDEBAR (fixed left column on wide screens, Archiki-style) ===== */
.sidebar {
  width: 280px;
  flex-shrink: 0;
}

@media (min-width: 821px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    width: 280px;
    /* Fallback before/without JS — same banner height as .banner-image-wrap; JS sets inline */
    top: calc(var(--container-padding-y) + clamp(96px, 14vw, 200px));
    max-height: calc(100vh - var(--container-padding-y) - clamp(96px, 14vw, 200px) - 16px);
    left: max(24px, calc((100vw - 1080px) / 2 + 24px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px; /* room for scrollbar */
  }

  .sidebar-sticky {
    position: static;
  }

  .main-content {
    margin-left: 320px; /* 280px column + 40px gap */
  }
}

.name {
  font-size: 26pt;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.first-name {
  font-weight: 800;
}

.last-name {
  font-weight: 300;
  color: #444;
}

/* Landscape photo (e.g. 4096×3072 → 4:3) — full column width on desktop */
.profile-photo {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  margin: 14px 0 12px;
  display: block;
  box-shadow: 0 4px 18px rgba(30,60,100,0.13);
  border: 3px solid #fff;
  outline: 1px solid #d8e4f0;
}

.sidebar-position {
  font-size: 13px;
  font-weight: 600;
  color: #2a6099;
  margin-top: 6px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.sidebar-inst {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

.sidebar-inst.muted {
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid #e0e8f0;
  margin: 14px 0;
}

/* sidebar nav (Archiki-style: prominent icon column + labels) */
.sidebar-links {
  list-style: none;
  padding: 0;
}

.sidebar-links.menur {
  margin-top: 2px;
}

.sidebar-link-item {
  margin-bottom: 4px;
  line-height: 1.85;
}

.sidebar-link-item.pt-3 {
  padding-top: 0.65rem;
}

.menulink {
  color: #2a6099;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0;
  transition: color 0.3s linear;
  letter-spacing: 0.01em;
}

/* archiki.github.io assets/style-3.css — .menulink:hover */
.menulink:hover {
  color: #111;
}

/* Prominent fixed-width icon column (cf. “had” on reference sites) */
.menulink i.had {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  min-width: 1.65rem;
  margin-right: 0.35rem;
  font-size: 1.05rem;
  color: #1a3a5c;
  flex-shrink: 0;
}

.menulink:hover i.had {
  color: #111;
}

/* collab callout */
.sidebar-collab {
  background: linear-gradient(135deg, #eef6ff 0%, #e8f4ed 100%);
  border-left: 3px solid #2a6099;
  border-radius: 7px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 9px 12px;
  margin-top: 4px;
  font-size: 11px;
  word-wrap: break-word;
}

.sidebar-collab strong {
  color: #1a3a5c;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  min-width: 0;
}

/* ===== BIO ===== */
.bio {
  background: #fff;
  border-radius: 10px;
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: 0 1px 6px rgba(30,60,100,0.07);
  border: 1px solid #e8eef5;
}

.bio p {
  margin-bottom: 12px;
  font-size: 14.5px;
  color: var(--text-primary);
  text-align: justify;
  line-height: 1.72;
  font-weight: 500;
}

.bio p:last-child {
  margin-bottom: 0;
}

.bio a {
  color: #2a6099;
  text-decoration: underline dotted;
  font-weight: 500;
}

.bio a:hover {
  color: #c0562a;
  text-decoration: underline;
}

.bio strong {
  color: var(--text-primary);
}

/* ===== SECTION WRAPPER ===== */
.section {
  background: #fff;
  border-radius: 10px;
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: 0 1px 6px rgba(30,60,100,0.07);
  border: 1px solid #e8eef5;
}

.section-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45em;
  font-size: 17pt;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0ecf8;
  letter-spacing: -0.01em;
}

.section-title-icon {
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.92;
}

/* ===== EDUCATION ===== */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.edu-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid #e8eef5;
}

.edu-card:first-child {
  padding-top: 4px;
}

.edu-card--last,
.edu-card:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.edu-logo-wrap {
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fafbfd 0%, #f0f4fa 100%);
  border: 1px solid #e4eaf2;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(30, 60, 100, 0.06);
}

.edu-logo {
  max-width: 76px;
  max-height: 76px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.edu-logo--round {
  border-radius: 50%;
  max-width: 72px;
  max-height: 72px;
}

.edu-body {
  flex: 1;
  min-width: 0;
}

.edu-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 6px;
}

.edu-school {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1a3a5c;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.edu-school a {
  color: #1a3a5c;
  text-decoration: none;
  border-bottom: 1px dotted rgba(42, 96, 153, 0.45);
}

.edu-school a:hover {
  color: #2a6099;
  border-bottom-color: #2a6099;
}

.edu-when {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.edu-degree {
  margin: 0 0 4px 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.edu-stat {
  margin: 0 0 8px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #2a6099;
}

.edu-details {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text-secondary);
  font-weight: 500;
}

.edu-details li {
  margin-bottom: 6px;
}

.edu-details li:last-child {
  margin-bottom: 0;
}

.edu-details a {
  font-weight: 500;
}

.edu-k {
  font-style: italic;
  color: var(--text-muted);
  margin-right: 2px;
}

.edu-highlight {
  list-style: none;
  margin-left: -1.1rem;
  padding-left: 0;
  color: var(--text-primary);
}

.edu-star {
  color: #c0562a;
  font-size: 0.95em;
  margin-right: 4px;
}

.edu-tag {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 600px) {
  .edu-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .edu-logo-wrap {
    flex: none;
  }

  .edu-header {
    flex-direction: column;
    align-items: center;
  }

  .edu-when {
    white-space: normal;
  }

  .edu-details {
    text-align: left;
    padding-left: 1.25rem;
  }

  .edu-highlight {
    margin-left: 0;
    text-align: center;
    padding-left: 0;
  }
}

/* ===== ACADEMIC SERVICES ===== */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-block {
  padding: 16px 0;
  border-bottom: 1px solid #e8eef5;
}

.service-block:first-child {
  padding-top: 4px;
}

.service-block--last,
.service-block:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.service-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 6px;
}

.service-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1a3a5c;
  line-height: 1.4;
  letter-spacing: -0.02em;
  max-width: 100%;
}

/* Primary linked title inside service h3 — same size as heading, wraps naturally */
.service-title-link {
  font-size: inherit;
  font-weight: 700;
  color: #2a6099;
  text-decoration: underline;
  text-decoration-color: rgba(42, 96, 153, 0.45);
  text-underline-offset: 2px;
}

.service-title-link:hover {
  color: #c0562a;
  text-decoration-color: #c0562a;
}

.service-link {
  font-weight: 600;
  font-size: 13.5px;
  margin-left: 4px;
  white-space: nowrap;
}

.service-when {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.service-where {
  margin: 0 0 8px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #2a6099;
  letter-spacing: 0.02em;
}

.service-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: justify;
}

.service-body {
  margin-top: 4px;
}

.service-line {
  margin: 0 0 10px 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  font-weight: 500;
}

.service-line:last-child {
  margin-bottom: 0;
}

.service-line--attended {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #dde6f0;
}

.service-label {
  display: inline;
  font-style: italic;
  color: var(--text-muted);
  margin-right: 0.35em;
}

.service-line strong {
  color: var(--text-primary);
  font-weight: 700;
}

.service-meta {
  margin: 4px 0 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Inline honor (e.g. NeurIPS Top Reviewer): visible but compact vs. full .award-badge */
.honor-mention {
  display: inline-block;
  font-weight: 700;
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
  color: #7a4a00;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 2px 7px;
  margin: 0 1px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff8e8 0%, #ffefcc 100%);
  border: 1px solid #e8c46a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  vertical-align: 0.08em;
}

@media (max-width: 600px) {
  .service-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-when {
    white-space: normal;
  }

  .service-label {
    display: block;
    margin-bottom: 4px;
    margin-right: 0;
  }
}

/* Invited Talks / Teaching: country label in .service-title; left-aligned short blocks */
.service-title .talk-country {
  font-variant: small-caps;
  font-weight: 600;
  font-size: 0.95em;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

#invited-talks .service-desc,
#teaching .service-desc {
  text-align: left;
}

#invited-talks .service-desc,
#teaching .service-desc,
#academic-services .service-desc {
  line-height: 1.48;
}

/* Stronger left accent + tint + shadow so bar blocks read as distinct cards */
#invited-talks .service-block,
#teaching .service-block,
#academic-services .service-block,
.news-item,
.award-block {
  border-left: var(--accent-bar-width) solid var(--accent-bar-color);
  background: var(--accent-bar-bg);
  box-shadow: var(--accent-bar-shadow);
  border-radius: var(--accent-bar-radius);
}

/* Per-item left bar; gaps between blocks */
#invited-talks .service-block,
#teaching .service-block,
#academic-services .service-block {
  padding: 6px 14px 6px 12px;
  margin-bottom: 8px;
  border-bottom: none;
}

#invited-talks .service-block:last-child,
#teaching .service-block:last-child,
#academic-services .service-block:last-child {
  margin-bottom: 0;
  padding-bottom: 6px;
}

#invited-talks .service-line {
  margin-top: 4px;
  margin-bottom: 0;
}

#invited-talks .service-line:last-child {
  margin-bottom: 0;
}

#invited-talks .service-head,
#teaching .service-head,
#academic-services .service-head {
  margin-bottom: 5px;
}

#academic-services .service-body {
  margin-top: 2px;
}

#academic-services .service-line {
  line-height: 1.48;
}

/* ===== NEWS ===== */
.news-list {
  max-height: 250px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  padding-right: 4px;
}

.news-list::-webkit-scrollbar       { width: 4px; }
.news-list::-webkit-scrollbar-track { background: #f0f4f8; border-radius: 4px; }
.news-list::-webkit-scrollbar-thumb { background: #b0c8e0; border-radius: 4px; }

.news-item {
  padding: 6px 0 6px 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.42;
  font-weight: 500;
  margin-bottom: 8px;
}

.news-item:last-child { margin-bottom: 0; }

.news-date {
  font-weight: 700;
  color: #2a6099;
  font-size: 12.5px;
  margin-right: 4px;
}

.news-item a {
  color: #2a6099;
  text-decoration: underline dotted;
}

.news-item a:hover { color: #c0562a; text-decoration: underline; }
.news-item strong  { color: var(--text-primary); }

/* ===== PUBLICATIONS ===== */
/* Home-page blurb (matches body); .pub-note stays compact for the legend on publications.html */
.pub-intro {
  font-size: 15px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

/* Empty / TBD sections (Teaching, Invited Talks, etc.) */
.placeholder-note {
  font-size: 15px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.pub-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.highlight-legend {
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 0 3px 3px 0;
  border-left: 3px solid #2a6099;
  background: linear-gradient(135deg, #e3eef8 0%, #ecf5f0 100%);
  box-shadow: 0 1px 3px rgba(42, 96, 153, 0.12);
}

.pub-year-heading {
  font-size: 14pt;
  font-weight: 700;
  color: #2a6099;
  margin: 20px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #ccdcee;
  letter-spacing: 0.02em;
}

/* Category titles (match CV: conferences / journals / preprints) */
.pub-section-heading {
  font-size: 13px;
  font-weight: 700;
  color: #1a3a5c;
  margin: 24px 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0ecf8;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.pub-section-heading:first-of-type {
  margin-top: 4px;
}

.pub-entry {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  margin-bottom: 12px;
  border-left: 3px solid #b8cfe4;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, #f5f8fb 0%, #ffffff 100%);
  box-shadow:
    0 1px 0 rgba(26, 58, 92, 0.06),
    0 2px 14px rgba(26, 58, 92, 0.07);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

/* Venue acronym: fixed-width tag column; long acronyms wrap */
.pub-venue-chip {
  --pub-venue-chip-w: 6rem;
  flex: 0 0 var(--pub-venue-chip-w);
  width: var(--pub-venue-chip-w);
  min-width: var(--pub-venue-chip-w);
  max-width: var(--pub-venue-chip-w);
  box-sizing: border-box;
  padding: 5px 8px;
  text-align: center;
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 96, 153, 0.07);
  border: 1px solid rgba(42, 96, 153, 0.22);
  border-radius: 10px;
  box-shadow: none;
}

.pub-entry.highlighted .pub-venue-chip {
  background: rgba(42, 96, 153, 0.12);
  border-color: rgba(42, 96, 153, 0.35);
}

.pub-text {
  flex: 1;
  min-width: 0;
}

.pub-entry:hover {
  border-left-color: #2a6099;
  background: #f3f8fc;
  box-shadow:
    0 1px 0 rgba(26, 58, 92, 0.08),
    0 4px 18px rgba(42, 96, 153, 0.11);
}

.pub-entry.highlighted {
  background: linear-gradient(135deg, #e3eef8 0%, #ecf5f0 100%);
  border-left: 3px solid #2a6099;
  box-shadow:
    0 1px 0 rgba(42, 96, 153, 0.1),
    0 3px 16px rgba(42, 96, 153, 0.14);
}

.pub-entry.highlighted:hover {
  background: linear-gradient(135deg, #d8e8f5 0%, #e3f2ea 100%);
  box-shadow:
    0 1px 0 rgba(42, 96, 153, 0.12),
    0 5px 20px rgba(42, 96, 153, 0.16);
}

.pub-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.4;
}

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

.pub-title a:hover {
  color: #2a6099;
  text-decoration: underline dotted;
}

.pub-authors {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 500;
  line-height: 1.5;
}

/* archiki — .thisauthor (emphasized author name) */
.pub-authors strong {
  color: #111;
  font-weight: 700;
  text-decoration: underline;
}

/* Full venue name only (acronym lives in .pub-venue-chip) */
.pub-venue {
  margin-bottom: 6px;
}

.pub-venue-chip .pub-venue-short {
  margin: 0;
  width: 100%;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  color: #1a3a5c;
  font-style: normal;
  letter-spacing: 0.05em;
  line-height: 1.35;
  font-variant: small-caps;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.pub-venue-chip .pub-venue-short a {
  color: #2a6099;
  text-decoration: none;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.06em;
}

.pub-venue-chip .pub-venue-short a:hover {
  color: #c0562a;
  text-decoration: underline;
}

.pub-venue-long {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.45;
  margin: 0;
}

.pub-venue-long em {
  font-style: italic;
}

@media (max-width: 560px) {
  .pub-entry {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pub-venue-chip {
    align-self: flex-start;
  }
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
}

.pub-links a {
  font-weight: 600;
  color: #fff;
  background: #2a6099;
  text-decoration: none;
  padding: 2px 10px;
  border-radius: 20px;
  transition: background 0.3s linear;
  letter-spacing: 0.02em;
  /* archiki — .tag */
  font-variant: small-caps;
  font-size: 0.9rem;
}

.pub-links a:hover {
  background: #c0562a;
}

.pub-badge {
  display: inline-block;
  background: #fff3e0;
  color: #b05800;
  border: 1px solid #f5c987;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 9px;
  margin-left: 8px;
  vertical-align: middle;
  font-style: normal;
  letter-spacing: 0.02em;
}

/* ===== INFO SECTIONS (Awards etc.) ===== */
.info-section { }

/* Segregated award blocks (same bar treatment as Invited Talks / Teaching / Academic Services) */
.award-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.award-block {
  margin: 0;
  padding: 6px 14px 6px 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.42;
  font-weight: 500;
}

.award-block:last-child {
  margin-bottom: 0;
  padding-bottom: 6px;
}

.award-block .award-text {
  margin: 0;
}

.award-block .label {
  font-weight: 700;
  color: #1a3a5c;
}

/* Period subheads — typography only (no bar/card: those are for .award-block) */
.award-subheading {
  margin: 0 0 8px 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.35;
  padding: 0;
  background: none;
  border: none;
}

.award-list > .award-subheading:first-of-type {
  margin-top: 4px;
}

/* Separate groups from prior entries with a rule, not a “card” */
.award-list > .award-subheading:not(:first-of-type) {
  margin-top: 0;
  margin-bottom: 8px;
  padding-top: 14px;
  border-top: 1px dashed #c9d6e6;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 24px 0 16px;
  font-size: 12px;
  color: #aaa;
  border-top: 1px solid #e8eef5;
  margin-top: 8px;
}

.footer a {
  color: #aaa;
  text-decoration: none;
}

.footer a:hover {
  color: #2a6099;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
  .container {
    flex-direction: column;
    padding: 18px 16px;
    gap: 18px;
  }

  .sidebar {
    position: static;
    left: auto;
    top: auto;
    max-height: none;
    overflow: visible;
    width: 100%;
    padding-right: 0;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-sticky {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .sidebar-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
  }

  .name {
    font-size: 22pt;
  }

  .profile-photo {
    max-width: 160px;
  }

  .sidebar-collab {
    text-align: left;
  }

  .banner-image-wrap {
    height: clamp(80px, 18vw, 150px);
  }

  .bio p {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .section { padding: 16px 14px; }
  .bio    { padding: 16px 14px; }
}

/* ===== Research Interests Bar ===== */
.research-interests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 14px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f7ff 0%, #f4fbf7 100%);
  border-left: 3px solid #2a6099;
  border-radius: 0 8px 8px 0;
}

.ri-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #1a3a5c;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-right: 4px;
  white-space: nowrap;
}

.ri-tag {
  background: #fff;
  color: #2a6099;
  border: 1px solid #bdd4ee;
  border-radius: 20px;
  padding: 2px 11px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.ri-tag:hover {
  background: #2a6099;
  color: #fff;
  cursor: default;
}

/* ===== Award Badge (inline) ===== */
.award-badge {
  display: inline-block;
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  color: #92600a;
  border: 1px solid #f5c842;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 12px;
  margin-left: 2px;
  vertical-align: middle;
  letter-spacing: 0.01em;
}

/* ===== Memories (photo gallery) ===== */
.memory-lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  max-width: 52rem;
}

.memory-path {
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(42, 96, 153, 0.08);
  color: #1a3a5c;
}

.memory-subheading {
  font-size: 16px;
  font-weight: 800;
  color: #0f2840;
  margin: 32px 0 14px 0;
  padding: 0 0 10px 12px;
  border-left: 4px solid #2a6099;
  border-bottom: 2px solid #c5d9ec;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.memory-subheading:first-of-type {
  margin-top: 10px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 4px;
}

.memory-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Poster: figure shrink-wraps to image width so caption aligns with image edges */
.memory-card.memory-card--poster-fit {
  display: inline-block;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
  margin-block: 0;
  vertical-align: top;
  box-sizing: border-box;
}

.memory-grid > .memory-card--poster-fit {
  justify-self: center;
}

.memory-card--poster-fit .memory-thumb.memory-thumb--natural-height {
  width: auto;
  max-width: 100%;
}

.memory-card--poster-fit .memory-thumb.memory-thumb--natural-height img {
  width: auto;
  max-width: 100%;
  height: auto;
}

.memory-card--poster-fit .memory-caption {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 8px;
  box-sizing: border-box;
}

.memory-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(145deg, #eef4fb 0%, #f8fafc 100%);
  border: 1px solid #d4e3f2;
}

.memory-thumb:not(:has(img)) {
  border-style: dashed;
  border-color: #b8cfe4;
}

.memory-thumb:not(:has(img))::after {
  content: "Photo placeholder — add your image";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.4;
}

.memory-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-caption {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* Side-by-side row: each figure has its own caption */
.memory-grid-row--two {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Three medals in one row — taller tiles than default 4:3 */
.memory-grid-row--three {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.memory-grid-row--three > .memory-card {
  min-width: 0;
}

.memory-grid-row--three .memory-thumb {
  aspect-ratio: 1 / 1;
}

/* Classmates pair, left cell (pj_3): no horizontal inset — narrow photo */
.memory-thumb--flush-h {
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

/* Two photos, one shared caption (3–4 medal pair only) */
.memory-card--medal-pair {
  grid-column: 1 / -1;
}

.memory-thumb-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

/* Grid default min-width:auto lets images overflow and overlap — looks like duplicate photos */
.memory-thumb-pair > .memory-thumb {
  min-width: 0;
  isolation: isolate;
}

.memory-grid > .memory-card,
.memory-grid-row--two > .memory-card,
.memory-grid-row--three > .memory-card {
  min-width: 0;
}

/* Degree + vertical portrait: letterbox portrait so height/weight matches row rhythm */
.memory-thumb--portrait {
  padding: 0 clamp(10px, 7vw, 42px);
  box-sizing: border-box;
}

.memory-thumb--portrait img {
  object-fit: contain;
}

/* Full image visible — default cover crops the center; similar ceremony shots looked identical */
.memory-thumb--contain {
  min-width: 0;
}

.memory-thumb--contain img {
  object-fit: contain;
  object-position: center;
}

/* Full width (no horizontal inset); height follows image — e.g. tall poster */
.memory-thumb.memory-thumb--natural-height {
  aspect-ratio: auto;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: fit-content;
  overflow: visible;
  flex-shrink: 0;
  align-self: stretch;
}

.memory-thumb.memory-thumb--natural-height img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center top;
  box-sizing: border-box;
}

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

  .memory-grid-row--two {
    grid-template-columns: 1fr;
  }

  .memory-grid-row--three {
    grid-template-columns: 1fr;
  }

  .memory-thumb-pair {
    grid-template-columns: 1fr;
  }
}