/* WFO Theme – Farben aus dem Logo */
:root {
  --wfo-blue-light: #4a9fd4;
  --wfo-blue: #1a6cb5;
  --wfo-blue-dark: #0d3d6b;
  --wfo-green: #3d9e4f;
  --wfo-green-dark: #2a7a38;
  --wfo-terracotta: #b85c38;
  --wfo-gold: #c9a227;
  --wfo-white: #ffffff;
  --wfo-gray-50: #f5f8fb;
  --wfo-gray-100: #e8eef4;
  --wfo-gray-600: #5a6b7d;
  --wfo-gray-800: #2d3748;
  --wfo-font-sans: "Montserrat", system-ui, sans-serif;
  --wfo-font-serif: "Lora", Georgia, serif;
  --wfo-radius: 8px;
  --wfo-shadow: 0 4px 24px rgba(13, 61, 107, 0.1);
  --wfo-max-width: 1100px;
  /* Header: Höhe & Logo stufenlos (--scroll-p auf html, 0 = Start, 1 = kompakt) */
  --scroll-p: 0;
  --wfo-header-h-max: 165px;
  --wfo-header-h-min: 68px;
  --wfo-header-logo-gap: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--wfo-font-serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--wfo-gray-800);
  background: var(--wfo-white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--wfo-font-sans);
  color: var(--wfo-blue-dark);
  line-height: 1.25;
  margin-top: 0;
}

a {
  color: var(--wfo-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--wfo-green-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* Platz im Dokument (gleiche Höhe wie fixierter Header) */
.wfo-header-spacer {
  height: calc(
    var(--wfo-header-h-min) + (var(--wfo-header-h-max) - var(--wfo-header-h-min)) * (1 - var(--scroll-p))
  );
  pointer-events: none;
}

/* Header fixiert – Höhe & Logo schrumpfen stufenlos, Logo bleibt in der Leiste */
.wfo-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(
    var(--wfo-header-h-min) + (var(--wfo-header-h-max) - var(--wfo-header-h-min)) * (1 - var(--scroll-p))
  );
  background: var(--wfo-white);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--wfo-green), var(--wfo-blue), var(--wfo-gold)) 1;
  box-shadow: 0 calc(2px + 2px * (1 - var(--scroll-p))) calc(8px + 16px * (1 - var(--scroll-p))) rgba(13, 61, 107, calc(0.08 + 0.06 * (1 - var(--scroll-p))));
  overflow: visible;
}

.wfo-header__inner {
  max-width: var(--wfo-max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

/* Logo links – Höhe immer kleiner als die Headbar */
.wfo-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 100%;
  max-height: 100%;
  max-width: min(200px, 30vw);
  flex: 0 0 auto;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  line-height: 0;
}

.wfo-brand__logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
}

.wfo-brand .wfo-logo-img,
.wfo-brand img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: calc(
    (var(--wfo-header-h-min) + (var(--wfo-header-h-max) - var(--wfo-header-h-min)) * (1 - var(--scroll-p)))
    - var(--wfo-header-logo-gap)
  ) !important;
  object-fit: contain;
  object-position: left center;
}

/* Navbar rechts, vertikal mittig */
.wfo-nav-toggle {
  display: none;
  flex-shrink: 0;
  margin-left: auto;
  background: var(--wfo-blue);
  color: var(--wfo-white);
  border: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--wfo-radius);
  cursor: pointer;
  font-family: var(--wfo-font-sans);
  font-weight: 600;
  font-size: 0.875rem;
}

.wfo-nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 10rem;
  overflow: visible;
  z-index: 2;
}

.wfo-nav > ul,
.wfo-nav ul.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.wfo-nav li {
  margin: 0;
}

.wfo-nav a {
  font-family: var(--wfo-font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--wfo-blue-dark);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  display: block;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.wfo-nav a:hover {
  background: var(--wfo-gray-50);
  color: var(--wfo-blue);
}

.wfo-nav .current-menu-item > a,
.wfo-nav .current_page_item > a {
  background: var(--wfo-blue);
  color: var(--wfo-white);
}

.wfo-nav .current-menu-item > a:hover,
.wfo-nav .current_page_item > a:hover {
  background: var(--wfo-blue-dark);
  color: var(--wfo-white);
}

/* Archiv-Link dezent absetzen */
.wfo-nav .menu-item a[href*="/archiv"] {
  color: var(--wfo-gray-600);
  font-weight: 500;
}

.wfo-nav .menu-item.current-menu-item a[href*="/archiv"],
.wfo-nav .menu-item.current_page_item a[href*="/archiv"] {
  color: var(--wfo-white);
}

.wfo-nav .sub-menu {
  display: none;
}

/* Hero */
.wfo-hero {
  background: linear-gradient(135deg, var(--wfo-blue-dark) 0%, var(--wfo-blue) 55%, var(--wfo-green) 100%);
  color: var(--wfo-white);
  padding: 3.5rem 1.25rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.wfo-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--wfo-green), var(--wfo-blue-light), var(--wfo-gold));
}

