/* =============================================================================
   CV. Inherits the site's tokens and webfaces from styles.css, then sets a
   denser type scale, because a CV is read close up and printed at A4.
   ========================================================================== */

.cv-page {
  background: var(--cream);
  font-size: 10.5pt;
  line-height: 1.5;
}

.cv {
  max-width: 46rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2.5rem) 3rem;
}

/* ---------------------------------------------------------------- Header -- */

.cv__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--green);
}

.cv__name {
  font-family: var(--display);
  font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.025em;
}
.cv__role {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--green);
}

.cv__contact {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: right;
}
.cv__contact a {
  text-decoration: none;
  color: inherit;
}
.cv__contact a:hover { color: var(--green); }

.cv__intro {
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-family: var(--display);
  max-width: 38em;
}

/* --------------------------------------------------------------- Sections -- */

.cv__section { margin-top: 2.25rem; }
.cv__section .eyebrow { margin-bottom: 1.25rem; }

/* ------------------------------------------------------------------- Jobs -- */

.job {
  padding-top: 0.875rem;
  border-top: 1px solid var(--rule);
}
.job + .job { margin-top: 1.25rem; }

.job__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
}
.job__org {
  font-family: var(--display);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.job__meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.job__blurb {
  margin-top: 0.4375rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 44em;
}

.job__title {
  margin-top: 0.9375rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.job__title span {
  font-weight: 400;
  color: var(--muted);
}
.job__title span::before { content: " \00b7  "; }

/* earlier titles in the same company, stacked under the most recent one */
.job__title--prior {
  margin-top: 0.1875rem;
  font-weight: 400;
  color: var(--muted);
}

.job__points {
  margin-top: 0.4375rem;
  font-size: 0.875rem;
}
.job__points li {
  position: relative;
  padding-left: 0.875rem;
  margin-top: 0.3125rem;
  max-width: 48em;
}
.job__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 4px;
  height: 4px;
  background: var(--green);
  border-radius: 50%;
}

/* ------------------------------------------------------- Tools and quals -- */

/* label and value share a row, which halves the block's height */
/* label and values share a line, running the full width of the page */
.kit {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
}
.kit dt {
  display: inline;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kit dd {
  display: inline;
  margin: 0;
}
.kit dd::after {
  content: "\A";
  white-space: pre;
}

/* ------------------------------------------------------------------ Print -- */

/* Zero page margin so the cream reaches the paper edge. The text margin comes
   from padding on .cv, which would normally apply once to the whole box and
   leave page two starting hard against the edge. box-decoration-break: clone
   is what fixes that: it redraws the padding and the background on every
   fragment, so each sheet gets both the full-bleed colour and its own margin. */
@page {
  size: A4;
  margin: 0;
}

@media print {
  .cv-page {
    font-size: 9pt;
    line-height: 1.42;
    /* keep the cream and the green rules in the PDF */
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .cv {
    max-width: none;
    padding: 11mm 14mm;
    background: var(--cream);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }
  .cv__name { font-size: 27pt; }
  .cv__intro { font-size: 10pt; margin-top: 0.85rem; }
  .cv__section { margin-top: 0.8rem; }
  .cv__section .eyebrow { margin-bottom: 0.65rem; }
  .job { padding-top: 0.6rem; }
  .job + .job { margin-top: 0.7rem; }
  .job__org { font-size: 1.25rem; }
  .job__points li { margin-top: 0.2rem; }
  .job__title { margin-top: 0.7rem; }

  /* Let a long role flow across a break, but never strand a heading at the
     foot of a page away from the bullets it belongs to. */
  .job { break-inside: auto; }
  /* Keep a heading with what follows it, but let the blurb sit at the foot of
     a page if that's where it falls. Binding the whole chain together was
     pushing entire jobs onto the next page and wasting the bottom of this one. */
  .job__head,
  .job__title { break-after: avoid; }
  .job__points li { break-inside: avoid; }
  .cv__section .eyebrow { break-after: avoid; }

  a { text-decoration: none; color: inherit; }
}
