/* ---------- Theme: edit these to restyle the whole site ---------- */
:root {
  --text: #111;
  --muted: #666;
  --line: #ddd;
  --bg: #fff;
  --font: "Palatino Linotype", Palatino, "TeX Gyre Pagella", "Book Antiqua", Georgia, serif;
  --sidebar: 340px;
  --thumb-width: 320px;   /* publication image column; figures keep their own aspect ratio */
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
.muted { color: var(--muted); }

/* ---------- Sidebar (fixed on the left) ---------- */
aside {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  padding: 48px 32px; border-right: 1px solid var(--line); overflow-y: auto;
  display: flex; flex-direction: column;
}
.photo { width: 140px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
aside h1 { font-size: 1.3rem; margin: 16px 0 4px; }
aside p { font-size: 0.9rem; margin: 0; }
nav { display: flex; flex-direction: column; gap: 4px; margin: 28px 0; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover, nav a.active { color: var(--text); }
nav a.active { font-weight: bold; }
.icons { display: flex; gap: 14px; font-size: 1.1rem; margin-bottom: 12px; }
.icons a { text-decoration: none; }
aside .updated { margin-top: auto; padding-top: 24px; font-size: 0.8rem; }

/* ---------- Main content ---------- */
main { margin-left: var(--sidebar); padding: 48px 56px; max-width: calc(var(--sidebar) + 860px); }
.page { display: none; }
.page.active { display: block; }
h2 { font-size: 1.5rem; margin: 0 0 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h2:not(:first-child) { margin-top: 40px; }
h3 { font-size: 1.1rem; margin: 24px 0 8px; }
ul { padding: 0; list-style: none; }

/* Lists with a right-aligned date (education, awards) */
.dated li { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 4px; }
.dated .date { color: var(--muted); white-space: nowrap; }

/* Plain bullet lists on About (research interests) */
#about ul:not(.dated) { list-style: disc; padding-left: 20px; }
#about ul:not(.dated) li { margin-bottom: 8px; }

/* ---------- Projects ---------- */
/* ### = research interest, #### = project, [J2](#J2) = paper link */
#projects h3 { margin-top: 36px; }
#projects h3 + p { margin-top: 0; }
#projects h4, #projects h4 + p { margin: 0 0 0 20px; padding-left: 16px; border-left: 2px solid var(--line); }
#projects h4 { padding-top: 12px; font-size: 1rem; }
#projects h4 + p { font-size: 0.95rem; }
#projects a[href^="#"]::before { content: "["; }
#projects a[href^="#"]::after { content: "]"; }

/* ---------- Publications ---------- */
/* Image column is reserved even when an entry has no image, so text always lines up. */
#publications li { display: grid; grid-template-columns: var(--thumb-width) 1fr; gap: 24px; margin-bottom: 24px; scroll-margin-top: 24px; font-size: 0.92rem; color: var(--muted); }
#publications li > div { grid-column: 2; }
#publications li p { margin: 0; }
#publications li :is(a, strong) { color: var(--text); }
#publications .thumb { align-self: start; cursor: zoom-in; }   /* click opens the full-size figure */
#publications img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
#publications li:target { background: #f4f4f4; outline: 8px solid #f4f4f4; }   /* highlight when jumped to from Projects */

/* ---------- Mobile: sidebar stacks on top ---------- */
@media (max-width: 800px) {
  aside { position: static; width: auto; padding: 32px 16px; border-right: 0; border-bottom: 1px solid var(--line); text-align: center; }
  nav { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 20px 0; }
  .icons { justify-content: center; }
  .photo { align-self: center; }
  main { margin-left: 0; padding: 32px 16px; }
  .dated li { flex-direction: column; gap: 0; }
  #publications li { grid-template-columns: 1fr; gap: 8px; }
  #publications li > div { grid-column: 1; }
  #projects h4, #projects h4 + p { margin-left: 0; }
}
