/* ---------------------------------------------------------------
   Personal academic homepage — Jing-Wen (Joycelyn) Chen
   Layout follows the classic Jon Barron / academic template:
   single 800px column, Lato, blue links with orange hover.
   --------------------------------------------------------------- */

:root {
  --link: #1772d0;
  --link-hover: #f09228;
  --text: #24292e;
  --muted: #666;
  --rule: #e2e2e2;
  --highlight: #ffffd0;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  padding: 0 20px 60px;
  max-width: 800px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

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

h2 {
  margin: 0 0 10px;
  font-weight: normal;
  font-size: 23px;
  letter-spacing: .2px;
}

strong { font-weight: 700; }
em { color: var(--muted); }

/* ---------- Header ---------- */

.header {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 30px 0 10px;
}

.header .bio { flex: 1 1 60%; min-width: 0; }

.header .portrait { flex: 0 0 200px; max-width: 40%; }

.header .portrait img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 25%;
  border-radius: 50%;
  display: block;
  transition: transform .25s ease-in-out;
}

.header .portrait img:hover { transform: scale(1.04); }

.name {
  margin: 0 0 14px;
  font-size: 33px;
  line-height: 1.2;
  text-align: center;
}

.name .zh {
  display: block;
  font-size: 17px;
  color: var(--muted);
  margin-top: 4px;
}

.links {
  text-align: center;
  margin-top: 16px;
  margin-bottom: 0;
}

/* ---------- Institution logo strip ---------- */

.logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  padding: 24px 0 6px;
}

.logos div { flex: 0 1 90px; text-align: center; }

.logos img {
  height: 64px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.logos p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Generic section ---------- */

section { padding: 22px 0 4px; }

section > p { color: var(--text); }

/* ---------- News ---------- */

.news-box {
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px 14px;
}

.news-box table { width: 100%; table-layout: fixed; border-collapse: collapse; }

.news-box th {
  width: 92px;
  text-align: left;
  vertical-align: top;
  font-weight: 700;
  white-space: nowrap;
  padding: 7px 12px 7px 0;
}

.news-box td { vertical-align: top; padding: 7px 0; }

/* ---------- Entries (papers, experience, projects) ---------- */

.entry {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 18px 12px;
}

.entry.selected { background: var(--highlight); }

.entry .thumb { flex: 0 0 160px; }

.entry .thumb img,
.entry .thumb svg {
  width: 160px;
  height: 160px;
  display: block;
  border-radius: 3px;
  object-fit: cover;
}

.entry .thumb.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
}

.entry .thumb.logo img { width: auto; max-width: 160px; height: auto; max-height: 100px; object-fit: contain; }

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

.papertitle { font-weight: 700; }

.venue { color: var(--muted); }

.entry .body p { margin: 8px 0 0; }

/* ---------- Awards & lists ---------- */

.award-list { margin: 0; padding-left: 20px; }
.award-list li { margin-bottom: 6px; }

/* ---------- Interests ---------- */

.interests { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 30px; }

.interests h3 {
  margin: 10px 0 4px;
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Footer ---------- */

.footer {
  padding: 26px 0 0;
  border-top: 1px solid var(--rule);
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .header { flex-direction: column-reverse; gap: 16px; padding-top: 22px; }
  .header .portrait { flex: 0 0 auto; width: 180px; max-width: 60%; }
  .entry { flex-direction: column; align-items: flex-start; gap: 14px; }
  .entry .thumb { flex: 0 0 auto; }
  .interests { grid-template-columns: 1fr; }
  .name { font-size: 27px; }
  .news-box th { width: 66px; white-space: normal; padding-right: 10px; }
  .entry .thumb img, .entry .thumb svg { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1 / 1; }
  .entry .thumb.logo img { max-width: 140px; }
}
