/* style.css — moderncv/banking rendered as DIN A4 pages.
   No chrome: the page background equals the document background, so nothing but
   the CV itself is ever visible. */

:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --ink: #1b1b1b;
  --muted: #5a5f66;
  --accent: #3873b3;          /* moderncv \moderncvcolor{blue} */
  --rule: rgba(56, 115, 179, 0.5);

  /* overwritten from the geometry package options in cv.tex */
  --ml: 14.70mm;
  --mr: 14.70mm;
  --mt: 14.00mm;
  --mb: 14.00mm;
  --hints: 2.6cm;
  --hintsep: 4.5mm;

  --base: 11pt;
  --lh: 1.2364;          /* LaTeX baselineskip at 11pt = 13.6pt */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161a;
    --ink: #e7e5e2;
    --muted: #a3a9b3;
    --accent: #7fb2e5;
    --rule: rgba(127, 178, 229, 0.45);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  overflow-x: hidden;
}

body {
  color: var(--ink);
  font: var(--base) / var(--lh) "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-text-size-adjust: 100%;
}

#stage { padding: 6mm 0 10mm; }

#doc {
  width: 210mm;
  transform-origin: top left;
}

.page {
  width: 210mm;
  height: 297mm;
  padding: var(--mt) var(--mr) var(--mb) var(--ml);
  background: var(--paper);
  overflow: hidden;
  position: relative;
}
.page.oversize { overflow: visible; }
.page + .page { margin-top: 8mm; }

.page-body {
  position: relative;
  height: 100%;
  display: flow-root;        /* contain child margins: keeps the text block exact */
}

/* a page always starts flush at the top margin */
.page-body > :first-child { margin-top: 0; }

/* ---------- title ---------- */

.cvtitle {
  text-align: center;
  margin: 0 0 6mm;
}

.cvtitle .photo {
  display: block;
  margin: 0 auto 3mm;
  border: 0 solid var(--rule);
  border-radius: 1px;
}

.name {
  margin: 0;
  font-size: 2.25em;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.jobtitle {
  margin-top: 1mm;
  font-size: 1.1em;
  color: var(--accent);
}

.contact {
  margin-top: 2.6mm;
  font-size: 0.84em;
  line-height: 1.5;
  color: var(--muted);
}

.quote {
  margin: 3mm auto 0;
  max-width: 80%;
  font-style: italic;
  color: var(--muted);
}

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

.section {
  margin: 5.2mm 0 2.2mm;
  padding-bottom: 0.9mm;
  border-bottom: 0.35mm solid var(--rule);
  font-size: 1.12em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.cvtitle + .section,
.vspace + .section { margin-top: 3mm; }

.subsection {
  margin: 3.4mm 0 1.6mm;
  font-size: 1em;
  font-weight: 700;
  color: var(--ink);
}

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

.entry {
  display: grid;
  grid-template-columns: var(--hints) 1fr;
  column-gap: var(--hintsep);
  margin-top: 2.1mm;
  break-inside: avoid;
}

/* \cvdoubleitem renders as two ordinary full-width rows (see expandDoubles):
   side-by-side columns leave dead space beside the shorter half. */

.hint {
  text-align: right;
  font-weight: 700;
  font-size: 0.9em;
  line-height: calc(var(--lh) / 0.9);
  color: var(--muted);
  hyphens: none;
}

.entry-head { line-height: var(--lh); }
.role { font-weight: 700; }
.meta { color: var(--ink); }

.desc {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.entry-head + .desc { margin-top: 0.6mm; }

.desc ul,
.desc ol {
  margin: 0;
  padding-left: 4.4mm;
}
.desc li { margin: 0.3mm 0; }
.desc ul { list-style: none; }
.desc ul > li::before {
  content: "\2013";
  float: left;
  margin-left: -4.4mm;
  color: var(--muted);
}

.para {
  margin-top: 2.1mm;
  text-align: justify;
  hyphens: auto;
}

.vspace { height: 0; }
.pagebreak { display: none; }

.sc { font-variant: small-caps; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.94em; }

a { color: inherit; text-decoration: none; }
.contact a { color: var(--accent); }
.desc a { color: var(--accent); }

.center { text-align: center; }
.flushleft { text-align: left; }
.flushright { text-align: right; }

/* ---------- print: exactly the same boxes, always on white ---------- */

@page {
  size: A4;
  margin: 0;
}

@media print {
  :root {
    --paper: #ffffff;
    --ink: #000000;
    --muted: #3d4147;
    --accent: #2f6399;
    --rule: rgba(47, 99, 153, 0.6);
  }

  html, body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #stage { padding: 0 !important; }

  #doc {
    width: 210mm !important;
    margin: 0 !important;
    transform: none !important;
  }

  .page {
    margin: 0 !important;
    /* a hair under 297mm: stops browsers from rounding each sheet into an
       extra blank page */
    height: 296.9mm;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
    overflow: hidden;
  }

  .page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
