/* Feng Yu — faculty site */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #1b1d21;
  --muted: #6b7178;
  --faint: #9aa0a8;
  --accent: #c9971d;       /* warm gold, pairs with the burgundy panel */
  --accent-dark: #8f6a12;  /* darker gold, for text/links on white (better contrast) */
  --bg: #fbfaf8;
  --panel: #7a2e3b;        /* warm burgundy, sidebar */
  --panel-text: #f7ecee;
  --panel-muted: #dcb7bd;
  --border: #e7e3dd;
  --tag-bg: #f6ead0;
  --card: #ffffff;
  --max-content: 820px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Layout ---------- */

.layout {
  display: flex;
  align-items: flex-start;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Sidebar (right) ---------- */

.sidebar {
  width: 280px;
  flex-shrink: 0;
  order: 2;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--panel-text);
  padding: 40px 26px 26px 26px;
  border-radius: 26px;
  box-shadow: 0 24px 48px rgba(20, 22, 26, 0.22), 0 2px 8px rgba(20, 22, 26, 0.12);
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  margin: 24px 0 24px 32px;
  overflow-y: auto;
}

.avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 20px auto;
  border: 4px solid rgba(255,255,255,0.85);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.sidebar h1 {
  color: #fff;
  font-size: 1.6em;
  text-align: center;
  margin: 0 0 8px 0;
}

.sidebar .role {
  text-align: center;
  color: var(--panel-muted);
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0 0 22px 0;
}

.sidebar .role a {
  color: var(--panel-muted);
  border-bottom: 1px solid transparent;
}

.sidebar .role a:hover {
  color: #fff;
  border-bottom-color: var(--accent);
}

.social-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.18);
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--panel-muted);
  font-size: 0.78em;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.social-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.social-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

nav.sidenav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-top: 1px solid rgba(255,255,255,0.18);
  margin-top: 22px;
  padding-top: 24px;
}

nav.sidenav a {
  color: var(--panel-muted);
  text-decoration: none;
  font-size: 1em;
  font-weight: 700;
  padding: 0 4px;
  transition: color 0.15s;
}

nav.sidenav a:hover {
  color: #fff;
}

nav.sidenav a.active {
  color: #fff;
}

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

.page {
  flex: 1;
  min-width: 0;
  order: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px 24px;
}

section.block {
  scroll-margin-top: 110px;
  margin-bottom: 72px;
}

section.block:last-of-type { margin-bottom: 32px; }

.page-title {
  font-size: 2em;
  margin: 0 0 28px 0;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

h2.section-title {
  font-size: 1.3em;
  margin: 2.6em 0 16px 0;
  color: var(--accent-dark);
}

h2.section-title:first-of-type { margin-top: 0; }

p { color: #33363c; }

a { color: var(--accent-dark); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--accent-dark); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.tag {
  background: var(--tag-bg);
  color: var(--accent-dark);
  font-size: 0.85em;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 20px;
  border-bottom: none;
  transition: background 0.15s;
}

a.tag:hover {
  background: var(--accent);
  color: #fff;
  border-bottom: none;
}

/* Cards for entries: publications, news, students, services */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.card .meta {
  font-size: 0.82em;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.card h3 {
  font-size: 1.02em;
  margin: 0 0 4px 0;
}

.card p { margin: 0; font-size: 0.95em; }

/* News timeline */

.timeline-year {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2em 0 14px 0;
}

.timeline-year:first-of-type { margin-top: 0; }

.timeline {
  position: relative;
  border-left: 2px solid var(--border);
  padding-left: 22px;
  margin-bottom: 8px;
}

.timeline-item {
  position: relative;
  padding-bottom: 18px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-item .meta {
  font-size: 0.78em;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.timeline-item p { margin: 0; font-size: 0.95em; }

.pub-list { counter-reset: pub; }

.pub-card {
  position: relative;
  padding-left: 52px;
}

.pub-card::before {
  counter-increment: pub;
  content: counter(pub);
  position: absolute;
  left: 16px;
  top: 18px;
  font-family: 'Source Serif 4', serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1em;
}

.pub-card p { font-size: 0.96em; color: #33363c; }

.pill {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

table.simple {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.95em;
  margin-top: 4px;
}

table.simple th:last-child, table.simple td:last-child {
  width: 190px;
}

table.simple th, table.simple td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

table.simple th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.simple tr:last-child td { border-bottom: none; }

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

.badges img {
  height: 56px;
  width: auto;
}

footer.site-footer {
  color: var(--faint);
  font-size: 0.82em;
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .layout { flex-direction: column; padding: 0; max-width: none; }
  .sidebar {
    order: -1;
    position: relative;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 32px 20px 26px 20px;
    border-radius: 0;
  }
  nav.sidenav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    border-top: none;
    margin-top: 16px;
    padding-top: 16px;
  }
  .page { order: 2; margin: 0; padding: 32px 20px 60px 20px; }
  section.block { scroll-margin-top: 20px; }
  .pub-card { padding-left: 44px; }
}
