/* API-Dokumentation der Smartsearch-API – Gestaltung wie die Pendelzeit-Doku (Agentur Junges Herz): Barlow Semi Condensed für Überschriften,
   Source Sans Pro für Text, Rot #C42008 als Akzent, helle Grauflächen. Schriften lokal, keine fremden Hosts. */
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-display: swap; src: url(fonts/BarlowSemiCondensed-Bold.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans Pro'; font-weight: 400; font-display: swap; src: url(fonts/SourceSansPro-Regular.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans Pro'; font-weight: 700; font-display: swap; src: url(fonts/SourceSansPro-Bold.woff2) format('woff2'); }

:root {
  --red: #C42008;
  --red-dark: #9e1a06;
  --ink: #1a1a1a;
  --dark: #33363b;
  --muted: #5c6066;
  --soft: #F4F5F7;
  --line: #e2e2e2;
  --code-bg: #1f2226;
  --code-fg: #e8e9eb;
  --head: 'Barlow Semi Condensed', 'Arial Narrow', Arial, sans-serif;
  --font: 'Source Sans Pro', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: #fff; color: var(--ink); font: 17px/1.6 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--red); text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }
a:focus-visible, button:focus-visible, pre:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; color: #fff; }

/* Kopf */
header.site { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); }
.brand img { height: 36px; width: auto; display: block; }
.brand span { display: flex; flex-direction: column; padding-left: 16px; border-left: 1px solid var(--line); font: 700 21px/1.1 var(--head); }
.brand small { font: 400 14px/1.3 var(--font); color: var(--muted); }
header nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; margin: 0; padding: 0; list-style: none; }
header nav a { color: var(--ink); text-decoration: none; font-weight: 700; }
header nav a[aria-current] { color: var(--red); }
header nav a.cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 8px; background: var(--red); color: #fff; }
header nav a.cta:hover { background: var(--red-dark); color: #fff; }

/* Startseite */
.buehne { background: var(--soft); padding: 64px 0 56px; border-bottom: 1px solid var(--line); }
.dachzeile { margin: 0 0 12px; color: var(--red); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 15px; }
.buehne h1 { margin: 0; max-width: 18ch; font: 700 clamp(36px, 4.6vw, 60px)/1.05 var(--head); }
.lead p { max-width: 46rem; margin: 20px 0 0; font-size: 20px; color: var(--dark); }
.knoepfe { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.knopf { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 700; text-decoration: none; }
.knopf:hover { background: var(--red-dark); color: #fff; }
.knopf.zweit { background: #fff; color: var(--ink); border: 1px solid #8a8d93; }
.knopf.zweit:hover { border-color: var(--ink); color: var(--ink); }
.start-inhalt { padding-top: 40px; padding-bottom: 64px; }
.start-inhalt .guide { max-width: 52rem; margin: 0; }
.start-inhalt .guide ul { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.start-inhalt .guide li { padding: 16px 18px; border-left: 4px solid var(--red); background: var(--soft); border-radius: 0 8px 8px 0; }
.karten-titel { font: 700 32px/1.1 var(--head); margin: 48px 0 20px; }
.karten { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.karten a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; background: #fff; }
.karten a:hover { border-color: var(--red); color: var(--ink); }
.karte-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 8px; background: #fbe9e6; color: var(--red); }
.karte-titel { font: 700 22px/1.15 var(--head); }
.karte-text { color: var(--dark); font-size: 16px; }

/* Leitfäden: Navigation | Inhalt | Inhaltsverzeichnis */
.spalten { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 48px; align-items: start; padding-top: 40px; padding-bottom: 64px; }
.seiten, .toc { position: sticky; top: 96px; font-size: 15.5px; }
.seiten-titel { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seiten ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.seiten a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.seiten a svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.seiten a:hover { background: var(--soft); color: var(--ink); }
.seiten a[aria-current] { background: #fbe9e6; color: var(--red-dark); font-weight: 700; }
.seiten a[aria-current] svg { color: var(--red); }
.toc { border-left: 1px solid var(--line); padding-left: 18px; }
.toc a { display: block; padding: 4px 0; color: var(--dark); text-decoration: none; }
.toc a:hover { color: var(--red); }
.guide { max-width: 46rem; }
.guide h1 { margin: 0 0 20px; font: 700 clamp(34px, 3.6vw, 48px)/1.08 var(--head); }
.guide h1 + p { font-size: 19px; color: var(--dark); }
.guide h2 { position: relative; margin: 48px 0 12px; padding-top: 18px; font: 700 28px/1.15 var(--head); }
.guide h2::before { content: ''; position: absolute; left: 0; top: 0; width: 40px; height: 4px; border-radius: 2px; background: var(--red); }
.guide h3 { margin: 32px 0 8px; font: 700 21px/1.2 var(--head); }
.guide li { margin: 4px 0; }
.guide li::marker { color: var(--red); }
.guide blockquote { margin: 24px 0; padding: 14px 20px; border-left: 4px solid var(--red); background: var(--soft); border-radius: 0 8px 8px 0; }
.guide blockquote p { margin: 0; }

code { font-family: var(--mono); font-size: .86em; background: var(--soft); border: 1px solid var(--line); padding: .05em .35em; border-radius: 4px; }
figure.code { margin: 20px 0; border-radius: 8px; background: var(--code-bg); color: var(--code-fg); overflow: hidden; }
figure.code figcaption { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 8px 0 16px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #b9bcc2; border-bottom: 1px solid #353a40; }
.kopieren { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #d4d6da; font: 700 13px var(--font); text-transform: none; letter-spacing: 0; cursor: pointer; }
.kopieren:hover { background: #33383e; color: #fff; }
.kopieren.ok { color: #8fd19e; }
figure.code pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
figure.code code { background: none; border: 0; padding: 0; color: inherit; font-size: 14px; line-height: 1.55; }
table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; margin: 20px 0; font-size: 16px; }
/* Lange Adressen (z. B. Kachel-URLs) umbrechen statt die Tabelle scrollen zu lassen */
td code { overflow-wrap: anywhere; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 700; border-bottom: 2px solid var(--ink); }
.blaettern { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.blaettern a { display: flex; flex-direction: column; padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; font: 700 19px/1.2 var(--head); }
.blaettern a:hover { border-color: var(--red); }
.blaettern small { font: 400 14px var(--font); color: var(--muted); margin-bottom: 2px; }
.blaettern .weiter { text-align: right; grid-column: 2; }

/* Fuß */
footer.site { background: var(--dark); color: #d9dbde; font-size: 15.5px; }
footer.site .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px 48px; padding-top: 40px; padding-bottom: 40px; }
footer.site p { margin: 0 0 8px; max-width: 30rem; }
.footer-titel { font: 700 22px/1.1 var(--head); color: #fff; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer.site a { color: #fff; }

/* API-Referenz: Scalar in den Farben der Seite */
body.reference main { padding: 0; }
body.reference .scalar-app, body.reference .light-mode {
  --scalar-color-accent: #C42008;
  --scalar-font: 'Source Sans Pro', Arial, sans-serif;
  --scalar-font-code: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --scalar-background-1: #fff;
  --scalar-background-2: #F4F5F7;
  --scalar-background-3: #eceef1;
  --scalar-color-1: #1a1a1a;
  --scalar-color-2: #33363b;
  --scalar-color-3: #5c6066;
  --scalar-border-color: #e2e2e2;
  --scalar-custom-header-height: 69px;
}
body.reference .scalar-app h1, body.reference .scalar-app h2, body.reference .scalar-app .section-header { font-family: 'Barlow Semi Condensed', 'Arial Narrow', Arial, sans-serif; }

/* Schmale Bildschirme */
@media (max-width: 1100px) {
  .spalten { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 800px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  header.site { position: static; }
  .brand img { height: 28px; }
  .brand span { font-size: 18px; padding-left: 12px; }
  header nav ul { gap: 8px 18px; }
  .spalten { display: block; padding-top: 16px; }
  .seiten { position: static; margin: 0 -16px 24px; padding: 0 16px 12px; border-bottom: 1px solid var(--line); }
  .seiten-titel { display: none; }
  .seiten ul { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .seiten li { flex: none; }
  .seiten a { border: 1px solid var(--line); white-space: nowrap; }
  .buehne { padding: 40px 0; }
  .lead p { font-size: 18px; }
  footer.site .wrap { grid-template-columns: 1fr; }
  .blaettern { grid-template-columns: 1fr; }
  .blaettern .weiter { grid-column: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .karten a, .blaettern a, .knopf, .seiten a, header nav a.cta { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease; }
  .karten a:hover, .blaettern a:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
