/* ============================================================
   Base Page Setup
   ============================================================ */

body.cheatsheet {
  background: #e1d8b0;
  color: #000;
  margin: 0;
  padding: 0;
}

/* ============================================================
   Single Page Container (AUTHORITATIVE SIZE)
   ============================================================ */

.cheatsheet-page {
  width: 100vw;
  height: 100vh;

  margin: 0 auto;
  padding: 1rem;
    padding-bottom: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
    letter-spacing: -0.03em;

}

/* ============================================================
   Columns Area (≈70% page height)
   ============================================================ */

.cheatsheet-columns {
  flex: 1 1 auto;
  min-height: 0;

  column-count: 4;
  column-gap: 1rem;
  column-fill: auto;

  font-family: "Iosevka Term", ui-monospace, SFMono-Regular,
               Menlo, Consolas, monospace;
  font-size: 0.65rem;

  overflow: hidden; 
}

/* ============================================================
   Headings
   ============================================================ */

.cheatsheet-columns h1 {
  font-size: 1.2rem;
  margin: 0.1rem 0;
}

.cheatsheet-columns h3 {
 padding: 0 0;
  margin: 0 0;

}

.cheatsheet-columns h2 {
  display: block;
  width: 100%;

  background: #c39595;
  padding: 0.15rem 0.35rem;

  font-size: 0.7rem;
  margin: 0.1rem 0 0.15rem;

  border-bottom: none; /* remove if you had one */
  box-sizing: border-box;

  break-after: avoid;
}


.cheatsheet-columns p {
  margin: 0.15rem 0;
}

/* ============================================================
   Code Blocks
   ============================================================ */

.cheatsheet-columns pre {
  margin: 0.25rem 0 0.4rem;
  padding: 0rem 0rem;

  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;

  font-family: "Iosevka Term", ui-monospace, SFMono-Regular,
               Menlo, Consolas, monospace;
  font-feature-settings: "liga" 0, "calt" 0;

  font-size: 0.6rem;
  line-height: 1.25;

  white-space: pre-wrap;
  word-break: break-word;

  break-inside: auto;
}

/* ============================================================
   Column Control Helpers
   ============================================================ */

.column-break {
  break-before: column;
}

/* ============================================================
   Footer (≈20% page height)
   ============================================================ */

.cheatsheet-footer {
  flex: 0 0 1%;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 0.7rem;
  border-top: 1px solid #874f4f;
  padding-top: 0;
}

.cheatsheet-footer-right {
  opacity: 0.6;
}

/* ============================================================
   Screen-Only Tweaks
   ============================================================ */

@media (max-width: 1100px) {
  .cheatsheet-columns {
    column-count: 2;
  }
}

/* ============================================================
   Print Rules — SINGLE PAGE GUARANTEE
   ============================================================ */
@media print {

  @page {
    size: A4 landscape;
    margin: 15mm;
  }

  header,
  nav,
  .cheatsheet-header {
    display: none !important;
  }

  body {
    margin: 0;
  }

  .cheatsheet-page {
    width: 100%;
    background-color: #f8e79b;

  }

  .cheatsheet-columns {
    column-count: 4;
    column-gap: 1rem;
    overflow: hidden;
  }

  .cheatsheet-footer {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  pre {
    border: none;
    background: #fff;
  }
}

@media print {
  .cheatsheet-columns h2 {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}