/*
  Terminal transcripts — ANSI output rendered as HTML.

  Written for the Addapa Discord bot's output, which can be pasted into a page
  verbatim (escape codes included) in a fenced block tagged `ansi`. build.py's
  ansi_to_html() turns SGR colour into these classes.

  The palette below is the ANSI 16 mapped onto addapa-phosphor. It is a real
  mapping, not a pass-through: raw ANSI green is #00ff00 (which is already the
  site's phosphor, so it lands unchanged), but raw ANSI white on a black panel is
  harsher than the dossier's prose grey, and raw ANSI cyan/yellow are more
  saturated than anything else on the site. Each is pulled toward the site's own
  ink and chrome so a pasted transcript sits inside a panel instead of shouting
  over it — while keeping the hue relationships the bot relies on to signal
  meaning (green ok, yellow warn, red fail, cyan chrome).
*/

.ansi {
  font-family: var(--mono-family);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink2);
  background: #000;
  border: 1px solid var(--border2);
  padding: 14px 16px;
  margin: 0 0 1em;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}

/* Transcripts are wide and fixed-width by nature. They scroll inside their own
   box rather than pushing the page sideways. */
.panel .ansi { max-width: 100%; }

.ansi .a-bold { font-weight: 700; }

/* normal intensity */
.ansi .a-blk { color: #5a6a58; }        /* pure black would vanish on the panel */
.ansi .a-red { color: var(--red); }
.ansi .a-grn { color: var(--accent); }  /* #00ff00 — already the site phosphor */
.ansi .a-yel { color: #c9a44c; }
.ansi .a-blu { color: #5f8fd8; }
.ansi .a-mag { color: #b07cd8; }
.ansi .a-cyn { color: #4fc4d0; }
.ansi .a-wht { color: var(--ink2); }    /* prose grey, not #fff */

/* bright intensity */
.ansi .a-blk-b { color: var(--dim); }
.ansi .a-red-b { color: #ff8a92; }
.ansi .a-grn-b { color: var(--accent-hi); }
.ansi .a-yel-b { color: #e4c477; }
.ansi .a-blu-b { color: #8fb4ec; }
.ansi .a-mag-b { color: #cba4ec; }
.ansi .a-cyn-b { color: #7fe0ea; }
.ansi .a-wht-b { color: var(--ink); }

/* Bold + white is the bot's "heading" combination, so it gets the brightest ink
   rather than merely a heavier weight. */
.ansi .a-wht.a-bold { color: var(--ink); }

@media (max-width: 600px) {
  .ansi { font-size: 10.5px; padding: 10px 12px; }
}

@media print {
  .ansi { background: #fff; border-color: #000; color: #000; }
  .ansi [class^="a-"] { color: #000 !important; }
}
