/* Die eine Kopfzeile der Nebenseiten (Paket 127).

   Sie steht auf fuenf Seiten: Startseite, Anmeldeseite, Hilfe,
   Impressum, Datenschutz. Vier davon laden web/stil.css und bekommen
   ihre Farb-Token von dort; die Startseite bringt eigene mit (sie wird
   als eigener Ordner ausgeliefert und teilt mit dem Programm nichts).

   DARUM EIGENE TOKEN mit Rueckfall: jede Farbe hier zieht zuerst den
   Token der Oberflaeche und faellt sonst auf den Wert des
   Erscheinungsbildes "neu-dunkel" zurueck. So sieht die Leiste auf
   allen fuenf Seiten gleich aus, ohne dass eine Seite die Farbtabelle
   der anderen laden muss.

   DIESE DATEI LIEGT ZWEIMAL im Repo, Byte fuer Byte gleich:
   web/kopfzeile.css und web/start/kopfzeile.css. Grund und Wache sind
   dieselben wie beim Favicon (Vertrag 2e): die Startseite kommt an
   web/ nicht heran, und tests/test_nebenseiten.py vergleicht die zwei
   Dateien. */

.seitenkopf {
  --kopf-grund: var(--leiste, #1c1f24);
  --kopf-schrift: var(--schrift-hell, #ffffff);
  --kopf-matt: var(--schrift-gedaempft, #a3aab4);
  --kopf-akzent: var(--akzent, #4da3ff);

  /* NICHT klebend: auf der Hilfeseite klebt schon die Leiste mit dem
     Suchfeld an derselben Stelle, und zwei klebende Leisten liegen
     uebereinander. Die Kopfzeile scrollt darum mit; wer zurueck will,
     ist mit einem Wisch oder der Pos1-Taste oben. */
  position: relative;
  z-index: 20;
  background: var(--kopf-grund);
  color: var(--kopf-schrift);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.seitenkopf-innen {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px;
}

/* Links: Navigation (z. B. So arbeitest du) */
.seitenkopf-links {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Mitte: das Wortzeichen und der Name, zusammen der Verweis auf Start. */
.seitenkopf-marke {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--kopf-schrift);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.seitenkopf-marke:hover {
  color: var(--kopf-schrift);
  background: rgba(255, 255, 255, .07);
}

.seitenkopf-marke .wortzeichen { display: block; }

.seitenkopf-name {
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--kopf-schrift);
}

/* Rechts: Aktionen (Farbschema-Schalter & Zum CAD) */
.seitenkopf-rechts {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Farbschema-Schalter (Sonne / Kippschalter / Mond) */
.schema-schalter-huelle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
  user-select: none;
}

.schema-symbol {
  flex-shrink: 0;
  display: block;
}

.schema-symbol-sonne {
  color: var(--kopf-matt, #a3aab4);
}

.schema-symbol-mond {
  color: var(--kopf-akzent, #4da3ff);
}

.schema-schalter-taste {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.schema-schalter-taste:focus-visible {
  outline: 2px solid var(--kopf-akzent, #4da3ff);
  outline-offset: 2px;
}

.schema-schalter-gleiter {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--kopf-akzent, #4da3ff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  display: block;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  transform: translateX(20px); /* Vorgabe dunkel: Knopf rechts beim Mond */
}

/* Helles Farbschema "Werkbank" in der Kopfzeile */
html[data-schema="hell"] .seitenkopf {
  --kopf-grund: #f3efe6;
  --kopf-schrift: #17201f;
  --kopf-matt: #55605e;
  --kopf-akzent: #1f5fa8;
  border-bottom: 1.5px solid #17201f;
}

html[data-schema="hell"] .schema-schalter-huelle {
  border: 1.5px solid #17201f;
  background: #fbf9f4;
}

html[data-schema="hell"] .schema-symbol-sonne {
  color: #17201f;
}

html[data-schema="hell"] .schema-symbol-mond {
  color: #55605e;
}

html[data-schema="hell"] .schema-schalter-taste {
  border: 1.5px solid #17201f;
  background: #fbf9f4;
}

html[data-schema="hell"] .schema-schalter-gleiter {
  background: #1f5fa8;
  transform: translateX(0px); /* Hell: Knopf links bei der Sonne */
  box-shadow: 0 1px 2px rgba(23, 32, 31, 0.3);
}

html[data-schema="hell"] .seitenkopf-marke:hover {
  background: rgba(23, 32, 31, 0.06);
}

html[data-schema="hell"] .seitenkopf-punkt {
  color: #17201f;
}

html[data-schema="hell"] .seitenkopf-punkt:hover {
  color: #1f5fa8;
  background: rgba(23, 32, 31, 0.06);
}

html[data-schema="hell"] .seitenkopf-punkt-cta {
  background: #1f5fa8;
  color: #fbf9f4;
  border: 1.5px solid #17201f;
  border-radius: 4px;
  box-shadow: none;
}

html[data-schema="hell"] .seitenkopf-punkt-cta:hover {
  background: #164579;
  color: #fbf9f4;
  border-color: #17201f;
  box-shadow: 2px 2px 0 #17201f;
}

/* Rueckwaertskompatibilitaet falls .seitenkopf-punkte verwendet wird */
.seitenkopf-punkte {
  display: flex;
  align-items: center;
  gap: 4px;
}

.seitenkopf-punkt {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  color: var(--kopf-matt);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.seitenkopf-punkt:hover {
  color: var(--kopf-schrift);
  background: rgba(255, 255, 255, .07);
}

/* Wo der Leser gerade steht. */
.seitenkopf-punkt-hier,
.seitenkopf-punkt-hier:hover {
  color: var(--kopf-schrift);
  box-shadow: inset 0 -2px 0 var(--kopf-akzent);
}

/* Praesenter Aktionsknopf 'Zum CAD' */
.seitenkopf-punkt-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--kopf-akzent);
  color: #06111e;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  padding: 6px 15px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(77, 163, 255, 0.35);
  transition: all 0.15s ease;
}

.seitenkopf-punkt-cta:hover {
  background: #6bb5ff;
  color: #040b14;
  border-color: #6bb5ff;
  box-shadow: 0 3px 14px rgba(77, 163, 255, 0.55);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .seitenkopf-innen {
    padding: 6px 12px;
    gap: 6px;
  }
  .seitenkopf-name {
    font-size: 15px;
  }
  .seitenkopf-punkt {
    padding: 5px 6px;
    font-size: 12px;
  }
  .schema-schalter-huelle {
    padding: 2px 4px;
    gap: 4px;
  }
  .schema-schalter-taste {
    width: 36px;
    height: 20px;
  }
  .schema-schalter-gleiter {
    width: 13px;
    height: 13px;
  }
  .schema-schalter-taste .schema-schalter-gleiter {
    transform: translateX(16px);
  }
  html[data-schema="hell"] .schema-schalter-taste .schema-schalter-gleiter {
    transform: translateX(0px);
  }
  .seitenkopf-punkt-cta {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* ---------- Die Fusszeile ---------- */

.seitenfuss {
  --fuss-matt: var(--schrift-matt, #5f6873);
  margin-top: 40px;
  padding: 18px 20px 26px;
  border-top: 1px solid var(--linie, #dde1e6);
  text-align: center;
  font-size: 12px;
  color: var(--fuss-matt);
}

.seitenfuss-innen { max-width: 1180px; margin: 0 auto; }

.seitenfuss p { margin: 0 0 6px; }

.seitenfuss a { color: var(--fuss-matt); }

.seitenfuss a:hover { color: var(--akzent, #4da3ff); }

.seitenfuss-stand { opacity: .85; }

/* Kopfzeile auf schmalen Bildschirmen (2026-10-01): die Verweise links
   stehen auch in der Fusszeile und fallen hier weg, damit "Zum CAD" nicht
   abgeschnitten wird; Tippziele mindestens rund 40 px. */
@media (max-width: 860px) {
  .seitenkopf-links { display: none; }
  .seitenkopf-innen { grid-template-columns: auto 1fr auto; }
  .seitenkopf-marke { justify-self: start; }
}

@media (max-width: 640px) {
  .schema-symbol { display: none; }
  .schema-schalter-huelle { padding: 6px; border: 0; background: none; }
  .schema-schalter-taste { width: 44px; height: 26px; }
  .schema-schalter-gleiter { width: 18px; height: 18px; }
  .schema-schalter-taste .schema-schalter-gleiter { transform: translateX(18px); }
  html[data-schema="hell"] .schema-schalter-taste .schema-schalter-gleiter { transform: translateX(0px); }
  .seitenkopf-punkt-cta { min-height: 40px; padding: 8px 14px; font-size: 13px; }
  .seitenkopf-punkt-konto { min-height: 40px; padding: 8px 12px !important; font-size: 13px !important; }
  .fuss-liste a { display: inline-block; padding: 9px 0; }
}

/* Start ohne Konten (2026-10-04): Ausprobieren steht anstelle von Konto und
   fuehrt wie Zum CAD auf cad.kriegercad.com. Auf sehr schmalen Bildschirmen
   passen nicht beide neben das Wortzeichen; dort bleibt Zum CAD allein. */
@media (max-width: 480px) {
  .seitenkopf-punkt-konto { display: none !important; }
}
