/* Varda's palette. Cool slate neutrals rather than a warm grey, and a
   lichen green: muted enough that the three severity colors below stay the
   loudest thing on a rules page, which is where a reader is scanning.

   Material stamps data-md-color-primary / -accent / -scheme on <body>, and
   its own palette.css defines the tokens against those attribute selectors.
   Declaring them on :root (which is <html>) therefore loses: not on
   specificity, but because <body> sits lower in the tree and its values
   shadow ours for everything inside it. Matching Material's own selectors is
   what makes these apply. `primary: custom` in mkdocs.yml is what causes the
   attribute to say "custom" rather than "indigo". */

[data-md-color-primary="custom"] {
  --md-primary-fg-color:        #2F6B57;
  --md-primary-fg-color--light: #3E8A70;
  --md-primary-fg-color--dark:  #22503F;
  --md-primary-bg-color:        #FFFFFF;
  --md-primary-bg-color--light: #FFFFFFB3;
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color:         #22503F;
  --md-accent-fg-color--transparent: #2F6B571A;
}

[data-md-color-scheme="default"] {
  --md-default-bg-color:  #F5F7F8;
  --md-typeset-a-color:   #2F6B57;
}

/* The dark scheme needs a lighter green: #2F6B57 on a near-black ground
   fails contrast for body text and reads as almost grey on links. */
[data-md-color-scheme="slate"][data-md-color-primary="custom"] {
  --md-primary-fg-color:        #22503F;
  --md-primary-fg-color--light: #3E8A70;
  --md-primary-fg-color--dark:  #16342A;
}

[data-md-color-scheme="slate"][data-md-color-accent="custom"] {
  --md-accent-fg-color:         #6FBFA0;
  --md-accent-fg-color--transparent: #6FBFA01A;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color:  #10151A;
  --md-code-bg-color:     #171D23;
  --md-typeset-a-color:   #6FBFA0;
}

/* Rule severities. Semantic color, deliberately separate from the accent —
   a reader scanning the rule list should spot the errors without reading a
   word. */
.sev-error   { color: #A6483A; }
.sev-warning { color: #9A6E24; }
.sev-info    { color: #5A6672; }

[data-md-color-scheme="slate"] .sev-error   { color: #E08877; }
[data-md-color-scheme="slate"] .sev-warning { color: #D6A64E; }
[data-md-color-scheme="slate"] .sev-info    { color: #8D99A4; }

/* Rule entries read as a reference list, not as prose sections. */
.md-typeset h3[id^="v"] {
  font-family: var(--md-code-font-family, monospace);
  scroll-margin-top: 4rem;
}

/* Tables here are mostly two- and three-column reference material; let the
   meaning column breathe rather than wrapping the identifier. */
.md-typeset table:not([class]) td:first-child { white-space: nowrap; }
.md-typeset table:not([class]) { font-size: .78rem; }
