/* The OntoCast console's look: its surface, ink, brand and accent ramps, dark
   by default with a light variant. Values match the console's theme tokens. */

[data-md-color-scheme="slate"] {
  --oc-surface-950: #0b101b;
  --oc-surface-900: #131b29;
  --oc-surface-800: #1c2636;
  --oc-surface-700: #293241;
  --oc-surface-600: #3c4a61;
  --oc-ink-100: #eef2f7;
  --oc-ink-300: #c3cddc;
  --oc-ink-400: #97a4b8;
  --oc-brand-300: #8fb4e8;
  --oc-brand-400: #6a97d8;
  --oc-brand-500: #3f6cb0;
  --oc-accent-500: #c45f28;
  --oc-rule: rgba(41, 50, 65, 0.6);
  --oc-on-brand: #ffffff;
}

[data-md-color-scheme="default"] {
  --oc-surface-950: #ffffff;
  --oc-surface-900: #f4f7fb;
  --oc-surface-800: #eaeff6;
  --oc-surface-700: #d8dfea;
  --oc-surface-600: #b9c4d6;
  --oc-ink-100: #16213a;
  --oc-ink-300: #1f2430;
  --oc-ink-400: #55607a;
  --oc-brand-300: #224777;
  --oc-brand-400: #1b3a63;
  --oc-brand-500: #224777;
  --oc-accent-500: #c45f28;
  --oc-rule: rgba(216, 223, 234, 0.9);
  --oc-on-brand: #ffffff;
}

[data-md-color-scheme="slate"],
[data-md-color-scheme="default"] {
  --md-hue: 218;
  --md-default-bg-color: var(--oc-surface-950);
  --md-default-bg-color--light: var(--oc-surface-900);
  --md-default-bg-color--lighter: var(--oc-surface-800);
  --md-default-bg-color--lightest: var(--oc-surface-700);
  --md-default-fg-color: var(--oc-ink-100);
  --md-default-fg-color--light: var(--oc-ink-400);
  --md-default-fg-color--lighter: color-mix(in srgb, var(--oc-ink-400) 60%, transparent);
  --md-default-fg-color--lightest: var(--oc-rule);
  --md-typeset-color: var(--oc-ink-300);
  --md-typeset-a-color: var(--oc-brand-300);
  --md-primary-fg-color: var(--oc-surface-950);
  --md-primary-fg-color--light: var(--oc-surface-900);
  --md-primary-fg-color--dark: var(--oc-surface-950);
  --md-primary-bg-color: var(--oc-ink-100);
  --md-primary-bg-color--light: var(--oc-ink-400);
  --md-accent-fg-color: var(--oc-brand-400);
  --md-accent-fg-color--transparent: color-mix(in srgb, var(--oc-brand-500) 15%, transparent);
  --md-accent-bg-color: var(--oc-on-brand);
  --md-code-bg-color: var(--oc-surface-900);
  --md-code-fg-color: var(--oc-ink-300);
  --md-code-hl-color: color-mix(in srgb, var(--oc-brand-500) 25%, transparent);
  --md-footer-bg-color: var(--oc-surface-950);
  --md-footer-bg-color--dark: var(--oc-surface-950);
  --md-footer-fg-color: var(--oc-ink-300);
  --md-footer-fg-color--light: var(--oc-ink-400);
  --md-footer-fg-color--lighter: var(--oc-ink-400);
  --md-shadow-z1: none;
  --md-shadow-z2: none;
  --md-shadow-z3: 0 0.5rem 2rem rgba(0, 0, 0, 0.35);
}

/* Header: the page's own ground with a hairline, as on the console. */

.md-header {
  border-bottom: 1px solid var(--oc-rule);
  box-shadow: none;
}

.md-header--shadow {
  box-shadow: none;
}

.md-header__title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.md-header__button.md-logo img {
  border-radius: 6px;
  height: 1.4rem;
  width: 1.4rem;
}

.md-search__form {
  background-color: var(--oc-surface-900);
  border: 1px solid var(--oc-surface-700);
  border-radius: 8px;
}

.md-search__form:hover {
  background-color: var(--oc-surface-800);
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  border-radius: 8px 8px 0 0;
}

/* Sidebar: the console's nav item (rounded, an accent rule on the left of the
   current page). On a wide screen the nav's title repeats the header, so it
   goes; the phone menu keeps it. */

@media screen and (min-width: 76.25em) {
  .md-nav--primary > .md-nav__title {
    display: none;
  }
}

