/* BOOKMARKS */

/*

**	The first portion of each of the comments below is a unique identifier that you can search for to jump to the desired section

**

**

*/

/***************** edit-top-menu-mobile; ********************/

/* The main editable sections for the main menu are found below

** 	When editing, try to contain your changes to the divs

*/

/* ;edit-top-menu-marked; 				--  rules for the menu elements in the selected element's chain ie if a child element is the current page, it and it's parent are both 'marked'*/

/* ;edit-top-menu-hover; 				--  styles for 'on hover' , often the same rules as 'this-is-the-page' */

/* ;edit-top-menu-this-is-the-page; 		--  styles for the currently selected page (distinct from the currently selected chain of elements as defined above in marked*/

/* note that this style sheet is organized mobile first with descktop versions overriding mobile styles in a mediaquery */

/* ;edit-top-menu-parent-divs;			--  styles for top level elements (parent) */

/* ;edit-top-menu-child-divs; 			--  styles for nested elements (child) */

/* ;edit-top-menu-gchild-divs; 			--  styles for deepest nested elements (gchild) */

/* ;edit-top-menu-parent-divs-desktop; 	--	override mobile styles for top-row desktop presentation */

/******************** edit-side-menu; **************************/

/* sidebar-menu divs follow the above

**	I've included all the typical segments but many, by default, are likely empty. If still empty for a site, be sure to remove them before going live

**	;edit-top-menu-marked;				-- Note, the top row element is always marked on the sidebar; it acts as a heading in this context.

** 	;edit-top-menu-this-is-the-page;		

**	;edit-top-menu-parent-divs;

**	;edit-top-menu-child-divs; 

**	;edit-top-menu-gchild-divs;

*/

/* top menu structure 



<ul .menu-parent-row> (top row)

	<li .has-arrow>  		(child with gchildren)

		<div>

			<span> | <a>

			<span .menu-button>

		<ul .menu-child-row>

			<li>

				<div>

					<span> | <a>

			<li .has-arrow>

				<div>

					<span> | <a>

					<span .menu-button>

				<ul .menu-gchild-row>

					<li>

						<div>

							<span> | <a>

					<li>

						<div>

							<span> | <a>

				

	<li>					(leaf child)

		<div>

			<span> | <a>

Each li contains a 

	div - which contains the link (or protolink) and optionally a button

		It is this div that should be targeted for styling backgrounds, padding, margins, borders, etc

	ul 	- the ul only exists if the li is a parent to another tier of children

*/

/* color definitions found at the top of atf.core.css */

.cms-nav {
  /* menu arrows */

  --menu-top-arrow-color: black;

  --menu-top-arrow-background: transparent;

  --menu-side-arrow-color: var(--brand-b-color);

  --menu-side-arrow-background: transparent;

  --menu-child-arrow-color: var(--brand-b-color);

  --menu-child-arrow-background: transparent;

  --menu-background: var(--brand-b);

  --menu-color: var(--brand-b-color);

  --menu-background-highlight: var(--brand-b-hover);

  --menu-color-highlight: var(--brand-b-hover-color);

  --menu-side-heading-background: var(--brand-a);

  --menu-side-heading-color: var(--brand-a-color);

  z-index: 1;
}

.menu-state {
  /* used by js during resize to know if we are seeing the hamburger(0) or fullwidth(1) version. Set as 0 here and 1 in the media query later */

  /* this approach allows us to work of mediaquery values without js needing to know what widths are set here for the mediaqueries */

  min-width: 0px; /* false: not fullwidth */
}

/* DEFINE nav wrapper and hamburger */

/* nav wrapper */

#top-nav-wrap {
  display: flex;

  align-items: center;

  justify-content: flex-end;
}

#top-nav-wrap.hamburger-open {
  position: absolute;

  top: 0;

  justify-content: space-between;

  /* width: 100%; */

  width: calc(100% + (var(--logo-min-width)) + 1rem); /*  PLUS LOGO WIDTH  */

  box-sizing: border-box;

  right: 0;

  align-items: start;
}

#top-nav {
  display: none;
}

/* Conceal sidebar navigation at mobile widths */

#side-nav {
  display: none;
}

@media only screen and (min-width: 900px) {
  /* ;sidebar-cutoff;  using 900px */

  #side-nav {
    display: unset;
  }
}

/* hamburger */

.hamburger-open #top-nav {
  flex-basis: 100%;

  display: unset;

  /* max-height: calc(100vh - 1rem); */ /*  OLD mobile menu height */

  max-height: calc(100vh - 185px); /*  mobile menu height with ALERT bar */

  max-height: calc(100vh - 150px); /*  mobile menu height with NO ALERT bar */

  overflow-y: auto;

  border: 1px solid #aaa;
}

#hamburger-wrap {
  display: block;

  padding: 0;

  background: white;
}

