/* ack3 skin for the Wake docs mirror (served at ack3.ai/wake/docs/latest).
 *
 * Injected by scripts/wake-docs/fetch.mjs as the LAST stylesheet in every
 * page head, so it overrides the upstream extra.css at equal specificity.
 * Values are the --ack3-* tokens from src/styles/tokens.css, hard-coded
 * because these pages never load the site's CSS.
 *
 * Scope: the dark (slate) scheme is retuned to the ack3 terminal-dark ladder;
 * the light (default) scheme — upstream ships it blue-on-white everywhere —
 * is derived from the brand's sanctioned light variant (paper ladder, ink
 * structure, onLight accent lanes; see references/light-variant.md in the
 * brand skill).
 */

[data-md-color-scheme="slate"] {
  /* surfaces — elevation by lightness, never pure black */
  --md-default-bg-color: #0e0f12;
  --md-code-bg-color: #0a0b0e; /* code blocks read as sunken artifact insets */
  --md-footer-bg-color: #0a0b0e;
  --md-footer-bg-color--dark: #0a0b0e;

  /* text — off-white tiers; body at 82%, small text never below the 60% AA floor */
  --md-default-fg-color: #ededef;
  --md-default-fg-color--light: rgba(237, 237, 239, 0.82);
  --md-default-fg-color--lighter: rgba(237, 237, 239, 0.6);
  --md-default-fg-color--lightest: rgba(237, 237, 239, 0.12);
  --md-code-fg-color: rgba(237, 237, 239, 0.82);

  /* header text/icons sit on the near-black bar below */
  --md-primary-bg-color: #ededef;
  --md-primary-bg-color--light: rgba(237, 237, 239, 0.7);
}

/* Accents — blue carries links and hover; cyan stays the single focal (h1).
 * The upstream palette.css sets these under [scheme][primary]/[scheme][accent]
 * (specificity 0,2,0), so a plain [scheme] override loses; match it and win
 * by order (this sheet loads last). */
[data-md-color-scheme="slate"][data-md-color-primary="indigo"],
[data-md-color-scheme="slate"][data-md-color-accent="indigo"] {
  --md-typeset-a-color: #6b8aff;
  --md-accent-fg-color: #6b8aff;
}

/* Upstream sets every heading cyan on dark; ack3's hierarchy rule spends the
 * brightest accent only at the top — the page title (h1) keeps upstream cyan,
 * section headings return to off-white. */
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4,
[data-md-color-scheme="slate"] .md-typeset h5,
[data-md-color-scheme="slate"] .md-typeset h6 {
  color: #ededef;
}

/* The ack3 nav signature on dark: near-black bar on a heavy 2px off-white
 * rule, replacing the upstream blue header. The rule sits under the tabs row
 * on desktop and under the header bar where tabs are hidden (Material hides
 * tabs below 76.25em). */
[data-md-color-scheme="slate"] .md-header {
  background-color: #0e0f12;
}
[data-md-color-scheme="slate"] .md-tabs {
  background-color: #0e0f12;
  border-bottom: 2px solid #ededef;
}
@media screen and (max-width: 76.1875em) {
  [data-md-color-scheme="slate"] .md-header {
    border-bottom: 2px solid #ededef;
  }
}

/* ——— Light (default) scheme — the sanctioned ack3 light variant ——————————
 * Upstream ships light as blue-on-white everywhere (blue header, blue tabs,
 * every heading blue). Same jobs as the dark skin above, onLight values. */

[data-md-color-scheme="default"] {
  /* surfaces — the paper ladder: off-white page, sunken code insets */
  --md-default-bg-color: #fafafa;
  --md-code-bg-color: #f3f3f5;

  /* text — ink tiers; on light the small-text AA floor moves up to 64% */
  --md-default-fg-color: #0a0a0c;
  --md-default-fg-color--light: rgba(10, 10, 12, 0.82);
  --md-default-fg-color--lighter: rgba(10, 10, 12, 0.64);
  --md-default-fg-color--lightest: rgba(10, 10, 12, 0.07);
  --md-code-fg-color: rgba(10, 10, 12, 0.82);

  /* the footer inverts with the page — no dark island on light */
  --md-footer-bg-color: #f3f3f5;
  --md-footer-bg-color--dark: #e9e9ec;
  --md-footer-fg-color: #0a0a0c;
  --md-footer-fg-color--light: rgba(10, 10, 12, 0.64);
  --md-footer-fg-color--lighter: rgba(10, 10, 12, 0.64);
}

/* dark-on-light ink must not be thinned (inverse of "don't compensate
 * weight on dark") */
