/* Format, the cheat sheets and the citation glossary. Loads after site.css and
   guide.css. On screen a sheet sits in the reading column like a page; printed,
   everything else on the page is hidden and the sheet fills one US Letter page.
   The print rules set every size themselves, so the PDF (npm run seo:pdf) depends
   only on this file and the sheet's markup (scripts/seo/sheets.json). */

/* ---------------------------------------------------------------- on screen */
.cheat {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--card-pad); color: var(--text);
  font-size: 15px; line-height: 1.5;
}
.cheat-top { border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 14px; }
.cheat-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.cheat-src { margin: 4px 0 0; color: var(--text-dim); font-size: 14px; }
.cheat h3 { margin: 0 0 8px; font: 600 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.cheat-sec + .cheat-sec { margin-top: 20px; }
.cheat-specs, .cheat-cites { display: grid; grid-template-columns: minmax(7em, 9.5em) minmax(0, 1fr); margin: 0; }
.cheat-specs dt, .cheat-specs dd, .cheat-cites dt, .cheat-cites dd { margin: 0; padding: 5px 0; border-top: 1px solid var(--line); }
.cheat-specs dt, .cheat-cites dt { font-weight: 650; padding-right: 12px; }
.cheat-cites dd { font-family: var(--serif); }
.cheat-note { margin: 0 0 8px; color: var(--text-dim); }
.cheat-ref { white-space: nowrap; font: 11.5px/1 var(--mono); color: var(--text-faint); }
.cheat-k { margin: 10px 0 0; font-weight: 650; font-size: 13.5px; }
.cheat-k:first-of-type { margin-top: 0; }
.cheat-entry { margin: 2px 0 0; padding-left: 2em; text-indent: -2em; font-family: var(--serif); overflow-wrap: anywhere; }
.cheat-tips { margin: 12px 0 0; padding-left: 1.2em; color: var(--text-dim); }
.cheat-tipref { margin: 2px 0 0; }
.cheat-foot { margin: 16px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--text-faint); font-size: 12.5px; }
.cheat a { color: inherit; text-decoration-color: var(--line-strong); }
@media (min-width: 1100px) {
  .cheat-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 28px; }
  .cheat-list { grid-column: 2; grid-row: 1 / span 2; }
  .cheat-sec + .cheat-sec { margin-top: 0; }
  .cheat-cols > .cheat-sec:nth-child(2) { margin-top: 20px; }
}

/* The suggested link for instructors: copyable markup. */
.embed { margin: 0; padding: 12px 14px; background: var(--bg-tint); border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; }
.embed code { font: 13.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* The glossary: a term, its definition and where to read more. */
.gloss { margin: 0; border-top: 1px solid var(--line); }
.gloss dt { margin: 0; padding-top: 14px; font-weight: 700; scroll-margin-top: var(--toc-top); }
.gloss dd { margin: 4px 0 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--text-dim); }
.gloss dd a { white-space: nowrap; }

/* ---------------------------------------------------------------- printed */
@media print {
  @page { size: letter; margin: 0.42in 0.45in; }
  html, body { background: #fff !important; color: #000 !important; }
  body.sheet-page > *:not(main),
  .sheet-page .guide-hero, .sheet-page .band-tint, .sheet-page .toc, .sheet-page .updated,
  .sheet-page .part:not(#sheet), .sheet-page #sheet > h2 { display: none !important; }
  .sheet-page main, .sheet-page .band:not(.band-tint), .sheet-page .wrap, .sheet-page .guide, .sheet-page .article, .sheet-page #sheet {
    display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; width: auto !important; border: 0 !important;
  }

  .cheat {
    background: #fff; color: #000; border: 0; border-radius: 0; box-shadow: none; padding: 0;
    font: 9.2pt/1.32 Arial, Helvetica, sans-serif;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .cheat a { color: #000; text-decoration: none; }
  .cheat-top { display: flex; align-items: baseline; gap: 12pt; border-bottom: 1.5pt solid #000; padding-bottom: 4pt; margin-bottom: 7pt; }
  .cheat-title { font: 700 17pt/1.1 Arial, Helvetica, sans-serif; letter-spacing: 0; white-space: nowrap; }
  .cheat-src { margin: 0; font-size: 8.4pt; color: #333; }
  .cheat-cols { display: grid !important; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 0 16pt; }
  .cheat-list { grid-column: 2; grid-row: 1 / span 2; }
  .cheat-sec + .cheat-sec { margin-top: 0; }
  .cheat-cols > .cheat-sec:nth-child(2) { margin-top: 8pt; }
  .cheat h3 { font: 700 8.4pt/1.2 Arial, Helvetica, sans-serif; letter-spacing: .08em; color: #1559d0; margin: 0 0 3pt; }
  .cheat-specs, .cheat-cites { grid-template-columns: 6.6em 1fr; }
  .cheat-specs dt, .cheat-specs dd, .cheat-cites dt, .cheat-cites dd { padding: 2pt 0; border-top: .5pt solid #bbb; }
  .cheat-specs dt, .cheat-cites dt { font-weight: 700; padding-right: 5pt; }
  .cheat-cites dd, .cheat-entry { font-family: 'Times New Roman', Times, serif; font-size: 9.8pt; line-height: 1.27; }
  .cheat-note { margin: 0 0 3pt; color: #222; }
  .cheat-ref { font: 7.2pt/1 'Courier New', Courier, monospace; color: #555; }
  .cheat-k { margin: 5pt 0 0; font-size: 8.4pt; font-weight: 700; }
  .cheat-entry { margin: 1pt 0 0; padding-left: 1.6em; text-indent: -1.6em; }
  .cheat-tips { margin: 6pt 0 0; padding-left: 1.1em; color: #222; }
  .cheat-tipref { margin: 1pt 0 0; }
  .cheat-foot { margin: 7pt 0 0; padding-top: 3pt; border-top: .5pt solid #999; font-size: 7.4pt; color: #444; }
}
