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

:root {
  --accent:   #1772d0;
  --accent-h: #e07b20;
  --text:     #222;
  --muted:    #555;
  --border:   #e0e0e0;
  --bg:       #fff;
  --bg-alt:   #f8f8f8;
  --red:      #c62828;
  --red-bg:   #fdf0f0;
  --red-bd:   #e57373;
  --max-w:    900px;
  --nav-h:    56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-h); }

/* ── Top Nav ─────────────────────────────────────────────── */
#topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.nav-links a:hover {
  color: var(--accent);
  background: #f0f5fc;
}

/* ── Page Wrapper ────────────────────────────────────────── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ── Bio Section ─────────────────────────────────────────── */
#bio {
  padding: 48px 0 0;
}

/* Top row: text left, card right */
.bio-top {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 40px;
  align-items: start;
}

/* Full-width openings banner below top row */
.openings-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--red-bd);
  background: var(--red-bg);
  border-radius: 10px;
  padding: 13px 18px;
  margin: 24px 0 0;
  color: var(--red);
  font-size: 15px;
  line-height: 1.55;
}

.openings-box::before {
  content: "📢";
  flex-shrink: 0;
  font-size: 17px;
  margin-top: 1px;
}

.bio-text h1 {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.bio-position {
  font-size: 15.5px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.bio-text p { margin-bottom: 12px; }

.bio-interests-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 16px 0 8px;
}

.bio-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.bio-kw {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: #eef4fd;
  border: 1px solid #c5d9f5;
  border-radius: 20px;
  padding: 3px 11px;
  white-space: nowrap;
}

/* Right column: photo card */
.bio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.bio-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.bio-card-body {
  width: 100%;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bio-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}

.bio-contact-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  font-size: 13px;
  opacity: .7;
  margin-top: 2px;
}

.bio-contact-row a {
  color: var(--accent);
  word-break: break-all;
}

/* Links row: below card body, inside card */
.bio-links {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 10px 8px 14px;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: center;
}

.bio-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1.5px solid #c5d9f5;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.bio-icon-link svg {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
}
.bio-icon-link span { display: none; }
.bio-icon-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Section ─────────────────────────────────────────────── */
.section {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ── News ────────────────────────────────────────────────── */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-list li {
  display: flex;
  gap: 14px;
  font-size: 16px;
  line-height: 1.6;
}

.news-date {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  width: 84px;
  padding-top: 1px;
}

/* ── Group ───────────────────────────────────────────────── */
.group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.group-card {
  text-align: center;
  font-size: 15px;
}

.group-card img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.group-card .member-name {
  font-weight: 700;
  font-size: 14px;
}

.group-card .member-role {
  color: var(--muted);
  font-size: 13px;
}

/* ── Publication filter ──────────────────────────────────── */
.pub-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.topic-chip {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.topic-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.topic-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Publications ────────────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pub-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: start;
}

.pub-thumb {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: opacity .15s;
}
.pub-thumb:hover { opacity: .85; }

.pub-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.4;
  display: block;
  margin-bottom: 5px;
}
.pub-title:hover { color: var(--accent-h); }

.pub-authors {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 4px;
}
.pub-authors strong { color: var(--text); }

.pub-venue {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text);
}
.pub-venue em { font-style: italic; }

.pub-venue .award {
  color: var(--red);
  font-weight: 700;
  font-style: normal;
}

.pub-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14.5px;
  margin-bottom: 8px;
}

.pub-links a {
  color: var(--accent);
  font-weight: 500;
}
.pub-links a:hover { color: var(--accent-h); }

.pub-links button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 14.5px;
  font-family: inherit;
  font-weight: 500;
}
.pub-links button:hover { color: var(--accent-h); }

.pub-abstract {
  display: none;
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  background: var(--bg-alt);
  border-left: 3px solid var(--border);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  text-align: justify;
}
.pub-abstract.open { display: block; }

/* ── Teaching / Service ──────────────────────────────────── */
#teaching-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.teaching-group {
  display: grid;
  grid-template-columns: 140px 1fr;
  column-gap: 24px;
  margin-bottom: 18px;
}

.teaching-institution {
  font-weight: 600;
  color: #333;
}

.teaching-courses {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teaching-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  column-gap: 20px;
  align-items: baseline;
}

.teaching-course {
  min-width: 0;
}

.teaching-term {
  text-align: right;
  white-space: nowrap;
  color: #666;
}



.simple-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 16px;
}

.simple-list li { padding-left: 0; }

.service-block { margin-bottom: 16px; }
.service-block h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.service-block ul {
  list-style: disc;
  padding-left: 20px;
  font-size: 16px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Sponsor ─────────────────────────────────────────────── */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 28px;
}
.sponsor-grid-item {
  text-align: center;
  font-size: 15px;
}

