// WordPress custom properties from theme.json
// stylelint-disable custom-property-pattern, csstools/value-no-unknown-custom-properties
// 🍔
.hamburger {
  --hamburger-layer-height: 2px;
  --hamburger-width: 2rem;
  --hamburger-color: var(--wp--preset--color--black);
  --hamburger-color-active: var(--wp--preset--color--white);
  background-color: var(--hamburger-color);
  flex-shrink: 0;
  height: var(--hamburger-layer-height);
  position: relative;
  transition: all .2s ease 0s;
  width: var(--hamburger-width);

  // Hamburger layers
  &::before,
  &::after {
    background-color: var(--hamburger-color);
    content: '';
    display: block;
    height: var(--hamburger-layer-height);
    position: absolute;
    transition: all .2s ease 0s;
    width: var(--hamburger-width);
  }

  &::before {
    top: -0.5625rem;
  }

  &::after {
    bottom: -0.5625rem;
  }
}

// 🍔 third layer width
body:not(.js-nav-active) .nav-toggle .hamburger::after,
body:not(.js-nav-active) .nav-toggle:focus .hamburger::after {
  width: 80%;
}

// 🍔 third layer hover
body:not(.js-nav-active) .nav-toggle:hover .hamburger::after {
  width: 100%;
}

// Active state for 🍔
.js-nav-active .hamburger::before,
.js-nav-active .hamburger::after {
  background-color: var(--hamburger-color-active);
  left: 0;
  top: 0;
}

.js-nav-active .hamburger::before {
  transform: rotate(-45deg);
}

.js-nav-active .hamburger::after {
  transform: rotate(45deg);
}

.js-nav-active .hamburger {
  background-color: transparent;
}

// Create visual label out of aria-label
// .nav-toggle::after {
//   color: var(--wp--preset--color--black);
//   content: attr(aria-label);
//   font-size: var(--wp--preset--font-size--14);
//   font-weight: var(--wp--custom--typography--weight-semibold);
//   margin-left: 1rem;
//   white-space: nowrap;
// }

// The actual toggle <button>
// Uncomment lines if absolute positioning of toggle is needed
.nav-toggle {
  align-items: center;
  background-color: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  font-weight: var(--wp--custom--typography--weight-semibold);
  height: 4rem;
  justify-content: center;
  margin: 0;
  margin-right: -1rem;
  margin-top: -0.5rem;
  opacity: 1;
  overflow: visible;
  padding: 0;
  position: relative;
  right: 0;
  text-decoration: none;
  user-select: none;
  // Bigger area for fingers
  width: 4rem;
  z-index: 99999;
}
