/*
Theme Name: plainJS
Theme URI: https://plainjs.com/
Author: Webhaus LLC
Description: Direction A "Column" (owner's choice of 2026-10-29): a narrow reading column with the code block as the widest thing on the page, JetBrains Mono titles, Inter text, one warm yellow, system dark mode with a toggle. Built for the HTML tools/publish.py writes (Pygments code blocks, callouts, the In short box) and the Niche Libraries post type.
Version: 0.2.2
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: plainjs
*/

/* ---------- fonts (files in the theme; Latin subsets of the Google Fonts builds, SIL OFL: assets/fonts/OFL-*.txt) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(assets/fonts/inter.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap; src: url(assets/fonts/inter-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(assets/fonts/jetbrains-mono.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: italic; font-weight: 100 800; font-display: swap; src: url(assets/fonts/jetbrains-mono-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens. Dark mode: the system setting, unless the toggle (assets/theme.js) set data-theme on <html>. ---------- */
:root {
  --bg: #fbfaf6; --bg-2: #f1efe8; --ink: #1b1a17; --ink-2: #5f5b52; --line: #e2dfd5;
  --accent: #f7c600; --accent-ink: #1b1a17;
  --ok: #1d7a4a; --ok-bg: #e4f3ea;
  /* code blocks are dark on both grounds (direction A); the light palette sits on #17181c */
  --code-bg: #17181c; --code-ink: #e8e6df; --code-line: #24262c;
  --tk-k: #ffd33d; --tk-s: #9ad17e; --tk-c: #8a8f98; --tk-b: #7fd3ff; --tk-n: #f5a97f; --tk-t: #ff9ea0; --tk-a: #ffd33d; --tk-o: #c8c5bc;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --col: 44rem; --wide: 56rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316; --bg-2: #1a1b1f; --ink: #ebe9e2; --ink-2: #a39f95; --line: #2a2c32;
    --ok: #7fd3a3; --ok-bg: #163125;
    --code-bg: #0b0c0e; --code-ink: #e8e6df; --code-line: #1c1e23;
    --tk-k: #ffd84d; --tk-s: #a6dc8a; --tk-c: #7d828b; --tk-b: #8fdaff; --tk-n: #f7b48f; --tk-t: #ffa8aa; --tk-a: #ffd84d; --tk-o: #b9b6ad;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121316; --bg-2: #1a1b1f; --ink: #ebe9e2; --ink-2: #a39f95; --line: #2a2c32;
  --ok: #7fd3a3; --ok-bg: #163125;
  --code-bg: #0b0c0e; --code-ink: #e8e6df; --code-line: #1c1e23;
  --tk-k: #ffd84d; --tk-s: #a6dc8a; --tk-c: #7d828b; --tk-b: #8fdaff; --tk-n: #f7b48f; --tk-t: #ffa8aa; --tk-a: #ffd84d; --tk-o: #b9b6ad;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--accent); color: var(--accent-ink); text-decoration-color: transparent; }
code, pre, kbd, samp { font-family: var(--mono); }
p code, li code, td code, th code, dd code, h1 code, h2 code, h3 code, summary code, blockquote code { font-size: .88em; background: var(--bg-2); padding: .1em .35em; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); margin: .2em 0 .3em; }
h2 { font-size: 1.15rem; margin: 2.4em 0 .8em; }
h2::before { content: "## "; color: var(--accent); }
h3 { font-size: 1rem; margin: 1.8em 0 .6em; }
h4 { font-size: .95rem; margin: 1.5em 0 .5em; }
button { font: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
img { max-width: 100%; height: auto; }
.wrap { width: min(100% - 2rem, var(--col)); margin-inline: auto; }
.wide { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.note { font-size: .9rem; color: var(--ink-2); }
.mono { font-family: var(--mono); }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-head .wide { display: flex; align-items: center; gap: 1.2rem; min-height: 3.4rem; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.25rem; text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.brand span { color: var(--accent-ink); background: var(--accent); padding: 0 .15em; border-radius: 3px; margin-left: .05em; }
.brand:hover { background: none; }
.site-head nav { display: flex; gap: 1.1rem; margin-left: auto; font-size: .95rem; }
.site-head nav a { text-decoration: none; color: var(--ink-2); }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ink); background: none; box-shadow: inset 0 -2px 0 var(--accent); }
.toggle { border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); width: 2.1rem; height: 2.1rem; border-radius: 6px; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.toggle svg { width: 18px; height: 18px; }
.toggle .moon { display: none; }
.toggle[aria-pressed="true"] .sun { display: none; }
.toggle[aria-pressed="true"] .moon { display: block; }
@media (max-width: 640px) { .site-head nav { gap: .8rem; font-size: .9rem; } .site-head nav a:nth-child(n+3) { display: none; } }

/* ---------- home ---------- */
.hero { padding: 3.5rem 0 2rem; }
.hero h1 { font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem); margin: 0 0 .6em; }
.hero h1 em { font-style: normal; background: var(--accent); color: var(--accent-ink); padding: 0 .12em; }
.hero p { font-size: 1.1rem; color: var(--ink-2); max-width: 36rem; margin: 0; }
.halves { display: grid; gap: 3rem; margin-block: 2.5rem; }
.half h2 { margin-top: 0; }
.cats { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: .95rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .25rem 1.5rem; }
.cats li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .45rem 0; }
.cats li a { text-decoration: none; }
.cats li span { color: var(--ink-2); }
.toplist { list-style: none; padding: 0; margin: 0; counter-reset: n; }
.toplist li { counter-increment: n; display: grid; grid-template-columns: 2.2rem 1fr; gap: 0 .5rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.toplist li::before { content: counter(n, decimal-leading-zero); font-family: var(--mono); color: var(--ink-2); font-size: .9rem; padding-top: .15rem; }
.toplist a { text-decoration: none; font-weight: 500; }
.toplist a:hover { text-decoration: underline; background: none; }
.toplist code { display: block; font-size: .82rem; color: var(--ink-2); background: none; padding: 0; margin-top: .15rem; }
.libs { list-style: none; padding: 0; margin: 0; }
.libs li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.libs li a { text-decoration: none; font-weight: 500; }
.libs li a:hover { text-decoration: underline; background: none; }
.libs li small { color: var(--ink-2); display: block; font-size: .9rem; }
.libs li .facts { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); text-align: right; white-space: nowrap; }
.honest { border-left: 3px solid var(--accent); padding: .3rem 0 .3rem 1rem; color: var(--ink-2); font-size: .98rem; margin: 2rem 0; }
.synced { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); margin-top: .8rem; }

