/* 
#######################################################################
## This code was from the following website:
## https://webdesign.tutsplus.com/tutorials/how-to-build-a-responsive-navigation-bar-with-flexbox--cms-33535      
##########################################################################
*/

/* ########################################################## */
/* Basic styling */
/* ########################################################## */

/* This "*" styling applies to everything. */
/* John disabled this.
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}
*/

/* John disabled this.
body {
	font-family: sans-serif;
	font-size: 20px;
	font-size: 16px;
}
*/


nav {
	background: #222;  /* charcoalish */
	padding: 0 1rem;
	font-size: 1.5rem;
	/*position: sticky; */
	/*top: 0;*/
}

#nav-main {
	position: sticky; 
	top: 0;
	z-index: 2010;
}

/* John disabled this.
a {
  color: white;
  text-decoration: none;
}
*/

.menu,
.submenu {
	padding: 0; /*John added this. */
	margin: 0; /*John added this. */
	list-style-type: none;
	color: white; /*John added this. */
}


.logo {
  font-size: 1.5rem;
  /*padding: 7.5px 10px 7.5px 0; */
  text-align: center; /*John added this. */
  /*border:  40px red; *//*John added this. */
  display: flex;
  padding: 0;
  
}


.logo-image {
  /*display: block;*/
  width: 48px;
}


.item {
  padding-left: 10px;
  padding-right: 10px;
}


.item.button {
  padding: 9px 5px;
}


.item:not(.button) a:hover,
.item a:hover::after {
  color: #ccc;  /* light gray */
}



/* ########################################################## */
/* Mobile menu */
/* ########################################################## */
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  
}

/*
.menu li a {
  display: block;
  padding: 15px 5px;
}
*/

.menu a {
  display: block;
  padding: 15px 5px;
  text-decoration: none; /*John added this. */
  color: white; /*John added this. */
}

/* This is for submenus. */
.menu li.subitem a {
  padding: 15px;
}

.toggle {
	order: 1;
	font-size: 1.5rem;
	z-index: 1000;
}

.logo {
	order: 2;
}

.item.button {
	order: 2;
}


.item {
	order: 3;
	width: 100%;
	text-align: center;
	display: none;
}

.active .item {
	display: block;
}

.button.secondary {
  /* divider between buttons and menu links */
  border-bottom: 1px #444 solid;  /* light charcoalish */
}


/* Submenu up from mobile screens */
.submenu {
	display: none;
}


.submenu-active .submenu {
	display: block;
}


.has-submenu i {
	font-size: 12px;
}


.has-submenu > a::after {
  font-family: "Font Awesome 5 Free";
  font-size: 12px;
  line-height: 1rem;
  font-weight: 900;
  content: "\f078";  /* Down arrow */
  color: white;
  padding-left: 5px;
}


.subitem a {
  padding: 10px 15px;
}


.submenu-active {
  background-color: #111; /* blackish */
  border-radius: 3px;
}


/* ####################################################### */
/* Tablet menu */
/* ####################################################### */
@media all and (min-width: 700px) {
  .menu {
    justify-content: center;
  }

  .logo {
    flex: 1;
  }
  
  .item.button {
    width: auto;
    order: 1;
    display: block;
  }
  
  .toggle {
    flex: 1;
    text-align: right;
    order: 2;
  }
  
  
  /* Button up from tablet screen */
  .menu li.button a {
    padding: 10px 15px;
    margin: 5px 0;
  }
  
  
  .button a {
    background: #0080ff;  /* blueish */
    border: 1px royalblue solid;
  }
  
  
  .button.secondary {
    border: 0;
  }
  
  
  .button.secondary a {
    background: transparent;
    border: 1px #0080ff solid;  /* blueish */
  }
  
  
  .button a:hover {
    text-decoration: none;
  }
  
  
  .button:not(.secondary) a:hover {
    background: royalblue;
    border-color: darkblue;
  }
}


/* ########################################################### */
/* Desktop menu */
/* ########################################################### */
@media all and (min-width: 960px) {
  .menu {
    align-items: flex-start;
    flex-wrap: nowrap;
    background: none;
  }
  
  .submenu {
	  z-index: 2010; /* This ensures that the Button is always on top. */
  }
  
  
  .logo {
    order: 0;
	display: none;
	/*visibility: hidden; */ /* John added this. */
  }
  
  
  .item {
    order: 1;
    position: relative;
    display: block;
    width: auto;
  }
  
  
  .button {
    order: 2;
  }
  
  .submenu-active .submenu {
    display: block;
    position: absolute;
    left: 0;
    top: 68px;
    background: #111;  /* blackish */
  }
  
  
  .toggle {
    display: none;
  }
  
  
  .submenu-active {
    border-radius: 0;
  }
}