


/*
=============== 
Navbar
===============
*/

/* Colors for tool: CSS Variables used */
:root {
  /* hamburger symbol color */
  --clr-hamburger-symbol: #0b2c69;
  /* hamburger symbol background color */
  --clr-hamburger-background-on-mobile: #fff;
}

/* CSS to operate tool */
header {
  background-color: var(--clr-background-tennis);
}

li {
  list-style: none;
}

a {
  color: var(--clr-primary-tennis);
}

.navbar {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.nav-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
}

.logo {
  /* How to size the logo */
  max-width: 10rem;
}

.nav-link {
  transition: 0.3s ease;
}

.nav-link:hover {
  color: var(--clr-primary-tennis-darker);
}

.cta {
  text-transform: capitalize;
  border-radius: 0;
  cursor: pointer;

  border: 0 solid white;

  padding: 0.25rem 0.5rem;

  font-weight: 600;

  background-color: var(--clr-primary-tennis-darker);
  color: var(--clr-background-tennis);
}

.hamburger {
  display: none;
  cursor:pointer;
}

/* Creating hamburger icon */
.bar {
  display: block;
  width: 25px;
  height: 3px;
  /* 5px margin top and bottom. auto margin on left and right */
  margin: 5px auto;
  /* Need to look this up: */
  /* -webkit-transition: all 0.3s ease-in-out; */
  /* transition: all 0.3s ease-in-out; */

  /* color of hamburger symbol */
  background-color: var(--clr-hamburger-symbol);
}

/* Media queries for navigation - Desktop screen */

@media(max-width: 1024px) { /* 768px */
  .hamburger {
    display: block;
  }

  /* 
  Animation:
  - top and bottom bar make X
  - middle bar disappears 
  */

  /* Key tool used: 
  - .hamburger.active = both classes .hamburger and .active must both be on this element trigger this CSS rule 
  .class.class does not equal .class .class - (.class .class is a descendant selector)
  */

  /* Removing the 2nd bar when hamburger clicked */
  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

   /* Key tool used: 
  - .hamburger.active = both classes .hamburger and .active must both be on this element trigger this CSS rule 
  .class.class does not equal .class .class - (.class .class is a descendant selector)
  */

  /* Making the hamburger symbol turn into a cross when clicked on */
  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

   /* Key tool used: 
  - .hamburger.active = both classes .hamburger and .active must both be on this element trigger this CSS rule 
  .class.class does not equal .class .class - (.class .class is a descendant selector)
  */

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Setting for when mobile menu visibile */
  .nav-menu {
    /* Keeps the menu on the screen until you click one of the links */
    position: fixed;

    /* Hiding the menu from view */
    left: -100%;
    top: 70px;
    gap: 0;
    /* Vertical menu */
    flex-direction: column;

    /* Background color of the menu on mobile */
    background-color: var(--clr-hamburger-background-on-mobile);

    /* We want the menu to take up the whole screen */
    width: 100%;

    /* Put links in the center of the screen */
    text-align: center;

    transition: 0.3s;
    z-index: 3;
  }

  .nav-item {
    /* Space between menu links */
    margin: 16px 0;
  }

  .nav-link {
    color: var(--clr-background-tennis);
  }

  .nav-link:hover {
    color: white;
  }

   /* Key tool used: 
  - .hamburger.active = both classes .hamburger and .active must both be on this element trigger this CSS rule 
  .class.class does not equal .class .class - (.class .class is a descendant selector)
  */

  /* 
  Displays the menu: 
  - For desktop: left is set to 100%
  - For mobile: left is set to 0 (now the menu is in the view of the user)
  - This change is activated with JavaScript
  */

  .nav-menu.active {
    left: 0;
  }

  /* How to hide buttons seen on RHS of desktop screen */
  .buttons {
    display: none;
  }
}