/* ---------- article head and foot ---------- */
.eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; margin: 2.5rem 0 .5rem; }
.eyebrow a { text-decoration: none; }
.jq { font-family: var(--mono); font-size: .95rem; color: var(--ink-2); margin: 0 0 1.6rem; }
.jq code { background: none; padding: 0; font-size: 1em; }
.jq strong { color: var(--ink); font-weight: 500; }
.deck { font-size: 1.1rem; color: var(--ink-2); margin: 0 0 1.5rem; }
.reviewed { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 1rem; margin: 3rem 0 0; }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0; font-size: .92rem; }
.prevnext a { text-decoration: none; color: var(--ink-2); max-width: 48%; }
.prevnext a b { display: block; color: var(--ink); font-weight: 500; }
.prevnext a:hover { background: none; } .prevnext a:hover b { text-decoration: underline; }
.prevnext .next { text-align: right; margin-left: auto; }

/* ---------- the publisher's blocks (tools/publish.py) ---------- */
.key-facts { background: var(--bg-2); border-left: 4px solid var(--accent); padding: 1rem 1.2rem; margin: 1.5rem 0 2rem; font-size: .98rem; }
.key-facts-label { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 .4rem; }
.key-facts p { margin: 0 0 .5rem; }
.key-facts ul { margin: 0; padding-left: 1.2rem; }
.key-facts li { margin: .2rem 0; }
sup.cite { font-size: .7em; line-height: 0; }
sup.cite a { text-decoration: none; color: var(--ink-2); }
sup.cite a::before { content: "["; } sup.cite a::after { content: "]"; }
.link-pending { color: var(--ink); text-decoration: underline dotted var(--line); text-underline-offset: 3px; }

