@media print {

  /* Basic layout and columns */

  .page-cheatmd .content-inner {
    max-width: 100%;
    width: 100%;
    padding: 0;
    font-size: .7em;

    & section:is(.col-2, .col-2-left, .col-3) {
      column-gap: 30px;
    }

    /* column-count and grid display required to be set again within @print media query to take effect when actually printing */
    & section.col-2 {
      column-count: 2;
    }
    & section.col-2-left {
      display: grid;
    }
    & section.col-3 {
      column-count: 3;
    }
  }

  /* @scope is used to prevent cheatsheet styles from affecting admonition block styling */

  @scope (.page-cheatmd) to (.admonition) {
    :scope .content-inner {

      /* Remove background colors and set border colors */
      & * {
        background-color: transparent !important;
        border-color: var(--gray400) !important;
      }

      /* Headings */

      & h1 {
        margin-top: 0;
        margin-bottom: .5em;
      }

      & h2.section-heading {
        font-weight: bold;
        margin-top: 1em;
        column-span: all;
      }

      & section.h2 {
        break-inside: avoid;
      }

      & h3 {
        font-weight: bold;
        color: var(--mainDark);
      }

      & h3::after {
        height: 2px;
        background-color: var(--gray400);
      }

      & section.h3 {
        min-width: 300px;
        break-inside: avoid;
      }

      & h4 {
        padding: .5em 0;
        border: none;
        font-weight: bold;
        color: black;
      }

      /* Paragraphs */

      & .h2 p {
        padding-left: 0;
        padding-right: 0;
        border: none !important;
      }

      /* Code blocks */

      & code {
        line-height: 1.5em;
      }

      /* Tables */

      & .h2 table {
        font-variant-numeric: tabular-nums;
        break-inside: avoid;
      }

      & .h2 :is(th, td) {
        vertical-align: top;
        padding-left: 0;
        padding-right: 0;
      }

      & .h2 thead {
        border-style: solid none;
        border-width: 1px;
      }

      & .h2 tr {
        border-bottom: none;
      }

      & .h2 th {
        font-weight: bold;
      }

      /* Lists */

      & .h2 li {
        padding-left: 0;
        padding-right: 0;
        vertical-align: middle;
        border-bottom: none;
      }

      /* Remove copy button from code blocks */
      & pre:hover button.copy-button {
        display: none;
      }

      /* Remove hover tooltip from inline code references */
      & div.tooltip {
        display: none;
      }

      & footer p:not(.built-using) {
        display: none;
      }
    }
  }

}
