/* ═══════════════════════════════════════════════════════════════
   CV — screen + print from one source.

   The PDF at /assets/pdfs/cv.pdf is this page run through WeasyPrint
   in CI, so anything here changes both. Layout stays in normal flow
   (nothing paged media can't break) and @page owns the margins.

   Typography follows the North American academic CV convention: a
   serif text face, and a narrow left column of dates (or publication
   numbers) against an indented content column, so a reader can scan
   one edge. Deliberately near-monochrome — the site's green accent is
   a web affordance and reads as decoration on a document, so it is
   kept to the download button and link hovers.
   ═══════════════════════════════════════════════════════════════ */

.cv-wrap {
  --cv-ink: #1a1a1a;        /* body text — near-black, not pure #000 */
  --cv-soft: #5c5c5c;       /* dates, locations, secondary detail    */
  --cv-rule: #b4b4b4;       /* section rules — hairline, not a bar   */
  --cv-head-rule: #8c8c8c;  /* the one under the name, a touch firmer*/
  --cv-hair: #dcdcdc;       /* hairlines inside a section            */
  --cv-gap: 112px;          /* width of the left date/number column  */

  max-width: 820px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  /* Times New Roman. The CI runner now installs the real Microsoft
     fonts, so the PDF carries it rather than a clone; Liberation Serif
     still stands behind it if that download ever fails. The CJK faces
     are named explicitly and are Song/Ming cuts rather than sans, so
     the Chinese paper title sits in the same voice as the Latin text:
     Songti on macOS, SimSun on Windows, Noto Serif on Linux. */
  font-family: "Times New Roman", "Liberation Serif", Georgia,
               "Songti SC", "SimSun", "Noto Serif CJK SC", "Noto Serif SC",
               serif;
  font-size: 16px;     /* 12pt */
  line-height: 1.5;
  color: var(--cv-ink);
}

/* ── Header ───────────────────────────────────────────────── */
.cv-head {
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--cv-head-rule);
}
.cv-name {
  font-size: 18.7px;   /* 14pt */
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 10px;
  line-height: 1.2;
}
.cv-contact {
  font-size: 16px;
  line-height: 1.55;
  color: var(--cv-soft);
}
.cv-contact a { color: inherit; text-decoration: none; }
.cv-contact a:hover { color: var(--accent-dark, #5a9a2e); }

/* ── Section headings ─────────────────────────────────────────
   The rule hangs close under the words and the air goes *below* it.
   A gap above the rule would detach it from its heading and make it
   read as a divider between sections instead of an underline. */
.cv-section { margin: 0 0 24px; }
.cv-section > h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--cv-ink);
  margin: 0 0 14px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--cv-rule);
}
.cv-section > h2 .cv-sec-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
  color: var(--cv-soft);
  margin-left: 10px;
}
.cv-sec-note a { color: inherit; }

/* ── The two-column row every section is built from ───────── */
.cv-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 9px;
}
.cv-row:last-child { margin-bottom: 0; }
.cv-when {
  flex: 0 0 var(--cv-gap);
  font-size: 16px;
  color: var(--cv-soft);
  line-height: 1.5;
}
.cv-what { flex: 1 1 auto; min-width: 0; }
.cv-num { text-align: right; font-variant-numeric: tabular-nums; }

/* organisation line: name left, place right */
.cv-orgline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.cv-org { font-weight: 700; letter-spacing: .01em; }
.cv-loc { flex: none; font-size: 16px; color: var(--cv-soft); white-space: nowrap; }
.cv-role { font-style: italic; color: #333; margin-top: 1px; }

/* ── Lists ────────────────────────────────────────────────── */
.cv-list { margin: 5px 0 0; padding-left: 17px; }
.cv-list li { margin-bottom: 3px; }
.cv-list li:last-child { margin-bottom: 0; }
.cv-list ul { margin: 3px 0 0; padding-left: 18px; list-style-type: circle; }
/* bullets sections have no left column, so they sit flush */
.cv-list-flush { margin-top: 0; padding-left: 18px; }
.cv-flow { margin: 0; }

/* ── Publications ─────────────────────────────────────────── */
.cv-group-label {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cv-soft);
  margin: 18px 0 9px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--cv-hair);
}
/* The per-group count rides on the label, set apart by weight and
   colour rather than brackets so it reads as a tally, not a footnote. */