/* code blocks: publish.py writes <pre class="code language-js"><code>…Pygments spans…</code></pre>; functions.php wraps each in
   .code with its bar (language, "jQuery" on the paired block, the copy button). The block breaks out of the reading column. */
.code { background: var(--code-bg); color: var(--code-ink); border-radius: 8px; margin: 1.2rem 0; font-size: .9rem; line-height: 1.55; }
.wrap .code, .entry .code { width: min(100vw - 2rem, var(--wide)); margin-left: 50%; transform: translateX(-50%); }
.code-bar { display: flex; align-items: center; gap: .6rem; padding: .45rem .9rem; border-bottom: 1px solid var(--code-line); font-family: var(--mono); font-size: .72rem; color: var(--tk-c); text-transform: uppercase; letter-spacing: .08em; }
.code-bar .lang { color: var(--accent); }
.code-bar .file { color: var(--tk-c); text-transform: none; letter-spacing: 0; }
.copy { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; background: none; border: 1px solid var(--code-line); color: var(--code-ink); border-radius: 5px; padding: .2rem .55rem; font: 500 .72rem var(--mono); cursor: pointer; text-transform: none; letter-spacing: 0; }
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy svg { width: 13px; height: 13px; }
.code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; background: none; }
.code pre code { background: none; padding: 0; font-size: 1em; }
pre.code { padding: 1rem 1.1rem; overflow-x: auto; }   /* a block the filter did not wrap (outside the loop) */
/* Pygments classes (HtmlFormatter nowrap): keywords, strings, comments, builtins, numbers, tags, attributes, operators */
.k, .kd, .kc, .kr, .kn, .kp, .kt, .ow { color: var(--tk-k); }
.s, .s1, .s2, .sb, .sc, .sd, .se, .sh, .si, .sx, .sr, .ss, .dl { color: var(--tk-s); }
.c, .c1, .cm, .cs, .cp, .ch { color: var(--tk-c); font-style: italic; }
.nb, .bp, .nf, .fm, .nc, .ne { color: var(--tk-b); }
.m, .mf, .mi, .mh, .mo, .il { color: var(--tk-n); }
.nt { color: var(--tk-t); }
.na, .nd { color: var(--tk-a); }
.o, .p { color: var(--tk-o); }
.nx, .n, .w, .nv, .vi { color: inherit; }
.gh, .gu { color: var(--tk-k); font-weight: 600; }

/* callouts: Browser support (Baseline), Differs from jQuery, Legacy browsers, Security; others plain */
.callout { margin: 2rem 0; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 8px; font-size: .98rem; }
.callout p { margin: 0 0 .6rem; } .callout p:last-child { margin-bottom: 0; }
.callout ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.callout-label { display: block; font-family: var(--mono); font-weight: 600; font-size: .85rem; margin: 0 0 .5rem; }
.callout-label::before { content: "/* "; color: var(--accent); } .callout-label::after { content: " */"; color: var(--accent); }
.callout-security { border-color: var(--accent); }
.stopgap { margin: 0 0 2rem; padding: 1rem 1.2rem; border: 1px dashed var(--accent); border-radius: 8px; font-size: .98rem; }
.stopgap p { margin: 0; } .stopgap .callout-label { margin-bottom: .5rem; }
.callout-baseline { background: var(--ok-bg); border-color: transparent; }
.callout-baseline .callout-label { color: var(--ok); letter-spacing: .04em; }
.callout-baseline .callout-label::before { content: ""; display: inline-block; width: .7em; height: .7em; background: var(--ok); margin-right: .55em; transform: rotate(45deg) scale(.8); }
.callout-baseline .callout-label::after { content: " · Baseline"; color: var(--ok); font-weight: 500; }
details.legacy, .callout-legacy { border: 1px solid var(--line); border-radius: 6px; padding: 0 1rem; margin: 1rem 0 2rem; font-size: .95rem; }
details.legacy summary { cursor: pointer; padding: .7rem 0; font-family: var(--mono); font-size: .85rem; }
details.legacy[open] summary { border-bottom: 1px solid var(--line); }
details.legacy .code { font-size: .85rem; width: auto; margin-left: 0; transform: none; }
.callout-legacy { padding: 1rem; }

