/* bauhaus.css: Bauhaus style for a post, loaded after style.css and post.css by a page whose
   <html> carries data-style="bauhaus". The page loads Jost and JetBrains Mono itself.
   One style, two palettes chosen by data-mode on <html>; js/mode.js switches it, dark is the default.
   PALETTE (this first half): one token block per mode. Structure (second half) is scoped to
   [data-style="bauhaus"] and uses the --bh-* tokens only.
     light            cream paper, black, red and blue accents, yellow squares
     dark (default)   mystman.com's own colours mapped onto the same roles:
                      navy ground, off-white rules, gold squares, azure accents, rust for red
   Hero: full-bleed, as tall as its content, a heavy base rule, lowercase Jost 900 title up to 16 characters
   a line, a small mountain (the site's own icon) on the base rule. No circle or vertical bar: tried at two sizes,
   they drew the eye and did not match the rest of the site. Sections: 2 px top rule, number in a yellow square.
   Figure roles, light: blue = answer, red = refusal, ochre = schema, black = structure.
   Figure roles, dark: post.css's own (emerald, rust, gold, azure), left untouched. */

/* ---------- light: cream, black, red, blue, yellow ---------- */
html[data-style="bauhaus"][data-mode="light"] {
  --bg-color:#f2ede4; --card-bg:#faf6ee; --text-primary:#111; --text-secondary:#5c5850;
  --accent-gold:#111; --accent-gold-muted:#5c5850;
  --bh-ground:#f2ede4; --bh-panel:#faf6ee; --bh-ink:#111; --bh-body:#1c1c1c; --bh-muted:#5c5850;
  --bh-heavy:#111;                       /* base rule, section rules, borders */
  --bh-mountain:#be1e2d; --bh-bar:#21409a; --bh-red-fill:#be1e2d;
  --bh-yellow:#f2c12e; --bh-on-yellow:#111;
  --bh-red:#be1e2d;                      /* red as text */
  --bh-link:#21409a; --bh-code:#e8e1d2;
}
html[data-style="bauhaus"][data-mode="light"] .post {
  --ink:#111; --ink-2:#111; --ink-3:#5c5850; --panel:#faf6ee; --panel-2:#ece5d6;
  --rule:#111; --rule-2:#cfc7b4; --warn:#be1e2d;
  --level:#21409a; --level-soft:rgba(33,64,154,.12);
  --key:#7a5c00;   --key-soft:rgba(242,193,46,.45);
  --struct:#111;   --struct-soft:rgba(17,17,17,.06); --struct-ink:#111;
  --edge:#be1e2d;  --edge-soft:rgba(190,30,45,.10); --edge-ink:#a8192a;
}

/* ---------- dark (default): the site's Midnight & Gold on the same roles ---------- */
html[data-style="bauhaus"][data-mode="dark"] {
  --bg-color:#0a192f; --card-bg:#112240; --text-primary:#e6f1ff; --text-secondary:#8892b0;
  --accent-gold:#ffd700; --accent-gold-muted:#b29758;
  --bh-ground:#0a192f; --bh-panel:#112240; --bh-ink:#e6f1ff; --bh-body:#ccd6f6; --bh-muted:#8892b0;
  --bh-heavy:#e6f1ff;
  --bh-mountain:#ffd700; --bh-bar:#007FFF; --bh-red-fill:#D14A10;
  --bh-yellow:#ffd700; --bh-on-yellow:#0a192f;
  --bh-red:#E8703D;
  --bh-link:#5aa9ff; --bh-code:#1a2d50;
}
/* figure tokens: post.css's own, which already are this palette */

/* ---------- structure ---------- */
html[data-style="bauhaus"] { overflow-x:clip; --font-main:"Jost",sans-serif; }
html[data-style="bauhaus"] body { background:var(--bh-ground); color:var(--bh-body); font-family:"Jost",sans-serif; font-size:17.5px; line-height:1.65; overflow-x:clip; }
html[data-style="bauhaus"] h1, html[data-style="bauhaus"] h2, html[data-style="bauhaus"] h3 { font-family:"Jost",sans-serif; color:var(--bh-ink); }

/* site header */
html[data-style="bauhaus"] .site-header { position:static; background:var(--bh-ground); backdrop-filter:none; border-bottom:0; padding:20px 0 8px; }
html[data-style="bauhaus"] .site-header .container { max-width:1120px; }
html[data-style="bauhaus"] .logo { font-family:"Jost",sans-serif; font-weight:900; font-size:1.55rem; letter-spacing:-.02em; color:var(--bh-ink); }
html[data-style="bauhaus"] .cursor { color:var(--bh-red); animation:none; }
html[data-style="bauhaus"] nav a { font-family:"Jost",sans-serif; font-weight:500; font-size:.95rem; color:var(--bh-ink); padding:.1em .35em; }
html[data-style="bauhaus"] nav a:hover { background:var(--bh-yellow); color:var(--bh-on-yellow); }
html[data-style="bauhaus"] .theme-toggle { display:none; }

