@charset "UTF-8";

/* ==========================================
   1. GLOBAL & DESKTOP STYLES
   ========================================== */
nav { 
  float: left; 
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  float: left;
  position: relative;
}

/* Base link styles with Flexbox for caret alignment */
nav ul li a,
nav ul li a:visited {
  display: flex;                  /* Added: Forces text left, caret right */
  justify-content: space-between; /* Added: Pushes elements to opposite edges */
  align-items: center;            /* Added: Perfect vertical centering */
  padding: 0 15px;
  line-height: 50px;
  background: #202020;
  color: #ddd;
  text-decoration: none;
}

nav ul li a#donate { 
  background: #511; 
}

nav ul li a:link { 
  color: #FFF; 
}

nav ul li a:hover,
nav ul li a:visited:hover {
  color: #fff;
  text-shadow: 
    0 0 5px #99c,
    0 0 10px #bba,
    0 0 20px #dd8,
    0 0 40px #ff6;
}

/* Desktop Submenu Rules */
nav ul li ul li { 
  min-width: 200px; 
}

nav ul li ul li a {
  padding: 10px;
  line-height: 15px;
}

.nav-dropdown {
  position: absolute;
  display: none;
  z-index: 1;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   2. UI ELEMENTS (Toggle Button & Carets)
   ========================================== */
.nav-mobile {
  display: none;
  position: absolute;
  top: 0;    
  right: 0;
  background-color: transparent;
  height: 50px;
  width: 50px;
  border: 2px solid;
  border-color: #444 #333 #333 #444;
  border-radius: 8px;
}

#nav-toggle {
  position: absolute;
  left: 11px;
  top: 19px;
  cursor: pointer;
  padding: 0; 
}

#nav-toggle span,
#nav-toggle span:before,
#nav-toggle span:after {
  cursor: pointer;
  border-radius: 2px;
  height: 3px;
  width: 27px;
  background: #ffffff;
  position: absolute;
  display: block;
  content: '';
  transition: all 300ms ease-in-out;
}

#nav-toggle span:before { top: -8px; }
#nav-toggle span:after { bottom: -8px; }

#nav-toggle p {
    color: #fd0000;
    font-weight: bold;
    margin: 12px 0 -10px -5px;
}

#nav-toggle.active span {
  background-color: transparent;
}

#nav-toggle.active span:before,
#nav-toggle.active span:after {
  top: 0;
}

#nav-toggle.active span:before { transform: rotate(45deg); }
#nav-toggle.active span:after { transform: rotate(-45deg); }

/* Caret Arrows */
.down-caret {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 5px 0 5px;
  border-color: #ffffff transparent transparent transparent;
  display: inline-block;
  margin-left: 6px;
  position: relative;
  transform: rotate(0deg);
  transform-origin: 50% 35%; 
  transition: all .25s ease-in;
}

.open-caret {
  transform: rotate(180deg);
  transition: all .25s ease-out;
}

/* ==========================================
   3. RESPONSIVE MEDIA QUERIES
   ========================================== */
@media only screen and (min-width: 990.0px) {
  nav ul li a { 
    padding: 0 27px;
    font-size: 1.1em;
  }
}

/* Desktop Fallback Override */
@media screen and (min-width: 768px) {
  .nav-list {
    display: block !important;
  }
}

/* Mobile Layout & Smooth Transitions */
@media only screen and (max-width: 767.98px) {
  .nav-mobile {
    display: block;
  }
  
  nav {
    width: 100%;
    padding: 0px 0 15px;
  }

  /* Smooth 300ms Collapse Container (Only targets top-level menu) */
  nav > ul {
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 300ms ease-in-out, opacity 300ms ease-in-out;
  }

  /* Smooth 300ms Open Container */
  nav > ul.nav-open {
    max-height: 600px;
    opacity: 1;
    overflow: visible; /* Let submenus burst past boundaries */
  }
  
  nav ul li {
    float: none;
  }

  nav ul li a {
    padding: 15px;
    line-height: 20px;
  }
  
  /* Change menu highlighting from hover to focus on mobile */
  nav ul li a:hover,
  nav ul li a:visited:hover {
    text-shadow: none;
  }
  nav ul li a:focus {
    text-shadow:
      0 0 5px #99c,
      0 0 10px #bba,
      0 0 20px #dd8,
      0 0 40px #ff6;
  }

  nav ul li a .down-caret {
    margin-left: auto; 
  }
  
  nav ul li ul li a {
    padding-left: 60px;
  }

  /* Submenus safe-zone: Bypasses parent height limits */
  .nav-dropdown {
    position: static;
    max-height: none !important;
    opacity: 1 !important;
  }
}
