/* ==========================================================================
   WorkZen Child Theme — Header & Footer CSS
   CI: Petrol #255959 | Schwarz #252525 | Montserrat
   Scoped mit .wz-nav / .wz-footer um Konflikte mit Elementor zu vermeiden
   ========================================================================== */

:root {
  --wz-bg:           #252525;
  --wz-petrol:       #255959;
  --wz-petrol-light: #76A89A;
  --wz-petrol-dark:  #1E4A4A;
  --wz-light:        #CEDFDA;
  --wz-line:         #E6E8E7;
  --wz-font:         'Montserrat', system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

/* ---- Basis-Reset nur für unsere Elemente ---- */
.wz-nav *,
.wz-footer * {
  box-sizing: border-box;
}
.wz-nav a,
.wz-footer a {
  text-decoration: none;
  color: inherit;
}
.wz-nav ul,
.wz-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.wz-nav {
  background: var(--wz-bg);
  position: sticky;
  top: 0;
  z-index: 9999;          /* über Elementor-Inhalten */
  font-family: var(--wz-font);
}

/* WordPress-Admin-Bar ist selbst position:fixed; top:0 mit sehr hohem z-index
   und schiebt sich sonst beim Scrollen vor die Sticky-Nav. Nur für eingeloggte
   Nutzer relevant (Body-Klasse "admin-bar" kommt automatisch von WP). */
body.admin-bar .wz-nav {
  top: 32px; /* Standard-Höhe der Admin-Bar */
}

@media screen and (max-width: 782px) {
  body.admin-bar .wz-nav {
    top: 46px; /* Admin-Bar ist ab 782px Breite höher */
  }
}

@media screen and (max-width: 600px) {
  body.admin-bar .wz-nav {
    top: 0; /* Admin-Bar scrollt hier selbst mit weg, kein Offset nötig */
  }
}

.wz-nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 96px;
  width: 100%;
  max-width: 1512px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ---- Logo / Brand ---- */
.wz-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wz-nav__logo, .custom-logo {
  width: 90px;
  height: auto;
  position: relative;
  flex: 0 0 auto;
}
.wz-nav__logo::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--wz-petrol-light);
}

.wz-nav__wordmark {
  color: #fff;
  font-weight: 500;
  letter-spacing: 3px;
  font-size: 16px;
  font-family: var(--wz-font);
}

/* ---- Navigations-Links ---- */
.wz-nav__links {
  display: flex;
  gap: 28px;
  margin-left: 28px;
  list-style: none;
}
.wz-nav__links a {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 8px;
  font-family: var(--wz-font);
  transition: color 0.15s ease;
}
.wz-nav__links a:hover {
  color: #fff;
}
.wz-nav__links a.current-menu-item,
.wz-nav__links a.is-active {
  color: #fff;
  border-bottom: 2.5px solid var(--wz-petrol-light);
}

/* ---- Caret (Dropdown-Pfeil) ---- */
.wz-caret {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--wz-petrol-light);
  border-bottom: 2px solid var(--wz-petrol-light);
  transform: rotate(45deg) translateY(-2px);
  margin-left: 4px;
}

/* ---- Rechte Aktionen ---- */
.wz-nav__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Suche */
.wz-nav__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 7px 12px;
}
.wz-nav__search-icon {
  width: 13px;
  height: 13px;
  border: 1.8px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.wz-nav__search-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 5px;
  height: 1.8px;
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(45deg);
}
.wz-nav__search input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12px;
  width: 210px;
  font-family: var(--wz-font);
}
.wz-nav__search input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* CTA-Button */
.wz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--wz-font);
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.12s ease;
  text-decoration: none;
}
.wz-btn:hover {
  opacity: 0.88;
}
.wz-btn--primary {
  background: var(--wz-petrol);
  color: #fff;
}

/* Kalender-Icon */
.wz-ico-calendar {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1.6px solid currentColor;
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
}
.wz-ico-calendar::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 3px;
  right: 3px;
  height: 3px;
  border-left: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
}
.wz-ico-calendar::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 1px;
  right: 1px;
  height: 1.6px;
  background: currentColor;
}

/* ---- Burger (Mobile) ---- */
.wz-nav__burger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.wz-nav__burger span {
  width: 22px;
  height: 2px;
  background: #fff;
  display: block;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Burger offen */
.wz-nav__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.wz-nav__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.wz-nav__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.wz-footer {
  background: var(--wz-bg);
  color: #fff;
  font-family: var(--wz-font);
}

.wz-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1512px;
  margin: 0 auto;
  padding: 50px 40px 30px;
}

