/*
 * Gestaltung des Benutzerhandbuchs, abgestimmt auf jfmanager.de.
 * Farben und Schriften wie die Website; alles wird lokal ausgeliefert.
 * Schriften: Bricolage Grotesque und Figtree (SIL Open Font License, siehe fonts/).
 */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url('../fonts/figtree-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Figtree';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url('../fonts/figtree-latin-ext-wght-normal.woff2') format('woff2-variations');
  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: 'Bricolage Grotesque';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('../fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
  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-display: swap;
  font-weight: 200 800;
  src: url('../fonts/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2-variations');
  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;
}

:root {
  --blue: #0b4ea2;
  --blue-dark: #083b7a;
  --blue-tint: #e6eef9;
  --orange: #e57a00;
  --orange-tint: #fdeedc;
  --orange-text: #9a4e00;
  --green-tint: #e2f0e6;
  --bg: #f7f5f0;
  --paper: #fffdf9;
  --sand: #ede9e0;
  --line: #e4e0d6;
  --ink: #0f2238;
  --muted: #46566b;
  --on-dark: #f7f5f0;
  --on-dark-muted: #c8d3e0;
  --font-display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 16px;
  --topbar: 68px;
  --shadow: 0 18px 40px -24px rgb(15 34 56 / 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-dark); padding: 12px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; color: var(--on-dark); }

/* Kopfleiste */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); background: rgb(247 245 240 / 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar__inner { height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; flex: none; }
.brand img { border-radius: 10px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.brand small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.brand:hover { color: var(--ink); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--ink); color: var(--on-dark); place-items: center; cursor: pointer; flex: none; }
.topbar__links { margin-left: auto; display: flex; gap: 22px; font-weight: 600; font-size: 15px; }
.topbar__links a { color: var(--ink); text-decoration: none; }
.topbar__links a:hover { color: var(--blue); }

/* Suche */
.search { position: relative; flex: 1 1 auto; max-width: 460px; margin-left: 28px; }
.search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; }
.search input { width: 100%; height: 44px; padding: 0 44px 0 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 15px; color: var(--ink); }
.search input::placeholder { color: #6b7a8c; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint); }
.search input::-webkit-search-cancel-button { display: none; }
.search__key { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 12px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); background: var(--bg); }
.search__panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: min(70vh, 560px); overflow-y: auto; padding: 8px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.search__panel article { padding: 10px 12px; border-radius: 10px; }
.search__panel article:hover { background: var(--bg); }
.search__panel h3 { margin: 0; font-size: 16px; font-family: var(--font-body); }
.search__panel h3 a { text-decoration: none; }
.search__panel p { margin: 2px 0 0; font-size: 14px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search__panel > p { padding: 10px 12px; }

/* Grundlayout */
.layout { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 28px 18px 40px 24px; border-right: 1px solid var(--line); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar__nav > ul { display: flex; flex-direction: column; gap: 4px; }
.sidebar a { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.35; }
.sidebar a:hover { background: var(--sand); color: var(--ink); }
.sidebar a.is-current { background: var(--blue-tint); color: var(--blue-dark); font-weight: 700; box-shadow: inset 3px 0 0 var(--blue); }
.nav-top { font-weight: 600; }
.nav-section summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 15px; }
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; margin-right: 4px; }
.nav-section details[open] > summary::after { transform: rotate(45deg); }
.nav-section summary:hover { background: var(--sand); }
.nav-section.is-active > details > summary { color: var(--blue-dark); }
.nav-section ul { margin: 2px 0 8px 12px; padding-left: 8px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.sidebar__note { margin: 28px 12px 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.sidebar__note a { display: inline; padding: 0; min-height: 0; color: var(--blue); text-decoration: underline; font-size: 14px; }
.sidebar__note a:hover { background: none; }
.sidebar-backdrop { display: none; }

.main { min-width: 0; padding: 0 40px; outline: none; }
.page { display: grid; grid-template-columns: minmax(0, 780px) 220px; gap: 56px; padding: 44px 0 24px; justify-content: start; }
.is-home .page { padding-top: 8px; }

/* Startseite */
.hero { margin: 32px 0 8px; padding: 48px; border-radius: 28px; background: var(--ink); color: var(--on-dark); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgb(229 122 0 / 0.35), transparent 65%); pointer-events: none; }
.hero .kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #9ebfea; }
.hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
.hero .lead { max-width: 720px; margin: 18px 0 0; font-size: 19px; line-height: 1.55; color: var(--on-dark-muted); }
.audiences { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; position: relative; z-index: 1; }
.audiences a { height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius); background: rgb(247 245 240 / 0.06); border: 1px solid rgb(247 245 240 / 0.16); color: var(--on-dark); text-decoration: none; transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.audiences a:hover { transform: translateY(-2px); background: rgb(247 245 240 / 0.12); border-color: rgb(247 245 240 / 0.35); color: var(--on-dark); }
.audiences__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--orange); color: var(--ink); margin-bottom: 6px; }
.audiences strong { font-size: 17px; }
.audiences span:last-child { font-size: 14.5px; line-height: 1.45; color: var(--on-dark-muted); }
.is-home .content > h1:first-child { display: none; }

