/* Hamburguer menu*/
.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 20px;
}

.hamburger span {
  display: block;
  height: 3px;
  background: black;
  border-radius: 2px;
  transition: 0.3s;
}

@media screen and (max-width: 450px) {
  .hamburger {
    margin: 10px;
  }

  /* Hide the navigation list by default and position it for slide-down */
  header .navbar ul {
    top: 70px !important;
  }
}

/* Mobile styles */
@media screen and (max-width: 950px) {
  /* Hide the navigation list by default and position it for slide-down */
  header .navbar ul {
    position: absolute;
    top: 90px;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--soft-brown);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    display: flex;
    padding: 0 10px;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }

  /* When the menu is open, set a max-height to reveal the links */
  header .navbar ul.open {
    max-height: 300px;
    z-index: 1;
  }

  header .navbar ul.open li {
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: center;
  }

  header .navbar ul.open li:last-child {
    padding-bottom: 10px;
  }

  header .navbar ul li:last-child {
    padding-bottom: 10px;
  }

  header .navbar ul li {
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: center;
  }

  header .navbar ul.open a {
    width: 100%;
    height: 100%;
    align-self: center;
    padding: 10px 0;
  }

  header .navbar ul.open a:hover {
    background: rgb(247, 217, 204);
  }

  /* Display hamburger icon on mobile */
  .hamburger {
    display: flex;
  }
}

/* Animation to transform hamburger icon into an "X" when open */
.hamburger.open span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}
