/* Chariot code blocks: dark code blocks, highlight.js colours, the language label and marked lines.
   Goes with code-highlight.js and highlight.js 11.12.0, on single Blog Entry pages only.
   Works on its own (the switch from SyntaxHighlighter) and under the full article style.
   ASSUMPTION to confirm: post content sits in .entry-content and Blog Entry pages have the body class .single-blog. */

.single-blog .entry-content {
  --cs-code-bg: #0f2236;
  --cs-code-ink: #e3e8ee;
  /* the article style swaps in IBM Plex Mono; on its own this uses the reader's system monospace font */
  --cs-mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* code blocks */
.single-blog .entry-content pre {
  border: 0;
  box-shadow: none;
  position: relative;
  margin: 1.4em 0 1.6em;
  padding: 1.1em 1.25em;
  background: var(--cs-code-bg);
  color: var(--cs-code-ink);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--cs-mono-font);
  font-size: 0.84rem;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
}
/* The theme styles every <code> as inline code (light box, dark text) with a stronger selector,
   so inside a code block the reset has to be !important. */
.single-blog .entry-content pre code {
  font: inherit !important;
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
/* marked lines (SyntaxHighlighter's "highlight: [3, 8]"), wrapped by code-highlight.js.
   The code box is at least as wide as the block, and the line bands reach into the padding. */
.single-blog .entry-content pre code.has-marked-lines { display: inline-block !important; min-width: 100%; }
.single-blog .entry-content pre .code-line { display: block; margin-inline: -1.25em; padding-inline: 1.25em; }
.single-blog .entry-content pre .code-line.is-marked {
  background: rgba(124, 196, 255, 0.16);
  box-shadow: inset 3px 0 0 #7cc4ff;
}

/* language label, set by code-highlight.js */
.single-blog .entry-content pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.45em;
  right: 0.8em;
  font-family: var(--cs-mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8aa0b6;
}
.single-blog .entry-content pre[data-lang="plain text"]::before { content: none; }
/* room for the label, so it never sits on top of a long first line */
.single-blog .entry-content pre[data-lang]:not([data-lang="plain text"]) { padding-top: 2em; }

/* highlighting colours (highlight.js classes) */
.single-blog .entry-content .hljs-comment,
.single-blog .entry-content .hljs-quote { color: #8197ad; font-style: italic; }
.single-blog .entry-content .hljs-keyword,
.single-blog .entry-content .hljs-selector-tag,
.single-blog .entry-content .hljs-built_in,
.single-blog .entry-content .hljs-literal,
.single-blog .entry-content .hljs-type { color: #7cc4ff; }
.single-blog .entry-content .hljs-string,
.single-blog .entry-content .hljs-regexp,
.single-blog .entry-content .hljs-template-string { color: #f0b46e; }
.single-blog .entry-content .hljs-number,
.single-blog .entry-content .hljs-symbol,
.single-blog .entry-content .hljs-bullet { color: #f5d77a; }
.single-blog .entry-content .hljs-attr,
.single-blog .entry-content .hljs-attribute,
.single-blog .entry-content .hljs-property,
.single-blog .entry-content .hljs-variable,
.single-blog .entry-content .hljs-template-variable { color: #9edfc8; }
.single-blog .entry-content .hljs-title,
.single-blog .entry-content .hljs-title.function_,
.single-blog .entry-content .hljs-title.class_,
.single-blog .entry-content .hljs-section { color: #ffffff; font-weight: 600; }
.single-blog .entry-content .hljs-meta,
.single-blog .entry-content .hljs-meta .hljs-keyword,
.single-blog .entry-content .hljs-tag,
.single-blog .entry-content .hljs-name { color: #b9a6ff; }
.single-blog .entry-content .hljs-params,
.single-blog .entry-content .hljs-subst,
.single-blog .entry-content .hljs-punctuation { color: inherit; }
.single-blog .entry-content .hljs-emphasis { font-style: italic; }
.single-blog .entry-content .hljs-strong { font-weight: 600; }
