@page {
  @top-right {
    content: none !important;
  }
  @bottom-right {
    content: none !important;
  }
}

@media print {
  /* Prevent heading breaks mid-page */
  h1, h2, h3 {
    page-break-after: avoid;
  }

  /* Default: start new section pages on h2 */
  h2 {
    page-break-before: always;
  }

  h2:first-child {
    page-break-before: auto;
  }

  /* TOC page: suppress h2 page breaks */
  body[data-md-file="toc"] h2 {
    page-break-before: auto !important;
  }

  /* TOC styling */
  body[data-md-file="toc"] ul {
    list-style-type: none;
    padding-left: 0;
    font-size: 11px;
    line-height: 1.4;
  }

  body[data-md-file="toc"] ul li {
    margin: 0.3em 0;
  }

  body[data-md-file="toc"] ul li a {
    text-decoration: none;
    color: #000;
  }

  body[data-md-file="toc"] ul li a::after {
    content: "";
  }

  /* Image formatting */
  img {
    max-width: 85% !important;
    height: auto !important;
    display: block;
    margin: 1em 0 1em 0 !important;
  }

  /* Code block rendering */
  code {
    font-family: "Courier New", Courier, monospace !important;
    background-color: #f5f5f5 !important;
    color: #000 !important;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.9em;
    white-space: pre-wrap;
  }

  pre {
    font-family: "Courier New", Courier, monospace !important;
    background-color: #f5f5f5 !important;
    color: #000 !important;
    padding: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow: auto;
  }

  .highlight pre,
  .highlight code {
    background-color: #f5f5f5 !important;
    color: #000 !important;
    font-family: "Courier New", Courier, monospace !important;
    font-size: 11px;
    white-space: pre-wrap;
  }

  /* Emphasis fixes for italics and bold */
  em, i {
    font-style: italic !important;
    font-family: "Times New Roman", "Georgia", serif !important;
    color: #000 !important;
  }

  strong, b {
    font-weight: bold !important;
    color: #000 !important;
  }

  em strong,
  strong em,
  i b,
  b i {
    font-style: italic !important;
    font-weight: bold !important;
    font-family: "Times New Roman", "Georgia", serif !important;
    color: #000 !important;
  }

  /* ✅ Fix for keyboard shortcut display (e.g., ++Ctrl++) */
  kbd {
    display: inline-block;
    font-family: "Courier New", Courier, monospace !important;
    font-size: 0.85em;
    padding: 2px 5px;
    line-height: 1.4;
    color: #000 !important;
    background-color: #eee !important;
    border: 1px solid #aaa;
    border-radius: 3px;
    box-shadow: inset 0 -1px 0 #aaa;
  }
}

@media screen {
  .md-nav__link[href$="toc/"],
  .md-nav__link[href$="toc.md"],
  .md-nav__link[href$="toc.html"] {
    display: none !important;
  }
}

/* Hide page numbers from header/footer */
.page-number,
.footer,
.print-footer,
.header,
.header .page-number,
.top-page-number {
  display: none !important;
}
