/* Header positioning */
.site-header {
  position: relative;
  background-color: var(--color-secondary);
  transition: background-color 0.3s ease;
}

.home .site-header {
  position: absolute;
  top: 0;
  left: 0;
  background-color: transparent;
}

/* Homepage: solid background when menu is open */
.home .site-header.menu-open {
  background-color: var(--color-secondary);
}

/* Burger icon */
.burger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 1px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  transform-origin: center;
}

/* Burger to cross animation */
.menu-open .burger-icon span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-open .burger-icon span:nth-child(2) {
  opacity: 0;
}

.menu-open .burger-icon span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: absolute;
  left: 0;
  right: 0;
  background-color: var(--color-secondary);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  z-index: 50;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
}

.mobile-menu.open {
  max-height: 100vh;
  opacity: 1;
}

/* Mobile menu links */
.mobile-menu a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.mobile-menu a:hover {
  color: #fff;
}

.mobile-menu ul a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1.0625rem;
}

.mobile-menu ul .current-menu-item a {
  padding-left: 2.5rem;
}