/* ---- Brand-Spalte ---- */
.wz-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wz-footer__brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wz-footer__logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--wz-light);
  position: relative;
  flex-shrink: 0;
}
.wz-footer__logo::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--wz-petrol-light);
}
.wz-footer__tagline {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

/* ---- Link-Spalten ---- */
.wz-footer__col h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 14px;
  color: #fff;
  font-family: var(--wz-font);
}
.wz-footer__col a,
.wz-footer__col span {
  display: block;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  margin-bottom: 12px;
  font-family: var(--wz-font);
  transition: color 0.15s ease;
}
.wz-footer__col a:hover {
  color: #fff;
}

/* ---- Footer Bottom ---- */
.wz-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1512px;
  margin: 0 auto;
  padding: 16px 40px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.wz-footer__bottom span {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-family: var(--wz-font);
}
.wz-footer__bottom a {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-family: var(--wz-font);
  text-decoration: none;
}
.wz-footer__bottom a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .wz-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .wz-nav__inner {
    padding: 0 20px;
    height: 74px;
  }
  .wz-nav__links,
  .wz-nav__search {
    display: none;
  }
  .wz-nav__burger {
    display: flex;
  }
  .wz-nav__actions {
    display: none;  /* CTA im Mobile-Menü sichtbar */
  }

  /* Mobile-Menü aufgeklappt */
  .wz-nav__links--open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wz-bg);
    padding: 8px 0 40px;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    z-index: 9998;
  }

  /* Alle direkten Links (Top-Level ohne Kinder) */
  .wz-nav__links--open > a,
  .wz-nav__links--open .wzmm-link {
    display: block;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: normal;
  }
  .wz-nav__links--open > a:hover,
  .wz-nav__links--open .wzmm-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.04);
  }

  /* Top-Level-Item mit Caret — Zeile mit Button */
  .wz-nav__links--open .wz-nav__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .wz-nav__links--open .wz-nav__item .wzmm-link {
    flex: 1;
    border-bottom: none; /* Trennlinie kommt vom li */
    padding: 14px 20px;
  }
  .wz-nav__links--open .wzmm-caret-btn {
    padding: 14px 20px !important;
    margin-left: 0 !important;
    color: rgba(255, 255, 255, 0.5);
  }

  /* Burger-Button — X ohne Hintergrund */
  .wz-nav__burger {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
  }

  .wz-footer__inner {
    grid-template-columns: 1fr;
    padding: 40px 20px 24px;
    gap: 28px;
  }
  .wz-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 20px 24px;
  }
}

/* Focus-Styles (Barrierefreiheit) */
.wz-nav a:focus-visible,
.wz-footer a:focus-visible,
.wz-btn:focus-visible,
.wzmm-caret-btn:focus-visible,
.wz-nav__burger:focus-visible {
  outline: 2px solid var(--wz-petrol-light);
  outline-offset: 2px;
}

/* ==========================================================================
   FIXES (v1.1)
   ========================================================================== */

/* Nav-Links nie umbrechen */
.wz-nav__links a {
  white-space: nowrap;
}

/* Suche: Form ist jetzt funktional — nur Submit-Button ausblenden,
   das Absenden läuft über Enter im Input-Feld */
.wz-nav__search input[type="submit"],
.wz-nav__search button[type="submit"] {
  display: none;
}
/* Form selbst kein eigenes Layout aufzwingen */
.wz-nav__search form {
  display: contents;
}
.wz-nav__search input[type="search"] {
  display: block;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12px;
  width: 210px;
  font-family: var(--wz-font);
}
.wz-nav__search input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* Termin-Button: Mindestbreite damit Text nicht umbricht */
.wz-btn.wz-btn--primary {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   FIXES (v1.2)
   ========================================================================== */

/* Suchfeld: Icon + Input vertikal mittig ausgerichtet */
.wz-nav__search {
  align-items: center;   /* bereits gesetzt, sicherstellen */
}
.wz-nav__search-icon {
  align-self: center;
  flex-shrink: 0;
  position: relative;
  top: 0;                /* kein vertikaler Versatz */
}
.wz-nav__search input,
.wz-nav__search input[type="search"] {
  line-height: 1;
  padding: 0;
  margin: 0;
  vertical-align: middle;
}

/* Button Textfarbe explizit #ffffff */
.wz-btn--primary,
.wz-btn.wz-btn--primary {
  color: #ffffff !important;
}

/* ==========================================================================
   FIXES (v1.3)
   ========================================================================== */

/* Logo: unabhängig von der hochgeladenen Datei nie höher als die Nav-Leiste
   werden lassen — vorher führte width:90px + height:auto bei einem eher
   quadratischen Logo zu Überlauf/Abschneiden beim Sticky-Scrollen. */
.wz-nav__brand img,
.wz-nav__brand .custom-logo {
  width: auto;
  height: auto;
  max-height: 72px;
  display: block;
}

@media (max-width: 720px) {
  .wz-nav__brand img,
  .wz-nav__brand .custom-logo {
    max-height: 56px;
  }
}