/* CV stylesheet — print (PDF) and screen (site) share one layout.
   Proportions follow the reference CV: 12pt text on a 16pt line, a 60pt date column,
   hanging-indent entries, ruled sections, bold-italic subheads. Tunables come from
   the `style:` block of cv.config.yaml (injected as :root variables). */

/* ---------- fonts (bundled; Source Serif 4, SIL OFL) ---------- */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-latin-wght-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-serif-4-latin-ext-wght-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */

:root {
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-size: 12pt;
  --line-height: 16pt;
  --date-col: 60pt;
  --main-col: 205pt;
  --entry-gap: 4pt;
  --ink: #000;
  --muted: #777;
  --link-underline: #8a8a8a;
}

@page {
  size: Letter;
  margin: 1in;
  @bottom-center {
    content: counter(page);
    font: 10pt "Source Serif 4", Georgia, serif;
    color: #000;
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: var(--line-height);
  font-kerning: normal;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.5pt;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 1.5pt;
}
a:hover { text-decoration-color: currentColor; }

em { font-style: italic; }

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  text-align: center;
}
.masthead h1 {
  margin: 0;
  font-size: 18pt;
  line-height: 22pt;
  font-weight: 700;
}
.masthead p { margin: 0; }
.subtitle { font-style: italic; }
.updated { font-size: 10pt; line-height: 14pt; color: var(--muted); }

.contact {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 12pt;
  text-align: left;
}
.contact-right { text-align: right; }

.pdf-link {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 10pt;
  color: var(--muted);
}

/* ---------- sections ---------- */

.section {
  margin-top: 20pt;
  padding-top: 10pt;
  border-top: 1pt solid var(--ink);
}
.section:first-of-type {
  margin-top: 14pt;
  padding-top: 0;
  border-top: 0;
}

h2, h3 {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  break-after: avoid;
}
h2 {
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 7pt;
}
h3 {
  font-weight: 700;
  font-style: italic;
  margin: 8pt 0 4pt;
}
h2 + h3 { margin-top: 0; }

/* ---------- entries ---------- */

.entry {
  display: grid;
  grid-template-columns: var(--date-col) minmax(0, 1fr);
  margin-top: var(--entry-gap);
  break-inside: avoid;
}
h2 + .entry, h3 + .entry { margin-top: 0; }

.entry p { margin: 0; }
.entry .note, .entry p.note { font-style: italic; }

.entry--three {
  grid-template-columns: var(--date-col) var(--main-col) minmax(0, 1fr);
}
.entry--three .note { grid-column: 2 / -1; }

.entry--definition { display: block; }

.list {
  margin: 0;
  padding: 0 0 0 var(--date-col);
  list-style: none;
}
.list { break-inside: avoid; }
.list li { margin-top: 2pt; }
h3 + .list li:first-child { margin-top: 0; }

/* ---------- screen only ---------- */

@media screen {
  .cv {
    max-width: 46rem;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
  }
}

@media screen and (max-width: 40rem) {
  .contact { flex-direction: column; gap: 0.75rem; }
  .contact-right { text-align: left; }
  .entry, .entry--three { grid-template-columns: minmax(0, 1fr); }
  .entry .date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9em; }
  .entry--three .note { grid-column: 1; }
  .list { padding-left: 0; }
  .pdf-link { position: static; display: block; margin-top: 0.5rem; }
}

/* ---------- print only ---------- */

@media print {
  .pdf-link { display: none; }
  .cv { max-width: none; padding: 0; margin: 0; }
}