/* hero: full bleed, content still aligned with the text column */
html[data-style="bauhaus"] .post { max-width:1120px; }
html[data-style="bauhaus"] .post > * { max-width:680px; }
html[data-style="bauhaus"] .post-header { max-width:none;
  margin-inline:calc(50% - 50vw); padding-inline:calc(50vw - 50%); display:flex; flex-direction:column;
  padding-top:28px; padding-bottom:clamp(28px,5vh,52px); border-bottom:16px solid var(--bh-heavy); margin-bottom:44px; }
html[data-style="bauhaus"] .post .post-meta { margin-bottom:0; padding-bottom:40px; font-family:"Jost",sans-serif; font-weight:700; font-size:.78rem;
  letter-spacing:.2em; color:var(--bh-ink); }
html[data-style="bauhaus"] .post .post-meta b { color:var(--bh-red); font-weight:700; }
html[data-style="bauhaus"] .post h1 { font-weight:900; text-transform:lowercase; letter-spacing:-.03em; line-height:.9;
  font-size:clamp(2.7rem,6.2vw,5.4rem); max-width:16ch; margin-bottom:.45em; color:var(--bh-ink); }
html[data-style="bauhaus"] .post .standfirst { font-weight:500; font-size:1.15rem; line-height:1.55; max-width:54ch; color:var(--bh-ink); }

/* mountain: the site's own icon (the path of the theme button's .tt-mountain), small, standing on the base rule.
   To drop it, delete this block and --bh-mountain in both palettes. Hidden on a phone, where it would cover the standfirst. */
