/* botbrix – base: Schriften, Design-Tokens (hell/dunkel), Reset, Typografie, Fließtext-Bausteine */

/* ---------- Schriften (selbst gehostet, OFL; Lizenzen in assets/fonts/) ---------- */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin.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: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 380 700; font-display: swap;
  src: url(../fonts/newsreader-latin.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: "Newsreader"; font-style: normal; font-weight: 380 700; font-display: swap;
  src: url(../fonts/newsreader-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader"; font-style: italic; font-weight: 380 700; font-display: swap;
  src: url(../fonts/newsreader-italic-latin.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: "Newsreader"; font-style: italic; font-weight: 380 700; font-display: swap;
  src: url(../fonts/newsreader-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Spline Sans Mono"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/spline-sans-mono-latin.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: "Spline Sans Mono"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/spline-sans-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  --ff-display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --ff-text: "Newsreader", Charter, "Iowan Old Style", Georgia, serif;
  --ff-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-body: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);   /* 18 → 20 px */
  --fs-small: 1rem;
  --fs-ui: 0.9375rem;
  --fs-mono: 0.75rem;
  --fs-h1: clamp(2.375rem, 1.55rem + 3.6vw, 4.625rem);
  --fs-h2: clamp(1.625rem, 1.33rem + 1.25vw, 2.375rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --lh-body: 1.55;
  --measure: 43rem;           /* ≈ 690 px Textspalte */
  --wrap: 82rem;              /* 1312 px */
  --gutter: clamp(1rem, 3.2vw, 2.5rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --radius: 3px;
  --header-h: 4rem;
  --hair: 1px;

  /* Hell */
  --bg: #f6f2ea;
  --bg-sunk: #ece6da;
  --bg-raised: #fbf9f5;
  --fg: #16130f;
  --fg-2: #48423a;
  --fg-3: #6a6257;
  --line: #d6cdbf;
  --line-soft: #e4ddd1;
  --rule: #16130f;
  --accent: #ffa800;           /* nur als Fläche/Marker, Text darauf: --on-accent */
  --on-accent: #16130f;
  --accent-text: #8f4f00;      /* Orange als Schrift auf hellem Grund (AA) */
  --link-line: #ffa800;
  --pro: #1b6b40;
  --con: #a8321c;
  --warn: #a8321c;
  --focus: #16130f;
  --c-tools: #1d6a73;
  --c-vergleich: #34509a;
  --c-ratgeber: #6a6414;
  --c-glossar: #8a4560;
  --c-news: #9a5200;
  --c-seite: #6a6257;
  color-scheme: light;
}

/* Dunkel – per Umschalter oder (ohne JS) per Systemeinstellung */
:root[data-theme="dark"] {
  --bg: #1b1a18;
  --bg-sunk: #232220;
  --bg-raised: #252421;
  --fg: #eee9e0;
  --fg-2: #c4bcaf;
  --fg-3: #a0978a;
  --line: #3c3a35;
  --line-soft: #302e2a;
  --rule: #eee9e0;
  --accent: #f9a91f;
  --on-accent: #16130f;
  --accent-text: #ffb53d;
  --link-line: #f9a91f;
  --pro: #6cc796;
  --con: #ff907a;
  --warn: #ff907a;
  --focus: #f9a91f;
  --c-tools: #5fb5be;
  --c-vergleich: #93a6e8;
  --c-ratgeber: #c4bb5c;
  --c-glossar: #dd93b2;
  --c-news: #f9a91f;
  --c-seite: #a0978a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1b1a18; --bg-sunk: #232220; --bg-raised: #252421; --fg: #eee9e0; --fg-2: #c4bcaf; --fg-3: #a0978a;
    --line: #3c3a35; --line-soft: #302e2a; --rule: #eee9e0; --accent: #f9a91f; --accent-text: #ffb53d; --link-line: #f9a91f;
    --pro: #6cc796; --con: #ff907a; --warn: #ff907a; --focus: #f9a91f;
    --c-tools: #5fb5be; --c-vergleich: #93a6e8; --c-ratgeber: #c4bb5c; --c-glossar: #dd93b2; --c-news: #f9a91f; --c-seite: #a0978a;
    color-scheme: dark;
  }
}

/* Linien-Kurzformen; in Bereichen mit eigenen Farbtokens neu berechnet */
body, .bb-footer, .bb-newsletter--band { --hl: var(--hair) solid var(--line); --hl-soft: var(--hair) solid var(--line-soft); --hr: var(--hair) solid var(--rule); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1.5rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--ff-text); font-size: var(--fs-body); line-height: var(--lh-body);
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p, ul, ol, dl, figure, blockquote, h1, h2, h3, h4 { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
table { border-collapse: collapse; }
hr { border: 0; border-top: var(--hl); margin: 2.5rem 0; }
::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
:focus:not(:focus-visible) { outline: none; }
.bb-main:focus { outline: none; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.bb-skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.75rem 1rem;
  background: var(--fg); color: var(--bg); font: 600 var(--fs-ui)/1 var(--ff-display); text-decoration: none;
}
.bb-skip:focus { top: 0.75rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Typografie ---------- */
h1, h2, h3, h4, .bb-display {
  font-family: var(--ff-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.012em;
  hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 10 4 4; overflow-wrap: break-word; text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 760; font-stretch: 82%; line-height: 0.98; letter-spacing: -0.015em; }
h2 { font-size: var(--fs-h2); font-stretch: 88%; }
h3 { font-size: var(--fs-h3); font-weight: 650; font-stretch: 94%; line-height: 1.18; }
h4 { font-size: 1.0625rem; font-weight: 650; }
p { text-wrap: pretty; }
small { font-size: var(--fs-small); }
code, kbd, samp, pre { font-family: var(--ff-mono); font-size: 0.82em; }

.bb-mono, .bb-label {
  font-family: var(--ff-mono); font-size: var(--fs-mono); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  font-variant-numeric: tabular-nums; line-height: 1.4;
}

/* ---------- Fließtext (content) ---------- */
.bb-prose { max-width: var(--measure); }
.bb-prose > * + * { margin-top: 1.1em; }
.bb-prose h2 { margin-top: 1.9em; padding-top: 0.6em; border-top: var(--hr); font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem); }
.bb-prose h3 { margin-top: 1.9em; font-size: clamp(1.2rem, 1.12rem + 0.35vw, 1.375rem); }
.bb-prose h2 + *, .bb-prose h3 + * { margin-top: 0.6em; }
.bb-prose > :first-child { margin-top: 0; }
.bb-prose > :first-child:is(h2) { border-top: 0; padding-top: 0; }
.bb-prose ul, .bb-prose ol { padding-left: 1.35em; }
.bb-prose li + li { margin-top: 0.35em; }
.bb-prose ul > li::marker { content: "–  "; color: var(--fg-3); font-family: var(--ff-mono); }
.bb-prose ol > li::marker { font-family: var(--ff-mono); font-size: 0.8em; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.bb-prose strong { font-weight: 650; }
.bb-prose a { font-weight: 500; }
.bb-prose code { background: var(--bg-sunk); padding: 0.08em 0.35em; border-radius: 2px; border: var(--hl-soft); }
.bb-prose pre { background: var(--bg-sunk); padding: 1rem 1.25rem; overflow-x: auto; border: var(--hl); line-height: 1.5; }
.bb-prose pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; }
.bb-prose blockquote {
  margin-left: 0; padding: 0.2em 0 0.2em 1.25em; border-left: 3px solid var(--accent);
  font-style: italic; font-size: 1.12em; line-height: 1.45; color: var(--fg);
}
.bb-prose blockquote p + p { margin-top: 0.6em; }
.bb-prose blockquote cite, .bb-prose blockquote footer { display: block; margin-top: 0.6em; font: 500 var(--fs-mono)/1.4 var(--ff-mono); font-style: normal; color: var(--fg-3); }
.bb-prose img { margin-inline: auto; }
.bb-prose figure, .bb-figure { margin: 2em 0; }
.bb-figure img { border: var(--hl); background: var(--bg-sunk); }
.bb-prose figcaption, .bb-figure figcaption, .wp-caption-text {
  margin-top: 0.6rem; font: 400 0.8125rem/1.5 var(--ff-mono); color: var(--fg-3); letter-spacing: 0.01em;
}
.bb-prose figcaption::before { content: "Abb. "; color: var(--fg-3); }
.bb-prose hr { margin: 2.5em 0; }
@media (min-width: 64em) {
  .bb-prose figure.alignwide { margin-right: -8rem; }
}

/* Kästen */
.bb-box {
  position: relative; padding: 1.15rem 1.35rem 1.2rem; border: var(--hl); border-left: 4px solid var(--fg-3);
  background: var(--bg-raised); font-size: 0.95em;
}
.bb-prose .bb-box > * + * { margin-top: 0.6em; }
.bb-box::before {
  display: block; margin-bottom: 0.45rem; font: 600 var(--fs-mono)/1.2 var(--ff-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2);
  content: "Hinweis";
}
.bb-box--info { border-left-color: var(--fg); }
.bb-box--info::before { content: "Gut zu wissen"; }
.bb-box--tipp { border-left-color: var(--accent); }
.bb-box--tipp::before { content: "Tipp"; color: var(--accent-text); }
.bb-box--warnung { border-left-color: var(--warn); }
.bb-box--warnung::before { content: "Achtung"; color: var(--warn); }
.bb-box:has(> p:first-child > strong:first-child)::before { display: none; }
.bb-box > p:first-child > strong:first-child {
  display: block; margin-bottom: 0.45rem; font: 600 var(--fs-mono)/1.2 var(--ff-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2);
}
.bb-box--tipp > p:first-child > strong:first-child { color: var(--accent-text); }
.bb-box--warnung > p:first-child > strong:first-child { color: var(--warn); }

/* Tabellen im Fließtext */
.bb-table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: var(--hr); max-width: 100%; }
.bb-prose table, .bb-table { width: 100%; font-family: var(--ff-display); font-size: 0.9375rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.bb-prose .bb-table-wrap table { min-width: 32rem; }
.bb-prose table caption, .bb-table caption {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.bb-prose th, .bb-prose td, .bb-table th, .bb-table td { padding: 0.7rem 0.9rem 0.7rem 0; text-align: left; vertical-align: top; border-bottom: var(--hl); }
.bb-prose thead th, .bb-table thead th {
  font: 600 var(--fs-mono)/1.3 var(--ff-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2);
  border-bottom: var(--hr); white-space: nowrap; vertical-align: bottom;
}
.bb-prose tbody th { font-weight: 650; }
.bb-prose td:last-child, .bb-prose th:last-child { padding-right: 0; }
.bb-scrollhint {
  display: none; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font: 500 var(--fs-mono)/1.2 var(--ff-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3);
}
.is-scrollable + .bb-scrollhint, .is-scrollable > .bb-scrollhint { display: flex; }

/* WordPress-Klassen aus Altinhalten */
.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.wp-caption { max-width: 100%; }
