/* Kopfleiste mit Hauptnavigation – gilt für alle Seiten.
   Erzeugt wird die Leiste von werkzeuge/navigation.py, das Auf- und Zuklappen steuert site/navigation.js.
   Die Leiste ist in Hell und Dunkel gleich dunkel, deshalb stehen die hellen Regionsfarben hier fest. */

.topbar {
  --nav-ink: #E7F4F2;
  --nav-ink-2: #9EC4BF;
  --nav-glow: #62D3C5;
  --r-suedamerika: #62B382;
  --r-mittelamerika: #D0A055;
  --r-asien: #8098D8;
  --r-malawi: #52AFC6;
  --r-tanganjika: #9B90DC;
  --r-victoria: #CC84BC;
  --r-afrika: #C39260;
  --r-ozeanien: #E1798F;
  position: sticky; top: 0; z-index: 50;
  background: rgba(4, 29, 33, .9);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: var(--nav-ink);
}
.topbar-in { display: flex; align-items: center; gap: 12px; height: var(--top-h, 60px); }
.brand {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  text-decoration: none; color: inherit;
}
.brand svg { width: 30px; height: 20px; color: var(--nav-glow); flex: none; }
.brand span { font: 600 1.25rem var(--f-display); letter-spacing: -.01em; white-space: nowrap; }

/* Hauptpunkte */
.hnav-liste { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.hnav-item { position: relative; }
.hnav-top {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 .95rem var(--f-body); color: var(--nav-ink-2);
  background: none; border: 0; cursor: pointer; text-decoration: none;
  padding: 8px 12px; border-radius: 999px;
  transition: color .15s, background-color .15s;
}
.hnav-top:hover, .hnav-top[aria-expanded="true"] { color: var(--nav-ink); background: rgba(255, 255, 255, .08); }
.hnav-top[aria-current], .hnav-item.is-active > .hnav-top {
  color: var(--nav-ink); background: rgba(98, 211, 197, .16); box-shadow: inset 0 0 0 1px rgba(98, 211, 197, .35);
}
.hnav-top svg { width: 10px; height: 10px; transition: transform .2s; }
.hnav-top[aria-expanded="true"] svg { transform: rotate(180deg); }
.hnav-kopf { display: none; }

/* Aufklappmenüs */
.hnav-menu {
  display: none; padding: 6px;
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 270px;
  background: #062A2E; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55);
}
.hnav-top[aria-expanded="true"] ~ .hnav-menu { display: block; animation: hnav-auf .16s ease-out; }
@keyframes hnav-auf { from { opacity: 0; transform: translateY(-4px); } }
/* Das letzte Menü (Ratgeber) rechtsbündig, damit es nicht über den Rand ragt */
.hnav-item:last-child > .hnav-menu { left: auto; right: 0; }
.hnav-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--nav-ink); font-size: .95rem;
}
.hnav-menu a:hover { background: rgba(255, 255, 255, .07); }
.hnav-menu a.is-active, .hnav-menu a[aria-current] { background: rgba(98, 211, 197, .14); }
.hnav-menu a.is-empty { opacity: .45; }
.hnav-gruppe {
  margin: 8px 12px 2px; font-size: .7rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--nav-ink-2);
}
.hnav-gruppe:first-child { margin-top: 4px; }
.hnav-menu .hnav-alle { margin-top: 6px; border-top: 1px solid rgba(255, 255, 255, .08); border-radius: 0 0 9px 9px; color: var(--nav-glow); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 30%, transparent); flex: none; }
.sub-name { flex: 1; }
.sub-count { font: 500 .8rem ui-monospace, "SF Mono", Menlo, monospace; color: var(--nav-ink-2); }

/* Suchen */
.hsuche {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; text-decoration: none; font-size: .9rem; font-weight: 600;
  background: var(--nav-glow); color: #04282B;
}
.hsuche svg { width: 15px; height: 15px; }
.hmenu-btn { display: none; }

/* Pfadzeile über der Seitenüberschrift, z. B. „Afrika · Malawisee › Demasoni“ */
.pfad {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 12px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--nav-glow, #62D3C5);
}
.pfad a { color: inherit; text-decoration: none; }
.pfad a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pfad span[aria-hidden] { color: #9EC4BF; }
.pfad .pfad-hier { color: #9EC4BF; }
.kopf-oben .pfad { margin: 0; }

/* Schmale Bildschirme: ein Knopf „Menü“ öffnet alles untereinander */
@media (max-width: 859px) {
  .topbar-in { gap: 8px; }
  .brand { gap: 8px; }
  .brand svg { width: 26px; height: 17px; }
  .brand span { font-size: 1.05rem; }
  .hmenu-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font: 600 .9rem var(--f-body); color: var(--nav-ink); cursor: pointer;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
    padding: 7px 10px; border-radius: 999px;
  }
  .hmenu-btn svg { width: 16px; height: 16px; }
  .hsuche { padding: 9px; }
  .hsuche span { display: none; }
  .hnav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100dvh - var(--top-h, 60px)); overflow-y: auto; overscroll-behavior: contain;
    background: #052629; border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding: 8px 16px 20px;
  }
  .topbar.is-open .hnav { display: block; animation: hnav-auf .18s ease-out; }
  .hnav-liste { flex-direction: column; gap: 0; }
  .hnav-item { border-bottom: 1px solid rgba(255, 255, 255, .07); padding-block: 8px; }
  .hnav-item:last-child { border-bottom: 0; }
  .hat-menu > .hnav-top { display: none; }
  .hnav-kopf {
    display: block; margin: 0; padding: 6px 12px 2px;
    font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--nav-glow);
  }
  .hnav-menu { display: block; position: static; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; animation: none !important; }
  .hnav-gruppe { margin-top: 10px; }
  .hnav-item > a.hnav-top { display: flex; width: 100%; border-radius: 9px; font-size: 1rem; color: var(--nav-ink); padding: 10px 12px; }
}
@media (max-width: 359px) {
  /* Sehr kleine Handys: Menüknopf nur mit Symbol */
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hmenu-btn { padding: 8px; }
}
@media print {
  .topbar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hnav-menu, .hnav { animation: none !important; }
}
