/* LEGO® Mindstorms – Aufgaben-Portal
   Zentrales Stylesheet für alle Seiten (Inhaltsverzeichnis, Aufgaben, Glossar) */

:root {
  --farbe-haupt: #c8102e;        /* LEGO-Rot */
  --farbe-haupt-dunkel: #9b0c22;
  --farbe-hintergrund: #f4f5f7;
  --farbe-karte: #ffffff;
  --farbe-text: #1f2328;
  --farbe-text-grau: #57606a;
  --farbe-link: #0969da;
  --tipp-1: #fff3bf;             /* gelb: Denkimpuls */
  --tipp-1-rahmen: #f59f00;
  --tipp-2: #ffe8cc;             /* orange: konkreter Hinweis */
  --tipp-2-rahmen: #e8590c;
  --tipp-3: #ffe3e3;             /* rot: fast die Lösung */
  --tipp-3-rahmen: #c92a2a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--farbe-hintergrund);
  color: var(--farbe-text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Kopfnavigation ---------- */

.kopf {
  background: var(--farbe-haupt);
  color: #fff;
  padding: 0.5rem 1rem;
}

.kopf-inhalt {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.kopf .titel {
  font-weight: 700;
  font-size: 1.05rem;
}

.kopf nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.kopf nav a:hover {
  background: var(--farbe-haupt-dunkel);
}

/* ---------- Seiteninhalt ---------- */

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
  flex: 1;
}

h1 {
  margin: 0.5rem 0 1rem;
  font-size: 1.9rem;
  line-height: 1.25;
}

h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
  border-bottom: 2px solid var(--farbe-haupt);
  padding-bottom: 0.25rem;
}

a { color: var(--farbe-link); }

/* ---------- Inhaltsverzeichnis: Aufgaben-Karten ---------- */

.aufgaben-liste {
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.aufgaben-liste a {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--farbe-karte);
  border: 1px solid #d8dee4;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--farbe-text);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.aufgaben-liste a:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.aufgaben-nummer {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  background: var(--farbe-haupt);
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aufgaben-titel { font-weight: 700; font-size: 1.05rem; }
.aufgaben-beschreibung { color: var(--farbe-text-grau); font-size: 0.92rem; }

/* ---------- Tippkarten ---------- */

.tipp {
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 0.75rem 0;
}

.tipp-1 { background: var(--tipp-1); border: 2px solid var(--tipp-1-rahmen); }
.tipp-2 { background: var(--tipp-2); border: 2px solid var(--tipp-2-rahmen); }
.tipp-3 { background: var(--tipp-3); border: 2px solid var(--tipp-3-rahmen); }

.tipp summary {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

.tipp summary::marker { font-size: 0.9em; }

.tipp p { margin: 0.6rem 0 0; }
.tipp p:last-child { margin-bottom: 0.25rem; }

.hinweis-stufe {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.tipp-1 .hinweis-stufe { color: #a0620a; }
.tipp-2 .hinweis-stufe { color: #c2410c; }
.tipp-3 .hinweis-stufe { color: #a51111; }

/* ---------- Glossar ---------- */

.glossar-eintrag {
  background: var(--farbe-karte);
  border: 1px solid #d8dee4;
  border-left: 5px solid var(--farbe-haupt);
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  margin: 0.75rem 0;
  scroll-margin-top: 5rem;
}

.glossar-eintrag h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.glossar-eintrag p { margin: 0; }

/* ---------- Sonstiges ---------- */

.material {
  background: #eef4ff;
  border: 1px solid #b6cdea;
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  margin: 1rem 0;
}

.material ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.hinweis-klein {
  color: var(--farbe-text-grau);
  font-size: 0.85rem;
}

.zurueck-block { margin-top: 2.5rem; }

/* ---------- Niveau-Blöcke (farbige Abschnitte je Schwierigkeit) ---------- */

.niveau {
  border-radius: 10px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 5px solid var(--farbe-haupt);
}

.niveau h2 {
  margin-top: 0.25rem;
  border-bottom: none;
  padding-bottom: 0;
}

.niveau-gruen { background: #e6f7e6; border-left-color: #4caf50; }
.niveau-gelb  { background: #fff9e6; border-left-color: #ffc107; }
.niveau-rot   { background: #ffebee; border-left-color: #f44336; }

/* ---------- Bugfix-Karten (häufige Probleme, aufklappbar) ---------- */

details.bugfix {
  background: #fff3cd;              /* Bernstein */
  border: 2px solid #ffc107;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin: 0.75rem 0;
}

details.bugfix summary {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

details.bugfix summary::marker { font-size: 0.9em; }

details.bugfix p { margin: 0.6rem 0 0; }
details.bugfix p:last-child { margin-bottom: 0.25rem; }

/* ---------- Fußzeile (Marken-Hinweis, auf jeder Seite) ---------- */

.fuss {
  background: #1f2328;
  color: #c9d1d9;
  padding: 1.25rem 1rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.55;
}

.fuss-inhalt { max-width: 860px; margin: 0 auto; }
.fuss p { margin: 0.35rem 0; }
.fuss a { color: #8ec2ff; }
