/* CV pages (/cv/, /cv/zh/), loaded only by _layouts/cv.html.
   Typeset like a LaTeX résumé: Fontin small caps for headings, TeX Gyre Termes for text,
   Latin Modern Mono for links, Noto Serif SC for Chinese. The sheet is a white A4 page on screen
   and prints to A4 as-is; that is how the PDFs in /files/cv/ are made (scripts/cv-pdf.js).
   Fonts are subsets in assets/fonts/cv/ and TrueType-flavoured, so PDFs embed them compactly. */

@font-face { font-family: "CV Termes"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/cv/termes-regular.woff2") format("woff2"); }
@font-face { font-family: "CV Termes"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/cv/termes-bold.woff2") format("woff2"); }
@font-face { font-family: "CV Termes"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/cv/termes-italic.woff2") format("woff2"); }
@font-face { font-family: "CV Termes"; font-weight: 700; font-style: italic; font-display: swap; src: url("../fonts/cv/termes-bolditalic.woff2") format("woff2"); }
@font-face { font-family: "CV Fontin"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/cv/fontin-sc.woff2") format("woff2"); }
@font-face { font-family: "CV Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/cv/lmmono.woff2") format("woff2"); }
/* Chinese has no italic: map italic to the upright faces so the browser does not slant it. */
@font-face { font-family: "CV Serif SC"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/cv/serif-sc-400.woff2") format("woff2"); }
@font-face { font-family: "CV Serif SC"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/cv/serif-sc-400.woff2") format("woff2"); }
@font-face { font-family: "CV Serif SC"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/cv/serif-sc-700.woff2") format("woff2"); }
@font-face { font-family: "CV Serif SC"; font-weight: 700; font-style: italic; font-display: swap; src: url("../fonts/cv/serif-sc-700.woff2") format("woff2"); }
@font-face { font-family: "CV Icons"; font-weight: 900; font-display: block; src: url("../fonts/cv/icons-solid.woff2") format("woff2"); }
@font-face { font-family: "CV Brands"; font-weight: 400; font-display: block; src: url("../fonts/cv/icons-brands.woff2") format("woff2"); }

.cv-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(210mm + 2rem);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.cv-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

/* The page */
.cv-sheet {
  --cv-text: "CV Termes", "CV Serif SC", "Times New Roman", "Songti SC", serif;
  --cv-head: "CV Fontin", "CV Serif SC", "CV Termes", serif;
  --cv-mono: "CV Mono", ui-monospace, monospace;
  box-sizing: border-box;
  width: 100%;
  min-height: 297mm;
  margin: 0 auto;
  padding: 13mm 15mm 14mm;
  background: #fff;
  color: #000;
  font-family: var(--cv-text);
  font-size: 10.5pt;
  line-height: 1.24;
  font-variant-numeric: lining-nums;
  font-kerning: normal;
  box-shadow: 0 1px 3px rgba(20, 10, 40, 0.12), 0 12px 40px -12px rgba(20, 10, 40, 0.25);
  -webkit-font-smoothing: antialiased;
}
.cv-body--zh .cv-sheet { line-height: 1.45; }

.cv-sheet h1,
.cv-sheet h2,
.cv-sheet h3,
.cv-sheet p,
.cv-sheet ul {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  letter-spacing: normal;
}
.cv-sheet strong { font-weight: 700; }
.cv-sheet a { color: inherit; text-decoration: none !important; }
.cv-sheet a:hover { text-decoration: underline !important; text-decoration-thickness: 0.5pt !important; text-underline-offset: 2px; }

/* Icons (Font Awesome 5 glyphs, own subset) */
.cvi { font-style: normal; font-family: "CV Icons"; font-weight: 900; display: inline-block; line-height: 1; }
.cvi.fab { font-family: "CV Brands"; font-weight: 400; }
.cvi.fa-envelope::before { content: "\f0e0"; }
.cvi.fa-globe::before { content: "\f0ac"; }
.cvi.fa-graduation-cap::before { content: "\f19d"; }
.cvi.fa-book::before { content: "\f02d"; }
.cvi.fa-trophy::before { content: "\f091"; }
.cvi.fa-briefcase::before { content: "\f0b1"; }
.cvi.fa-phone::before { content: "\f095"; }
.cvi.fa-github::before { content: "\f09b"; }

/* Header */
.cv-head { text-align: center; margin-bottom: 2pt; }
.cv-name {
  font-family: var(--cv-head) !important;
  font-size: 25pt !important;
  line-height: 1.1 !important;
  letter-spacing: 0.01em !important;
}
.cv-body--zh .cv-name { font-weight: 700 !important; letter-spacing: 0.08em !important; }
.cv-name__alt {
  font-family: var(--cv-text);
  font-size: 12pt;
  letter-spacing: 0;
  margin-left: 0.6em;
  color: #444;
}
.cv-body--zh .cv-name__alt { font-family: "CV Fontin", var(--cv-text); font-size: 13pt; font-weight: 400; }
.cv-contact {
  list-style: none;
  margin-top: 5pt !important;
  font-size: 9.6pt;
  font-family: "CV Termes", serif;
}
.cv-contact li { display: inline-block; margin: 0; white-space: nowrap; }
.cv-contact li + li::before { content: "·"; margin: 0 0.5em; }
.cv-contact li.cv-contact__wrap::before { content: none; }
.cv-contact .cvi { font-size: 0.9em; margin-right: 0.35em; vertical-align: 0.02em; }

/* Section headings: icon + small caps, ruled underneath */
.cv-section { margin-top: 9pt; }
.cv-section__title {
  font-family: var(--cv-head) !important;
  font-size: 13.5pt !important;
  line-height: 1.3 !important;
  border-bottom: 0.6pt solid #000;
  padding-bottom: 1pt !important;
  margin-bottom: 5pt !important;
}
.cv-body--zh .cv-section__title { font-weight: 700 !important; font-size: 12.5pt !important; letter-spacing: 0.05em !important; }
.cv-section__title .cvi { font-size: 0.82em; margin-right: 0.4em; vertical-align: 0.05em; }

/* Entries: org + date on one line, italic role, bullets */
.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
}
.cv-entry + .cv-entry { margin-top: 6pt; }
.cv-entry__org { font-size: 11pt !important; }
.cv-date { flex: none; white-space: nowrap; font-size: 11pt; }
.cv-entry__role { font-style: italic; margin-top: 1pt !important; }
.cv-body--zh .cv-entry__role { font-style: normal; }
.cv-url { font-family: var(--cv-mono); font-size: 0.9em; font-weight: 400; overflow-wrap: anywhere; }

.cv-bullets {
  list-style: disc;
  margin-top: 2pt !important;
  padding-left: 1.55em !important;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.cv-bullets li { margin: 0 0 1pt; padding-left: 0.1em; }
.cv-bullets li::marker { font-size: 0.85em; }

/* Publications */
.cv-pubs { margin-top: 0 !important; padding-left: 1.1em !important; }
.cv-pub + .cv-pub { margin-top: 3pt; }
.cv-pub__line { display: block; text-align: left; }
.cv-pub__line .cv-url { white-space: nowrap; }
.cv-pub__desc { display: block; }
.cv-author { white-space: nowrap; }

/* Awards */
.cv-awards { list-style: none; }
.cv-awards li { margin: 0 0 1pt; }

/* Screen-only adjustments */
@media screen and (max-width: 820px) {
  .cv-wrap { padding: 1rem 0 2rem; }
  .cv-toolbar { justify-content: center; padding: 0 1rem; }
  .cv-sheet { min-height: 0; padding: 7mm 5.5mm; font-size: 11pt; box-shadow: none; }
  .cv-name { font-size: 22pt !important; }
  .cv-row { flex-wrap: wrap; gap: 0 1em; }
  .cv-entry__org .cv-url { display: block; }
  .cv-bullets { text-align: left; }
}

/* A4 print / PDF: just the sheet. */
@page { size: A4; margin: 13mm 15mm 12mm; }

@media print {
  html, body { background: #fff !important; }
  .masthead, .page__footer, .cv-toolbar, .back-to-top { display: none !important; }
  .cv-wrap { max-width: none; margin: 0; padding: 0; }
  .cv-sheet { box-shadow: none; min-height: 0; padding: 0; }
  .cv-entry, .cv-pub, .cv-awards li { break-inside: avoid; }
  .cv-section__title { break-after: avoid; }
  .cv-sheet a[href]::after { content: none !important; }
}
