/* Self-hosted IBM Plex, mirroring breqwatr-site/source/stylesheets/site.css. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-regular.woff2")  format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-medium.woff2")   format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-semibold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-regular.woff2")  format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-medium.woff2")   format("woff2"); }

/* Brand palette — single source of truth shared with breqwatr-site. */
:root,
[data-md-color-scheme="default"] {
  --bw-ink: #0f1418;
  --bw-ink-2: #586068;
  --bw-ink-3: #8a939b;
  --bw-bg: #ffffff;
  --bw-surface: #f6f8f9;
  --bw-line: #e4e9ec;
  --bw-accent: #007fac;
  --bw-accent-ink: #00557a;
  --bw-accent-tint: #ebf5f9;
  --bw-accent-line: #d3e7ef;

  /* Map brand tokens onto Material's CSS variables. */
  --md-primary-fg-color: var(--bw-accent);
  --md-primary-fg-color--dark: var(--bw-accent-ink);
  --md-primary-fg-color--light: var(--bw-accent-tint);
  --md-primary-bg-color: var(--bw-bg);
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);

  --md-accent-fg-color: var(--bw-accent);
  --md-accent-fg-color--transparent: rgba(0, 127, 172, 0.1);
  --md-accent-bg-color: var(--bw-bg);
  --md-accent-bg-color--light: rgba(255, 255, 255, 0.7);

  --md-default-fg-color: var(--bw-ink);
  --md-default-fg-color--light: var(--bw-ink-2);
  --md-default-fg-color--lighter: var(--bw-ink-3);
  --md-default-fg-color--lightest: var(--bw-line);
  --md-default-bg-color: var(--bw-bg);

  --md-typeset-color: var(--bw-ink);
  --md-typeset-a-color: var(--bw-accent);
  --md-typeset-mark-color: var(--bw-accent-tint);
  --md-code-bg-color: var(--bw-surface);
  --md-code-fg-color: var(--bw-ink);

  --md-text-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --md-code-font: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Body typography — match breqwatr-site (17px / 1.65). */
body { -webkit-font-smoothing: antialiased; }
.md-typeset { line-height: 1.65; }

.md-typeset h1, .md-typeset h2, .md-typeset h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--bw-ink);
}
.md-typeset h1 { font-size: 2.05rem; margin-bottom: 1rem; }
.md-typeset h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.md-typeset h3 { font-size: 1.15rem; margin-top: 1.6rem; }

/* Code surface uses brand surface tone with a 1px brand line, slight radius. */
.md-typeset code { border: 1px solid var(--bw-line); border-radius: 4px; }
.md-typeset pre > code { border: 0; }
.md-typeset .highlight, .md-typeset pre { border-radius: 8px; }

/* Admonitions tinted with brand accent — same colour family as breqwatr-site .feature. */
.md-typeset .admonition, .md-typeset details {
  border-radius: 8px;
  border-color: var(--bw-accent-line);
  background-color: var(--bw-accent-tint);
  box-shadow: none;
}
.md-typeset .admonition-title, .md-typeset summary {
  background-color: transparent;
  color: var(--bw-accent-ink);
}
.md-typeset .admonition > .admonition-title::before,
.md-typeset summary::before { background-color: var(--bw-accent); }

/* Screenshot placeholders — visible frames showing where an image will go
   before the real screenshot is captured. Swap each block back to a plain
   image reference (`![alt](path.png)`) once the screenshot lands. */
.md-typeset .admonition.screenshot {
  border: 2px dashed var(--bw-ink-3);
  background-color: var(--bw-surface);
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin: 1.5em 0;
  box-shadow: none;
}
.md-typeset .admonition.screenshot > .admonition-title {
  background: transparent;
  color: var(--bw-ink-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0;
  margin: 0 0 0.6rem 0;
  border: none;
}
.md-typeset .admonition.screenshot > .admonition-title::before {
  display: none;
}
.md-typeset .admonition.screenshot > p {
  color: var(--bw-ink-2);
  font-size: 0.95rem;
  margin: 0;
  max-width: 52ch;
}

/* Header — white with the same translucent backdrop blur as the marketing nav. */
.md-header,
.md-header[data-md-state="shadow"] {
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--bw-line);
  box-shadow: none;
  color: var(--bw-ink);
}
.md-header__title { color: var(--bw-ink); font-weight: 600; letter-spacing: -0.01em; }
.md-header__button { color: var(--bw-ink); }

/* Search box uses brand surface tone. */
.md-search__form { background-color: var(--bw-surface); border: 1px solid var(--bw-line); }
.md-search__form:hover { background-color: var(--bw-bg); }
.md-search__input { color: var(--bw-ink); }

/* Brand logo — Breqwatr wordmark; dark variant swapped in for the slate scheme. */
.md-header__button.md-logo {
  padding: 0 0.35rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.md-header__button.md-logo .md-logo-img { height: 28px; width: auto; display: block; }
.md-header__button.md-logo .md-logo-img--dark { display: none; }
[data-md-color-scheme="slate"] .md-header__button.md-logo .md-logo-img--light { display: none; }
[data-md-color-scheme="slate"] .md-header__button.md-logo .md-logo-img--dark  { display: block; }

/* Tabs — match brand. */
.md-tabs { background-color: var(--bw-bg); color: var(--bw-ink); border-bottom: 1px solid var(--bw-line); }
.md-tabs__link { color: var(--bw-ink-2); opacity: 1; }
.md-tabs__link:hover, .md-tabs__link--active { color: var(--bw-ink); }

/* Footer. */
.md-footer { background-color: var(--bw-bg); color: var(--bw-ink-2); border-top: 1px solid var(--bw-line); }
.md-footer-meta { background-color: var(--bw-bg); color: var(--bw-ink-3); }
.md-footer__inner { color: var(--bw-ink-2); }
.md-footer-meta__inner { color: var(--bw-ink-3); }

/* Focus ring uses brand accent. */
:focus-visible { outline: 2px solid var(--bw-accent); outline-offset: 2px; }

/* Hide the redundant site_name text in the header bar. visibility:hidden
   (not display:none) preserves the flex spacer Material uses between the
   logo and the search/toggle, so they stay laid out correctly. */
.md-header__title { visibility: hidden; }

/* Hide the redundant "Breqwatr Docs" title above the desktop sidebar nav.
   The header already shows it; the mobile drawer still needs it as its header,
   so this only applies above Material's sidebar breakpoint. */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav--primary > .md-nav__title {
    display: none;
  }
}

/* Dark scheme — brand-derived inversion. No equivalent in breqwatr-site yet, so
   the palette is defined here. Accent is lifted ~30% for AA contrast on dark bg. */
[data-md-color-scheme="slate"] {
  --bw-ink: #e8ecef;
  --bw-ink-2: #a0a8b0;
  --bw-ink-3: #6e7780;
  --bw-bg: #0f1418;
  --bw-surface: #1a2128;
  --bw-line: #2a3138;
  --bw-accent: #3aa3c8;
  --bw-accent-ink: #1f8fb6;
  --bw-accent-tint: #0d3140;
  --bw-accent-line: #1a4255;
}

/* Header backdrop tinted to the dark bg in dark mode. */
[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="slate"] .md-header[data-md-state="shadow"] {
  background-color: rgba(15, 20, 24, 0.85);
  border-bottom-color: var(--bw-line);
}
