/* Typography: IBM Plex Sans (text, headings, navigation, tables, admonitions, UI)
   and IBM Plex Mono (code, CLI commands, literals, kbd).
   Local files only: docs/_static/fonts/ibm-plex-{sans,mono}/ (SIL OFL 1.1, IBM/plex releases
   @ibm/plex-sans@1.1.0 and @ibm/plex-mono@2.5.0, "complete" builds with Latin and Cyrillic).
   Loaded after fakel/theme.css: it only remaps font tokens and type metrics; colours, layout,
   dark/light themes and responsive behaviour stay with Furo and the Fakel theme. */

@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans/IBMPlexSans-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans/IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans/IBMPlexSans-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono/IBMPlexMono-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono/IBMPlexMono-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono/IBMPlexMono-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

/* ── Font tokens ─────────────────────────────────────────── */
:root {
  --font-plex-sans: "IBM Plex Sans", "Arial", sans-serif;
  --font-plex-mono: "IBM Plex Mono", "DejaVu Sans Mono", monospace;
  /* Fakel theme tokens (fakel/tokens.css): brand and device text become Plex Sans. */
  --font-brand: var(--font-plex-sans);
  --font-device: var(--font-plex-sans);
  --font-fallback: var(--font-plex-sans);
}

/* Furo variables (same selector weight as fakel/theme.css, which is loaded earlier). */
html:root body {
  --font-stack: var(--font-plex-sans);
  --font-stack--headings: var(--font-plex-sans);
  --font-stack--monospace: var(--font-plex-mono);
  --code-font-size: 14px;
  --admonition-font-size: 0.9375rem;
  --admonition-title-font-size: 0.9375rem;
}

/* ── Text ────────────────────────────────────────────────── */
body,
button,
input,
select,
textarea {
  font-family: var(--font-plex-sans);
}

body {
  font-size: 16px;
  line-height: 1.625;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

article[role="main"] { line-height: 1.625; }

article[role="main"] :is(h1, h2, h3, h4, h5, h6),
.sidebar-tree, .toc-tree, .toc-title, .sidebar-brand, .mobile-header,
.admonition, .admonition-title, table.docutils, .related-pages, .bottom-of-page {
  font-family: var(--font-plex-sans);
}

/* Plex has a SemiBold that reads better than Bold for long Cyrillic headings. */
article[role="main"] :is(h1, h2, h3, h4, h5, h6) { font-weight: 600; letter-spacing: -0.01em; }

/* Main readable column ≈ 78 characters (Furo: 46em, content-box). Applies only where Furo
   keeps a fixed column width (above its 48em breakpoint); below it Furo's fluid layout stays. */
@media (min-width: 48em) {
  .content { width: 78ch; }
}

/* ── Code ────────────────────────────────────────────────── */
code,
kbd,
pre,
samp,
tt,
.literal,
.highlight,
.highlight pre,
.sig,
.sig-inline {
  font-family: var(--font-plex-mono);
}

/* Inline code, literals and kbd: 14px at a 16px body. */
article[role="main"] :is(code.literal, code.docutils, .sig-inline, kbd, samp) {
  font-family: var(--font-plex-mono);
  font-size: 0.875em;
}

/* Tables and admonitions use a smaller text size; keep their inline code at 14px too. */
article[role="main"] :is(table, .admonition) :is(code.literal, code.docutils, kbd, samp) {
  font-size: 14px;
}

/* Code blocks and literal blocks: 14px, line-height 1.5. */
article[role="main"] .highlight pre,
article[role="main"] pre.literal-block,
article[role="main"] pre {
  font-family: var(--font-plex-mono);
  font-size: 14px;
  line-height: 1.5;
}

/* CLI command headings (.. rst-class:: cli-command) are commands: monospace. */
article[role="main"] section.cli-command > :is(h2, h3, h4, h5, h6) {
  font-family: var(--font-plex-mono);
  font-weight: 600;
  letter-spacing: 0;
}
