/* juntangw.com: one page, no build step. Edit this file and index.html directly. */

:root {
  --text: #1f1f1f;
  --sec: #4a4a4a;      /* authors, venue lines */
  --light: #6e6e6e;    /* dates, notes, footer (5.1:1 on white, passes WCAG AA) */
  --rule: #dedede;
  --link: #2c5282;
  --link-hover: #1a365d;
  --award: #a51c30;
  --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .08);         /* photo and teasers */
  --shadow-hover: 0 1px 3px rgba(0, 0, 0, .12), 0 4px 14px rgba(0, 0, 0, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 56px 24px 64px; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }

h1 { margin: 0 0 32px; font-size: 2.1rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; text-align: center; }
h2 { margin: 0; font-size: 1.35rem; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 14px; }

.sprite { display: none; }

/* ---- Header: photo and links on the left, bio on the right ---- */

.about { display: flex; align-items: flex-start; gap: 36px; }
.profile { flex: 0 0 24%; max-width: 210px; }
.profile img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
.social { display: flex; justify-content: center; gap: 14px; margin-top: 12px; }
.social a { display: inline-flex; color: #555; }
.social a:hover { color: var(--text); text-decoration: none; }
.social svg { width: 20px; height: 20px; fill: currentColor; }
.social .cv { font-size: 1.02rem; font-weight: 800; line-height: 20px; letter-spacing: -.03em; }
.bio { flex: 1; }
/* Links inside running text get a faint underline, so they are not told apart by color alone (WCAG 1.4.1). */
.bio a, .news td a:not(.pic) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(44, 82, 130, .35);
}
.bio a:hover, .news td a:not(.pic):hover { text-decoration-color: currentColor; }
.bio p:last-child { margin-bottom: 0; }

/* ---- Sections ---- */

section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--rule); scroll-margin-top: 12px; }
.head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.scholar { font-size: .9rem; }

/* ---- News: a fixed-height box that scrolls ---- */

.newsbox { max-height: min(11.4em, 50vh); overflow-y: auto; }
.newsbox::-webkit-scrollbar { width: 8px; }
.newsbox::-webkit-scrollbar-track { background: #f3f3f3; border-radius: 4px; }
.newsbox::-webkit-scrollbar-thumb { background: #b9b9b9; border-radius: 4px; }
@supports not selector(::-webkit-scrollbar) {
  .newsbox { scrollbar-width: thin; scrollbar-color: #b9b9b9 #f3f3f3; }
}
.news { width: 100%; border-collapse: collapse; }
.news th {
  width: 1%; padding: 5px 22px 5px 0;
  color: var(--light); font-weight: 400; font-variant-numeric: tabular-nums;
  text-align: left; vertical-align: top; white-space: nowrap;
}
.news td { padding: 5px 24px 5px 0; }
.pic, .pic:hover { text-decoration: none; }

/* ---- Publications: venue banner over a teaser, text on the right ---- */

.pubs { margin: 0; padding: 0; list-style: none; }
.pubs li { display: grid; grid-template-columns: 150px 1fr; gap: 26px; margin-bottom: 26px; scroll-margin-top: 12px; }
.banner {
  display: block; margin-bottom: 8px; padding: 3px 0 4px;
  background: #222; color: #fff; border-radius: 2px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em; line-height: 1.2; text-align: center;
}
.thumb {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  background: #fff; border-radius: 4px; box-shadow: var(--shadow); transition: box-shadow .15s;
}
/* The teaser is the link to the poster (or slides), so it is shown on every screen size. */
.thumb-link { display: block; }
.thumb-link:hover .thumb { box-shadow: var(--shadow-hover); }
.title { font-weight: 600; line-height: 1.4; }
.authors { color: var(--sec); }
.authors strong { color: var(--text); font-weight: 600; }
.venue { color: var(--sec); }
.venue em { font-family: Georgia, "Times New Roman", Times, serif; font-size: .97em; }
.venue b { color: var(--award); font-weight: 600; }
.plinks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: .85rem; }
.plinks a { display: inline-flex; align-items: center; gap: 5px; }
.plinks svg { width: 12px; height: 12px; fill: currentColor; }

details { margin-top: 4px; }
summary { width: fit-content; margin-bottom: 20px; color: var(--light); font-size: .95rem; cursor: pointer; }
summary:hover { color: var(--text); }

footer {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule);
  color: var(--light); font-size: .82rem; text-align: center;
}

/* ---- Phones ---- */

@media (max-width: 640px) {
  .wrap { padding: 36px 20px 48px; }
  h1 { font-size: 1.8rem; margin-bottom: 24px; }
  .about { flex-direction: column; gap: 22px; }
  .profile { flex-basis: auto; width: 56%; margin: 0 auto; }
  /* Same two columns as on a desktop, scaled down, so the teaser stays beside its paper. */
  .pubs li { grid-template-columns: 96px 1fr; gap: 14px; margin-bottom: 22px; }
  .banner { margin-bottom: 5px; padding: 2px 0 3px; font-size: .62rem; }
  .title { font-size: .95rem; line-height: 1.35; }
  .authors, .venue { font-size: .87rem; line-height: 1.45; }
  .plinks { gap: 4px 12px; font-size: .82rem; }
  .news th { padding-right: 14px; }
}