.hamburger {
  position: relative;

  display: flex;

  justify-content: center;

  align-items: center;

  width: 25px;

  height: 20px;

  cursor: pointer;

  transition: all 0.2s ease-in-out;

  overflow: hidden;
}

.hamburger-line {
  width: 100%;

  height: 4px;

  background: white;

  transition: all 0.2s ease-in-out;
}

.hamburger .hamburger-line::before,
.hamburger .hamburger-line::after {
  content: "";

  position: absolute;

  width: 100%;

  height: 4px;

  left: 0;

  background: white;

  transition: all 0.2s ease-in-out;
}

.hamburger .hamburger-line::before {
  transform: translateY(-8px);
}

.hamburger .hamburger-line::after {
  transform: translateY(8px);
}

/*  ANIMATION for Hamburger Menu  */

.hamburger-open .hamburger .hamburger-line {
  transform: translateX(-50px);

  background: transparent;
}

.hamburger-open .hamburger .hamburger-line::before {
  transform: rotate(45deg) translate(35px, -35px);
}

.hamburger-open .hamburger .hamburger-line::after {
  transform: rotate(-45deg) translate(35px, 35px);
}

/* end hamburger */

.cms-nav ul {
  padding: 0;

  margin: 0;

  list-style: none;
}

.cms-nav li {
  padding: 0;

  margin: 0;

  position: relative;
}

/* unset all sitewide <a> and <span> styles to allow menu rules to take over */

.cms-nav a,
.cms-nav span {
  text-decoration: unset;

  color: white;

  font-weight: unset;

  transition: unset;

  cursor: pointer;

  font-weight: 500;
}

.cms-nav li.with-arrow ul.menu-child-row a {
  color: var(--brand-b-color);
  transition: all 0.5s;
}

.cms-nav li.with-arrow ul.menu-child-row a:hover {
  color: var(--brand-b-hover-color);
  transition: all 0.5s;
}

#top-nav.cms-nav ul.menu-parent-row {
  display: flex;

  flex-direction: column;
}

.hamburger-open #top-nav.cms-nav ul.menu-parent-row {
  overflow: hidden;
}

#top-nav.cms-nav li > ul {
  display: flex;

  flex-direction: column;
}

#top-nav.cms-nav ul.menu-child-row {
  min-width: 200px;
}

/* styling-divs-begin mobile*/

/* core styles, applies to top-nav and side-nav, all elements */

.cms-nav div {
  color: var(--brand-b-color);

  background: var(--brand-b);

  font-weight: 300;
}

.cms-nav a,
.cms-nav span {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
}

.cms-nav li.with-arrow > div > span.menu-button {
  position: absolute;

  top: 7px;

  right: 10px;

  padding: 0;
}

.cms-nav li.with-arrow span.menu-button {
  padding: 0 !important;
}

.cms-nav li.with-arrow li.with-arrow {
  display: none;
}

.cms-nav li.with-arrow.arrow-clicked li.with-arrow {
  display: block;
}

.cms-nav .marked-group > div {
  background: #555e;

  color: var(--brand-b-hover-color);
}

.cms-nav div:hover,
.cms-nav li.this-is-the-page > div {
  background: var(--brand-b-hover);

  color: var(--brand-b-hover-color);
}

/* start expandable elements closed */

.cms-nav .menu-parent-row ul li > div {
  /* base rules, setting menu items in closed presentation: 0 for height, padding height, and line height */

  white-space: nowrap; /* prevent button wrapping to bottom */

  display: flex;

  justify-content: space-between;

  line-height: 0; /* appear closed when not clicked */

  overflow: hidden; /* appear closed when not clicked */

  padding-top: 0;

  padding-bottom: 0;

  height: 0; /* appear closed when not clicked */

  transition: color 0.25s, padding-top 0.5s, padding-bottom 0.5s,
    line-height 0.5s;

  /* base styles */

  color: #0000; /* while closed, transparent color for smooth fade-in */
}

/* elements with arrows */

.cms-nav li.with-arrow > div {
  padding-right: 0.5rem; /* remove div padding because button has enough already*/
}

/* force top level items to close instantly, prevents top level menu items retaining hover while opening one and closing another */

body:not(.is-mobile)
  #top-nav-wrap:not(.hamburger-open)
  #top-nav.cms-nav
  .menu-parent-row
  > li:not(.arrow-clicked)
  ul
  li
  > div {
  transition: unset;
}

/***************** edit-top-menu-mobile; ********************/

/* base open styles */

.cms-nav li.arrow-clicked > ul > li > div,
#side-nav.cms-nav .menu-parent-row > li > ul > li > div {
  /* with arrow clicked, regulate how it appears as open by setting padding and line heights and unsetting height. (animation occurs based on padding and line-height */

  height: unset;

  /* padding-top: 0.5rem;

  padding-bottom: 0.5rem; */

  line-height: 1.5rem;

  color: var(--brand-b-color);
}