/* the one ad: below the answer (functions.php puts it before the "In jQuery" heading) */
.ad { margin: 2rem 0; text-align: center; }
.ad .ad-label { display: block; font: .7rem var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.ad ins.adsbygoogle { display: block; min-height: 90px; }
.ad.ad-empty { border: 1px dashed var(--line); color: var(--ink-2); font: .75rem var(--mono); padding: 1.6rem; border-radius: 6px; letter-spacing: .08em; text-transform: uppercase; }

/* tables, steps, lists */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: .82rem; font-weight: 500; color: var(--ink-2); }
ol.steps { padding-left: 1.4rem; } ol.steps li { margin: .6rem 0; }
.entry ul, .entry ol { padding-left: 1.4rem; }
.entry li { margin: .3rem 0; }
.entry blockquote:not(.callout) { border-left: 3px solid var(--line); margin: 1.5rem 0; padding: .2rem 0 .2rem 1rem; color: var(--ink-2); }

/* Related Articles and Sources: the publisher's H2 sections */
.related-articles ul { list-style: none; padding: 0; margin: 0; }
.related-articles li { padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: .95rem; }
.related-articles li a { text-decoration: none; font-weight: 500; color: var(--ink); }
.related-articles li a:hover { text-decoration: underline; background: none; }
.sources ol { font-size: .92rem; padding-left: 1.4rem; }
.sources li { margin: .3rem 0; }
.sources a { word-break: break-word; }
.sources li:target { background: var(--bg-2); }

