/* Alabaster, ported from Nikita Prokopov's VS Code theme (MIT):
   https://github.com/tonsky/vscode-theme-alabaster

   Four things are coloured and nothing else: strings, constants, comments,
   and definitions. Keywords, operators, variables and properties stay black.
   Comments are red rather than dimmed, on the theory that a comment is the
   part worth reading first.

   microlighter flattens TextMate scopes into a fixed set of highlight names
   (getCategory() in microlighter.js), which is coarser than VS Code's scope
   selectors, so a few of the original rules land differently:

   - Escape sequences (\n) are grey in Alabaster; here they come through as
     `constant` and read purple, like every other constant.
   - Definitions: `entity.name.X` arrives as the highlight `X`. Only the names
     that nothing but entity.name produces are coloured. `variable`,
     `property` and `interpolation` also come from ordinary variables and
     property names, and colouring them would paint most of the code blue.
   - CSS selectors are blue whole (`a.heavy:hover`), where Alabaster colours
     only the element name: microlighter's CSS grammar marks the full
     selector as one entity.name.selector. Likewise keys in JSON, YAML and
     TOML are entity.name.key here, so JSON keys go blue rather than green.
   - Punctuation is grey only where a grammar tags it; the JS grammar leaves
     braces and semicolons untagged, so they stay black.
   - `invalid` has no highlight at all, so it is not styled.
   - Diff lines take the background tints Alabaster uses for diff headers;
     the original leaves them to VS Code's own diff colours. */

pre:has(> code[class*="language-"]) {
  background: #f7f7f7;
  color: #000;
  line-height: 1.2;
  padding: .75rem 1rem;      /* the only rule that changes layout; drop it to keep the block flush */
  width: fit-content;
}
pre > code[class*="language-"]::selection { background: #bfdbfe; }

/* Comments */
::highlight(comment)                                                  { color: #aa3731; }

/* Strings. Links and attribute values are strings in the grammars too. */
::highlight(string), ::highlight(regexp), ::highlight(symbol),
::highlight(link), ::highlight(attribute-value)                       { color: #448c27; }

/* Constants: numbers, booleans, language constants, entities */
::highlight(numeric), ::highlight(boolean), ::highlight(constant),
::highlight(character-entity)                                         { color: #7a3e9d; }

/* Definitions (entity.name.*) */
::highlight(function), ::highlight(type), ::highlight(tag),
::highlight(selector), ::highlight(section), ::highlight(decorator),
::highlight(animation), ::highlight(key), ::highlight(anchor)          { color: #325cc0; }

/* Punctuation */
::highlight(punctuation)                                              { color: #777; }

/* Diff */
::highlight(inserted)                                                 { background-color: #ddffdd; }
::highlight(deleted)                                                  { background-color: #ffdddd; }
