/*
 * Brand code colours, mapped onto Giallo's indexed class output (.z-N),
 * matching docs/src/code-theme.ts. Loaded AFTER giallo.css so these win.
 *
 * Since Zola 0.23 (Giallo class mode), highlighted spans carry indexed
 * classes (z-1, z-2, ...) instead of semantic scope names (z-variable, ...).
 * The indices are derived from the configured theme (github-light), so this
 * file is keyed to that theme: if `markdown.highlighting.theme` changes, the
 * mapping below must be redone. Reference for the current theme:
 *
 *   z-1 #005CC5  constants, flags, JSON/TOML keys, `String`, markup headings
 *   z-2 #032F62  strings, string punctuation, regexps, escape chars
 *   z-3 #22863A  TOML keys (github-light entity.name.tag), quotes, inserted
 *   z-4 #586069  (unused by current content)
 *   z-5 #6A737D  comments
 *   z-6 #6F42C1  entity names: commands (docker, curl, jq), type names
 *   z-7 #B31D28  invalid/deleted (usually paired with giallo's .z-i)
 *   z-8 #D73A49  keywords, storage, operators, nginx directives
 *   z-9 #E36209  variables, parameters, GraphQL fields
 *   z-bg1..5     token backgrounds (diff tints, carriage-return, ignored)
 *   z-b/z-i/z-u/z-s/z-us  bold/italic/underline/strike (giallo-managed)
 */

/* Structural classes required by Giallo's class output. */
.giallo-l {
  display: inline-block;
  min-height: 1lh;
  width: 100%;
}
.giallo-ln {
  display: inline-block;
  user-select: none;
  margin-right: 0.4em;
  padding: 0.4em;
  min-width: 3ch;
  text-align: right;
  opacity: 0.8;
}

/* Code block surface - use the brand code background/foreground. */
pre.giallo,
pre.z-code {
  color: var(--code-foreground) !important;
  background-color: var(--code-background) !important;
}

/* Highlighted lines (hl_lines annotation). */
.z-hl {
  background-color: var(--code-highlight-color) !important;
}

/* Token colours (brand palette). */
.z-1 {
  color: var(--code-token-constant) !important;
}
.z-2 {
  color: var(--code-token-string) !important;
}
.z-3,
.z-8 {
  color: var(--code-token-keyword) !important;
}
.z-4 {
  color: var(--code-token-punctuation) !important;
}
.z-5 {
  color: var(--code-token-comment) !important;
  font-style: italic;
}
.z-6 {
  color: var(--code-token-property) !important;
}
.z-7 {
  color: var(--code-token-constant) !important;
}
.z-9 {
  color: var(--code-token-parameter) !important;
}

/* Diff line backgrounds and other token backdrops. */
.z-bg1 {
  background-color: var(--code-token-keyword) !important;
}
.z-bg2 {
  background-color: var(--code-token-constant) !important;
}
.z-bg3 {
  background-color: var(--code-diff-inserted-bg) !important;
}
.z-bg4 {
  background-color: var(--code-diff-changed-bg) !important;
}
.z-bg5 {
  background-color: var(--code-diff-deleted-bg) !important;
}

/* Ignored / untracked / carriage-return markers - light text on a brand
   backdrop (the backdrop comes from z-bg1/z-bg2). */
.z-10,
.z-11 {
  color: var(--code-background) !important;
}

/* Line numbers - dim, theme-aware. */
.giallo-ln {
  color: color-mix(in srgb, var(--foreground) 40%, transparent) !important;
}
