/*
 * Dark-mode overrides for the ACE "github" editor theme.
 *
 * This file exists because the editor is the one surface DarkReader can never
 * reach. ACE injects its theme as a <style> element at runtime, and the
 * generator in darkmode_generator/ only ever loads the home page — which has no
 * editor — so darkmode.min.css contains no rule for it. The result was a
 * blinding white code pane on every submit page in dark mode.
 *
 * Loaded from base.html inside the same `{% if use_darkmode %}` block as
 * darkmode-svg.css, so it never applies in light mode.
 *
 * Every selector is prefixed with `body` for one reason: ACE's own <style> tag
 * lands in <head> *after* this stylesheet, so at equal specificity ACE wins.
 * The extra element bumps specificity by one and avoids a file full of
 * !important. Colours mirror the SCSS tokens ($primary-*, $accent) — this is
 * plain CSS outside the Sass build, so they are literals; keep them in step
 * with resources/vars.scss.
 */

body .ace-github {
  background-color: #10202f;
  color: #d7e3ee;
}

body .ace-github .ace_gutter {
  background: #0c1a26;
  color: #6f8ba6;
}

body .ace-github .ace_gutter-active-line {
  background-color: rgba(95, 224, 229, 0.12);
}

body .ace-github .ace_print-margin {
  background: #1b2f42;
}

body .ace-github .ace_cursor {
  color: #5fe0e5;
}

/* The light theme flags the caret line in near-fluorescent yellow
   (rgb(255,255,204)); on a dark pane that reads as a highlighter stripe. */
body .ace-github.ace_focus .ace_marker-layer .ace_active-line {
  background: rgba(95, 224, 229, 0.09);
}

body .ace-github .ace_marker-layer .ace_active-line {
  background: rgba(255, 255, 255, 0.04);
}

body .ace-github .ace_marker-layer .ace_selection {
  background: rgba(47, 86, 128, 0.7);
}

body .ace-github .ace_marker-layer .ace_selected-word {
  border: 1px solid rgba(95, 224, 229, 0.4);
}

body .ace-github .ace_indent-guide {
  background: none;
  box-shadow: inset -1px 0 0 rgba(215, 227, 238, 0.12);
}

/* ── Syntax ──────────────────────────────────────────────────────────────── */

body .ace-github .ace_comment {
  color: #6f8ba6;
  font-style: italic;
}

body .ace-github .ace_string {
  color: #ffab8f;
}

body .ace-github .ace_string.ace_regexp {
  color: #8fd694;
}

body .ace-github .ace_constant.ace_numeric {
  color: #7fd6c4;
}

body .ace-github .ace_keyword,
body .ace-github .ace_constant.ace_language,
body .ace-github .ace_boolean {
  color: #8ab6ff;
}

body .ace-github .ace_support.ace_function,
body .ace-github .ace_constant.ace_buildin,
body .ace-github .ace_variable.ace_language {
  color: #5fe0e5;
}

body .ace-github .ace_variable.ace_class,
body .ace-github .ace_variable.ace_instance {
  color: #9ad6de;
}

body .ace-github .ace_paren {
  color: #d7e3ee;
}

body .ace-github .ace_fold {
  background-color: #5fe0e5;
  border-color: #d7e3ee;
}
