/* The site's look: the CoE5SE banner's black, with the warm earth of its tiles for accents. */

:root,
[data-md-color-scheme="default"] {
  --coe5se-rule: #7a3f2c;
  --md-primary-fg-color: #000;
  --md-primary-fg-color--light: #1a1a1a;
  --md-primary-fg-color--dark: #000;
  --md-accent-fg-color: #b0714f;
  --md-typeset-a-color: #7a3f2c;
  --coe5se-command: #6a3d9a;
}

[data-md-color-scheme="slate"] {
  --coe5se-rule: #b0714f;
  --md-default-bg-color: #121212;
  --md-code-bg-color: #1c1c1c;
  --md-typeset-a-color: #d08c66;
  --coe5se-command: #b48ee0;
}

/* The banner is the header's logo, as tall as the header allows. */
.md-header__button.md-logo {
  padding: 0.2rem 0.4rem;
}

.md-header__button.md-logo img {
  height: 2rem;
  width: auto;
}

/* Where the theme shows the logo, the banner already names the site. */
@media screen and (min-width: 76.25em) {
  .md-header__title .md-header__topic:first-child {
    visibility: hidden;
  }
}

.md-nav__button.md-logo img {
  height: auto;
  width: 100%;
}

/* The repository's star and fork counts. */
.md-source__facts {
  display: none;
}

.md-typeset h1 {
  color: var(--md-default-fg-color);
}

/* A command entry: a rule above it, its heading set as the code a modder types. */
.md-typeset h3 {
  margin-top: 2.6em;
  padding-top: 0.9em;
  border-top: 0.15rem solid var(--coe5se-rule);
  font-family: var(--md-code-font-family);
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: 0;
}

.md-typeset h3 + p {
  margin-top: 0.5em;
}

/* A page's whole example closes it; its heading reads as a label, not a command. */
.md-typeset h3#example,
.md-typeset h3#example-events {
  font-family: var(--md-text-font-family);
  border-top-style: double;
  border-top-width: 0.3rem;
}

/* The Commands overview's headings are sections, not commands. */
.md-typeset h3#where,
.md-typeset h3#pages {
  font-family: var(--md-text-font-family);
}

/* Code blocks wrap long lines instead of scrolling sideways. */
.md-typeset pre > code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The New label on an entry from one of the four newest CoE5SE releases, and on its line in the
   table of contents. */
.md-typeset .new-badge, .md-nav .new-badge {
  display: inline-block;
  margin-left: 0.5em;
  padding: 0.1em 0.55em;
  border-radius: 1em;
  background-color: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color);
  font-family: var(--md-text-font-family);
  font-size: 0.6em;
  font-weight: 700;
  vertical-align: middle;
}

/* The table of contents' text is already small: its label is less so. */
.md-nav .new-badge {
  font-size: 0.85em;
}

/* The header's New labels switch: with the labels off, every New label and the nav's new status go,
   and the switch shows its dimmed button, which shows them again. */
[data-new-labels="off"] .new-badge,
[data-new-labels="off"] .md-status--new {
  display: none;
}
.new-labels-switch__show svg {
  opacity: 0.5;
}
:root:not([data-new-labels="off"]) .new-labels-switch__show,
[data-new-labels="off"] .new-labels-switch__hide {
  display: none;
}

/* Hover boxes keep their line breaks, as the VS Code extension's do. */
.md-tooltip2__inner {
  white-space: pre-line;
}

/* In-game screenshots as numbered steps, one under the other, each at its own size. */
.md-typeset .coe5se-shots {
  display: grid;
  gap: 1.2rem;
  justify-items: start;
}

.md-typeset .coe5se-shots figure {
  margin: 0;
}

.md-typeset .coe5se-shots img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.2rem;
}

.md-typeset .coe5se-shots figcaption {
  margin: 0.4rem 0 0;
  text-align: left;
  font-style: normal;
}

/* An entry's example sits close to its text; a label reads as a caption over its code. */
.md-typeset .tabbed-set {
  margin-top: 0.8em;
}

.md-typeset .tabbed-block > p {
  margin: 0.8em 0 0.2em;
  font-size: 0.9em;
  color: var(--md-default-fg-color--light);
}

.md-typeset .tabbed-block > p:first-child {
  margin-top: 0.4em;
}

/* The event branch words, each its own bold colour, as in the VS Code extension. */
.md-typeset .highlight .k-Branch-If { color: #00c853; font-weight: bold; }
.md-typeset .highlight .k-Branch-Elseif { color: #ff9f1c; font-weight: bold; }
.md-typeset .highlight .k-Branch-Else { color: #e040fb; font-weight: bold; }

/* A command's line in the page's table of contents, in purple, apart from the examples and other headings
   (hooks/command_toc.py marks it). The line you are on and the one under the pointer keep the theme's colour. */
.md-nav--secondary .md-nav__link.command-link:not(.md-nav__link--active):not(:hover) {
  color: var(--coe5se-command);
}

/* A command or value in a table cell stays on one line ("corpsekind largeanimal", `smallanimal`); the
   cell's other text wraps as usual. */
.md-typeset table:not([class]) td code {
  white-space: nowrap;
}