/* ---------- listings: a category, the functions hub, search ---------- */
.listing-head { margin: 2.5rem 0 1rem; }
.listing-head .deck { margin-bottom: 0; }
.hub-group { margin: 2.5rem 0; }
.hub-group h2 { margin-bottom: .4rem; }
.hub-group .note { margin: 0 0 .6rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0; font-family: var(--mono); font-size: .9rem; }
.pagination a, .pagination span { text-decoration: none; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 5px; }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.search { display: flex; gap: .5rem; margin: 1.5rem 0; }
.search input { flex: 1; min-width: 0; font: inherit; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.search button { background: var(--ink); color: var(--bg); border: 0; border-radius: 6px; padding: .55rem 1rem; cursor: pointer; font-family: var(--mono); font-size: .9rem; }
.empty { color: var(--ink-2); }

/* ---------- library entry ---------- */
.badges { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.badge { font: 500 .78rem var(--mono); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; color: var(--ink-2); }
.badge.verified { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { border-color: var(--tk-n); color: var(--ink); }
.card { background: var(--code-bg); color: var(--code-ink); border-radius: 8px; padding: 1.5rem; margin: 1.5rem 0; font-family: var(--mono); display: grid; gap: .3rem; }
.card .name { font-size: 1.6rem; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.card .row { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .85rem; color: var(--tk-c); }
.card .row b { color: var(--code-ink); font-weight: 500; }
.facts { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1rem 0; }
.facts th, .facts td { text-align: left; padding: .55rem .2rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { font-weight: 500; color: var(--ink-2); width: 11rem; font-family: var(--mono); font-size: .82rem; }
.facts td code { font-size: .85em; }
.facts caption { caption-side: bottom; text-align: left; font-size: .8rem; color: var(--ink-2); padding: .6rem 0; font-family: var(--mono); }
.links { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0; }
.links a { border: 1px solid var(--ink); border-radius: 6px; padding: .45rem .9rem; text-decoration: none; font-size: .92rem; font-weight: 500; }
.links a.primary { background: var(--ink); color: var(--bg); }
.links a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seealso { list-style: none; padding: 0; margin: 0; }
.seealso li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.seealso a { text-decoration: none; font-weight: 500; }
.seealso a:hover { text-decoration: underline; background: none; }
.seealso span { color: var(--ink-2); font-size: .92rem; }
.lib-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.lib-list li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.lib-list li a { text-decoration: none; font-weight: 500; }
.lib-list li a:hover { text-decoration: underline; background: none; }
.lib-list li small { color: var(--ink-2); display: block; font-size: .9rem; }
.lib-list .facts { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); text-align: right; white-space: nowrap; margin: 0; width: auto; }
.lib-list .badge { margin-top: .3rem; }

/* ---------- 404 ---------- */
.lost { padding: 3rem 0; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0 3rem; font-size: .88rem; color: var(--ink-2); }
.site-foot .wide { display: grid; gap: .8rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; background: none; }
.site-foot .brand { font-size: 1rem; }
.site-foot p { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap .code, .entry .code { width: calc(100vw - 2rem); }
  .facts th { width: 8rem; }
  .libs li, .lib-list li { grid-template-columns: 1fr; }
  .libs li .facts, .lib-list .facts { text-align: left; white-space: normal; }
  .prevnext { flex-direction: column; } .prevnext a { max-width: none; } .prevnext .next { text-align: left; margin-left: 0; }
}
@media print { .site-head, .site-foot, .ad, .toggle, .copy { display: none; } .code { break-inside: avoid; } }

/* ---------- runnable examples (assets/theme.js; 0.2.0) ---------- */
.run { display: inline-flex; align-items: center; margin-left: auto; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 5px; padding: .2rem .6rem; font: 600 .72rem var(--mono); cursor: pointer; text-transform: none; letter-spacing: 0; }
.run + .copy { margin-left: 0; }
.run:disabled { opacity: .5; cursor: wait; }
.run-output, .run-error { font: .82rem/1.5 var(--mono); padding: .5rem 1.1rem .6rem; border-top: 1px solid var(--code-line); white-space: pre-wrap; word-break: break-word; }
.run-output { color: var(--tk-s); }
.run-output::before, .run-error::before { content: "// output"; display: block; color: var(--tk-c); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.run-error { color: var(--tk-t); }
.run-error::before { content: "// error"; }
.example-live { border: 1px solid var(--line); border-radius: 8px; margin: 1.2rem 0 2rem; overflow: hidden; }
.example-live .bar { display: flex; align-items: center; justify-content: space-between; font: .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: .45rem .9rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.example-live .reset { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 5px; padding: .15rem .55rem; font: 500 .72rem var(--mono); cursor: pointer; text-transform: none; letter-spacing: 0; }
.example-live .reset:hover { border-color: var(--accent); }
.example-live .stage { padding: 1.2rem; display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; }
.example-live .stage > * { margin: 0; }
.example-live .stage button { background: var(--ink); color: var(--bg); border: 0; border-radius: 6px; padding: .45rem .9rem; cursor: pointer; font: .9rem var(--mono); }
.example-live .stage input, .example-live .stage textarea, .example-live .stage select { font: inherit; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.example-live .stage nav, .example-live .stage [class^="is-"], .example-live .stage [class*=" is-"] { transition: .15s; }
.example-live .stage nav { padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: .9rem; }
.example-live .stage [class^="is-"], .example-live .stage [class*=" is-"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }   /* a state class (is-open, is-visible…) shows */
.example-live .stage main:empty::after { content: "<main id=\"app\"> is empty"; color: var(--ink-2); font: .8rem var(--mono); }
