/* ============================================================================
   kopf.css — die Kopfleiste der statischen Werkzeug-Seiten.

   Ziel: Die Leiste ist optisch DECKUNGSGLEICH mit dem React-Kopf der Startseite
   (`src/components/Layout.tsx` + `Layout.css`). Weil die statischen Seiten das
   gebündelte React-CSS nicht laden können, sind die nötigen Regeln hier 1:1
   nachgezogen — dieselben Klassen (`.be-header…`), dieselben Werte.

   Die Farb-/Schrift-/Maß-Tokens sind aus `src/styles/theme.css` (Vorgabe-Theme
   „notfalltresor") übernommen und bewusst auf `.be-ribbon, .be-header`
   GESCHACHTELT — nicht auf `:root`. So fasst diese Datei die globalen Variablen
   der Werkzeug-Seite (styles.css: `--navy`, `--paper` …) nicht an, und der
   pixelgleiche Body der Tools bleibt unberührt. Die Namen (`--color-*`) sind
   ohnehin andere als die von styles.css — doppelte Sicherheit.

   Hinweis: Diese Datei liegt in public/ und wird vom Token-Lint (nur src/) nicht
   gelesen; die Hex-Werte hier sind Absicht und die einzige zulässige Kopie.
   ============================================================================ */

.be-ribbon,
.be-header {
  /* FARBEN */
  --color-bg: #faf7f0;
  --color-surface: #ffffff;
  --color-navy: #0f1e3d;
  --color-blue: #2563eb;
  --color-gold: #b8862f;
  --color-text: #1a2233;
  --color-text-muted: #5a6472;
  --color-border: #e4ddd0;
  --color-surface-alt: #f4efe4;
  --color-blue-strong: #1d4ed8;
  --color-blue-soft: #eef3fe;
  --color-gold-ink: #7d5c1f;
  --color-on-dark: #ffffff;

  /* TYPO */
  --font-serif: 'Fraunces', 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --fs-body: 1.05rem;
  --fs-small: 0.9rem;
  --fs-tiny: 0.78rem;
  --fw-medium: 500;

  /* MASSE */
  --space-unit: 8px;
  --space-1: calc(var(--space-unit) * 1);
  --space-2: calc(var(--space-unit) * 2);
  --space-3: calc(var(--space-unit) * 3);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-lift: 0 14px 44px rgba(15, 30, 61, 0.14);
  --container-max: 1200px;

  /* BEWEGUNG */
  --motion-fast: 120ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Das Signature-Element. */
  --ribbon: linear-gradient(90deg, var(--color-blue), var(--color-gold));
  --seal-ring: var(--color-gold);
}

@media (prefers-reduced-motion: reduce) {
  .be-ribbon,
  .be-header {
    --motion-fast: 0ms;
  }
}

.be-header *,
.be-header *::before,
.be-header *::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Layout-Bausteine (aus primitives.css)
   -------------------------------------------------------------------------- */
.be-header .be-container {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--space-3);
}
.be-header .be-container--normal {
  max-width: var(--container-max);
}

/* --------------------------------------------------------------------------
   Ribbon — Blau → Gold, das schmale Band über dem Kopf
   -------------------------------------------------------------------------- */
.be-ribbon {
  background: var(--ribbon);
  width: 100%;
  height: 4px;
}

/* --------------------------------------------------------------------------
   Siegel
   -------------------------------------------------------------------------- */
.be-seal {
  color: var(--seal-ring);
  flex: none;
}

/* --------------------------------------------------------------------------
   Knopf (nur die im Kopf genutzte Primär-Variante in klein)
   -------------------------------------------------------------------------- */
.be-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--motion-fast) var(--ease),
    color var(--motion-fast) var(--ease),
    transform var(--motion-fast) var(--ease);
}
.be-btn--sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-small);
}
.be-btn--primary {
  background: var(--color-blue);
  color: var(--color-surface);
}
.be-btn--primary:hover {
  background: var(--color-blue-strong);
  color: var(--color-surface);
}

/* --------------------------------------------------------------------------
   Kopf
   -------------------------------------------------------------------------- */
.be-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-sans);
}

.be-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: calc(var(--space-unit) * 9);
}

.be-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  flex: none;
}

.be-header__name {
  font-family: var(--font-serif);
  font-size: calc(var(--fs-body) * 1.15);
  color: var(--color-navy);
  white-space: nowrap;
}

.be-header__name-akzent {
  color: var(--color-gold-ink);
}

.be-header__nav {
  display: flex;
  gap: var(--space-1);
  margin-inline-start: auto;
}

.be-header__gruppe {
  position: relative;
}

.be-header__gruppe-knopf {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--color-text);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.be-header__gruppe-knopf:hover {
  background: var(--color-surface-alt);
}

/* Das Mega-Menü. React mountet es nur im offenen Zustand; hier steht es immer im
   DOM und wird per Hover / Fokus / Klick sichtbar gemacht. */
.be-header__mega {
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  min-width: calc(var(--space-unit) * 40);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  padding: var(--space-1);
  display: none;
  flex-direction: column;
  z-index: 60;
}

.be-header__gruppe:hover .be-header__mega,
.be-header__gruppe:focus-within .be-header__mega,
.be-header__gruppe.offen .be-header__mega {
  display: flex;
}

.be-header__mega a {
  display: block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.be-header__mega a:hover {
  background: var(--color-blue-soft);
}
.be-header__mega .t {
  display: block;
  color: var(--color-navy);
  font-weight: var(--fw-medium);
}
.be-header__mega .m {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--fs-tiny);
}

.be-header__aktionen {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}

.be-header__bestatter {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}

.be-header__bestatter:hover {
  color: var(--color-navy);
  background: var(--color-surface-alt);
}

.be-header__burger {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-navy);
  font-size: calc(var(--fs-body) * 1.4);
  line-height: 1;
  padding: 0 var(--space-1);
  cursor: pointer;
}

.be-header__mobil {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-2);
  background: var(--color-surface);
}

.be-header__mobil-gruppe + .be-header__mobil-gruppe {
  margin-top: var(--space-1);
}

.be-header__mobil-titel {
  font-size: var(--fs-tiny);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold-ink);
  margin-top: var(--space-2);
}

.be-header__mobil a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-navy);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Mobil
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .be-header__nav {
    display: none;
  }
  .be-header__burger {
    display: block;
  }
  .be-header__aktionen {
    margin-inline-start: auto;
  }
}

@media (max-width: 560px) {
  .be-header__name {
    display: none;
  }
  .be-header__bestatter {
    display: none;
  }
}
