/* ------------------------------------------------------------------
   Realisable brand foundation — shared by all three design directions.

   Palette and type lifted from the live WordPress theme
   (wp-content/themes/realisable/style.css):
     #31a2d9  primary sky blue   (36 uses — the dominant accent)
     #334659  dark navy          (headings, dark sections)
     #344759  logo navy
     #626262  body grey
     #b8b8b8  muted grey
     #f4f4f4  page background
     GT Walsheim  body   (19px/1.35 on the marketing site)
     DAX-bold     display headings
   ------------------------------------------------------------------ */

/* WOFF2 only. Generated from the licensed TrueType originals in fonts-src/ by
   tools/fonts2woff2.py — 632 KB of .ttf becomes 147 KB, and the .ttf never
   reaches the deploy payload. WOFF2 has been supported by every current
   browser since 2016, so no TrueType fallback is declared. */
@font-face {
  font-family: "GT Walsheim";
  src: url("fonts/GT-Walsheim-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GT Walsheim";
  src: url("fonts/GT-Walsheim-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DAX";
  src: url("fonts/dax_bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --rs-blue: #31a2d9;
  --rs-blue-dark: #2589ba;
  --rs-navy: #334659;
  --rs-navy-deep: #26364a;
  --rs-logo-navy: #344759;
  --rs-grey: #626262;
  --rs-grey-mute: #b8b8b8;
  --rs-bg: #f4f4f4;
  --rs-rule: #e1e8f0;

  --rs-body-font: "GT Walsheim", "Segoe UI", Arial, sans-serif;
  --rs-display-font: "DAX", "GT Walsheim", Arial, sans-serif;

  /* Material plumbing */
  --md-text-font: "GT Walsheim", "Segoe UI", Arial, sans-serif;
  --md-code-font: "Cascadia Mono", "Consolas", "SF Mono", monospace;
  --md-primary-fg-color: var(--rs-navy);
  --md-accent-fg-color: var(--rs-blue);
  --md-typeset-a-color: var(--rs-blue);
}

/* Admonitions are styled entirely in editorial.css, not here.
 *
 * They used to be remapped in both files. Material colours each type with a
 * .md-typeset .admonition.note rule (0,3,0), so the remap here had to be
 * per-type to outrank it — but that also outranked editorial.css's own generic
 * .md-typeset .admonition-title (0,2,0), and note/example titles came out
 * wearing a pale blue band it never asked for. Two files competing over one
 * component, with Material as a third bidder.
 *
 * One block now owns it: editorial.css, per-type, at a specificity that beats
 * Material. See the comment there for what each type maps to.
 */

/* Screenshots are UI captures at natural size — never upscale them, and keep
   them visually distinct from the page. */
.md-typeset img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rs-rule);
}

/* Chevron bullets, as the Flare stylesheet had them: li.Options carried a
   multi-chevron glyph and li.Options2ndLevel a single one. Rendered as
   characters rather than the original PNGs so they scale and take colour.
   Written as unicode escapes, not literal characters: a stylesheet served
   without charset=utf-8 (as python's http.server does) would otherwise
   render them as mojibake.

   Set through list-style-type, NOT `::marker { content }`. Safari implements
   ::marker for `color` and `font-size` only (MDN browser-compat-data, and it
   is why MDN marks the whole pseudo-element "limited availability"), so the
   content declaration was a no-op there — every Safari and, because all iOS
   browsers are WebKit, every iPhone and iPad fell back to plain discs. A
   string list-style-type has been supported since Safari 14.1 / Chrome 79 /
   Firefox 39 and keeps the marker a real marker, so list semantics survive
   for screen readers in a way `list-style: none` plus a ::before would not.

   The trailing \00A0 is the gap to the text; a plain space would collapse. */
.md-typeset ul {
  list-style-type: "\00BB\00A0";      /* » */
}
.md-typeset ul ul {
  list-style-type: "\203A\00A0";      /* › */
}

/* Colour survives everywhere; the weight is Chromium/Gecko only, since Safari
   allows just color and font-size on ::marker. Degrades to an unbolded navy
   chevron rather than to nothing. */
.md-typeset ul > li::marker {
  color: var(--rs-navy);
  font-weight: 700;
}

/* Code: long function signatures such as
     Lookup("MULTILKUP", "RESULT", Array(%Fld1, %Fld2, %Fld3), true)
   overflowed the measure and produced a horizontal scrollbar on almost
   every reference page. Wrapping is far easier to read than scrolling,
   and the smaller size fits more of a signature per line.

   THAT IS TRUE OF A SIGNATURE AND FALSE OF DATA (DOCS-138). A block holding a
   sample file is a picture of that file, and wrapping changes what the reader
   sees it to be: the nine records of orders-keyed.csv rendered as thirteen
   lines and read as more rows than there are, and a wrapped fixed-width sample
   is not merely untidy but wrong, because column positions are the whole point
   of one. So data scrolls, and the wrap is scoped to the blocks the rule was
   written for -- the reference pages' function blocks, which are already
   wrapped in <div class="fn">.

   Scoping by language is not available: pymdownx.highlight emits a bare
   <div class="highlight"> with no language-* class, so `csv` and `vb` are
   indistinguishable in the DOM. 87 blocks scroll as a result of this, and no
   page gained any width at 1280 or 375. */
.md-typeset pre > code {
  font-size: 0.68rem;
  line-height: 1.55;
  white-space: pre;
  overflow-wrap: normal;
}

.md-typeset .fn pre > code {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Nothing in the prose may widen the page. The corpus contains unbroken runs
   that no measure can hold — the worst is a 246-character concatenation of
   Amazon marketplace IDs on amazon/setup/iman-setup.md, and there are ~200
   bare URLs printed as link text. Without this the page itself scrolls
   sideways at 375px, which moves every heading and image off-screen too.

   break-word, not break-all: it only breaks a word that would otherwise
   overflow, so ordinary prose still wraps between words. */
.md-typeset {
  overflow-wrap: break-word;
}

/* ...but never inside a table cell. A column is sized from its content, and
   break-word lets the layout treat a code span's minimum width as one
   character, so a narrow column squeezes an identifier into a three-character
   strip: `"INTCONSTANTS"` printed as "INTC / ONSTA / NTS" (DOCS-138). Normal
   wrapping gives the column the token's own width as its minimum.

   It does not stop a break that is genuinely needed. A 168-character OAuth
   URL still has to break somewhere, and paths and query strings still break —
   but at their slashes and brackets rather than inside a word. Measured over
   the built site, spans wrapping inside a table with no whitespace in them
   fell from 37 to 11, and all 11 of those break at punctuation. */
.md-typeset table:not([class]) code {
  overflow-wrap: normal;
  word-break: keep-all;
}

.md-typeset table:not([class]) {
  font-size: 0.74rem;
  border: 1px solid var(--rs-rule);
}
.md-typeset table:not([class]) th {
  background: var(--rs-navy);
  color: #fff;
  font-weight: 700;
}

/* ------------------------------------------------------------------
   The Copy as Markdown button beside the page title (DOCS-164).

   overrides/partials/actions.html renders it with Material's
   md-content__button, the class written for the edit and view-source
   <a> icons, so Material floats it, sizes the icon and hides it in
   print. It is a <button>, and this takes the button chrome off.
   ------------------------------------------------------------------ */
.md-typeset .md-content__button.rs-copy-markdown {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.md-typeset .md-content__button.rs-copy-markdown:hover,
.md-typeset .md-content__button.rs-copy-markdown:focus-visible {
  color: var(--md-accent-fg-color);
}

/* ------------------------------------------------------------------
   Square corners throughout. The Realisable house style has none, so
   Material's own rounding comes off as well as the theme's.
   ------------------------------------------------------------------ */
.md-typeset code,
.md-typeset kbd,
.md-typeset pre > code,
.md-typeset .md-code__nav,
.md-typeset .admonition,
.md-typeset details,
.md-typeset .admonition-title,
.md-typeset summary,
.md-typeset table:not([class]),
.md-typeset .md-button,
.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card,
.md-typeset .tabbed-set,
.md-nav__icon,
.md-nav__icon::after,
.md-skip,
.md-top,
.md-dialog,
.md-search__form,
.md-search__output,
.md-tooltip,
.md-tooltip2__inner,
.md-clipboard {
  border-radius: 0;
}
/* Material rounds these under [dir=ltr] and [dir=rtl], a specificity the rule above does not reach */
[dir] .md-typeset .admonition-title,
[dir] .md-typeset summary,
[dir] .md-typeset .md-input,
[dir] .md-search__output {
  border-radius: 0;
}
