/* Schrift: Computer Modern (CMU Serif), wie in den LaTeX-Blättern. Lizenz: fonts/OFL.txt */
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-500-roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-500-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("fonts/cmu-serif-700-roman.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* Farben aus der Vorlage der Aufgabenblätter */
:root {
  --hauptfarbe: #0070c0;   /* RGB 0, 112, 192 */
  --hellblau: #d9eaf8;     /* RGB 217, 234, 248 */
  --grau: #e6e6e6;         /* RGB 230, 230, 230 */
  --grau-rand: #b8b8b8;
  --text: #222;
  --leise: #666;
  --schrift: "CMU Serif", "Latin Modern Roman", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: #fff; color: var(--text);
  font-family: var(--schrift); font-size: 19px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--hauptfarbe); }
:focus-visible { outline: 2px solid var(--hauptfarbe); outline-offset: 2px; }
.blatt { max-width: 820px; margin: 0 auto; padding: 0 28px; }

/* Kopfzeile wie fancyhdr: links, Mitte, rechts, darunter eine feine Linie */
.kopf { border-bottom: 0.6px solid var(--text); background: #fff; }
.kopf-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; padding-top: 14px; padding-bottom: 6px; font-size: 15px; }
.kopf-links { color: var(--text); text-decoration: none; }
.kopf-mitte { text-align: center; }
.kopf-rechts { display: flex; justify-content: flex-end; gap: 18px; }
.kopf-rechts a { color: var(--text); text-decoration: none; }
.kopf-rechts a:hover { color: var(--hauptfarbe); text-decoration: underline; }

/* Titel wie \Huge\color{hauptfarbe}\textbf */
.titelblock { text-align: center; padding: 64px 0 36px; }
h1 { color: var(--hauptfarbe); font-size: clamp(38px, 6.4vw, 56px); font-weight: 700; line-height: 1.1; margin: 0 0 14px; }
.titelblock p { font-size: 17px; margin: 0 auto; max-width: 46ch; }

/* Theoriebox: blauer Rahmen, hellblauer Grund, Titel blau, fett, unterstrichen */
.theorie { border: 2px solid var(--hauptfarbe); background: var(--hellblau); padding: 14px 18px 18px; }
.theorie-titel { color: var(--hauptfarbe); font-size: 19px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin: 0 0 6px; }
.theorie-inhalt { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; align-items: start; }
.theorie-text p { margin: 0 0 10px; }
.formel { text-align: center; margin: 12px 0 14px !important; font-size: 20px; }
.var { font-style: italic; }
.bruch { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin-left: 4px; }
.bruch span:first-child { border-bottom: 1px solid var(--text); padding: 0 4px 1px; }
.bruch span:last-child { padding-top: 1px; }
.hinweis { font-style: italic; font-size: 16px; color: #3b4a5a; }
.werte { display: flex; gap: 24px; font-size: 18px; min-height: 1.6em; font-variant-numeric: tabular-nums; }
.weiter { font-size: 17px; }
#mini { width: 100%; aspect-ratio: 5 / 4; background: #fff; border: 0.6px solid var(--hauptfarbe); cursor: crosshair; touch-action: pan-y; display: block; }

/* Abschnitte wie \section* */
section { margin-top: 56px; }
.abschnitt { font-size: 27px; font-weight: 700; margin: 0 0 14px; line-height: 1.2; }
.einleitung { margin: -4px 0 14px; }

.steuerung { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
#suche {
  font: inherit; font-size: 17px; width: min(260px, 100%);
  border: 0; border-bottom: 1px solid var(--text); padding: 4px 2px; background: transparent; border-radius: 0;
}
#suche:focus { outline: none; border-bottom: 2px solid var(--hauptfarbe); }
.typen { display: flex; flex-wrap: wrap; gap: 16px; font-size: 17px; }
.typen button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); }
.typen button[aria-pressed="true"] { color: var(--hauptfarbe); text-decoration: underline; text-underline-offset: 4px; }

/* Material nach Thema gruppiert */
.gruppe { margin-bottom: 26px; }
.gruppe-titel { color: var(--hauptfarbe); font-size: 19px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin: 0 0 4px; }
.eintrag { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 10px 0; border-bottom: 0.6px solid var(--grau-rand); }
.eintrag:last-child { border-bottom: 0; }
.eintrag h3 { font-size: 19px; font-weight: 700; margin: 0; }
.eintrag-art { font-weight: 400; font-style: italic; color: var(--leise); font-size: 16px; margin-left: 8px; }
.eintrag p { margin: 0; grid-column: 1; font-size: 17px; color: #444; }
.eintrag-links { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; align-self: center; }
.dl {
  font-size: 15px; text-decoration: none; color: var(--hauptfarbe);
  border: 1px solid var(--hauptfarbe); background: var(--hellblau); padding: 3px 10px;
}
.dl:hover { background: var(--hauptfarbe); color: #fff; }
.dl.fehlt { color: #999; border-color: #ccc; background: #f4f4f4; pointer-events: none; }
.bald { font-style: italic; color: var(--leise); font-size: 16px; }
.leer { font-style: italic; color: var(--leise); }

/* Beispielbox: grauer Grund, feiner dunkler Rand */
.bsp { background: var(--grau); border: 1px solid #a8a8a8; padding: 18px 22px 22px; }
.bsp p { margin: 0 0 16px; max-width: 62ch; }
.knopf { display: inline-block; background: var(--hauptfarbe); color: #fff; text-decoration: none; font-weight: 700; padding: 9px 18px; font-size: 17px; }
.knopf:hover { background: #005a9c; }

.fuss { margin-top: 56px; padding-top: 14px; padding-bottom: 40px; border-top: 0.6px solid var(--text); font-size: 15px; color: var(--leise); }
.fuss p { margin: 0 0 8px; }
.fuss summary { cursor: pointer; }

@media (max-width: 700px) {
  body { font-size: 18px; }
  .blatt { padding: 0 18px; }
  .kopf-inner { grid-template-columns: auto 1fr; }
  .kopf-mitte { display: none; }
  .kopf-inner { font-size: 14px; padding-top: 4px; padding-bottom: 0; }
  .kopf-rechts { gap: 2px; }
  .kopf-links, .kopf-rechts a { display: inline-block; padding: 10px 5px; }
  .kopf-links { padding-left: 0; }
  .kopf-rechts a:last-child { padding-right: 0; }
  #mini { order: -1; }
  .titelblock { padding: 40px 0 26px; }
  .theorie-inhalt { grid-template-columns: 1fr; }
  .eintrag { grid-template-columns: minmax(0, 1fr); }
  .eintrag h3, .eintrag p, .gruppe-titel, h1 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
  .eintrag-links { grid-column: 1; grid-row: auto; margin-top: 6px; }
}