.md-nav__title {
  background: none;
  box-shadow: none;
  color: var(--oc-ink-400);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-nav--primary .md-nav__link {
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: var(--oc-ink-400);
  margin-top: 0.15em;
  padding: 0.35em 0.6em;
  transition: background-color 0.15s, color 0.15s;
}

.md-nav--primary .md-nav__link:hover,
.md-nav--primary .md-nav__link:focus {
  background-color: var(--oc-surface-800);
  color: var(--oc-ink-100);
}

.md-nav--primary .md-nav__link--active,
.md-nav--primary .md-nav__link--active:hover {
  background-color: color-mix(in srgb, var(--oc-brand-500) 15%, transparent);
  border-left-color: var(--oc-accent-500);
  color: var(--oc-ink-100);
  font-weight: 600;
}

/* A section label in the nav (Concepts) is not a link. */
.md-nav__item--section > .md-nav__link {
  background: none !important;
  border-left-color: transparent !important;
  color: var(--oc-ink-400) !important;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The page's table of contents: plain, with the current section in brand blue. */
.md-nav--secondary .md-nav__link--active {
  color: var(--oc-brand-300);
}

/* Type: the console's system face, headings bold and tight. */

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--oc-ink-100);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.md-typeset h1 {
  font-size: 1.8em;
  line-height: 1.2;
}

.md-typeset h2 {
  border-top: 1px solid var(--oc-rule);
  font-size: 1.3em;
  line-height: 1.3;
  margin-top: 2.2em;
  padding-top: 1.2em;
}

.md-typeset h1 + h2,
.md-typeset h1 + p + h2 {
  border-top: 0;
  padding-top: 0;
}

.md-typeset h3 {
  font-size: 1.05em;
  line-height: 1.4;
}

.md-typeset strong {
  color: var(--oc-ink-100);
}

.md-typeset a {
  text-decoration: none;
}

.md-typeset a:hover {
  color: var(--oc-brand-400);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Code. */

.md-typeset code {
  border: 1px solid var(--oc-rule);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}

.md-typeset pre {
  border: 1px solid var(--oc-rule);
  border-radius: 12px;
  overflow: hidden;
}

.md-typeset pre > code {
  border: 0;
  border-radius: 0;
  padding: 1em 1.2em;
}

.md-typeset h1 code,
.md-typeset h2 code,
.md-typeset h3 code {
  font-weight: 600;
}

/* Tables: a bordered panel with a tinted header, like the console's tables. */

.md-typeset table:not([class]) {
  border: 1px solid var(--oc-rule);
  border-radius: 12px;
  box-shadow: none;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.md-typeset table:not([class]) th {
  background-color: var(--oc-surface-900);
  color: var(--oc-ink-400);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.8em 1em;
  text-transform: uppercase;
}

.md-typeset table:not([class]) td {
  border-top: 1px solid var(--oc-rule);
  padding: 0.65em 1em;
}

.md-typeset table:not([class]) tr:hover {
  background-color: color-mix(in srgb, var(--oc-surface-800) 50%, transparent);
  box-shadow: none;
}

.md-typeset table:not([class]) code {
  overflow-wrap: normal;
  word-break: normal;
}

/* The first column names codes and options, which read best on one line. */
.md-typeset table:not([class]) td:first-child {
  color: var(--oc-ink-100);
  white-space: nowrap;
}

/* Admonitions: a notice, as the console draws one — a tinted panel with a
   brand rule. */

.md-typeset .admonition,
.md-typeset details {
  background-color: color-mix(in srgb, var(--oc-brand-500) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--oc-brand-500) 30%, transparent);
  border-left: 3px solid var(--oc-brand-400);
  border-radius: 10px;
  box-shadow: none;
  color: var(--oc-ink-300);
  font-size: 0.72rem;
}

.md-typeset .admonition > .admonition-title,
.md-typeset details > summary {
  background-color: transparent;
  color: var(--oc-ink-100);
  font-weight: 700;
}

.md-typeset .admonition > .admonition-title::before,
.md-typeset details > summary::before {
  background-color: var(--oc-brand-300);
}

/* Overview: the lead, the base URL and the cards. */

.md-typeset .oc-lead {
  color: var(--oc-ink-400);
  font-size: 1.15em;
  line-height: 1.55;
  max-width: 38em;
}

.md-typeset .oc-base {
  align-items: center;
  background-color: var(--oc-surface-900);
  border: 1px solid var(--oc-rule);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin: 1.2em 0 1.4em;
  padding: 0.6rem 0.9rem;
}

.md-typeset .oc-base p {
  margin: 0;
}

.md-typeset .oc-base__label {
  color: var(--oc-ink-400);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-typeset .oc-base code {
  background: none;
  border: 0;
  color: var(--oc-ink-100);
  font-size: 0.85em;
  padding: 0;
}

.md-typeset .grid.cards > ul > li {
  background-color: color-mix(in srgb, var(--oc-surface-900) 60%, transparent);
  border: 1px solid var(--oc-rule);
  border-radius: 12px;
  transition: border-color 0.15s;
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--oc-brand-400);
  box-shadow: none;
}

.md-typeset .grid.cards > ul > li > p:first-child a {
  color: var(--oc-ink-100);
}

.md-typeset .grid.cards > ul > li:hover > p:first-child a {
  color: var(--oc-brand-300);
  text-decoration: none;
}

/* Footer: the page ground, the previous and next pages as plain links. */

.md-footer {
  border-top: 1px solid var(--oc-rule);
}

.md-footer-meta {
  background-color: var(--oc-surface-950);
}
