/* docs/stylesheets/theme.css: the site takes its colours from the banner.
 *
 * banner.svg draws the name in white on #120f0c, the tagline and the divider
 * in #c9b8a6, the lossy steps in #6f655b and the lossless wave in orange
 * #ff8a1f. The header and the dark page use the banner background; the accent
 * is the wave's orange. mkdocs.yml sets `primary: custom` and
 * `accent: custom`, so Material paints nothing until these variables exist.
 */
:root {
  --md-primary-fg-color: #120f0c; /* banner background */
  --md-primary-fg-color--light: #1c1814;
  --md-primary-fg-color--dark: #0a0806;
  --md-primary-bg-color: #ffffff; /* banner wordmark */
  --md-primary-bg-color--light: #c9b8a6; /* banner tagline */

  --md-accent-fg-color: #ff8a1f; /* the lossless wave */
  --md-accent-fg-color--transparent: #ff8a1f1a;
}

/* Dark scheme: the page body uses the banner background too, so the header
   and the page read as one surface. #ff8a1f on #120f0c is 8.1:1. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #120f0c;
  --md-code-bg-color: #1c1814;
  --md-typeset-a-color: #ff8a1f;
}

/* Light scheme: #ff8a1f on white is 2.4:1, too faint for body links.
   #b85800 is the same hue at 4.7:1. */
[data-md-color-scheme="default"] {
  --md-typeset-a-color: #b85800;
}

/* Fixed logo size so it does not crowd the site name. */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.6rem;
  width: 1.6rem;
}

/* The site name, set the way banner.svg sets the wordmark: white, bold.
 *
 * Only the first topic is styled. Material puts the site name in one
 * .md-header__topic and the page title in a second one, and swaps them on
 * scroll. Styling both would change every page title too. */
.md-header__topic:first-child .md-ellipsis {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Keep the mark and the name close, so they read as one unit. */
.md-header__button.md-logo {
  padding-right: 0.2rem;
}

.md-header__title {
  margin-left: 0.2rem;
}

/* Buttons.
 *
 * Material paints .md-button in --md-primary-fg-color, the header colour. On
 * the dark page that is also the page background, so a button would show as
 * plain text. Outline buttons take the link colour instead. */
.md-typeset .md-button {
  color: var(--md-typeset-a-color);
  border-color: var(--md-typeset-a-color);
  border-radius: 0.5rem;
}

.md-typeset .md-button:focus,
.md-typeset .md-button:hover {
  background-color: var(--md-typeset-a-color);
  border-color: var(--md-typeset-a-color);
  color: #120f0c;
}

/* The primary button is the banner's own pair: the banner background on the
   wave's orange, 8.1:1. */
.md-typeset .md-button--primary,
.md-typeset .md-button--primary:focus,
.md-typeset .md-button--primary:hover {
  background-color: #ff8a1f;
  border-color: transparent;
  color: #120f0c;
}

.md-typeset .md-button--primary:focus,
.md-typeset .md-button--primary:hover {
  box-shadow: 0 0.2rem 0.8rem #ff8a1f59;
}

/* Grid cards: the border picks up the accent on hover, so the cards match
   the buttons and links. */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border-radius: 0.5rem;
}

.md-typeset .grid.cards > ul > li:focus-within,
.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid > .card:focus-within,
.md-typeset .grid > .card:hover {
  border-color: #ff8a1f;
}

/* The home page keeps an H1 for search, screen readers and the browser tab.
   The banner under it already shows the name, so the H1 is hidden visually.
   Use it as: # slskd-transform { .st-visually-hidden } */
.md-typeset h1.st-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Environment variable names in tables, such as SLSKD_DURATION_TOLERANCE,
   must not wrap mid-word. Material sets word-break: break-word on code;
   normal keeps a name whole but still lets a long line wrap at its spaces. */
.md-typeset table:not([class]) code {
  word-break: normal;
}
