/* Drumkit – Bedienungsanleitung für Einsteiger. Keine externen Ressourcen, nur Systemschriften. */
:root {
  --bg: #fbfbf8;
  --paper: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --line: #e3e5e8;
  --accent: #4d7c0f;        /* dunkles Grün, gut lesbar auf Weiß */
  --accent-soft: #eef6dc;
  --lime: #c6ff3d;          /* Akzentfarbe der App */
  --try: #e8f4ff;
  --try-line: #2f7dd1;
  --tip: #fff7e0;
  --tip-line: #d99a00;
  --warn: #fdecec;
  --warn-line: #c94141;
  --nav-w: 290px;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font);
  -webkit-text-size-adjust: 100%;
}

a { color: #1d5fa8; text-underline-offset: 2px; }
a:hover { color: #0d3f75; }
:focus-visible { outline: 3px solid var(--try-line); outline-offset: 2px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--paper); padding: 8px 14px; border-radius: 6px; border: 2px solid var(--try-line);
}
.skip:focus { left: 8px; }

/* ------------------------------------------------------------------ navigation (Inhalt) */
.toc {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w);
  overflow-y: auto; overscroll-behavior: contain;
  background: #f3f4ef; border-right: 1px solid var(--line);
  padding: 20px 14px 40px;
  font-size: 15px; line-height: 1.35;
}
.toc .brand {
  display: block; font-weight: 800; letter-spacing: 0.18em; font-size: 20px;
  color: #111; text-decoration: none; margin: 0 8px 2px;
}
.toc .brand span { background: #17181b; color: var(--lime); padding: 0 4px; border-radius: 4px; margin-left: 2px; }
.toc .subtitle { margin: 0 8px 16px; color: var(--muted); font-size: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.toc li { counter-increment: ch; }
.toc ol a {
  display: flex; gap: 8px; padding: 6px 8px; border-radius: 7px;
  color: var(--text); text-decoration: none;
}
.toc ol a::before { content: counter(ch) "."; color: var(--muted); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.toc li.intro { counter-increment: none; }
.toc li.intro a::before { content: "★"; color: var(--accent); }
.toc ol a:hover { background: #e7eadf; }
.toc a.current { background: var(--accent-soft); color: var(--accent); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }

.toc-toggle { display: none; }

/* ------------------------------------------------------------------ content */
main {
  margin-left: var(--nav-w);
  padding: 32px clamp(18px, 4vw, 56px) 80px;
  max-width: calc(var(--nav-w) + 900px);
}
.content { max-width: 860px; }

header.hero {
  background: #17181b; color: #e9e9e9; border-radius: 16px;
  padding: 28px 30px; margin-bottom: 28px;
}
header.hero h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; color: #fff; }
header.hero h1 span { color: var(--lime); }
header.hero p { margin: 6px 0 0; color: #c9c9c9; max-width: 60ch; }

section.chapter { padding-top: 12px; margin-top: 36px; border-top: 1px solid var(--line); }
section.chapter:first-of-type { border-top: 0; margin-top: 0; }

h2 { font-size: 30px; line-height: 1.2; margin: 18px 0 12px; }
h2 .num { color: var(--accent); margin-right: 6px; }
h3 { font-size: 22px; margin: 30px 0 8px; line-height: 1.3; }
h4 { font-size: 18px; margin: 20px 0 6px; }
p, ul, ol { margin: 10px 0; }
li { margin: 4px 0; }
.lead { font-size: 19px; color: #333a42; }

dfn { font-style: normal; font-weight: 700; background: linear-gradient(transparent 62%, #e5f6b8 62%); }
kbd {
  font: 600 0.85em/1 var(--mono);
  padding: 3px 6px; border-radius: 5px; white-space: nowrap;
  border: 1px solid #c7cbd1; border-bottom-width: 2px; background: #f6f7f8; color: #222;
}
code { font: 0.9em var(--mono); background: #f0f1f3; padding: 1px 5px; border-radius: 4px; }
pre.tree { background: #17181b; color: #e6e6e6; padding: 14px 18px; border-radius: 8px; overflow-x: auto; font: 14px/1.5 var(--mono); }
pre.tree code { background: none; padding: 0; color: inherit; font: inherit; }
.ui { font-weight: 650; white-space: nowrap; }       /* Beschriftung in der App, z. B. Knopf „Speichern“ */
.sym { font-family: var(--font); font-weight: 700; padding: 0 3px; border: 1px solid #d4d7db; border-radius: 4px; background: #fff; white-space: nowrap; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ boxes */
.box { border-radius: var(--radius); padding: 14px 18px; margin: 18px 0; border-left: 5px solid; }
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.box .box-title { font-weight: 750; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.box.try { background: var(--try); border-color: var(--try-line); }
.box.try .box-title::before { content: "▶"; color: var(--try-line); }
.box.tip { background: var(--tip); border-color: var(--tip-line); }
.box.tip .box-title::before { content: "💡"; }
.box.warn { background: var(--warn); border-color: var(--warn-line); }
.box.warn .box-title::before { content: "!"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--warn-line); color: #fff; font-size: 14px; }
.box.term { background: #f4f4f0; border-color: #9aa08a; }
.box.term .box-title::before { content: "Begriff"; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; background: #9aa08a; color: #fff; padding: 1px 7px; border-radius: 4px; }

/* step-by-step lists */
ol.steps { counter-reset: st; list-style: none; padding-left: 0; }
ol.steps > li { counter-increment: st; position: relative; padding-left: 42px; margin: 12px 0; }
ol.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
}

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 16px; background: var(--paper); }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: #f1f2ee; font-weight: 700; }
tbody tr:nth-child(even) td { background: #fcfcfa; }

/* ------------------------------------------------------------------ figures and markers */
figure { margin: 20px 0 26px; }
figure .shot {
  position: relative; display: block; width: fit-content; max-width: 100%;
  border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.15), 0 6px 18px rgba(0,0,0,0.08);
  background: #17181b;
}
figure .shot img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
figure .shot.small img { max-width: min(100%, 420px); }
figure .shot.medium img { max-width: min(100%, 660px); }
figure.marked .shot { margin-top: 16px; }
figcaption { color: var(--muted); font-size: 15px; margin-top: 8px; }
figure a.zoom { display: block; width: fit-content; max-width: 100%; }

.mk {
  position: absolute; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: #ffd400; color: #111; font: 800 15px/1 var(--font);
  border: 2px solid #111; box-shadow: 0 0 0 2px #ffd400, 0 2px 6px rgba(0,0,0,0.5);
  pointer-events: none;
}
.legend { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 18px; }
.legend li { display: flex; gap: 10px; align-items: baseline; margin: 2px 0; }
.legend .n {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  background: #ffd400; border: 2px solid #111; font-weight: 800; font-size: 13px; position: relative; top: 4px;
}

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 28px; align-items: start; }

/* glossary */
dl.glossary { margin: 10px 0; }
dl.glossary dt { font-weight: 750; margin-top: 14px; }
dl.glossary dd { margin: 2px 0 0 0; padding-left: 14px; border-left: 3px solid var(--accent-soft); }
.alpha { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.alpha a { padding: 2px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-decoration: none; }

details.faq { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; padding: 0 16px; }
details.faq summary { cursor: pointer; font-weight: 650; padding: 12px 0; }
details.faq[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
details.faq > :last-child { margin-bottom: 14px; }

.back-top { display: inline-block; margin-top: 18px; font-size: 14px; color: var(--muted); }
footer.page-foot { margin-top: 60px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ small screens: collapsible table of contents */
@media (max-width: 900px) {
  body { font-size: 16.5px; }
  main { margin-left: 0; padding-top: 70px; }
  .toc-toggle {
    display: flex; align-items: center; gap: 8px;
    position: fixed; top: 10px; left: 10px; z-index: 30;
    font: 650 15px var(--font); padding: 9px 14px; border-radius: 10px;
    background: #17181b; color: #fff; border: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.25); cursor: pointer;
  }
  .toc-toggle .bars { width: 18px; height: 2px; background: var(--lime); box-shadow: 0 -6px 0 var(--lime), 0 6px 0 var(--lime); margin: 0 3px; }
  .toc {
    z-index: 25; width: min(86vw, 340px); transform: translateX(-105%);
    transition: transform 0.2s ease, visibility 0.2s; visibility: hidden; box-shadow: 0 0 30px rgba(0,0,0,0.25); padding-top: 64px;
  }
  body.toc-open .toc { transform: none; visibility: visible; }
  body.toc-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 20; }
  /* ohne JavaScript: siehe <noscript> in index.html */
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
  .mk { width: 22px; height: 22px; font-size: 12px; }
}
@media (max-width: 700px) {
  figure.dense .mk { display: none; }
  figure.dense.marked .shot { margin-top: 0; }
}
@media (max-width: 520px) {
  header.hero { padding: 20px; }
  th, td { padding: 6px 7px; font-size: 15px; }
  .mk { width: 18px; height: 18px; font-size: 10px; border-width: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toc { transition: none !important; }
}

/* ------------------------------------------------------------------ print */
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; font-size: 11pt; line-height: 1.45; }
  .toc, .toc-toggle, .skip, .back-top { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; }
  header.hero { background: #fff; color: #000; border: 2px solid #000; }
  header.hero h1, header.hero p { color: #000; }
  header.hero h1 span { color: #000; }
  section.chapter { break-before: page; border-top: 0; }
  section.chapter:first-of-type { break-before: auto; }
  figure, .box, table, details.faq, ol.steps > li { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
  figure .shot { box-shadow: none; border: 1px solid #999; }
  a { color: #000; text-decoration: none; }
  details.faq { border: 0; padding: 0; }
  details.faq summary { list-style: none; }
  details.faq > * { display: block; }
}
