/* ==========================================================================
   CV / résumé — classic LaTeX (Computer Modern) serif resume.
   Everything is scoped under .cv-doc so the CMU Serif face and the resume
   layout never leak into the rest of the site. The document is ALWAYS light
   ink-on-paper (independent of the site theme) so the printed / saved PDF is
   correct regardless of dark mode.
   ========================================================================== */

@font-face {
  font-family: "CMU Serif";
  src: url("/static/fonts/cmu-serif-roman.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  src: url("/static/fonts/cmu-serif-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  src: url("/static/fonts/cmu-serif-bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  src: url("/static/fonts/cmu-serif-bolditalic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}

/* ── Action bar (screen only) ─────────────────────────────────────────────── */
.cv-actions {
  max-width: 820px;
  margin: 1.6rem auto 0;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex;
  gap: .6rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.cv-actions__hint { margin-right: auto; font-size: .82rem; color: var(--faded); font-family: var(--font-record); }
.cv-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  font: inherit; font-size: .9rem; font-weight: 600; letter-spacing: .01em;
  padding: .5rem .95rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--hair-strong); background: transparent; color: var(--ink);
  transition: background .15s, border-color .15s, transform .12s;
}
.cv-btn:hover { background: rgba(23,19,13,.05); }
.cv-btn:active { transform: translateY(1px); }
.cv-btn--primary { background: var(--sanguine); border-color: var(--sanguine); color: #fff; }
.cv-btn--primary:hover { filter: brightness(.94); background: var(--sanguine); }

/* ── The document ─────────────────────────────────────────────────────────── */
.cv-doc {
  --cv-ink:   #111;
  --cv-rule:  #111;
  --cv-paper: #fff;
  color: var(--cv-ink);
  background: var(--cv-paper);
  font-family: "CMU Serif", "Latin Modern Roman", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 10.6pt;
  line-height: 1.34;
  max-width: 820px;
  margin: 1rem auto 3rem;
  padding: clamp(2rem, 5vw, 3.2rem) clamp(1.4rem, 5vw, 3rem);
  box-shadow: 0 1px 3px rgba(0,0,0,.10), 0 8px 30px rgba(0,0,0,.08);
  border-radius: 2px;
}
.cv-doc :is(p, ul, li) { margin: 0; }

/* Header */
.cv-name {
  text-align: center;
  font-size: 20pt;
  font-weight: 700;
  letter-spacing: .06em;
  margin: 0 0 .28rem;
}
.cv-headline {
  text-align: center;
  font-style: italic;
  font-size: 11.5pt;
  margin: 0 0 .35rem;
}
.cv-contact {
  text-align: center;
  font-size: 9.6pt;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 60em;
}
.cv-contact a { color: inherit; text-decoration: none; }
.cv-contact a:hover { text-decoration: underline; }
.cv-contact .sep { padding: 0 .38em; color: var(--cv-ink); }

/* Section heading — small-caps-ish, letterspaced, full-width rule under it */
.cv-section { margin-top: 1.15rem; }
.cv-h {
  font-size: 11pt;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 .35rem;
  padding-bottom: .12rem;
  border-bottom: 1px solid var(--cv-rule);
}

/* Entry: title left, date right; sub-line: org left, location right */
.cv-entry { margin-top: .5rem; }
.cv-entry:first-child { margin-top: .1rem; }
.cv-entry__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.cv-entry__title { font-weight: 700; }
.cv-entry__date  { font-weight: 400; white-space: nowrap; }
.cv-entry__sub {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-style: italic;
}
.cv-entry__summary { margin-top: .15rem; }
.cv-entry__stack { margin-top: .12rem; }
.cv-entry__stack b { font-weight: 700; font-style: normal; }

/* Bullets — tight, LaTeX itemize feel */
.cv-bullets {
  list-style: disc;
  padding-left: 1.35em;
  margin-top: .2rem !important;
}
.cv-bullets li { margin-top: .08rem; padding-left: .1em; }

/* Skills: "Label: items" rows */
.cv-skills { margin-top: .15rem; }
.cv-skill { margin-top: .18rem; }
.cv-skill__label { font-weight: 700; }

/* Objective / paragraph */
.cv-para { margin-top: .1rem; text-align: justify; }

/* Force document to stay light regardless of the site's dark theme */
html[data-theme="dark"] .cv-doc {
  color: #111;
  background: #fff;
}
html[data-theme="dark"] .cv-doc { --cv-ink: #111; --cv-rule: #111; }

/* ── Print: strip all site chrome, render clean A4 ───────────────────────── */
@media print {
  @page { size: A4; margin: 14mm 15mm; }

  /* Hide all site chrome; show only the document. The visibility trick keeps
     layout intact (unlike display:none) so the print box measures correctly. */
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  .cv-print-root, .cv-print-root * { visibility: visible !important; }
  .cv-print-root {
    position: absolute; left: 0; top: 0; width: 100%;
  }
  .cv-actions { display: none !important; }
  .cv-doc {
    max-width: none; margin: 0; padding: 0;
    box-shadow: none; border-radius: 0;
    color: #000; background: #fff;
    font-size: 10.5pt;
  }
  .cv-section { page-break-inside: auto; }
  .cv-entry, .cv-h { page-break-inside: avoid; }
  .cv-h { break-after: avoid; }
}
