/* ==========================================================================
   Bausteine
   ========================================================================== */

/* --------------------------------------------------------------------------
   Gestaltungselement Balken (CD S. 12) — 32 Grad, eine Kante schraeg,
   mindestens eine Seite im Anschnitt. Der Versatzfaktor 1.6003 = 1/tan(32deg)
   ist die einzige Stelle, an der der Winkel entsteht; alles andere leitet
   sich davon ab. Damit ist der Winkel messbar und kann nicht driften.
   -------------------------------------------------------------------------- */
.balken {
  --balken-h: 3rem;
  height: var(--balken-h);
  background: var(--cd-blau);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--balken-h) * var(--winkel-faktor)) 100%, 0 100%);
}


/* --------------------------------------------------------------------------
   Schaltflaechen — die Alt-Seite hatte Pillen (border-radius 25px). Hier
   traegt die Ecke die Marke: unten rechts im 32-Grad-Winkel angeschnitten.
   -------------------------------------------------------------------------- */
.knopf {
  --ecke: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 3rem;                        /* Touch-Ziel                     */
  padding: 0.8rem 1.5rem;
  border: 0;
  background: var(--cd-blau);
  color: var(--cd-weiss);
  font: inherit;
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(
    0 0, 100% 0,
    100% calc(100% - var(--ecke)),
    calc(100% - var(--ecke) * var(--winkel-faktor)) 100%,
    0 100%);
  transition: background var(--dauer-kurz) var(--ease-aus),
              transform var(--dauer-kurz) var(--ease-aus);
}
.knopf:hover { background: color-mix(in oklab, var(--cd-blau) 84%, #000); }
.knopf:active { transform: translateY(1px); }

/* Die abgeschraegte Ecke entsteht per clip-path — und clip-path beschneidet
   auch die Fokus-Outline, die ausserhalb der Box liegt. Tastaturnutzer saehen
   sonst nicht, wo sie stehen. Der Fokusring wandert deshalb nach INNEN
   (box-shadow inset wird nicht weggeschnitten) und bekommt zusaetzlich einen
   Helligkeitswechsel, damit er auch ohne Farbwahrnehmung auffaellt. */
.knopf:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--cd-weiss), inset 0 0 0 6px var(--grund);
}
.knopf--weiss:focus-visible {
  box-shadow: inset 0 0 0 3px var(--grund), inset 0 0 0 6px var(--cd-weiss);
}
.knopf--offen:focus-visible {
  box-shadow: inset 0 0 0 2px currentColor, inset 0 0 0 5px color-mix(in oklab, currentColor 35%, transparent);
}
.knopf .pfeil { transition: transform var(--dauer-kurz) var(--ease-aus); }
.knopf:hover .pfeil { transform: translateX(4px); }

.knopf--weiss { background: var(--cd-weiss); color: var(--grund); }
.knopf--weiss:hover { background: color-mix(in oklab, var(--cd-weiss) 88%, var(--cd-blau)); }

/* Sekundaerknopf: nur Kontur.
   Ein inset-Schatten folgt der rechteckigen Border-Box — die abgeschraegte
   Ecke schneidet ihn weg, unten rechts blieb die Kontur offen. Der Rahmen
   wird deshalb als eigene Ringflaeche gezeichnet: ein Polygon, das erst die
   Aussenkontur im Uhrzeigersinn umlaeuft und dann die um 2px eingerueckte
   Innenkontur gegen den Uhrzeigersinn. Nach der Nonzero-Regel hebt sich die
   Innenflaeche auf, uebrig bleibt exakt der Rahmen — inklusive Schraege.
   Die Korrekturen 1.11px und 0.57px sind der senkrechte 2px-Versatz der
   32-Grad-Kante, umgerechnet auf ihre Schnittpunkte mit den geraden Kanten. */
