@page professional-cv {
  size: A4;
  margin: 0;
}

html:has(#cvModal[open]),
body.portfolio-page:has(#cvModal[open]) {
  width: auto;
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  color-scheme: light;
  background: #fff;
}

body:has(#cvModal[open]) > :not(#cvPrintSheet),
#cvModal::backdrop { display: none !important; }

body:has(#cvModal[open]) > #cvPrintSheet[hidden] {
  display: block;
  position: static;
  page: professional-cv;
  font: 8.7pt/12pt "CV DejaVu", "DejaVu Sans", sans-serif;
  color: #27323b;
  background: #fff;
}

/* Reset portfolio typography and spacing before applying the reference metrics. */
#cvPrintSheet :where(*) { all: revert; box-sizing: border-box; }
#cvPrintSheet :is(h1, h2, h3, p, ul, li) { margin: 0; padding: 0; }

#cvPrintSheet .print-page {
  position: relative;
  padding: 33.5pt 36pt 0;
}
#cvPrintSheet .cv-page-2 { break-before: page; }
#cvPrintSheet :is(h1, h2, h3, .print-role) { color: #18334a; font-weight: 700; }
#cvPrintSheet h1 { font-size: 19pt; line-height: 24.5pt; }
#cvPrintSheet .print-role { font-size: 11pt; line-height: 16.5pt; }
#cvPrintSheet :is(.print-header > p:not(.print-role), .print-date) { font-size: 8.5pt; line-height: 12pt; }
#cvPrintSheet a { color: inherit; text-decoration: none; }
#cvPrintSheet .print-group { margin-top: 8.5pt; }
#cvPrintSheet h2 {
  font-size: 10pt;
  line-height: 13pt;
  margin-bottom: 4pt;
  break-after: avoid;
}
#cvPrintSheet h3 {
  font-size: 9.5pt;
  line-height: 14pt;
  break-after: avoid;
}
#cvPrintSheet .print-group > p + p { margin-top: 3pt; }
#cvPrintSheet h3 span { color: #27323b; font-weight: 400; }
#cvPrintSheet .print-date { color: #4b5863; margin-bottom: 4pt; break-after: avoid; }
#cvPrintSheet .print-job + .print-job { margin-top: 8pt; }
#cvPrintSheet .print-job > p:not(.print-date) { margin-bottom: 3pt; }
#cvPrintSheet ul { list-style: none; }
#cvPrintSheet li {
  position: relative;
  padding-inline-start: 9pt;
  line-height: 12pt;
  break-inside: avoid;
}
#cvPrintSheet li::before {
  content: "•";
  position: absolute;
  inset-inline-start: 1pt;
}
#cvPrintSheet li + li { margin-top: 2pt; }
#cvPrintSheet .print-page-number {
  position: absolute;
  top: 817.5pt;
  right: 36pt;
  font: 7pt/10pt "CV DejaVu", "DejaVu Sans", sans-serif;
}