/* ;edit-top-menu-marked; */

.cms-nav li.arrow-clicked > ul > li.marked-group > div {
  color: var(--brand-b-color);
}

/* ;edit-top-menu-hover; */

/* ;edit-top-menu-this-is-the-page; */

.cms-nav li.arrow-clicked > ul > li > div:hover,
.cms-nav li.arrow-clicked > ul > li.this-is-the-page > div {
  color: var(--brand-b-hover-color);
}

/* ;edit-top-menu-parent-divs; */

#top-nav.cms-nav .menu-parent-row > li > div {
  border-bottom: 1px solid #aaa;
}

#top-nav.cms-nav .menu-parent-row > li > div:hover {
}

/* ;edit-top-menu-child-divs; */

/* child specific rules for padding, color, background, etc */

/* child closed */

.cms-nav ul.menu-child-row > li > div {
  /* padding must be set in closed position so it doesn't jank when opening */
}

/* child open */

.cms-nav li.arrow-clicked > .menu-child-row > li > div {
  border-bottom: 1px solid #aaa; /* border-bottom must be set on open case so it doesn't display when closed */
}

/* child hover */

.cms-nav li.arrow-clicked > .menu-child-row > li > div:hover {
}

/* edit-top-menu-gchild-divs; */

/* grand-child specific rules for padding, color, background, etc */

/* child closed */

.cms-nav ul.menu-gchild-row > li > div {
  /* background set in closed case so it doesn't flicker on slide open */

  /* color with zero opacity so it can fade into opaque */

  padding-left: 2rem; /* indent grand-children */
}

/* gchild open */

.cms-nav li.arrow-clicked > .menu-gchild-row > li > div {
  border-bottom: 1px solid #aaa;
}

/* gchild hover */

.cms-nav li.arrow-clicked > .menu-gchild-row > li > div:hover {
}

/********************** edit-side-menu; *******************/

/* Typically, the sidemenu is not displayed on mobile. If a site requires them on mobile, the rules presented here are for mobile with desktop overrides in the media query below */

/*	;edit-side-menu-marked; */

#side-nav.cms-nav .menu-parent-row > li > ul > li.marked-group > div,
#side-nav.cms-nav li.arrow-clicked > ul > li.marked-group > div {
  color: var(--brand-b-color);
}

/* 	;edit-side-menu-this-is-the-page;		*/

#side-nav.cms-nav .menu-parent-row > li > ul > li.this-is-the-page > div,
#side-nav.cms-nav li.arrow-clicked > ul > li.this-is-the-page > div {
  color: var(--brand-b-hover-color);
}

/*	;edit-side-menu-parent-divs; */

#side-nav.cms-nav .menu-parent-row > li > div {
  border-bottom: 1px solid #aaa;

  background: var(--brand-a);

  font-weight: 600;

  font-size: 1.25rem;

  color: var(--brand-a-color);

  padding-top: 0.3em;

  padding-bottom: 0.3em;
}

#side-nav.cms-nav .menu-parent-row > li > div:hover {
  /* currently uses same as top-menu, set above */
}

/*	;edit-side-menu-child-divs; */

#side-nav.cms-nav .menu-child-row > li > div {
  border-bottom: 1px solid #aaa;
}

#side-nav.cms-nav .menu-child-row > li > div a,
#side-nav.cms-nav .menu-child-row > li > div span {
  padding-left: 1.5rem;
}

#side-nav.cms-nav .menu-child-row > li > div:hover {
  /* currently uses same as top-menu, set above */
}

/*	;edit-side-menu-gchild-divs; */

#side-nav.cms-nav .menu-gchild-row > li > div {
  /* don't set border here, it is set when opened, only */

  padding-left: 2rem;
}

#side-nav.cms-nav .menu-gchild-row > li > div:hover {
  /* currently uses same as top-menu, set above */
}

/* DEFINE Menu Buttons +/- */

.cms-nav .menu-button {
  position: relative;

  float: right;

  color: #ecf0f1;

  background: #e74c3c;

  width: 1.5rem;

  height: 1.5rem;

  border: 0;

  position: relative;

  display: inline-block;
}

.cms-nav .menu-button:before,
.cms-nav .menu-button:after {
  content: "";

  display: block;

  position: absolute;

  transition: 300ms;

  background: white;

  border-radius: 2px;
}

/* Create the "+" shape by positioning the spans absolutely */

.cms-nav .menu-button:before {
  top: 25%;

  bottom: 25%;

  width: 10%;

  left: 45%;
}

.cms-nav .menu-button:after {
  left: 25%;

  right: 25%;

  height: 10%;

  top: 45%;
}