.sponsor-img {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.sponsor-img img {
  max-width: 100%;
  max-height: 110px;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  opacity: .85;
  transition: opacity .15s;
  filter: grayscale(20%);
}
.sponsor-img img:hover { opacity: 1; filter: none; }

/* ── Misc ────────────────────────────────────────────────── */
.misc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.misc-card {
  text-align: center;
  font-size: 15px;
}

.misc-card-img {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.misc-card-img img {
  max-width: 100%;
  max-height: 110px;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.misc-card .misc-title { font-weight: 700; font-size: 15px; }
.misc-card .misc-sub { color: var(--muted); font-size: 14px; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 12.5px;
  color: #999;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* News fixed scroll window */
#news .section-content {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
}
#news .section-content::-webkit-scrollbar { width: 5px; }
#news .section-content::-webkit-scrollbar-track { background: transparent; }
#news .section-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
  body {
    font-size: 16px;
    line-height: 1.65;
  }

  .page {
    padding: 0 18px 52px;
  }

  /* Keep navigation visible on mobile */
  #topnav {
    height: auto;
    min-height: var(--nav-h);
  }

  .nav-inner {
    padding: 10px 18px 9px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nav-name {
    font-size: 15.5px;
    line-height: 1.2;
  }

  .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links li {
    flex: 0 0 auto;
  }

  .nav-links a {
    display: block;
    font-size: 12.5px;
    line-height: 1.25;
    padding: 5px 9px;
    background: #f7f7f7;
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
  }

  #bio {
    padding-top: 34px;
  }

  .bio-top {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 0;
  }

  .bio-text h1 {
    font-size: 31px;
  }

  .bio-position {
    font-size: 15px;
  }

  .bio-keywords {
    gap: 8px;
  }

  .bio-kw {
    white-space: normal;
    line-height: 1.35;
  }

  /* Mobile bio card: compact, but not squeezed */
  .bio-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    max-width: 430px;
    margin: 2px auto 0;
    border-radius: 14px;
  }

  .bio-card img {
    grid-column: 1;
    grid-row: 1;
    width: 118px;
    height: 118px;
    aspect-ratio: unset;
    object-fit: cover;
    border-radius: 0;
  }

  .bio-card-body {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 14px 16px;
    justify-content: center;
    gap: 8px;
  }

  .bio-contact-row {
    font-size: 13px;
    line-height: 1.4;
    gap: 8px;
  }

  .bio-contact-row a,
  .bio-contact-row span {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .bio-links {
    grid-column: 1 / -1;
    width: 100%;
    padding: 11px 10px 13px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .bio-icon-link {
    width: 34px;
    height: 34px;
    padding: 6px;
  }

  .bio-icon-link svg {
    width: 16px;
    height: 16px;
  }

  .openings-box {
    font-size: 14px;
    padding: 13px 15px;
    margin-top: 26px;
  }

  .section {
    padding: 34px 0;
  }

  .section-header {
    margin-bottom: 18px;
  }

  /* News: more breathing room on mobile */
  .news-list {
    gap: 0;
  }

  .news-list li {
    display: block;
    padding: 13px 0 14px;
    border-bottom: 1px solid var(--border);
    font-size: 15.5px;
    line-height: 1.6;
  }

  .news-list li:first-child {
    padding-top: 0;
  }

  .news-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .news-date {
    display: block;
    width: auto;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.35;
  }

  #news .section-content {
    max-height: 360px;
    padding-right: 8px;
  }

  .pub-row {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .pub-thumb {
    max-width: 240px;
  }

  /* Teaching: turn rows into clean cards on mobile */
  .teaching-group {
    display: block;
    margin-bottom: 26px;
  }

  .teaching-group:last-child {
    margin-bottom: 0;
  }

  .teaching-institution {
    margin-bottom: 10px;
    font-size: 15.5px;
    line-height: 1.35;
  }

  .teaching-courses {
    gap: 0;
  }

  .teaching-row {
    display: block;
    padding: 12px 0 13px;
    border-bottom: 1px solid var(--border);
  }

  .teaching-row:first-child {
    padding-top: 0;
  }

  .teaching-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .teaching-course {
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .teaching-term {
    text-align: left;
    white-space: normal;
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--muted);
  }

  .simple-list {
    gap: 10px;
    font-size: 15.5px;
  }

  .service-block {
    margin-bottom: 20px;
  }

  .service-block ul {
    gap: 6px;
  }

  /* Do not force 3 columns on phones */
  .group-grid,
  .misc-grid,
  .sponsor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
  }

  .group-card,
  .misc-card,
  .sponsor-grid-item {
    font-size: 14.5px;
  }

  .group-card img {
    width: 110px;
    height: 110px;
  }
}

@media (max-width: 440px) {
  .page {
    padding: 0 16px 46px;
  }

  .nav-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-links a {
    font-size: 12px;
    padding: 5px 8px;
  }

  .bio-text h1 {
    font-size: 30px;
  }

  .bio-card {
    grid-template-columns: 102px minmax(0, 1fr);
    max-width: 100%;
  }

  .bio-card img {
    width: 102px;
    height: 102px;
  }

  .bio-card-body {
    padding: 12px 13px;
    gap: 7px;
  }

  .bio-contact-row {
    font-size: 12.5px;
    line-height: 1.35;
  }

  .bio-links {
    gap: 7px;
    padding: 10px 8px 12px;
  }

  .bio-icon-link {
    width: 32px;
    height: 32px;
  }

  .news-list li {
    padding: 14px 0 15px;
  }

  .teaching-row {
    padding: 13px 0 14px;
  }

  .group-grid,
  .misc-grid,
  .sponsor-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sponsor-img,
  .misc-card-img {
    height: auto;
    min-height: 92px;
  }
}

@media (max-width: 360px) {
  .bio-card {
    display: flex;
    flex-direction: column;
    max-width: 250px;
  }

  .bio-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .bio-card-body {
    width: 100%;
  }

  .bio-links {
    flex-wrap: wrap;
  }
}

