/* import fonts */
/* Fonts are loaded site-wide by theme.scss; the print stylesheet needs Public Sans directly
   because pagedjs-cli renders the standalone HTML without the site theme. */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;700&display=swap');

/* all formats */

h2 {
  border-bottom: none;
}

/* Right-hand years: upright, in a reserved gutter so entry text wraps short of them */
.cvdate {
  float: right;
  font-style: normal;
  margin-right: -6em;
}
.cv-indent p:has(.cvdate) {
  margin-right: 6em;
}

.print-only {
  display: none;
  /*color: aquamarine;*/
}

.inline_italic {
  font-style: italic;
}


/* adapt stylesheet for print
from: https://github.com/quarto-dev/quarto-cli/discussions/2538#discussioncomment-4081842 */

/* for page-breaks use style spans
  page-break-before: always;
  page-break-after: always;
*/

@media print {
  @page {
      size: a4 portrait;
      margin: 2cm 2cm 2cm 2.5cm;
      counter-increment: page;
      @bottom-center {
        content: counter(page)
      }
  }
  .no-print {
      display: none;
  }
  .print-only {
      display: block;
  }

  /* suppress website chrome in PDF */
  .navbar, header {
    display: none;
  }

  .cv-print-name p {
    font-size: calc(1.325rem + .9vw);
    font-weight: 900;
    text-align: center;
    margin-bottom: 0.25em;
  }

  .contact-block {
      margin-top: 0%;
      text-align: center;
      border-top: 1px solid #333;
      border-bottom: 1px solid #333;
      padding: 0.5em 0;
      margin-bottom: 1em;
  }

  html {
    font-family: 'Public Sans', sans-serif;
  }

  header {
    margin-block-end: 2em;
  }
  header h1.title {
      display: none;
  }
  header .author {
    font-size: 2em;
    font-weight: 900;
    color: black;
    text-align: center;
    margin-block-end: 0em;
    margin-bottom: 0;
    text-transform: capitalize;
  }

  h2 {
    font-weight: 900;
    text-transform: uppercase;
  }
  /* the site's mark, carried into print: black rule with a red segment */
  h2::after {
    content: "";
    display: block;
    width: 36pt;
    height: 3pt;
    margin-top: 3pt;
    background: linear-gradient(to right, #1C1B22 0 78%, #B3261E 78% 100%);
  }
  .cv-download { display: none; }

  h3 {
    font-weight: 700;
    text-transform: uppercase;
    /* color: green; */
  }

  body {
    font-size: small;
  }

  p, div, ol li, ul li {
    font-size: small;
  }

  ul li {
    margin-bottom: 0.1em;
  }

  .two-col {
    column-count: 2;
    column-gap: 2em;
  }

  a {
    text-decoration: none;
    font-weight: 700;
    color: #36a7e9;
  }

  /* h2 must not be orphaned at bottom of page */
  h2 {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* year headers stay with first entry */
  h4 {
    font-weight: 700;
    break-after: avoid;
    page-break-after: avoid;
  }

  .pub-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cv-indent {
    orphans: 3;
    widows: 2;
  }
}


.cv-header {
  margin-bottom: 2em;
  line-height: 1.6;
}

.cv-header p {
  margin: 0.15em 0;
}

ol {
  padding-left: 1.5em;   /* controls how far the whole list is indented */
}

ol li {
  padding-left: 1.5em;  /* controls space between number and text */
}

ol li,
ul li {
  margin-bottom: 0.5em;
}

.cv-indent {
  margin-left: 2.5em;
}

/* hanging bullets: wrapped lines align with the first line's text, not the bullet */
.cv-indent ul {
  padding-left: 1.2em;
  list-style-position: outside;
  margin-top: 0;
  margin-block-start: 0;
}

.two-col > ul,
.two-col > ol {
  margin-top: 0;
  margin-block-start: 0;
}

.pub-item {
  margin-left: 0;
  padding-left: 0;
  text-indent: 0;
  margin-bottom: 0.5em;
}

/* Pandoc wraps "26. text" in <ol start="26"><li> — use the list marker for the hanging number */
.pub-item ol {
  padding-left: 2.5em;
  margin: 0;
  list-style-type: decimal;
  list-style-position: outside;
}
.pub-item li {
  padding-left: 0;
  margin-bottom: 0;
}

/* The hex band is screen decoration. The pagedjs PDF is built from a standalone HTML render without
   the site theme, so nothing hid the band and its images (root-absolute paths, unreachable) came out
   as broken-image alt text after Teaching. pagedjs wraps content in .pagedjs_page; hide it there. */
.pagedjs_pages .hexband, .pagedjs_page .hexband { display: none !important; }



/* Software: two columns; the second starts at Data Science Projects */
.cv-software {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2em;
  align-items: start;
}
.cv-software-col + .cv-software-col .cv-indent {
  margin-left: 0;
}

/* Keep headings with what follows. Neither Chrome's printer nor pagedjs reliably honours
   break-after: avoid through the nested section wrappers, so each heading is made unbreakable and
   given a reserve of padding below it, cancelled by an equal negative margin (net spacing unchanged:
   h2 keeps 0.5rem padding + 1rem margin, h3/h4 keep 0.5rem margin). If less than the reserve is left
   on the page, the heading's box overflows and it moves to the next page with its content. A heading
   that is followed directly by a subsection needs room for that subsection's heading and reserve too,
   so it carries a larger one. */
@media print {
  h2, h3, h4 {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  h2 {
    padding-bottom: calc(0.5rem + 4em);
    margin-bottom: calc(1rem - 4em);
  }
  h2:has(+ section) {
    padding-bottom: calc(0.5rem + 9em);
    margin-bottom: calc(1rem - 9em);
  }
  h3, h4 {
    padding-bottom: 4.5em;
    margin-bottom: calc(0.5rem - 4.5em);
  }
  h3:has(+ section) {
    padding-bottom: 7em;
    margin-bottom: calc(0.5rem - 7em);
  }
}

/* Entries are short: never split one across pages. */
@media print {
  .cv-indent, .cv-software {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