html[data-style="bauhaus"] .post-header { position:relative; }
html[data-style="bauhaus"] .post-header::after { content:""; position:absolute; bottom:0; right:max(24px, calc(50vw - 560px));
  width:180px; aspect-ratio:20/14; background:var(--bh-mountain);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 6 20 14'%3E%3Cpath d='M2 20 L9 6 L14 14 L17 9 L22 20 Z'/%3E%3Cpath d='M11 20 L15 12 L19 20 Z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 6 20 14'%3E%3Cpath d='M2 20 L9 6 L14 14 L17 9 L22 20 Z'/%3E%3Cpath d='M11 20 L15 12 L19 20 Z'/%3E%3C/svg%3E") no-repeat center / contain; }
@media (max-width:700px) { html[data-style="bauhaus"] .post-header::after { display:none; } }

/* sections: 2 px rule, number in a yellow square, lowercase heading */
html[data-style="bauhaus"] .post { counter-reset:sec; }
html[data-style="bauhaus"] .post h2 { counter-increment:sec; font-weight:700; text-transform:lowercase; letter-spacing:-.01em;
  font-size:clamp(1.4rem,2.4vw,1.85rem); line-height:1.02; border-top:2px solid var(--bh-heavy); padding-top:18px; margin:3.6rem 0 1.2rem; }
html[data-style="bauhaus"] .post h2::before { content:counter(sec,decimal-leading-zero); display:inline-grid; place-items:center;
  width:1.9em; height:1.9em; margin-right:.5em; vertical-align:.3em; background:var(--bh-yellow); color:var(--bh-on-yellow);
  font-size:.42em; font-weight:700; letter-spacing:.04em; }
html[data-style="bauhaus"] .post h3 { font-weight:700; font-size:1.25rem; }
html[data-style="bauhaus"] .post h3::before { content:"\25B2  "; color:var(--bh-red); font-size:.7em; }
/* a post that numbers some of its headings itself keeps that number in data-n on the <h2> and on its contents link:
   only those headings get a square, and the other rows of the contents list get no number */
html[data-style="bauhaus"] .post h2[data-n]::before { content:attr(data-n); }
html[data-style="bauhaus"] .post:has(h2[data-n]) h2:not([data-n])::before { display:none; }
/* a name that must keep its case in a lowercase heading, such as RealFIFO */
html[data-style="bauhaus"] .post h2 .keep-case { text-transform:none; }

/* prose */
html[data-style="bauhaus"] .post p, html[data-style="bauhaus"] .post li { color:var(--bh-body); }
html[data-style="bauhaus"] .post strong { color:var(--bh-ink); font-weight:700; }
html[data-style="bauhaus"] .post a { color:var(--bh-link); text-decoration-thickness:2px; text-underline-offset:3px; }
html[data-style="bauhaus"] .post a:hover { background:var(--bh-yellow); color:var(--bh-on-yellow); }
html[data-style="bauhaus"] .post code { background:var(--bh-code); color:var(--bh-ink); border-radius:0; }

/* blocks */
html[data-style="bauhaus"] .callout { background:var(--bh-panel); border:0; border-left:14px solid var(--bh-red-fill); border-radius:0; padding:1rem 1.3rem; }
html[data-style="bauhaus"] .callout .lab, html[data-style="bauhaus"] .runnote .lab { font-family:"Jost",sans-serif; font-weight:700; font-size:.72rem;
  letter-spacing:.2em; color:var(--bh-ink); }
html[data-style="bauhaus"] h2 ~ .callout { background:var(--bh-yellow); border-left:0; margin:2rem 0 2.2rem; }
html[data-style="bauhaus"] h2 ~ .callout .lab, html[data-style="bauhaus"] h2 ~ .callout p { color:var(--bh-on-yellow); }
html[data-style="bauhaus"] h2 ~ .callout p { font-weight:700; font-size:1.35rem; line-height:1.3; }
html[data-style="bauhaus"] h2 ~ .callout code { background:rgba(0,0,0,.12); color:var(--bh-on-yellow); }
html[data-style="bauhaus"] .runnote { background:var(--bh-panel); border:0; border-left:10px solid var(--bh-bar); border-radius:0; }
html[data-style="bauhaus"] .post > figure { max-width:none; }
html[data-style="bauhaus"] .fig-box { border:3px solid var(--bh-heavy); border-radius:0; background:var(--bh-panel); }
html[data-style="bauhaus"] .post pre, html[data-style="bauhaus"] .measured, html[data-style="bauhaus"] .post .tbl { border-radius:0; }
html[data-style="bauhaus"] .post figcaption { max-width:680px; color:var(--bh-ink); border-left:8px solid var(--bh-bar); padding-left:12px; }
html[data-style="bauhaus"] .post figcaption b { color:var(--bh-ink); }
html[data-style="bauhaus"] .post-footer { border-top:2px solid var(--bh-heavy); }

/* contents list (.post-toc): heavy rules, yellow on hover */
html[data-style="bauhaus"] .post-toc { display:block; margin:0 0 2.4rem; font-size:.95rem; }
html[data-style="bauhaus"] .post-toc .toc-h { font-weight:700; font-size:.72rem; letter-spacing:.2em; text-transform:uppercase; color:var(--bh-ink);
  border-bottom:2px solid var(--bh-heavy); padding-bottom:.4rem; margin-bottom:0; }
html[data-style="bauhaus"] .post-toc ol { list-style:none; margin:0; counter-reset:toc; }
html[data-style="bauhaus"] .post-toc li { counter-increment:toc; margin:0; border-bottom:2px solid var(--bh-heavy); }
html[data-style="bauhaus"] .post-toc a { margin:0; font-size:inherit; display:grid; grid-template-columns:2.4em 1fr; padding:.45rem .2rem; color:var(--bh-ink);
  text-decoration:none; font-weight:500; line-height:1.35; }
html[data-style="bauhaus"] .post-toc a::before { content:counter(toc,decimal-leading-zero); color:var(--bh-red); font-weight:700; }
html[data-style="bauhaus"] .post-toc a[data-n]::before { content:attr(data-n); }
html[data-style="bauhaus"] .post-toc:has(a[data-n]) a:not([data-n])::before { content:""; }
html[data-style="bauhaus"] .post-toc a:hover { background:var(--bh-yellow); color:var(--bh-on-yellow); }

@media (max-width:700px) {
  html[data-style="bauhaus"] .post .post-meta { padding-bottom:56px; }
  html[data-style="bauhaus"] .post figure svg { min-width:640px; }   /* readable figure, scrolls sideways in its box */
}

/* light/dark button (.mode-toggle in the site header) */
html[data-style="bauhaus"] .mode-toggle { display:inline-flex; align-items:center; gap:.4em; margin-left:1.2rem; padding:.2em .6em .15em;
  font:500 .92rem/1.2 "Jost",sans-serif; cursor:pointer; color:var(--bh-ink); background:none; border:2px solid var(--bh-heavy); border-radius:0; }
html[data-style="bauhaus"] .mode-toggle:hover, html[data-style="bauhaus"] .mode-toggle:focus-visible { background:var(--bh-yellow); color:var(--bh-on-yellow); border-color:var(--bh-yellow); }
@media (max-width:768px) { html[data-style="bauhaus"] .mode-toggle { margin-left:.75rem; } }
