@page {
  size: A4;
  margin: 14mm 13mm 16mm;

  @bottom-right {
    content: "Page " counter(page);
    font-family: Arial, sans-serif;
    font-size: 8pt;
    font-weight: 700;
  }
}

@media print {
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html {
    font-size: 9.4pt;
  }

  body {
    color: #000;
    background: #fff !important;
    line-height: 1.42;
  }

  .navbar,
  .nav-footer,
  #quarto-sidebar,
  #quarto-margin-sidebar,
  .quarto-secondary-nav,
  .syllabus-actions,
  .anchorjs-link {
    display: none !important;
  }

  #quarto-content,
  main.content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .quarto-title-block {
    margin: 0 0 8mm !important;
    padding: 8mm 9mm 7mm;
    color: #000;
    background: #a2e436 !important;
    border: 2px solid #000;
    border-radius: 4mm;
    box-shadow: 3mm 3mm 0 #000;
  }

  .quarto-title-block .quarto-title-banner {
    min-height: 0;
    padding: 0;
    color: #000;
    background: transparent !important;
    border: 0;
  }

  .quarto-title h1 {
    margin: 0 0 1.5mm;
    font-size: 24pt;
    line-height: 1;
  }

  .quarto-title .subtitle {
    margin: 0;
    font-size: 12pt;
  }

  .quarto-title-meta {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4mm;
    width: 112mm;
    padding: 3mm 4mm;
    margin-top: 5mm;
    background: #fff !important;
    border: 1.2pt solid #000;
    border-radius: 2mm;
  }

  .quarto-title-meta-heading {
    margin-bottom: .5mm;
    color: #000 !important;
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: none;
  }

  .quarto-title-meta-contents,
  .quarto-title-meta-contents p {
    margin: 0 !important;
    color: #000 !important;
    font-weight: 600;
  }

  .syllabus-page > section.level1 {
    padding: 5mm 5.5mm;
    margin: 0 0 5mm;
    background: #fff !important;
    border: 1.4pt solid #000;
    border-top-width: 5pt;
    border-radius: 2.5mm;
    box-shadow: none;
    break-inside: auto;
  }

  .syllabus-page > section.level1:nth-of-type(3n + 1) {
    border-top-color: #77aa19;
  }

  .syllabus-page > section.level1:nth-of-type(3n + 2) {
    border-top-color: #1599ad;
  }

  .syllabus-page > section.level1:nth-of-type(3n) {
    border-top-color: #c49500;
  }

  h1,
  h2,
  h3 {
    color: #000;
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .syllabus-page > section.level1 > h1 {
    padding-bottom: 2mm;
    margin: 0 0 3mm;
    font-size: 16pt;
    border-bottom: 1.4pt solid #000;
  }

  .syllabus-page h2 {
    margin: 5mm 0 2mm;
    font-size: 12pt;
  }

  p,
  li {
    orphans: 3;
    widows: 3;
  }

  .syllabus-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5mm;
    margin-bottom: 4mm;
  }

  .syllabus-fact {
    padding: 3mm;
    background: #f8f9fa !important;
    border: 1pt solid #000;
    break-inside: avoid;
  }

  .textbook-card,
  .integrity-statement,
  .ai-declaration,
  .callout {
    padding: 3.5mm;
    margin: 3mm 0;
    border: 1.2pt solid #000;
    box-shadow: none !important;
    break-inside: avoid-page;
  }

  .textbook-card {
    background: #fff4cc !important;
  }

  .integrity-statement {
    background: #d3f6fb !important;
  }

  .ai-declaration {
    background: #f8f9fa !important;
    border-left: 5pt solid #8b4ac8;
  }

  .callout-important {
    background: #fff4cc !important;
  }

  table {
    width: 100% !important;
    margin: 3mm 0 !important;
    font-size: 8.1pt !important;
    border: 1.2pt solid #000 !important;
    border-collapse: collapse !important;
  }

  thead {
    display: table-header-group;
    background: #a2e436 !important;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  th,
  td {
    padding: 1.5mm 2mm !important;
    border: .7pt solid #000 !important;
  }

  tbody tr:nth-child(even) {
    background: #f1f3f5 !important;
  }

  .supporting-resources ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5mm 5mm;
  }

  a {
    color: #000 !important;
    text-decoration-thickness: .6pt;
  }

  a[href^="http"]::after,
  a[href^="mailto"]::after {
    content: none !important;
  }
}
