/*
 * VOMA Child Theme – header.css
 *
 * Enthält: Skip-Link, Header-Wrapper, Logo, Desktop-Navigation,
 * Header-CTA, Mobile-Toggle, Mobile-Navigation.
 *
 * Quellen:
 *   06_Standards/CI/COMPONENTS.md       – Zielwerte Header, Navigation
 *   06_Standards/CI/COLORS.md           – Farbpalette
 *   06_Standards/DEVELOPMENT/CSS-TOKENS.md – Token-Register
 *   06_Standards/QUALITAET/ACCESSIBILITY.md – Skip-Link, Fokus
 *   06_Standards/DEVELOPMENT/BREAKPOINTS.md – Mobile First
 */

/* ============================================================
   SKIP LINK
   Quelle: ACCESSIBILITY.md – erstes Element im Header,
   nur bei Tastatur-Fokus sichtbar, Ziel: #content.

   Nutzt das etablierte "visually hidden until focus"-Muster
   (wie .sr-only in base.css) statt einer negativen top-Position:
   robuster gegenüber dem sticky-Positionierungskontext von
   .voma-header, der bei top:-4rem zu einem dauerhaft sichtbaren
   Skip-Link führte (Befund Staging-Review, 01.07.2026).
   ============================================================ */

.voma-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  z-index: 100;
  background: var(--voma-green);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--voma-radius-btn);
}

.voma-skip-link:focus {
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--voma-space-3) var(--voma-space-4);
  overflow: visible;
  clip: auto;
  white-space: normal;
  position: absolute;
  top: var(--voma-space-3);
  left: var(--voma-space-3);
}

/* ============================================================
   HEADER WRAPPER
   Quelle: COMPONENTS.md – sticky, z-index 40, #ffffff, voma-border
   ============================================================ */

.voma-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: #ffffff;
  border-bottom: var(--voma-border);
}

/* Scroll-Zustand: via JS-Klasse .voma-header--scrolled gesetzt */
.voma-header--scrolled {
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(10px);
}

/* ============================================================
   HEADER INNER
   Max-Width folgt dem Standard-Container, kein verschachtelter
   .container – Header verwaltet seine eigene Breite.
   ============================================================ */

.voma-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--voma-space-4);
  max-width: var(--voma-max);
  margin-inline: auto;
  padding-inline: var(--voma-space-5);
  min-height: 3.75rem;
  padding-block: 0.7rem;
}

/* ============================================================
   LOGO / BRAND
   Quelle: COMPONENTS.md – Logo-Breite 340px (Desktop),
   alt-Text "VOMA Assekuranz – zur Startseite"
   Hinweis: the_custom_logo() erzeugt .custom-logo-link > img.custom-logo.
   ============================================================ */

.voma-header__brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.voma-header__brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.voma-header__brand .custom-logo {
  display: block;
  width: 180px;
  height: auto;
}

/* ============================================================
   DESKTOP NAVIGATION (Mobile First: zunächst versteckt)
   ============================================================ */

.voma-header__nav {
  display: none;
}

/* ============================================================
   HEADER ACTIONS – CTA-Button (Mobile First: versteckt)
   Quelle: COMPONENTS.md – Primary Button, Radius 999px
   ============================================================ */

.voma-header__actions {
  display: none;
  align-items: center;
  flex-shrink: 0;
}

.voma-header__cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  background: var(--voma-green);
  color: #ffffff;
  border: 1px solid var(--voma-green);
  border-radius: var(--voma-radius-pill);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--voma-transition-base),
    border-color var(--voma-transition-base);
}

.voma-header__cta:hover,
.voma-header__cta:focus-visible {
  background: var(--voma-green-dark);
  border-color: var(--voma-green-dark);
  color: #ffffff;
}

/* ============================================================
   MOBILE MENU TOGGLE
   Quelle: COMPONENTS.md – Hamburger-Icon, Textlabel
   ============================================================ */

.voma-header__menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: #1f2933;
  padding: 0.2rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
}

.voma-header__menu-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.voma-header__menu-toggle-icon span {
  display: block;
  width: 1.125rem;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition:
    transform var(--voma-transition-base),
    opacity var(--voma-transition-base);
}

