/* The CV document itself.
   A direct translation of the LaTeX preamble:
     \documentclass[10.5pt,a4paper]  ->  10.5pt on a 210mm page
     \usepackage[margin=1.5cm]{geometry}  ->  15mm padding / @page margin
     helvet + \sfdefault  ->  Helvetica/Arial stack
     \titleformat{\section} + \rule{\textwidth}{0.6pt}  ->  .cv h2 + border-bottom
   Used for BOTH the on-screen preview and the printed page. */

.cv {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  padding: 15mm;
  margin: 0 auto;
  background: #fff;
  color: #000;
  font-family: Helvetica, Arial, "Liberation Sans", sans-serif;
  font-size: 10.5pt;
  line-height: 1.28;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 8px 28px rgba(0, 0, 0, .1);
}

/* \hidelinks -- links print as plain black text, still clickable */
.cv a { color: inherit; text-decoration: none; }

.cv p { margin: 0 0 0.35em; }

/* --- page-boundary guide (screen only) ---
   Printed content area is 297mm - 15mm top - 15mm bottom = 267mm per page.
   The overlay starts below the top padding, then rules a line every 267mm. */
.cv::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 15mm;
  bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 266.6mm,
    rgba(31, 79, 216, .28) 266.6mm 267mm
  );
}

/* --- header block: \begin{center} ... \end{center} --- */

.cv-head { text-align: center; margin-bottom: 0.2em; }

.cv-head h1 {
  font-size: 1.72em;          /* \LARGE */
  font-weight: bold;
  text-transform: uppercase;
  margin: 0 0 2pt;
  line-height: 1.1;
}

.cv-role {
  font-size: 1.18em;          /* \large */
  margin: 0 0 3pt;
}

.cv-contact { margin: 0 0 2pt; }
.cv-links { margin: 0; }

.cv .ph { color: #aaa; }

/* --- \section --- */

.cv h2 {
  font-size: 1.18em;          /* \large\bfseries */
  font-weight: bold;
  text-transform: uppercase;
  margin: 0.9em 0 0.5em;      /* \titlespacing*{0pt}{0.9em}{0.5em} */
  padding-bottom: 0.15em;
  border-bottom: 0.6pt solid #000;   /* \rule{\textwidth}{0.6pt} */
  line-height: 1.15;
}

.cv section { margin: 0; }

/* --- \role{title}{dates}{org}{location} --- */

.cv .role { margin: 0 0 2pt; }

.cv .role-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5em;
  line-height: 1.3;
}
.cv .role-line > :first-child { text-align: left; }
.cv .role-line > :last-child { text-align: right; flex: none; }

.cv .role-title { font-weight: bold; }
.cv .role-dates { font-style: italic; }

/* \vspace{4pt} between consecutive role blocks */
.cv .role-block + .role-block { margin-top: 4pt; }

/* --- \setlist[itemize]{leftmargin=1.2em, itemsep=1pt, topsep=2pt} --- */

.cv ul {
  margin: 2pt 0 0;
  padding-left: 1.2em;
  list-style: none;
}
.cv li { position: relative; margin: 0; }
.cv li + li { margin-top: 1pt; }
.cv li::before {
  content: "\2022";
  position: absolute;
  left: -1.2em;
}

.cv .group-head { font-weight: bold; margin: 0.35em 0 0; }
.cv .group-head:first-child { margin-top: 0; }

/* --- template variants ---
   The base rules above are the Classic layout. Each variant states only what it
   changes, so a fourth template is a small block rather than a second file. */

/* Harvard: title-case headings, employer on the bold first line, position in
   italics beneath it, name in normal case. */
.cv--harvard h1 { text-transform: none; }
.cv--harvard h2 { text-transform: none; letter-spacing: 0; }
.cv--harvard .role-sub { font-style: italic; }
.cv--harvard .role-dates { font-style: italic; }

/* Compact: no section rules, tighter leading, and a single-column role block —
   removing the only two-column construct a PDF text extractor can jumble. */
.cv--compact { line-height: 1.2; }
.cv--compact h2 {
  font-size: 1.02em;
  border-bottom: 0;
  margin: 0.7em 0 0.25em;
  padding-bottom: 0;
  letter-spacing: .04em;
}
.cv--compact .cv-head { margin-bottom: 0.1em; }
.cv--compact .cv-head h1 { font-size: 1.5em; }
.cv--compact .role { margin-bottom: 1pt; }
.cv--compact .role-meta { line-height: 1.25; }
.cv--compact .role-block + .role-block { margin-top: 3pt; }
.cv--compact ul { margin-top: 1pt; }
.cv--compact li + li { margin-top: 0; }
.cv--compact p { margin-bottom: 0.2em; }

/* shared by the variants */
.cv .role-sub { display: block; }
.cv .role-meta { line-height: 1.3; }

/* --- print --- */

@page {
  size: A4;
  margin: 15mm;
}

@media print {
  .cv {
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    background: none;
  }

  /* the guide is a screen aid, never printed */
  .cv::before { display: none; }

  /* keep headings and role blocks attached to what follows them */
  .cv h2,
  .cv .role,
  .cv .group-head { break-after: avoid; page-break-after: avoid; }

  .cv .role { break-inside: avoid; page-break-inside: avoid; }
  .cv li { break-inside: avoid; page-break-inside: avoid; }
  .cv .cv-head { break-after: avoid; page-break-after: avoid; }
}
