/* Build a CubeSat docs – the Zensical theme (Material's --md-* variables) on the BAC design tokens (Ops mode).

   This file holds no values of its own: every color, font and weight is a reference to tokens.css, the copy
   that bac-design-tokens generates in bac-utils. Light and dark follow the system setting, which tokens.css
   switches on; both schemes of the theme therefore get the same mapping. */

:root,
[data-md-color-scheme='default'],
[data-md-color-scheme='slate'] {
  --md-text-font: 'Nunito Sans';
  --md-code-font: 'IBM Plex Mono';

  --md-default-bg-color: var(--bg);
  --md-default-fg-color: var(--text);
  --md-default-fg-color--light: var(--text-muted);
  --md-default-fg-color--lighter: var(--text-faint);
  --md-default-fg-color--lightest: var(--border);

  --md-primary-fg-color: var(--bg-raised);
  --md-primary-fg-color--light: var(--bg-raised);
  --md-primary-fg-color--dark: var(--bg-raised);
  --md-primary-bg-color: var(--text-strong);
  --md-primary-bg-color--light: var(--text-muted);

  --md-accent-fg-color: var(--link);
  --md-accent-fg-color--transparent: var(--surface-hover);
  --md-accent-bg-color: var(--text-on-accent);

  --md-typeset-color: var(--text);
  --md-typeset-a-color: var(--link);
  --md-typeset-table-color: var(--border);
  --md-typeset-table-color--light: var(--surface-hover);

  --md-code-bg-color: var(--surface-sunken);
  --md-code-fg-color: var(--text-strong);

  --md-footer-bg-color: var(--bg-raised);
  --md-footer-bg-color--dark: var(--bg-raised);
  --md-footer-fg-color: var(--text);
  --md-footer-fg-color--light: var(--text-muted);
  --md-footer-fg-color--lighter: var(--text-faint);
}

body {
  font-family: var(--font-body);
}

.md-header,
.md-tabs {
  box-shadow: none;
  border-bottom: var(--border-w) solid var(--border);
}

/* Opaque surfaces from the tokens in place of the theme's translucent header and its footer band. */
.md-header {
  background-color: var(--bg-raised);
  backdrop-filter: none;
}

.md-footer-meta {
  background-color: var(--bg-raised);
}

.md-nav__link--active,
.md-nav__link:hover {
  background-color: var(--surface-hover);
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-heading);
  color: var(--text-strong);
  letter-spacing: var(--ls-tight);
}

.md-typeset code,
.md-typeset kbd,
.md-typeset pre {
  font-family: var(--font-mono);
}

.md-typeset a:focus-visible,
.md-nav__link:focus-visible {
  outline: var(--border-w-thick) solid var(--focus-ring);
  outline-offset: 2px;
}

.md-footer-meta {
  border-top: var(--border-w) solid var(--border);
}

/* Width for anything people read (Identity Guide, Section 5.1). */
.md-grid {
  max-width: var(--container);
}

/* No shadows: depth comes from background steps and hairlines (Section 5.3). */
.md-header,
.md-header--shadow,
.md-search__form,
.md-search__output,
.md-typeset .admonition,
.md-typeset details,
.md-typeset table:not([class]) {
  box-shadow: none;
}

.md-search__form,
.md-search__button {
  background-color: var(--surface-sunken);
  border-radius: var(--radius-pill);
}

/* Tables: a strong header rule, hairline rows, no outer border and no fills (Section 5.4). */
.md-typeset table:not([class]) {
  border: 0;
  border-radius: 0;
  background: none;
}

.md-typeset table:not([class]) th {
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: var(--border-w-thick) solid var(--text-strong);
}

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

.md-typeset table:not([class]) tbody tr:hover {
  background: none;
  box-shadow: none;
}

/* Callouts: a card with a hairline, information blue for the note (Sections 4 and 5.2). */
.md-typeset .admonition,
.md-typeset details {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface-card);
  font-size: inherit;
}

.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: var(--bac-blue-ink);
  background-color: var(--bac-blue-tint);
}

.md-typeset .note > .admonition-title,
.md-typeset .note > summary {
  background-color: transparent;
  color: var(--text-strong);
}

.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before {
  background-color: var(--bac-blue-ink);
}

.md-typeset code {
  border-radius: var(--radius-sm);
}
