/*
 * The look of the Hacker theme for GitHub Pages, https://github.com/pages-themes/hacker (CC0 1.0):
 * a near-black page, light gray monospace text, green headings with a soft glow, blue links and
 * dashed green rules. Its colors are cod grey #151515, gallery #eaeaea and conifer #b5e853.
 * Material for MkDocs draws the pages, so formulas, admonitions and diagrams keep working.
 */
:root {
  --hacker-bg: #151515;
  --hacker-fg: #eaeaea;
  --hacker-green: #b5e853;
  --hacker-link: #63c0f5;
  --hacker-muted: #a0a0a0;
  --hacker-rule: #6d6d6d;
  --hacker-glow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(181, 232, 83, 0.1),
    0 0 10px rgba(181, 232, 83, 0.1);
  --md-text-font: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
  --md-code-font: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
}

[data-md-color-scheme="slate"] {
  --md-hue: 0;
  --md-default-bg-color: var(--hacker-bg);
  --md-default-fg-color: var(--hacker-fg);
  --md-default-fg-color--light: #c8c8c8;
  --md-default-fg-color--lighter: #8a8a8a;
  --md-default-fg-color--lightest: #3a3a3a;
  --md-typeset-color: var(--hacker-fg);
  --md-typeset-a-color: var(--hacker-link);
  --md-code-bg-color: rgba(0, 0, 0, 0.9);
  --md-code-fg-color: var(--hacker-green);
  --md-footer-bg-color: #0d0d0d;
  --md-footer-bg-color--dark: #080808;
}

[data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--hacker-bg);
  --md-primary-fg-color--light: #222;
  --md-primary-fg-color--dark: #0d0d0d;
  --md-primary-bg-color: var(--hacker-green);
  --md-primary-bg-color--light: var(--hacker-green);
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color: var(--hacker-green);
  --md-accent-fg-color--transparent: rgba(181, 232, 83, 0.1);
}

/* The header and the tabs: dark, with a dashed green line below, and "./ " before the name. */
.md-header {
  border-bottom: 1px dashed var(--hacker-green);
  box-shadow: none;
}

.md-header__topic:first-child .md-ellipsis::before {
  content: "./ ";
}

.md-header__title,
.md-tabs__link {
  text-shadow: var(--hacker-glow);
}

.md-tabs {
  border-bottom: 1px dashed var(--hacker-rule);
}

/* Twelve sections do not fit on one line of monospace tabs. Material cuts the extra tabs off,
   so the list wraps to a second line instead. */
.md-tabs__list {
  flex-wrap: wrap;
  white-space: normal;
}

.md-tabs__item {
  height: auto;
  padding-bottom: 0.4rem;
}

/* Headings in green, normal weight, with the glow. */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--hacker-green);
  font-weight: normal;
  letter-spacing: -0.03em;
  text-shadow: var(--hacker-glow);
}

.md-typeset h5,
.md-typeset h6 {
  color: var(--hacker-muted);
}

.md-typeset a {
  text-shadow: 0 0 5px rgba(104, 182, 255, 0.5);
}

/* Code blocks: black, with a thin light border. Inline code in the theme's purple. */
.md-typeset pre > code {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.md-typeset :not(pre) > code {
  color: #aa759f;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.md-typeset blockquote {
  color: var(--hacker-muted);
  border-left: 1px dotted var(--hacker-rule);
}

.md-typeset hr {
  border-bottom: 1px dashed var(--hacker-green);
}

/* Tables: no boxes, a dashed green line under the header row. */
.md-typeset table:not([class]) {
  background: transparent;
  border: none;
}

.md-typeset table:not([class]) th {
  background: transparent;
  color: var(--hacker-fg);
  border-bottom: 1px dashed var(--hacker-green);
}

.md-typeset table:not([class]) td {
  border-top: none;
}

/* Keep wide formulas and tables readable on phones. */
.md-typeset .arithmatex {
  overflow-x: auto;
}

/* An inline formula cannot wrap. A wide one scrolls in its own box, not the whole page. */
.md-typeset span.arithmatex {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
}