body[data-md-color-scheme="default"] {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* Accents — links match the audit-report register (report-template
 * core/theme.yml): #1D5FC2, the lighter ack3 blue on light, shared with
 * severity low, 5.8:1 AA on the paper page. Docs and reports are the same
 * "document" register; the underline stays docs-native (hover) rather than
 * print-permanent. Double-attribute selector for the same palette.css
 * specificity reason as the slate block above. */
[data-md-color-scheme="default"][data-md-color-primary="indigo"],
[data-md-color-scheme="default"][data-md-color-accent="indigo"] {
  --md-typeset-a-color: #1d5fc2;
  --md-accent-fg-color: #1d5fc2;
}

/* Headings mirror the dark treatment: the page title keeps the focal in the
 * cyan lane's onLight value, section headings are structure — ink. */
[data-md-color-scheme="default"] .md-typeset h1 {
  color: #0a8a8a;
}
[data-md-color-scheme="default"] .md-typeset h2,
[data-md-color-scheme="default"] .md-typeset h3,
[data-md-color-scheme="default"] .md-typeset h4,
[data-md-color-scheme="default"] .md-typeset h5,
[data-md-color-scheme="default"] .md-typeset h6 {
  color: #0a0a0c;
}

/* The nav signature on light: paper bar on a heavy 2px ink rule. The
 * --md-primary-bg-color remap (header/tab text is "text on primary" in
 * Material) is scoped to the bars so nothing else inherits it. */
[data-md-color-scheme="default"] .md-header {
  background-color: #fafafa;
  --md-primary-bg-color: #0a0a0c;
  --md-primary-bg-color--light: rgba(10, 10, 12, 0.64);
}
[data-md-color-scheme="default"] .md-tabs {
  background-color: #fafafa;
  border-bottom: 2px solid #111114;
  --md-primary-bg-color: #0a0a0c;
  --md-primary-bg-color--light: rgba(10, 10, 12, 0.64);
}
/* the Wake logo PNG is white-on-transparent (drawn for the blue header) —
 * invert it to ink on the paper bar */
[data-md-color-scheme="default"] .md-header__button.md-logo img {
  filter: invert(1);
}
@media screen and (max-width: 76.1875em) {
  [data-md-color-scheme="default"] .md-header {
    border-bottom: 2px solid #111114;
  }
}

/* ——— Upstream blue leftovers, retired ————————————————————————————————————
 * Two places keep upstream's #0000FF fill after the scheme retune. Blue is
 * the action/link lane; neither of these is an action, so both move to
 * neutral surfaces. */

/* 1. mkdocstrings doc-heading chips (API reference): class/function name
 * pills. Match the h1 module-chip treatment — elevated surface, scheme text.
 * Upstream sets `color: #FFF !important`, so !important is required here. */
[data-md-color-scheme="slate"] :not(.doc-attribute) > h2.doc-heading > code,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h3.doc-heading > code,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h4.doc-heading > code,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h2.doc-heading .doc-label > code,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h3.doc-heading .doc-label > code,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h4.doc-heading .doc-label > code {
  color: #ededef !important;
  background-color: #212229;
}
[data-md-color-scheme="slate"] :not(.doc-attribute) > h2.doc-heading > code span,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h3.doc-heading > code span,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h4.doc-heading > code span,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h2.doc-heading .doc-label > code span,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h3.doc-heading .doc-label > code span,
[data-md-color-scheme="slate"] :not(.doc-attribute) > h4.doc-heading .doc-label > code span {
  color: #ededef !important;
}
[data-md-color-scheme="default"] :not(.doc-attribute) > h2.doc-heading > code,
[data-md-color-scheme="default"] :not(.doc-attribute) > h3.doc-heading > code,
[data-md-color-scheme="default"] :not(.doc-attribute) > h4.doc-heading > code,
[data-md-color-scheme="default"] :not(.doc-attribute) > h2.doc-heading .doc-label > code,
[data-md-color-scheme="default"] :not(.doc-attribute) > h3.doc-heading .doc-label > code,
[data-md-color-scheme="default"] :not(.doc-attribute) > h4.doc-heading .doc-label > code {
  color: #0a0a0c !important;
  background-color: #e9e9ec;
}
[data-md-color-scheme="default"] :not(.doc-attribute) > h2.doc-heading > code span,
[data-md-color-scheme="default"] :not(.doc-attribute) > h3.doc-heading > code span,
[data-md-color-scheme="default"] :not(.doc-attribute) > h4.doc-heading > code span,
[data-md-color-scheme="default"] :not(.doc-attribute) > h2.doc-heading .doc-label > code span,
[data-md-color-scheme="default"] :not(.doc-attribute) > h3.doc-heading .doc-label > code span,
[data-md-color-scheme="default"] :not(.doc-attribute) > h4.doc-heading .doc-label > code span {
  color: #0a0a0c !important;
}

/* 2. the mobile drawer title bar — joins the scheme bars instead of blue */
@media screen and (max-width: 76.1875em) {
  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__title[for="__drawer"] {
    background-color: #0e0f12;
    border-bottom: 1px solid #2a2b31;
  }
  [data-md-color-scheme="default"] .md-nav--primary .md-nav__title[for="__drawer"] {
    background-color: #fafafa;
    border-bottom: 1px solid #e9e9ec;
    --md-primary-bg-color: #0a0a0c;
    --md-primary-bg-color--light: rgba(10, 10, 12, 0.64);
  }
  [data-md-color-scheme="default"] .md-nav--primary .md-nav__title[for="__drawer"] img {
    filter: invert(1);
  }
}
