/* ==========================================================
   Navigation – JS-frei, Checkbox-Technik
   ========================================================== */

.site-nav {
  position: relative;
  font-family: 'Source Sans Pro', sans-serif;
}

.nav-toggle-checkbox,
.dropdown-toggle-checkbox {
  display: none;
}

/* ---- Hamburger-Button ---- */
.nav-toggle-label {
  display: none;
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1002;
}
.nav-toggle-label span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #fff;
  left: 0;
  transition: all 0.3s ease;
}
.nav-toggle-label span:nth-child(1) { top: 0; }
.nav-toggle-label span:nth-child(2) { top: 10px; }
.nav-toggle-label span:nth-child(3) { top: 20px; }

/* Hamburger wird zum X, wenn offen */
.nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(2) {
  opacity: 0;
}
.nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* ---- Abgedunkelter Hintergrund (Mobile) ---- */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-toggle-checkbox:checked ~ .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Doppellinie links/rechts (Desktop) ---- */
:root {
  --nav-line-color: rgba(255, 255, 255, 0.35);
}

.nav-bar {
  display: flex;
  align-items: center;
}

.nav-line {
  flex: 1 1 auto;
  height: 4px;
  position: relative;
  border-top: 1px solid var(--nav-line-color);
  border-bottom: 1px solid var(--nav-line-color);
}
.nav-line::before {
  content: '';
  position: absolute;
  top: -6px;
  width: 1px;
  height: 16px;
  background: var(--nav-line-color);
}
.nav-line:first-child::before { left: 0; }
.nav-line:last-child::before { right: 0; }

/* ---- Grundstruktur Top-Ebene ---- */
.nav-main {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5em;
}
.nav-main > li {
  position: relative;
}

.nav-main > li > a,
.nav-main > li > .dropdown-toggle {
  display: block;
  padding: 0.9em 1.3em;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-main > li:hover > a,
.nav-main > li:hover > .dropdown-toggle {
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================
   Desktop (ab 900px) – Dropdown-Karten per Hover
   ========================================================== */
@media (min-width: 900px) {
  .nav-toggle-label,
  .nav-backdrop {
    display: none;
  }

  .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 230px;
    list-style: none;
    margin: 0;
    padding: 0.5em 0;
    z-index: 999;
  }

  .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
  }

  .has-dropdown:hover > .dropdown-menu {
    display: block;
  }

  /* Hover-Brücke über die Lücke */
  .has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 14px;
  }

  .dropdown-menu li {
    border-bottom: 1px solid #eee;
  }
  .dropdown-menu li:last-child {
    border-bottom: none;
  }

  .dropdown-menu a {
    display: block;
    padding: 0.7em 1.3em;
    color: #2c5568;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
  }
  .dropdown-menu a:hover {
    background-color: #2c5568;
    color: #fff;
  }
  .dropdown-menu li:first-child a:hover {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }
  .dropdown-menu li:last-child a:hover {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }

  /* Mitgliedschaft-Flyout */
  .has-flyout {
    position: relative;
  }
  .has-flyout::after {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    width: 10px;
    height: 100%;
  }
  .flyout-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 230px;
    list-style: none;
    margin: 0 0 0 10px;
    padding: 0.5em 0;
    z-index: 1000;
  }
  .flyout-menu li {
    border-bottom: 1px solid #eee;
  }
  .flyout-menu li:last-child {
    border-bottom: none;
  }
  .flyout-menu a {
    display: block;
    padding: 0.7em 1.3em;
    color: #2c5568;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
  }
  .flyout-menu a:hover {
    background-color: #2c5568;
    color: #fff;
  }
  .has-flyout:hover > .flyout-menu {
    display: block;
  }
}

/* ==========================================================
   Mobile (unter 900px) – Slide-in-Panel von links
   ========================================================== */
@media (max-width: 899px) {
  .nav-line {
    display: none;
  }

  .nav-toggle-label {
    display: block;
    position: fixed;
    top: 1em;
    left: 1em;
  }

  .nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    background: #2c5568;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding-top: 4.5em;
    display: block;
  }
  .nav-toggle-checkbox:checked ~ .nav-bar {
    transform: translateX(0); 
  }

  .nav-main {
    display: block;
    gap: 0;
  }
  .nav-main > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .nav-main > li > a,
  .nav-main > li > .dropdown-toggle {
    border-radius: 0;
    position: relative;
		text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  }
  .nav-main > li:hover > a,
  .nav-main > li:hover > .dropdown-toggle {
    background: none;
    border-color: transparent;
		text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  }

  .has-dropdown > .dropdown-toggle::after {
    content: '▾';
    position: absolute;
    right: 1.3em;
    transition: transform 0.25s ease;
  }
  .dropdown-toggle-checkbox:checked ~ .dropdown-toggle::after {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
  }
  .dropdown-toggle-checkbox:checked ~ .dropdown-menu {
    max-height: 400px;
  }
  .dropdown-menu a {
    display: block;
    padding: 0.8em 1.3em 0.8em 2.2em;
    color: #e8edf0;
    text-decoration: none;
    font-weight: 700;
  }
  .dropdown-menu a:active {
    background: rgba(255, 255, 255, 0.1);
  }

  /* Mitgliedschaft-Flyout auf Mobile weggelassen */
  .flyout-menu {
    display: none !important;
  }
}