.knopf--offen {                            /* sekundaer                      */
  position: relative;
  background: transparent;
  color: currentColor;
  box-shadow: none;
}
.knopf--offen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  pointer-events: none;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--ecke)),
    calc(100% - var(--ecke) * var(--winkel-faktor)) 100%,
    0 100%,
    0 0,
    2px 2px,
    2px calc(100% - 2px),
    calc(100% - var(--ecke) * var(--winkel-faktor) - 0.57px) calc(100% - 2px),
    calc(100% - 2px) calc(100% - var(--ecke) - 1.11px),
    calc(100% - 2px) 2px,
    2px 2px);
}
.knopf--offen:hover { background: color-mix(in oklab, currentColor 12%, transparent); }

/* Textlink mit Pfeil — fuer „weiterlesen"-Ziele */
.weiter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-weight: 600;
  color: var(--cd-blau);
  text-decoration: none;
}
.weiter::after {
  content: "";
  width: 1.35rem; height: 2px;
  background: currentColor;
  transition: width var(--dauer-kurz) var(--ease-aus);
}
.weiter:hover::after { width: 2.25rem; }
.sektion--dunkel .weiter, .sektion--blau .weiter { color: var(--cd-weiss); }

/* --------------------------------------------------------------------------
   Leistungs-Chips
   -------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; list-style: none; }
.chips li {
  margin: 0;
  padding: 0.3rem 0.7rem;
  font-size: var(--step--1);
  line-height: 1.35;
  background: var(--flaeche-2);
  color: var(--ink);
}
.sektion--dunkel .chips li {
  background: color-mix(in oklab, var(--cd-weiss) 12%, transparent);
  color: var(--auf-dunkel);
}

/* --------------------------------------------------------------------------
   Bildwelt: Duotone. Das CD erlaubt „umgefaerbtes Bildmaterial (schwarz auf
   blauem Hintergrund)" (S. 11). Die Fotos sind Schwarzweiss — die Einfaerbung
   bindet Platzhalter und spaetere Shooting-Fotos in eine Bildsprache.
   -------------------------------------------------------------------------- */
/* Das Verfahren der Konzernseite: ein Graustufenbild im Blend-Mode multiply
   ueber einer blauen Flaeche. Helle Bildbereiche nehmen das Blau an, dunkle
   bleiben dunkel — daher die Tiefe. Eine halbtransparente Farbebene daruber
   (unsere frueherer Weg) faerbt zwar auch ein, laesst das Bild aber flach.
   isolation: isolate ist Pflicht: ohne eigenen Stacking-Kontext wuerde
   multiply gegen den Seitenhintergrund rechnen statt gegen das Blau.        */
.bild {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--cd-blau);
}
.bild img { width: 100%; height: 100%; object-fit: cover; }

.bild--duotone img {
  filter: grayscale(1);
  mix-blend-mode: multiply;
}

.bild--duotone-tief::before {              /* Tiefe fuer Text darueber       */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--grund) 44%, transparent) 0%,
    color-mix(in oklab, var(--grund) 22%, transparent) 28%,
    color-mix(in oklab, var(--grund) 52%, transparent) 66%,
    color-mix(in oklab, var(--grund) 74%, transparent) 100%);
  z-index: 2;
  pointer-events: none;
}
.bild--zoom img {
  transition: transform var(--dauer-lang) var(--ease-aus-weich);
  will-change: transform;
}
.bild--zoom:hover img, a:hover .bild--zoom img { transform: scale(1.045); }

/* --------------------------------------------------------------------------
   Bildmarke als Gestaltungsflaeche (CD S. 5: gross im Anschnitt erlaubt,
   auch ohne definierten Schutzraum). Vektor, skaliert verlustfrei.
   -------------------------------------------------------------------------- */
.bogen-flaeche {
  position: absolute;
  pointer-events: none;
  color: rgba(0, 104, 181, 0.22);          /* Fallback ohne color-mix        */
  color: color-mix(in oklab, var(--cd-blau) 22%, transparent);
  z-index: 0;
}

