/* CSS Document */
.toggle,
.menu-toggle,
[id^='drop'] {
  display: none;
}

/* Giving a background-color to the nav container. */
nav {
  margin: 0;
  padding: 0;
  background-color: var(--dark-background);
  position: sticky;
  top: 0;
  font-size: 1rem;
}

/* Since we'll have the "ul li" "float:left"
 * we need to add a clear after the container. */

nav:after {
  content: '';
  display: table;
  clear: both;
}

/* Removing padding, margin and "list-style" from the "ul",
 * and adding "position:reltive" */
nav ul {
  /* float: right; */
  display: flex;
  justify-content: center;
  list-style: none;
  position: relative;
}
.menu li a {
  color: var(--light-text-color);
}

/* Positioning the navigation items inline */
nav ul li {
  margin: 0px;
  /* display: inline-block; */
  background-color: var(--dark-background);
}

/* Styling the links */
nav a {
  display: block;
  padding: 1rem 1.2rem;

  text-decoration: none;
}

/* Background color change on Hover */
nav a:hover {
  background-color: var(--dark-gray);
}

/* Hide Dropdowns by Default
 * and giving it a position of absolute */
nav ul ul {
  display: none;
  position: absolute;
  /* has to be the same number as the "line-height" of "nav a" */
  /* top: 57px; */
  z-index: 10;
}
.menu li ul a {
  color: var(--light-text-color);
}

/* Display Dropdowns on Hover */
nav ul li:hover > ul {
  display: inherit;
}

/* Fisrt Tier Dropdown */
nav ul ul li {
  width: 85%;
  float: none;
  display: block;
  position: relative;
}
nav ul ul li a {
  background-color: var(--black);
}
nav ul ul li a:hover {
  background: var(--dark-gray);
  color: var(--light-text-color);
}

/* Second, Third and more Tiers	
 * We move the 2nd and 3rd etc tier dropdowns to the left
 * by the amount of the width of the first tier.
*/
nav ul ul ul li {
  position: relative;
  top: -60px;
  /* has to be the same number as the "width" of "nav ul ul li" */
  left: 170px;
}

/* Change ' +' in order to change the Dropdown symbol */
li > a:after {
  content: ' ▾';
}
li > a:only-child:after {
  content: '';
}
/* Hamburger Icon styling */
.hamburger {
  display: none; /* Hidden on Desktop */
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 1.2rem 0;
}

.hamburger .bar {
  margin-left: 0.7rem;
  width: 25px;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease-in-out;
}

/* Media Queries
--------------------------------------------- */

@media all and (max-width: 825px) {
  .hamburger {
    display: flex; /* Show hamburger button on mobile screens */
  }
  nav {
    margin: 0;
  }
  /* 1. Animate the top bar into a diagonal line */
  .menu-toggle:checked ~ .hamburger .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  /* 2. Fade out the middle bar */
  .menu-toggle:checked ~ .hamburger .bar:nth-child(2) {
    opacity: 0;
  }

  /* 3. Animate the bottom bar into the opposing diagonal line to make an "X" */
  .menu-toggle:checked ~ .hamburger .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  /*  End of hamburger menu effect*/

  /* Hide the navigation menu by default */
  /* Also hide the  */
  .toggle + a,
  .menu {
    display: none;
  }

  /* Styling the toggle label */
  .toggle {
    display: block;
    background-color: var(--dark-background);
    padding: 1rem 1.3rem;
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    border: none;
  }

  .hamburger:hover,
  .toggle:hover {
    background-color: var(--dark-gray);
  }

  /* Display Dropdown when clicked on Parent Lable */
  [id^='drop']:checked ~ ul,
  [id='menu-toggle']:checked ~ ul {
    display: block;
  }

  /* Change menu item's width to 100% */
  nav ul li {
    display: block;
    width: 100%;
  }

  nav ul ul .toggle,
  nav ul ul a {
    padding: 0 40px;
  }

  nav ul ul ul a {
    padding: 0 80px;
  }

  nav a:hover,
  nav ul ul ul a {
    background-color: var(--dark-gray);
  }

  nav ul li ul li .toggle,
  nav ul ul a,
  nav ul ul ul a {
    padding: 14px 20px;
    color: #fff;
    font-size: 17px;
  }

  nav ul li ul li .toggle,
  nav ul ul a {
    background-color: #313131;
  }

  /* Hide Dropdowns by Default */
  nav ul ul {
    float: none;
    position: static;
    color: #ffffff;
    /* has to be the same number as the "line-height" of "nav a" */
  }

  /* Hide menus on hover */
  nav ul ul li:hover > ul,
  nav ul li:hover > ul {
    display: none;
  }

  /* Fisrt Tier Dropdown */
  nav ul ul li {
    display: block;
    width: 100%;
  }

  nav ul ul ul li {
    position: static;
    /* has to be the same number as the "width" of "nav ul ul li" */
  }
}

@media all and (max-width: 330px) {
  nav ul li {
    display: block;
    width: 94%;
  }
}