/* Inhalt */
.breadcrumb { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.content h1, .content h2, .content h3, .content h4 { font-family: var(--font-display); color: var(--ink); letter-spacing: -0.01em; line-height: 1.15; }
.content h1 { margin: 0 0 20px; font-size: clamp(34px, 3.6vw, 48px); font-weight: 800; letter-spacing: -0.02em; }
.content h2 { margin: 52px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 28px; font-weight: 800; }
.content h3 { margin: 34px 0 10px; font-size: 21px; font-weight: 700; }
.content h4 { margin: 26px 0 8px; font-size: 18px; font-weight: 700; }
.content h1 + p { font-size: 18.5px; color: var(--muted); }
.content p, .content ul, .content ol { margin: 0 0 16px; }
.content li { margin: 4px 0; }
.content li::marker { color: var(--orange); }
.content strong { font-weight: 700; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.headerlink { margin-left: 8px; font-weight: 400; color: var(--line); text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.content :is(h1, h2, h3, h4):hover .headerlink, .headerlink:focus { opacity: 1; color: var(--muted); }

.content img { display: block; margin: 20px 0 8px; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.content p:has(> img) + p > em:only-child, .content p > img + em { display: block; font-style: normal; font-size: 14px; color: var(--muted); }
.content p > em:only-child { color: var(--muted); }

.content code { font-family: var(--font-mono); font-size: 0.88em; padding: 2px 6px; border-radius: 6px; background: var(--sand); color: var(--ink); overflow-wrap: anywhere; }
.content pre { margin: 18px 0 22px; padding: 16px 18px; border-radius: 14px; background: var(--ink); color: var(--on-dark); overflow-x: auto; font-size: 14.5px; line-height: 1.65; box-shadow: var(--shadow); }
.content pre code { padding: 0; background: none; color: inherit; font-size: inherit; overflow-wrap: normal; }

.content table { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 18px 0 24px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); font-size: 15.5px; line-height: 1.5; }
.content th, .content td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.content th { background: var(--sand); font-weight: 700; white-space: nowrap; }
.content tr:last-child td { border-bottom: 0; }
.content tbody tr:nth-child(even) td { background: rgb(237 233 224 / 0.35); }

.content blockquote { margin: 20px 0; padding: 14px 18px; border-radius: 12px; background: var(--blue-tint); border-left: 4px solid var(--blue); }
.content blockquote p:last-child { margin-bottom: 0; }

/* Weiterblättern */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.pager a:hover { border-color: var(--blue); transform: translateY(-1px); color: var(--ink); }
.pager span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pager strong { font-size: 17px; color: var(--blue-dark); }
.pager__next { text-align: right; align-items: flex-end; grid-column: 2; }

/* Inhaltsverzeichnis rechts */
.toc { position: sticky; top: calc(var(--topbar) + 28px); align-self: start; max-height: calc(100vh - var(--topbar) - 56px); overflow-y: auto; font-size: 14px; }
.toc__title { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--blue); }
.toc a.is-active { color: var(--blue-dark); font-weight: 700; }

.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 40px 0 0; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer img { border-radius: 8px; }
.footer p { margin: 0; }
.footer__links { margin-left: auto !important; }

/* Mittlere Breite: Inhaltsverzeichnis entfällt */
@media (max-width: 1240px) {
  .page { grid-template-columns: minmax(0, 780px); }
  .toc { display: none; }
  .audiences { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Schmal: Navigation als ausklappbare Seitenleiste */
@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .topbar__links { display: none; }
  .search { margin-left: auto; max-width: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; left: 0; top: var(--topbar); width: min(320px, 86vw); background: var(--bg); transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow); }
  .nav-open .sidebar { transform: none; }
  .nav-open .sidebar-backdrop { display: block; position: fixed; inset: var(--topbar) 0 0 0; z-index: 45; background: rgb(15 34 56 / 0.35); }
  .main { padding: 0 20px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar__inner { padding: 0 14px; gap: 10px; }
  .brand small, .search__key { display: none; }
  .brand strong { font-size: 17px; }
  .brand span { display: none; }
  .brand img { width: 34px; height: 34px; }
  .main { padding: 0 16px; }
  .hero { margin-top: 16px; padding: 28px 22px; border-radius: 22px; }
  .audiences { grid-template-columns: minmax(0, 1fr); }
  .content h2 { font-size: 24px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager__next { grid-column: auto; }
  .footer__links { margin-left: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .sidebar, .sidebar-backdrop, .toc, .pager, .footer, .hero, .headerlink, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .layout, .page { display: block; max-width: none; padding: 0; }
  .main { padding: 0; }
  .content img, .content pre { box-shadow: none; }
  .content pre { background: #f3f3f3; color: #000; border: 1px solid #ccc; }
  img, tr, pre { break-inside: avoid; }
  a { color: #000; }
}