/* Morph the shape when the button is hovered over */

.cms-nav li.arrow-clicked > div > .menu-button:before,
.cms-nav li.arrow-clicked > div > .menu-button:after {
  transform: rotate(90deg);
}

.cms-nav li.arrow-clicked > div > .menu-button:before {
  width: 12.5%;

  border-radius: 0;
}

.cms-nav li.arrow-clicked > div > .menu-button:after {
  left: 50%;

  right: 50%;
}

/* END: DEFINE Menu Buttons +/- */

/* set colors for buttons */

#top-nav .menu-parent-row > .with-arrow > div > .menu-button,
#top-nav .menu-child-row > .with-arrow > div > .menu-button {
  background: var(--menu-child-arrow-background); /* button background */
}

#top-nav .menu-parent-row > .with-arrow > div > .menu-button > span::before,
#top-nav .menu-parent-row > .with-arrow > div > .menu-button > span::after,
#top-nav .menu-child-row > .with-arrow > div > .menu-button > span::before,
#top-nav .menu-child-row > .with-arrow > div > .menu-button > span::after {
  background: var(--menu-child-arrow-color); /* button color */
}

#side-nav .menu-child-row > .with-arrow > div > .menu-button {
  background: var(--menu-side-arrow-background); /* button background */
}

#side-nav .menu-child-row > .with-arrow > div > .menu-button > span::before,
#side-nav .menu-child-row > .with-arrow > div > .menu-button > span::after {
  background: var(--menu-side-arrow-color); /* button color */
}

#side-nav.cms-nav a {
  font-size: 0.85rem;

  font-weight: 400;
}

#side-nav.cms-nav .menu-parent-row > li > div a {
  font-size: 1.1rem;

  font-weight: 600;
}

#top-nav.cms-nav a,
#top-nav.cms-nav span {
  font-family: "Prata", serif;
  white-space: nowrap;
}

.menu-child-row a,
.menu-child-row span,
#top-nav-wrap.hamburger-open a,
#top-nav-wrap.hamburger-open span {
  white-space: normal;

  padding-right: 25px;
}

/****************************** MEDIA QUERIES ***************************************/

/* all declarations for transition to desktop */

/* adjust this value to change when desktop nav starts */

@media only screen and (min-width: 1186px) {
  .menu-state {
    /* used by js during resize to know if we are seeing the hamburger(0) or fullwidth(1) version. */

    min-width: 1px; /* true: fullwidth menu version*/
  }

  #top-nav-wrap {
    display: flex;

    align-items: center;

    justify-content: flex-end;
  }

  #top-nav-wrap.hamburger-open {
    position: unset;

    top: unset;

    width: unset;

    right: unset;

    justify-content: right;
  }

  #top-nav-wrap.hamburger-open #top-nav {
    flex-basis: unset;

    background: unset;

    max-height: unset;

    overflow-y: unset;
  }

  #top-nav {
    display: unset;
  }

  #top-nav.cms-nav ul.menu-parent-row {
    display: flex;

    flex-direction: row;

    margin-right: -1rem;
  }

  #top-nav.cms-nav ul.menu-child-row {
    position: absolute;
  }

  /* right adjust for right most element(s) */

  /* the number of elements to include here will depend on the width of the elements */

  #top-nav li:nth-last-child(-n + 5) > .menu-child-row {
    right: 0;
  }

  #hamburger-wrap {
    display: none;
  }

  body:not(.is-mobile)
    #top-nav.cms-nav
    .menu-parent-row
    > .with-arrow
    > div
    > .menu-button {
    display: none;
  }

  /* ;edit-top-menu-parent-divs-desktop; */

  #top-nav.cms-nav .menu-parent-row > li > div {
    border-bottom: none;

    background: transparent;

    padding-right: 1em;

    color: black;
  }

  /* #top-nav.cms-nav .menu-parent-row > li.marked-group > div:after,
  #top-nav.cms-nav .menu-parent-row > li:hover > div:after {
    width: calc(100% - 2rem - 2px);

    content: "";

    position: absolute;

    left: 50%;

    top: 0.4rem;

    transform: translateX(-50%);

    height: 2.5px;

    background: var(--brand-a);
  } */

  /* set colors for buttons */

  #top-nav .menu-parent-row > .with-arrow > div > .menu-button {
    background: var(--menu-top-arrow-background); /* button background */
  }

  #top-nav .menu-parent-row > .with-arrow > div > .menu-button > span::before,
  #top-nav .menu-parent-row > .with-arrow > div > .menu-button > span::after {
    background: var(--menu-top-arrow-color); /* button color */
  }
}

@media only screen and (max-width: 1185px) {
  .cms-nav ul.menu-child-row > li > div a,
  .cms-nav ul.menu-child-row > li > div span {
    padding-left: 2rem;
  }
}