.wfo-hero h1 {
  color: var(--wfo-white);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.wfo-hero p {
  font-size: 1.15rem;
  max-width: 42rem;
  margin: 0 auto 1.5rem;
  opacity: 0.95;
}

.wfo-hero__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-family: var(--wfo-font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.wfo-btn {
  display: inline-block;
  font-family: var(--wfo-font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--wfo-radius);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.wfo-btn--primary {
  background: var(--wfo-white);
  color: var(--wfo-blue-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.wfo-btn--primary:hover {
  transform: translateY(-2px);
  color: var(--wfo-blue-dark);
}

.wfo-btn--secondary {
  background: transparent;
  color: var(--wfo-white);
  border: 2px solid var(--wfo-white);
  margin-left: 0.5rem;
}

.wfo-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--wfo-white);
}

/* Layout */
.wfo-main {
  max-width: var(--wfo-max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.wfo-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--wfo-green);
}

.wfo-page-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.25rem;
}

/* Cards / Schwerpunkte */
.wfo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.wfo-card {
  background: var(--wfo-gray-50);
  border-radius: var(--wfo-radius);
  padding: 1.5rem;
  border-left: 4px solid var(--wfo-green);
  box-shadow: var(--wfo-shadow);
}

.wfo-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--wfo-blue);
}

.wfo-card p {
  margin: 0;
  font-size: 0.98rem;
}

/* Sections */
.wfo-section {
  margin: 2.5rem 0;
}

.wfo-section--alt {
  background: var(--wfo-gray-50);
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  padding: 2rem 1.25rem;
  border-radius: var(--wfo-radius);
}

.wfo-divider {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, var(--wfo-green), var(--wfo-blue), var(--wfo-gold));
  margin: 2.5rem 0;
  opacity: 0.6;
}

/* Archive notice */
.wfo-archive-notice {
  background: #fff8e6;
  border: 1px solid var(--wfo-gold);
  border-radius: var(--wfo-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

body.wfo-is-archive-page .wfo-main {
  border-top: 4px solid var(--wfo-gold);
}

/* Archive index */
.wfo-archive-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}

.wfo-archive-list a {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--wfo-gray-50);
  border-radius: var(--wfo-radius);
  font-family: var(--wfo-font-sans);
  font-weight: 600;
  text-decoration: none;
  color: var(--wfo-blue-dark);
  border-left: 4px solid var(--wfo-blue);
}

.wfo-archive-list a:hover {
  background: var(--wfo-gray-100);
  border-left-color: var(--wfo-green);
}

/* Contact */
.wfo-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.wfo-contact-card {
  background: var(--wfo-gray-50);
  padding: 1.25rem;
  border-radius: var(--wfo-radius);
}

.wfo-contact-card h3 {
  font-size: 1rem;
  color: var(--wfo-green-dark);
}

/* Footer */
.wfo-footer {
  background: var(--wfo-blue-dark);
  color: rgba(255, 255, 255, 0.9);
  padding: 2.5rem 1.25rem 1.5rem;
  margin-top: 3rem;
}

.wfo-footer__inner {
  max-width: var(--wfo-max-width);
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

.wfo-footer a {
  color: rgba(255, 255, 255, 0.95);
}

.wfo-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.875rem;
  text-align: center;
  opacity: 0.85;
}

.wfo-footer .wfo-nav ul {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.wfo-footer .wfo-nav a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
}

/* Content typography */
.wfo-content ul {
  padding-left: 1.25rem;
}

.wfo-content li {
  margin-bottom: 0.5rem;
}

/* Desktop: Navigation immer sichtbar */
@media (min-width: 992px) {
  .wfo-nav-toggle {
    display: none !important;
  }

  .wfo-nav {
    display: flex !important;
    position: static;
    flex: 1 1 auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
  }
}

/* Mobile / Tablet */
@media (max-width: 991px) {
  :root {
    --wfo-header-h-max: 140px;
    --wfo-header-h-min: 60px;
    --wfo-header-logo-gap: 16px;
  }

  .wfo-nav-toggle {
    display: block;
  }

  .wfo-header {
    position: fixed;
  }

  .wfo-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex: none;
    background: var(--wfo-white);
    padding: 0.75rem 1rem 1rem;
    box-shadow: var(--wfo-shadow);
    border-top: 1px solid var(--wfo-gray-100);
    z-index: 101;
  }

  .wfo-nav.is-open {
    display: block;
  }

  .wfo-nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .wfo-nav a {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
  }

  .wfo-header__inner {
    flex-wrap: wrap;
    position: relative;
  }

  .wfo-btn--secondary {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}