/* Hamburger → X, wenn Menü geöffnet */
.voma-header__menu-toggle[aria-expanded="true"] .voma-header__menu-toggle-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.voma-header__menu-toggle[aria-expanded="true"] .voma-header__menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.voma-header__menu-toggle[aria-expanded="true"] .voma-header__menu-toggle-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ============================================================
   MOBILE NAVIGATION
   ============================================================ */

.voma-mobile-nav {
  display: none;
  border-top: var(--voma-border);
  background: #ffffff;
  padding-block: var(--voma-space-4) var(--voma-space-5);
}

.voma-mobile-nav.is-open {
  display: block;
}

.voma-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--voma-max);
  margin-inline: auto;
  padding-inline: var(--voma-space-5);
  display: grid;
  gap: var(--voma-space-3);
}

.voma-mobile-nav__list a {
  display: block;
  color: #1f2933;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding-block: var(--voma-space-2);
}

.voma-mobile-nav__list a:hover,
.voma-mobile-nav__list a:focus-visible {
  color: var(--voma-green);
}

.voma-mobile-nav__cta {
  max-width: var(--voma-max);
  margin-inline: auto;
  padding-inline: var(--voma-space-5);
  margin-top: var(--voma-space-4);
}

.voma-mobile-nav__cta a {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px var(--voma-space-5);
  background: var(--voma-green);
  color: #ffffff;
  border: 1px solid var(--voma-green);
  border-radius: var(--voma-radius-pill);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background var(--voma-transition-base),
    border-color var(--voma-transition-base);
}

.voma-mobile-nav__cta a:hover,
.voma-mobile-nav__cta a:focus-visible {
  background: var(--voma-green-dark);
  border-color: var(--voma-green-dark);
  color: #ffffff;
}

/* ============================================================
   DESKTOP BREAKPOINT (≥ 64rem / 1024px)
   Quelle: BREAKPOINTS.md, COMPONENTS.md
   ============================================================ */

@media (min-width: 64rem) {
  .voma-header__inner {
    min-height: 4.5rem;
    padding-block: 0.95rem;
  }

  .voma-header__brand .custom-logo {
    width: 340px;
  }

  /* Desktop-Navigation einblenden */
  .voma-header__nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    margin-inline-end: var(--voma-space-4);
  }

  /* Desktop-CTA einblenden */
  .voma-header__actions {
    display: flex;
  }

  /* Mobile-Toggle verstecken */
  .voma-header__menu-toggle {
    display: none;
  }

  /* Mobile-Navigation immer versteckt auf Desktop */
  .voma-mobile-nav,
  .voma-mobile-nav.is-open {
    display: none !important;
  }
}

/* ============================================================
   DESKTOP NAVIGATION – wp_nav_menu() Ausgabe
   Quelle: COMPONENTS.md – Schrift 15px/500, Farbe #575760,
   Hover var(--voma-green), Item-Höhe 46px, Padding 14px,
   Untermenü 220px, BG #ffffff, Text #1f2933
   ============================================================ */

.voma-header__nav .nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.voma-header__nav .nav-menu > li > a {
  display: flex;
  align-items: center;
  height: 46px;
  padding-inline: 14px;
  color: #575760;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--voma-transition-base);
}

.voma-header__nav .nav-menu > li > a:hover,
.voma-header__nav .nav-menu > li.current-menu-item > a,
.voma-header__nav .nav-menu > li.current-page-ancestor > a {
  color: var(--voma-green);
}

/* Untermenü */
.voma-header__nav .nav-menu li {
  position: relative;
}

.voma-header__nav .nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: var(--voma-space-2) 0;
  background: #ffffff;
  border: var(--voma-border);
  border-radius: var(--voma-radius-btn);
  box-shadow: var(--voma-shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition:
    opacity var(--voma-transition-base),
    transform var(--voma-transition-base),
    visibility var(--voma-transition-base);
}

.voma-header__nav .nav-menu li:hover > .sub-menu,
.voma-header__nav .nav-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.voma-header__nav .nav-menu .sub-menu a {
  display: block;
  padding: 10px 14px;
  color: #1f2933;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  transition: color var(--voma-transition-base);
}

.voma-header__nav .nav-menu .sub-menu a:hover {
  color: var(--voma-green);
}
