/*
  MEDLEARNING – CSS-NAVIGATION: kopfbereich.css

  kb01 – Seitenkopf, Markenbereich und Direktzugriffe
  kb02 – Aufklappbare Hauptnavigation und mobiles Bedienverhalten
  kb03 – Durchgehende Zugriffsleiste auf schmalen Bildschirmen
*/

/* ============================================================
   kb01 – Seitenkopf, Markenbereich und Direktzugriffe
   ============================================================ */

.kb01-kopfbereich {
  /* Schriftgrößen für Hauptaktion und Kontozugriffe sind zentral definiert. */
  --kb01-zugriff-schrift: 13px;
  --kb01-hauptaktion-schrift: 14px;
  --kb01-steuerhoehe: 43px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--bs01-linie);
  /* Gemeinsame, dezente Tiefenwirkung unter dem gesamten Seitenkopf. */
  box-shadow: 0 4px 16px rgba(20, 45, 90, .07);
}

.kb01-kopfbereich-innen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  min-height: 79px;
}

.kb01-marke {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.kb01-logo {
  display: block;
  width: clamp(172px, 18vw, 252px);
  min-width: 0;
}

.kb01-logo img {
  width: 100%;
  height: auto;
}

.kb01-menueknopf {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid #e0e8f3;
  border-radius: 10px;
  color: var(--bs01-blau);
  background: #f3f6fa;
  transition: background-color .18s ease;
}

.kb01-menueknopf:hover, .kb01-menueknopf[aria-expanded="true"] {
  background: #e5edf7;
}

.kb01-menuestriche {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 15px;
}

.kb01-menuestriche i {
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: opacity .18s, transform .18s;
}

.kb01-menueknopf[aria-expanded="true"] i:first-child {
  transform: translateY(6.5px) rotate(45deg);
}

.kb01-menueknopf[aria-expanded="true"] i:nth-child(2) {
  opacity: 0;
}

.kb01-menueknopf[aria-expanded="true"] i:last-child {
  transform: translateY(-6.5px) rotate(-45deg);
}

.kb01-aktuelle-cme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  justify-self: center;
  height: var(--kb01-steuerhoehe);
  padding: 0 20px;
  border: 1.5px solid var(--bs01-rot);
  border-radius: 10px;
  color: #fff;
  background: var(--bs01-rot);
  font-size: var(--kb01-hauptaktion-schrift);
  font-weight: 700;
  line-height: 1.12;
  white-space: nowrap;
  transition: color .18s, background-color .18s;
}

.kb01-aktuelle-cme:hover {
  background: var(--bs01-rot-dunkel);
  border-color: var(--bs01-rot-dunkel);
}

.kb01-schnellzugriff {
  display: flex;
  align-items: stretch;
  justify-self: end;
  min-height: 43px;
  border-radius: 9px;
  background: var(--bs01-blau);
  overflow: hidden;
}

.kb01-schnellzugriff a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  color: #fff;
  font-size: var(--kb01-zugriff-schrift);
  font-weight: 660;
  letter-spacing: .005em;
  border-left: 1px solid #ffffff24;
  white-space: nowrap;
  transition: background-color .18s ease;
}

.kb01-schnellzugriff a:first-child {
  border-left: 0;
}

.kb01-schnellzugriff a:hover {
  background: #354776;
}

.kb01-schnellzugriff .ml-symbol, .kb01-suchknopf .ml-symbol {
  display: block;
  width: 15px;
  height: 15px;
  flex: none;
}

.kb01-suchknopf {
  display: none;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: var(--kb01-steuerhoehe);
  height: var(--kb01-steuerhoehe);
  border: 1px solid var(--bs01-linie);
  border-radius: 10px;
  color: var(--bs01-blau);
  background: #f3f6fa;
  transition: background-color .18s;
}

.kb01-suchknopf:hover {
  background: #e5edf7;
}

.kb01-suchknopf .ml-symbol {
  width: 19px;
  height: 19px;
}

@media (max-width: 900px) {
  .kb01-kopfbereich {
    --kb01-steuerhoehe: 42px;
    --kb01-hauptaktion-schrift: 13px;
    /* Schatten erst unter der vollständigen weißen und blauen Kopfzeile. */
    box-shadow: 0 6px 16px rgba(20, 45, 90, .14);
  }
  .kb01-kopfbereich-innen {
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 72px;
    column-gap: 12px;
  }
  .kb01-marke { grid-column: 1; }
  .kb01-aktuelle-cme { grid-column: 2; justify-self: end; padding-inline: 16px; }
  .kb01-schnellzugriff { display: none; }
  .kb01-suchknopf { display: flex; grid-column: 3; }
  .kb01-logo { width: clamp(160px, 24vw, 220px); }
}