/* --------------------------------------------------------------------------
   Kopfzeile
   -------------------------------------------------------------------------- */
.kopf {
  position: sticky; top: 0;
  z-index: var(--z-sticky);
  background: #ffffff;                     /* Fallback ohne color-mix        */
  background: color-mix(in oklab, var(--cd-weiss) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in oklab, var(--cd-grau) 32%, transparent);
  transition: padding var(--dauer) var(--ease-aus),
              background var(--dauer) var(--ease-aus);
}
.kopf__innen {
  display: flex; align-items: center; gap: var(--s-4);
  /* Schutzraum = 2x Balkenhoehe der Bildmarke. Logo-Hoehe 44px, Bildmarken-
     Balken darin = 44 * (24.34/111.48) = 9.6px -> Schutzraum 19.2px.        */
  padding-block: 1.25rem;
  transition: padding-block var(--dauer) var(--ease-aus);
}
.kopf--kompakt .kopf__innen { padding-block: 0.7rem; }
.kopf__logo { display: block; flex: 0 0 auto; }
.kopf__logo img { height: 44px; width: auto; }
.kopf--kompakt .kopf__logo img { height: 36px; }

.nav { margin-left: auto; }
.nav ul { display: flex; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav a {
  display: inline-flex; align-items: center;
  min-height: 48px;                        /* Touch-Ziel                     */
  padding: 0 0.7rem;
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute; left: 0.7rem; right: 0.7rem; bottom: 0.55rem;
  height: 2px;
  background: var(--cd-blau);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dauer-kurz) var(--ease-aus);
}
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
/* .nav a ist spezifischer als .knopf und wuerde dem Button im Aufklappmenue
   sonst dunkle Schrift auf Blau geben (2,94:1). */
.nav a.knopf { color: var(--cd-weiss); }
.nav a.knopf::after { content: none; }

.kopf .knopf { --ecke: 0.7rem; min-height: 48px; padding: 0.55rem 1.1rem; font-size: var(--step--1); }

