/* Kulturbanause Hamburger Menu Implementation */

/* Basis Styling für den Hamburger Button */
.hamburger-icon-container {
  color: var(--color-primary-red) !important;
  height: 44px !important;
  width: 44px !important;
  position: relative !important;
  cursor: pointer !important;
  background: currentColor !important;
  border: 10px solid currentColor !important;
  border-radius: 3px !important;
  z-index: 1001 !important; /* Ensure button stays above mobile menu */
  display: none !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Always show hamburger on mobile */
@media (max-width: 768px) {
  .hamburger-icon-container {
    display: flex !important;
  }
  .main-nav {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background-color: var(--color-background) !important;
    border-bottom: 1px solid var(--color-border) !important;
    padding: var(--space-m) !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1) !important;
    z-index: 999 !important;
  }
  .main-nav.mobile-nav-open {
    display: block !important;
  }
  .main-nav ul {
    flex-direction: column !important;
    gap: var(--space-m) !important;
  }
  .main-nav li {
    width: 100% !important;
  }
  .main-nav a {
    display: block !important;
    padding: var(--space-s) var(--space-xs) !important;
    width: 100% !important;
  }
}

/* Ensure nav is always visible and hamburger hidden above 768px */
@media (min-width: 769px) {
  .main-nav {
    display: block !important;
    position: static !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;
  }
  .hamburger-icon-container {
    display: none !important;
  }
  .main-nav ul {
    flex-direction: row !important;
    gap: var(--space-m) !important;
  }
  .main-nav li {
    width: auto !important;
  }
  .main-nav a {
    display: inline-block !important;
    padding: var(--space-xs) 0 !important;
    width: auto !important;
  }
}

/* Keyboard focus styles */
.hamburger-icon-container:focus {
  outline: 2px solid var(--color-primary-red);
  outline-offset: 2px;
}

.hamburger-icon,
.hamburger-icon:before,
.hamburger-icon:after {
  position: absolute !important;
  height: 3px !important;
  width: 24px !important;
  background: white !important;
  transition: all .2s ease !important;
}

.hamburger-icon {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.hamburger-icon:before,
.hamburger-icon:after {
  content: '' !important;
  left: 0 !important;
}

.hamburger-icon:before {
  top: -8px !important;
  width: 24px !important;
}

.hamburger-icon:after {
  top: 8px !important;
  width: 24px !important;
}

/* Additional specificity to ensure uniform widths */
.hamburger-icon-container .hamburger-icon {
  width: 24px !important;
}

.hamburger-icon-container .hamburger-icon:before,
.hamburger-icon-container .hamburger-icon:after {
  width: 24px !important;
}

/* Darstellung wenn das Close-Icon angezeigt werden soll */
.hamburger-active .hamburger-icon-container {
  color: var(--color-primary-red) !important;
}

.hamburger-active .hamburger-icon {
  background: transparent !important;
}

.hamburger-active .hamburger-icon:before,
.hamburger-active .hamburger-icon:after {
  top: 0 !important;
  background: white !important;
}

.hamburger-active .hamburger-icon:before {
  transform: rotate(45deg) !important;
}

.hamburger-active .hamburger-icon:after {
  transform: rotate(-45deg) !important;
}

/* Mobile Navigation Menu Animation */
/* (REMOVED: @media (max-width: 992px) block that hid .main-nav) */

/* Also apply mobile nav styles when .force-mobile-nav is on body, regardless of width */
.force-mobile-nav .site-header .container {
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    display: flex !important;
}
.force-mobile-nav .main-nav {
    transform: translateY(-20px) scaleY(0.95) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform-origin: top center !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background-color: var(--color-background) !important;
    padding: var(--space-m) !important;
    border-bottom: 1px solid var(--color-border) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1) !important;
    z-index: 999 !important;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
                visibility 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    will-change: transform, opacity, visibility !important;
}
.force-mobile-nav .main-nav.mobile-nav-open {
    transform: translateY(0) scaleY(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}
.force-mobile-nav .main-nav ul {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--space-m) !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.force-mobile-nav .main-nav li {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
    width: 100% !important;
}
.force-mobile-nav .main-nav a {
    display: block !important;
    padding: var(--space-s) var(--space-xs) !important;
    width: 100% !important;
    color: var(--color-text) !important;
    text-decoration: none !important;
    font-weight: bold !important;
    border-radius: 4px !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}
.force-mobile-nav .main-nav a:hover {
    background-color: rgba(var(--color-primary-red-rgb), 0.1) !important;
    color: var(--color-primary-red) !important;
}

/* Desktop: Ensure all mobile styles are reset */
@media (min-width: 993px) {
    .main-nav {
        /* Reset all mobile transforms and positioning */
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        position: static !important;
        background: none !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        transition: none !important;
        will-change: auto !important;
    }

    .main-nav li {
        opacity: 1 !important;
        transform: none !important;
        width: auto !important;
    }

    .main-nav a {
        display: inline-block !important;
        padding: var(--space-xs) 0 !important;
        width: auto !important;
        background: none !important;
    }
}