.cv-group-n {
  margin-left: 8px;
  font-weight: 400;
  color: var(--cv-soft);
  letter-spacing: 0;
}
.cv-group-n::before { content: "("; }
.cv-group-n::after  { content: ")"; }

.cv-pubs + .cv-group-label { margin-top: 20px; }
.cv-section > .cv-group-label:first-child { margin-top: 0; }
.cv-pubs .cv-row { margin-bottom: 9px; }
.cv-pubs .cv-when { flex-basis: 34px; font-weight: 600; color: var(--cv-ink); }
.cv-pubs .me { font-weight: 700; }
.cv-pub-note { color: var(--cv-soft); }
.cv-what em { font-style: italic; }
.cv-what a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--cv-hair); }
.cv-what a:hover { border-bottom-color: var(--accent, #7db544); }

/* The reviewer tally sits above its journal list: the number is the
   headline, the journals are the evidence for it. */
.cv-tally {
  font-weight: 700;
  margin-bottom: 2px;
}

/* ── Skillset / referees ──────────────────────────────────── */
.cv-label { font-weight: 700; color: var(--cv-ink) !important; }
.cv-ref-name { font-weight: 700; color: var(--cv-ink) !important; }
.cv-ref-note { font-style: italic; color: var(--cv-soft); }
.cv-refline { font-size: 16px; color: #3a3a3a; }

/* ── Download button (screen only) ────────────────────────── */
.cv-actions { text-align: center; margin: -14px 0 28px; }
.cv-actions a {
  display: inline-block;
  padding: 7px 18px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  border: 1.5px solid var(--accent, #7db544);
  border-radius: 4px;
  color: var(--accent-dark, #5a9a2e);
  text-decoration: none;
}
.cv-actions a:hover { background: var(--accent, #7db544); color: #fff; }

/* ── Narrow screens: the left column stacks ───────────────── */
@media screen and (max-width: 620px) {
  .cv-wrap { padding: 26px 16px 56px; }
  .cv-row { display: block; }
  .cv-when { font-weight: 600; margin-bottom: 2px; }
  .cv-num { text-align: left; }
  .cv-orgline { display: block; }
  .cv-loc { white-space: normal; }
}

/* ── Dark mode (screen only — print is always on white) ───── */
body.dark .cv-wrap {
  --cv-ink: #e6e6e6;
  --cv-soft: #a0a0a0;
  --cv-rule: #6a6a6a;
  --cv-hair: #3a3a3a;
}
body.dark .cv-role { color: #c8c8c8; }
body.dark .cv-refline { color: #c0c0c0; }

/* ═══ Paged media — WeasyPrint and Ctrl-P both land here ═══ */
@page {
  size: Letter;
  margin: 15mm 14mm 14mm;
  @bottom-center {
    content: "Wenjun Chen · " counter(page) " / " counter(pages);
    font-family: "Times New Roman", "Liberation Serif", Georgia, serif;
    font-size: 8pt;
    color: #8a8a8a;
  }
}

@media print {
  #nav-bar, #banner, #footer, .cv-actions, .sr-only { display: none !important; }
  body { background: #fff !important; }

  .cv-wrap {
    --cv-ink: #000;
    --cv-soft: #3a3a3a;
    --cv-rule: #9a9a9a;
    --cv-head-rule: #6a6a6a;
    --cv-hair: #c4c4c4;
    --cv-gap: 104px;
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: 12pt;
    line-height: 1.36;
  }
  .cv-head { padding-bottom: 12pt; margin-bottom: 16pt; }
  .cv-name { font-size: 14pt; }
  .cv-contact { font-size: 12pt; line-height: 1.4; }
  .cv-section { margin-bottom: 13pt; }
  .cv-section > h2 { font-size: 12pt; margin-bottom: 7pt; padding-bottom: 3pt; }
  .cv-when, .cv-loc { font-size: 12pt; }
  .cv-refline { font-size: 12pt; }
  .cv-what a { border-bottom: none; }
  a { color: #000; text-decoration: none; }

  /* Keep a heading with the start of its section, and never split a
     single entry, reference or referee across a page. */
  .cv-section > h2, .cv-group-label { break-after: avoid; page-break-after: avoid; }
  .cv-row { break-inside: avoid; page-break-inside: avoid; }
  .cv-head { break-after: avoid; page-break-after: avoid; }
}
