/* To Serve Admin — code highlighting theme (Prism tokens mapped to the
 * 50s phosphor/amber manual palette) + copy button + cheat-sheet + print.
 * Loaded after style.css so it can lean on the :root tokens defined there. */

/* ---- copy button in the terminal title bar ---- */
pre.term .term-bar { justify-content: flex-start; }
pre.term .term-copy {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  background: transparent; color: var(--faint);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 3px 9px; cursor: pointer; text-transform: uppercase;
  transition: color .15s, border-color .15s, background .15s;
}
pre.term .term-copy:hover { color: var(--green); border-color: var(--green-dk); }
pre.term .term-copy.ok { color: #081; color: var(--green); border-color: var(--green); background: rgba(91,217,140,.08); }

/* keep long lines scrollable, never break the layout */
.art-body pre.term { overflow: hidden; }
pre.term code[class*="language-"] {
  display: block; overflow-x: auto; white-space: pre;
  padding: 14px 16px; color: #bfe6cd; font-size: 13.5px; line-height: 1.6;
  background: none; border: 0; tab-size: 2;
}

/* ---- Prism token colors (phosphor green base, amber accents) ---- */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--faint); font-style: italic; }
.token.punctuation { color: #7f9a88; }
.token.namespace { opacity: .7; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: var(--red); }
.token.boolean, .token.number { color: #e0b978; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #8fe0a6; }
.token.operator, .token.entity, .token.url,
.language-css .token.string, .style .token.string { color: var(--amber); }
.token.atrule, .token.attr-value, .token.keyword { color: var(--amber); }
.token.function, .token.class-name { color: #79d3ff; }
.token.regex, .token.important, .token.variable { color: #e0b978; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }
/* bash specifics */
.language-bash .token.function { color: #8fe0a6; }
.language-bash .token.variable { color: var(--amber); }
/* diff */
.token.deleted { background: rgba(217,107,91,.12); }
.token.inserted { background: rgba(91,217,140,.10); }

/* inline code stays as-is from style.css; ensure Prism doesn't override it */
.art-body :not(pre) > code[class*="language-"] { background: #12181f; padding: 1px 6px; color: #cfe3d6; }

/* =========================================================
   CHEAT SHEET  (template: page-cheatsheet.php)
   Dense, printable quick-reference — the "pin it to the wall" page.
   ========================================================= */
.cheat-head { padding: 30px 0 4px; }
.cheat-head .art-kicker { margin-bottom: 10px; }
.cheat-head h1 { font-family: var(--serif); font-size: clamp(26px,4.4vw,40px); margin: 0 0 6px; }
.cheat-lede { font-family: var(--mono); font-size: 12.5px; color: var(--dim); letter-spacing: .04em; max-width: 70ch; }
.cheat-toolbar { display: flex; gap: 12px; margin: 16px 0 6px; flex-wrap: wrap; }
.cheat-toolbar .btn-print {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  background: transparent; color: var(--green); border: 1px solid var(--green-dk);
  padding: 7px 14px; border-radius: 3px; cursor: pointer;
}
.cheat-toolbar .btn-print:hover { background: rgba(91,217,140,.08); }
.cheat-toolbar .filter {
  font-family: var(--mono); font-size: 12px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); padding: 6px 10px; border-radius: 3px; min-width: 220px;
}

.cheat-grid {
  columns: 2 380px; column-gap: 22px; margin: 22px 0 40px;
}
.cheat-card {
  break-inside: avoid; border: var(--rule); border-top: 3px solid var(--amber);
  background: var(--panel); margin: 0 0 22px; padding: 0;
}
.cheat-card > h2 {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber); margin: 0; padding: 11px 14px; border-bottom: 1px dashed var(--line);
  display: flex; align-items: baseline; gap: 8px;
}
.cheat-card > h2 .no { color: var(--green); font-size: 10px; }
.cheat-card table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.cheat-card td { padding: 6px 14px; vertical-align: top; border-top: 1px solid var(--line-soft); }
.cheat-card tr:first-child td { border-top: 0; }
.cheat-card td.cmd { color: #bfe6cd; white-space: nowrap; padding-right: 10px; }
.cheat-card td.cmd code { background: none; border: 0; color: #bfe6cd; padding: 0; font-size: 12.5px; }
.cheat-card td.desc { color: var(--dim); font-family: var(--sans); font-size: 12.5px; line-height: 1.5; }
.cheat-card tr:hover td { background: rgba(255,255,255,.02); }
.cheat-card mark { background: rgba(226,165,74,.28); color: var(--head); }
.cheat-hint { font-family: var(--mono); font-size: 10.5px; color: var(--faint); padding: 8px 14px; border-top: 1px dashed var(--line); letter-spacing: .04em; }
.cheat-empty { font-family: var(--mono); color: var(--faint); padding: 30px 4px; }

@media (max-width: 720px) { .cheat-grid { columns: 1; } }

/* =========================================================
   PRINT  — make articles and the cheat sheet paper-friendly
   ========================================================= */
@media print {
  :root { --bg:#fff; --text:#111; --head:#000; --dim:#333; --faint:#666; --line:#bbb; --line-soft:#ddd; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .site-header, .site-footer, .rail, .term-copy, .cheat-toolbar, .sponsor-box, .comments-area, nav, .art-kicker .stamp { display: none !important; }
  a { color: #111; text-decoration: none; }
  .wrapper { max-width: none; padding: 0; }
  .cheat-grid { columns: 2; column-gap: 14px; }
  .cheat-card { border: 1px solid #999; border-top: 2px solid #333; background: #fff; margin-bottom: 12px; page-break-inside: avoid; }
  .cheat-card > h2 { color: #000; border-bottom: 1px solid #999; }
  .cheat-card td.cmd, .cheat-card td.cmd code { color: #000; }
  .cheat-card td.desc { color: #333; }
  pre.term { border: 1px solid #999; background: #f6f6f6; }
  pre.term .term-bar { background: #eee; color: #333; border-bottom: 1px solid #ccc; }
  pre.term code[class*="language-"] { color: #111; white-space: pre-wrap; word-break: break-word; }
  .token.comment { color: #666; }
  .token.keyword, .token.atrule, .token.attr-value { color: #000; font-weight: 700; }
  .cheat-head h1, .art-head h1 { color: #000; }
}