@media (max-width: 620px) {
  .kb01-kopfbereich { --kb01-zugriff-schrift: 11px; --kb01-hauptaktion-schrift: 11px; --kb01-steuerhoehe: 38px; }
  .kb01-kopfbereich-innen { min-height: 66px; column-gap: 9px; }
  .kb01-marke { gap: 7px; }
  .kb01-menueknopf { flex-basis: 38px; width: 38px; height: 38px; }
  .kb01-logo { width: clamp(88px, 27vw, 154px); }
  .kb01-aktuelle-cme { padding-inline: 9px; }
}

@media (max-width: 365px) {
  .kb01-kopfbereich { --kb01-zugriff-schrift: 10px; --kb01-hauptaktion-schrift: 10px; --kb01-steuerhoehe: 35px; }
  .kb01-kopfbereich-innen { column-gap: 6px; }
  .kb01-marke { gap: 4px; }
  .kb01-menueknopf { flex-basis: 35px; width: 35px; height: 35px; }
  .kb01-logo { width: 88px; }
  .kb01-aktuelle-cme { padding-inline: 7px; }
}

/* ============================================================
   kb02 – Aufklappbare Hauptnavigation und mobiles Bedienverhalten
   ============================================================ */

.kb02-hauptmenue {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: min(78vh, 660px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-top: 1px solid #e8edf4;
  box-shadow: 0 20px 42px #17274d26;
}

.kb02-menue-innen {
  padding-block: 24px 30px;
}

.kb02-menue-ueberschrift {
  margin-bottom: 19px;
}

.kb02-menue-ueberschrift h2 {
  margin: 2px 0 0;
  color: var(--bs01-blau);
  font-size: clamp(21px, 2vw, 26px);
}

.kb02-menue-raster {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
}

.kb02-menue-gruppe {
  min-width: 0;
  padding: 0 17px 0 0;
  border-right: 1px solid var(--bs01-linie);
}

.kb02-menue-gruppe:last-child {
  border-right: 0;
}

.kb02-menue-gruppe h3 {
  position: relative;
  margin: 0 0 10px;
  padding-bottom: 12px;
  font-size: 15px;
}

.kb02-menue-gruppe h3::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--bs01-rot);
  content: "";
}

.kb02-menue-gruppe a {
  display: block;
  padding: 9px 8px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 550;
}

.kb02-menue-gruppe a:hover {
  color: var(--bs01-rot);
  background: #edf3fa;
}

@media (max-width: 900px) {
  .kb02-hauptmenue {
    max-height: calc(100dvh - 118px);
  }
  .kb02-menue-offen body {
    overflow: hidden;
  }
  .kb02-menue-raster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .kb02-menue-gruppe:nth-child(even) {
    border-right: 0;
  }
}

@media (max-width: 620px) {
  .kb02-hauptmenue {
    max-height: calc(100dvh - 110px);
  }
  .kb02-menue-raster {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .kb02-menue-gruppe {
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--bs01-linie);
  }
  .kb02-menue-gruppe:last-child {
    border-bottom: 0;
  }
}

/* Aktueller Navigationspunkt im aufklappbaren Menü. */
.kb02-hauptmenue .kb02-aktiv[aria-current="page"] { background: #edf2fa; color: var(--bs01-dunkelblau); border-radius: 7px; font-weight: 750; }

/* ============================================================
   kb03 – Durchgehende Zugriffsleiste auf schmalen Bildschirmen
   ============================================================ */

.kb03-kontoband { display: none; }

@media (max-width: 900px) {
  .kb03-kontoband {
    display: block;
    width: 100%;
    background: var(--bs01-blau);
    color: #fff;
  }
  .kb03-kontoband-innen {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    min-height: 46px;
  }
  .kb03-kontoband a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    padding: 10px 12px;
    font-size: var(--kb01-zugriff-schrift);
    font-weight: 660;
    letter-spacing: .01em;
    transition: background-color .18s ease;
  }
  .kb03-kontoband a + a { border-left: 1px solid #ffffff32; }
  .kb03-kontoband a:hover { background: #354776; }
  .kb03-kontoband a:focus-visible { outline-offset: -3px; }
  .kb03-kontoband .ml-symbol {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

@media (max-width: 620px) {
  .kb03-kontoband-innen { min-height: 44px; }
  .kb03-kontoband a { padding: 9px 6px; gap: 7px; }
  .kb03-kontoband .ml-symbol { width: 15px; height: 15px; }
}