/* Menuetaste (mobil) */
.menue-taste {
  display: none;
  width: 48px; height: 48px;
  margin-left: auto;
  border: 0; background: transparent;
  cursor: pointer; color: var(--ink);
}
.menue-taste span, .menue-taste span::before, .menue-taste span::after {
  content: ""; display: block;
  width: 24px; height: 2px;
  background: currentColor;
  transition: transform var(--dauer-kurz) var(--ease-aus),
              opacity var(--dauer-kurz) var(--ease-aus);
}
.menue-taste span { margin-inline: auto; position: relative; }
.menue-taste span::before { position: absolute; top: -7px; }
.menue-taste span::after  { position: absolute; top: 7px; }
.menue-taste[aria-expanded="true"] span { background: transparent; }
.menue-taste[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.menue-taste[aria-expanded="true"] span::after  { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 60rem) {
  .menue-taste { display: block; }
  /* Das Overlay-Panel greift NUR mit JS. Ohne JS gibt es kein hidden-Attribut,
     das es wieder schliesst — dann laege ein weisses Vollbild ueber dem Inhalt.
     Ohne JS fliesst die Navigation stattdessen unter dem Logo mit. */
  html.js .nav {
    position: fixed; inset: auto 0 0 0; top: var(--kopf-h, 76px);
    background: var(--cd-weiss);
    border-top: 1px solid color-mix(in oklab, var(--cd-grau) 32%, transparent);
    padding: var(--s-3) var(--rand) var(--s-6);
    overflow-y: auto;
  }
  html.no-js .menue-taste { display: none; }
  html.no-js .kopf__innen { flex-wrap: wrap; }
  html.no-js .nav { width: 100%; margin-left: 0; }
  html.no-js .nav ul { flex-direction: row; flex-wrap: wrap; gap: 0 var(--s-2); }
  /* inline-flex kann nicht umbrechen: ein langer Menuepunkt liefe damit auf
     schmalen Viewports ueber den Rand. Im Fliess-Modus wird der Link ein
     normales Inline-Element und bricht wie Text um. */
  html.no-js .nav ul { display: block; }
  html.no-js .nav li { display: inline; }
  html.no-js .nav a {
    display: inline;
    width: auto; border-bottom: 0;
    font-size: var(--step--1);
    line-height: 2.6;
    padding-inline: 0 0.9rem;
    overflow-wrap: break-word;
  }
  html.no-js .nav a::after { display: none; }
  .nav { margin-left: 0; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { min-height: 56px; font-size: var(--step-1); border-bottom: 1px solid color-mix(in oklab, var(--cd-grau) 22%, transparent); width: 100%; padding-inline: 0; }
  .nav a::after { left: 0; right: auto; width: 2rem; bottom: 0.8rem; }
  .kopf .knopf { display: none; }
  .nav .knopf { display: inline-flex; margin-top: var(--s-4); width: 100%; justify-content: center; font-size: var(--step-0); }
  html.js .nav[hidden] { display: none; }
}
@media (min-width: 60.01rem) {
  .nav[hidden] { display: block !important; }   /* Desktop: nie versteckt    */
  .nav > .knopf { display: none; }              /* nur im Aufklappmenue      */
  .nav { display: flex; align-items: center; }
}

/* --------------------------------------------------------------------------
   Fusszeile
   -------------------------------------------------------------------------- */
.fuss { background: var(--grund); color: var(--auf-dunkel); padding-block: var(--s-7) var(--s-5); }
.fuss a { color: var(--auf-dunkel-muted); text-decoration: none; }
.fuss a:hover { color: var(--cd-weiss); text-decoration: underline; text-underline-offset: 0.2em; }
.fuss__raster {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.fuss__logo img { height: 52px; width: auto; }
.fuss h3 { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--auf-dunkel-muted); font-weight: 700; margin-bottom: var(--s-3); }
.fuss ul { list-style: none; margin: 0; padding: 0; }
.fuss li { margin-bottom: 0.15rem; }
.fuss li a { display: inline-flex; align-items: center; min-height: 44px; }
.fuss__unten {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4);
  justify-content: space-between; align-items: center;
  margin-top: var(--s-6); padding-top: var(--s-4);
  border-top: 1px solid color-mix(in oklab, var(--cd-weiss) 14%, transparent);
  font-size: var(--step--1); color: var(--auf-dunkel-muted);
}

/* --------------------------------------------------------------------------
   Freigabe-Marker: Bausteine, die auf Kundendaten warten. Sichtbar im
   Prototyp, damit nichts unbemerkt leer bleibt — vor Livegang entfernen
   oder befuellen (siehe FREIGABEN.md im Projektordner).
   -------------------------------------------------------------------------- */
.freigabe {
  border: 2px dashed color-mix(in oklab, var(--cd-blau) 45%, transparent);
  background: color-mix(in oklab, var(--cd-blau) 5%, transparent);
  padding: var(--s-4);
  color: var(--ink-muted);
  font-size: var(--step--1);
}
.freigabe__titel {
  display: block;
  font-weight: 700; color: var(--cd-blau);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.75rem; margin-bottom: var(--s-1);
}
.sektion--dunkel .freigabe { border-color: color-mix(in oklab, var(--blau-hell) 45%, transparent); color: var(--auf-dunkel-muted); }
.sektion--dunkel .freigabe__titel { color: var(--blau-hell); }

/* Kurze Zeilen brauchen weniger Durchschuss als der Fliesstext im Lesetext:
   1,62 stammt vom Body und zerfasert Absaetze unter ~50 Zeichen.            */
.katalog p, .stellen__text p, .schritte p, .fragen p { line-height: 1.55; }
