/* Gemeinsamer Kopf, Fußzeile und Zeichen. Setzt farben.css voraus.
   Der Kopf ist auf jeder Seite gleich breit (1240 px, Rand 32 px), damit das
   Zeichen beim Seitenwechsel an seiner Stelle bleibt.

   Zwei Fassungen:
   - Website-Seiten: <header class="ap-kopf ap-kopf--blatt"> mit .ap-marke
     (Zeichen und Name) und .ap-nav (Themen, Apps, Über).
     Der Kopf bleibt beim Scrollen oben und trägt die Seitenlinien des Blatts.
   - Apps: <header class="ap-kopf"> mit .ap-pfad (Zeichen / App-Name),
     ohne Navigation, weil die App ihre eigene Werkzeugleiste hat. */

/* ---------- Zeichen ---------- */
.ap-zeichen { display: block; width: 26px; height: 26px; flex: none; }
.ap-zeichen rect { rx: 0; }
.ap-zeichen .z-grund  { fill: var(--zeichen-grund); }
.ap-zeichen .z-vorn   { fill: none; stroke: var(--zeichen-vorn); }
.ap-zeichen .z-vorn-f { fill: var(--zeichen-vorn); }
.ap-zeichen .z-akzent { fill: none; stroke: var(--zeichen-akzent); }
.ap-zeichen .z-akzent-f { fill: var(--zeichen-akzent); }

/* ---------- Kopf ---------- */
.ap-kopf {
  margin: 0;
  background: var(--grund);
  border-bottom: 1px solid var(--linie);
  font-family: var(--schrift);
}
.ap-kopf-innen {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  max-width: var(--ap-kopf-breite, 1240px);
  margin: 0 auto;
  padding: 0 var(--ap-kopf-rand, 32px);
}
.ap-kopf--blatt {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--grund) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.ap-kopf--blatt .ap-kopf-innen {
  border-left: 1px solid var(--linie);
  border-right: 1px solid var(--linie);
}

.ap-marke {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tinte);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
}

.ap-nav { margin-left: auto; display: flex; gap: 4px; }
.ap-nav a {
  position: relative;
  padding: 10px 12px;
  font: 500 15px/1 var(--schrift);
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-still);
}
.ap-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  background: var(--marke);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .16s ease-out;
}
.ap-nav a:hover, .ap-nav a:focus-visible, .ap-nav a[aria-current] { color: var(--tinte); }
.ap-nav a:hover::after, .ap-nav a:focus-visible::after, .ap-nav a[aria-current]::after { transform: scaleX(1); }

/* Pfad der Apps: Zeichen / App-Name */
.ap-pfad { flex: 1; min-width: 0; }
.ap-pfad ol {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}
.ap-pfad li { display: flex; align-items: center; min-width: 0; }
.ap-pfad li + li::before {
  content: "/" / "";
  margin: 0 12px;
  color: var(--linie-stark);
  font-size: 18px;
}
.ap-pfad a { color: var(--text-still); text-decoration: none; }
.ap-pfad a:hover { color: var(--tinte); }
.ap-pfad a[aria-current="page"] { color: var(--tinte); font-weight: 600; }
.ap-pfad li:last-child { overflow: hidden; }
.ap-pfad li:last-child a { overflow: hidden; text-overflow: ellipsis; }

.ap-heim { display: inline-flex; align-items: center; }
.ap-heim-wort {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 14px;
  color: var(--text-still);
  transition: max-width .18s ease-out, opacity .18s ease-out, margin .18s ease-out;
}
.ap-heim:hover .ap-heim-wort,
.ap-heim:focus-visible .ap-heim-wort {
  max-width: 7em;
  margin-left: 10px;
  opacity: 1;
}

.ap-kopf a:focus-visible { outline: 2px solid var(--marke); outline-offset: 4px; }

/* Umschalter für die helle und die dunkle Ansicht. thema.js hängt ihn ans
   Ende von .ap-kopf-innen. */
.ap-thema-knopf {
  appearance: none;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin: 0 0 0 8px;
  padding: 0 11px;
  border: 1px solid var(--linie-stark);
  border-radius: 0;
  background: none;
  color: var(--text-still);
  font: 500 14px/1 var(--schrift);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ap-thema-knopf svg { display: block; width: 15px; height: 15px; }
.ap-thema-knopf:hover, .ap-thema-knopf:focus-visible { color: var(--tinte); border-color: var(--tinte); }
.ap-thema-knopf:focus-visible { outline: 2px solid var(--marke); outline-offset: 2px; }
.ap-pfad + .ap-thema-knopf { margin-left: auto; }
@media (max-width: 720px) {
  .ap-thema-knopf { padding: 0 8px; }
  .ap-thema-knopf span { display: none; }
}
@media print { .ap-thema-knopf { display: none; } }

/* ---------- Fußzeile ---------- */
.ap-fuss {
  max-width: var(--ap-breite, 1240px);
  margin: 56px auto 0;
  padding: 22px var(--ap-rand, 32px) 40px;
  border-top: 1px solid var(--linie-stark);
  font-family: var(--schrift);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-still);
}
.ap-fuss p { margin: 0 0 8px; }
.ap-fuss .satz { display: block; text-wrap: balance; }
.ap-fuss-zeile {
  margin: 0 !important;
  font: 400 13.5px/1.6 var(--schrift);
}
.ap-fuss p + .ap-fuss-zeile { margin-top: 14px !important; }
.ap-fuss a { color: var(--text); }
.ap-fuss a:hover { color: var(--tinte); }
.ap-fuss a:focus-visible { outline: 2px solid var(--marke); outline-offset: 3px; }

@media (max-width: 720px) {
  .ap-kopf-innen { padding: 0 18px; }
  .ap-kopf--blatt .ap-kopf-innen { height: auto; min-height: 52px; flex-wrap: wrap; gap: 0 8px; border: 0; }
  .ap-kopf--blatt .ap-marke span { display: none; }
  .ap-nav { margin-left: auto; gap: 0; }
  .ap-nav a { padding: 10px 7px; font-size: 13.5px; }
  .ap-nav a::after { left: 8px; right: 8px; }
}

@media print {
  .ap-nav { display: none; }
  .ap-kopf--blatt { position: static; }
}

/* ---------- Seitenübergang ----------
   Nur Seiten, die diese Datei einbinden, nehmen teil. Das Zeichen und der
   Seitentitel wandern, der Rest blendet über. Browser ohne Unterstützung
   wechseln die Seite wie bisher. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) {
    animation-duration: .24s;
    animation-timing-function: cubic-bezier(.2, .7, .2, 1);
  }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: .18s; }
}
.vt-zeichen { view-transition-name: ap-zeichen; }

@media (prefers-reduced-motion: reduce) {
  .ap-heim-wort, .ap-nav a::after { transition: none; }
}
