/* ============================= */
/* Header Layout */
/* ============================= */

.header--classic {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--header-height);
  height: auto;
  z-index: 1000;
  isolation: isolate;
}

.header--classic__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: var(--space-xs) 0;
}

/* ============================= */
/* Logo */
/* ============================= */

.header--classic__logo-img {
  display: block;
  width: 100%;
  max-width: clamp(180px, 20vw, 350px);
  height: auto;
}

/* ============================= */
/* Burger */
/* ============================= */

.header--classic__toggle {
  width: 32px;
  height: 24px;
  position: relative;
  background: none;
  border: none;
  outline: none;
  color: inherit;

}

.header--classic__toggle:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
  border-radius: var(--radius-xs);
}

/* Burger Lines */
.header--classic__toggle-icon {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.header--classic__toggle-icon::before,
.header--classic__toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.header--classic__toggle-icon::before {
  top: -8px;
}
.header--classic__toggle-icon::after {
  top: 8px;
}

.header--classic__toggle[aria-expanded="true"] .header--classic__toggle-icon {
  background: transparent;
}

.header--classic__toggle[aria-expanded="true"]
  .header--classic__toggle-icon::before {
  transform: translateY(8px) rotate(45deg);
}

.header--classic__toggle[aria-expanded="true"]
  .header--classic__toggle-icon::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================= */
/* Mobile Navigation Panel */
/* ============================= */

.header--classic__nav {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: clamp(320px, 70vw, 720px);
  max-width: 90%;
  background: var(--base-ultra-light);
  padding: var(--space-l) var(--space-m);
  transform: translateY(-20px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
  z-index: 9999;
}

.header--classic__nav.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ============================= */
/* Nav List */
/* ============================= */

.header--classic__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.header--classic__nav-item {
  position: relative;
  margin: 0;
}

/* Links + Buttons */
.header--classic__nav-link,
.header--classic__dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}

/*Nur als Beispiel - testweise */
.header--classic__nav-link.is-active {
  text-decoration: none;
  text-underline-offset: 4px;
  font-weight: 500;
}

/* ============================= */
/* Mobile Dropdown */
/* ============================= */

.header--classic__dropdown {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Open state */
.header--classic__nav-item.is-open > .header--classic__dropdown {
  max-height: 500px;
  opacity: 1;
}

/* Second level spacing */
.header--classic__dropdown-link {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.header--classic_dropdown-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.header--classic__nav-item.is-open
  > .header--classic__dropdown-toggle
  .header--classic__dropdown-icon {
  transform: rotate(180deg);
}

/* Header Overlay zum Abdunkeln*/
.header--classic__overlay {
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100vw;
  height: calc(100vh - var(--header-height));
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}

.header--classic.is-open .header--classic__overlay {
  opacity: 1;
  pointer-events: auto;
}

/* ============================= */
/* Desktop */
/* ============================= */

@media (min-width: 768px) {
  /* Hide burger */
  .header--classic__toggle {
    display: none;
  }

  /* Reset mobile panel styles */
  .header--classic__nav {
    position: static;
    width: auto;
    max-width: none;
    background: transparent;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding: 0;
  }

  .header--classic__nav-list {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    width: 100%;
    justify-content: flex-end;
  }

  /* Remove mobile arrow */
  .header--classic__dropdown-icon {
    display: none;
  }

  /* Desktop dropdown */
  .header--classic__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: var(--base-ultra-light);
    z-index: 9999;

    /* RESET mobile animation */
    max-height: none;
    opacity: 0;
    transform: translateY(6px);
    visibility: hidden;
    pointer-events: none;

    transition:
      opacity 0.18s ease-out,
      transform 0.18s ease-out;
  }

  .header--classic__nav-item--has-dropdown:hover > .header--classic__dropdown,
  .header--classic__nav-item--has-dropdown:focus-within
    > .header--classic__dropdown {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
}
