:root {
  /* Define this in :root because it also needs to be referenced outside this file. */
  --subheader-height: 60px;
}

.subheader {
  /* Layout */
  --subheader-item-gap: 4em;
  --subheader-searchbar-width: 300px;
  /* Typography */
  --subheader-font-size: 0.8rem;
  /* Colors */
  --color-subheader-bg: var(--color-primary-purple);
  --color-subheader-text: hsl(0 0% 100% / 1);
  --color-subheader-submenu-bg: var(--color-primary-purple);
}

.subheader {
  position: relative; z-index: 50;
  height: var(--subheader-height);
  font-size: var(--subheader-font-size);
  color: var(--color-subheader-text);
  background: var(--color-subheader-bg);
  @media (width < 800px) { display: none; }
}

.subheader-content {
  display: grid; grid-template-columns: 1fr auto;
  width: 100%; height: 100%; max-width: 100vw;
  padding-right: 10px;
  padding-left: var(--subheader-searchbar-width);
  @media (width < 1500px) { padding-left: 0; }
}

.subheader-nav {
  width: 100%; height: 100%;
  max-width: calc(100vw - var(--subheader-searchbar-width));
}

.subheader ul {
  margin: 0; padding: 0;
}

.subheader li {
  /* outline: 1px solid hsl(0 100% 50% / 1); */
  display: flex; justify-content: center; align-items: center;
  position: relative;
  padding: 0 calc(var(--subheader-item-gap) / 2);
  list-style-type: none;
  cursor: pointer;
  transition: backdrop-filter ease-out 200ms;
}

.subheader li.menu-item-has-children:after {
  content: url(/wp-content/themes/wnmu/assets/imgs/icons/caret-down.svg);
  transform: scale(0.8) translate(0, 3px); filter: invert(1);
  transition: transform ease-out 200ms;
}

.subheader li:hover { backdrop-filter: brightness(1.3); }

.subheader a {
  text-decoration: none;
  color: var(--color-subheader-text);
  cursor: pointer;
}

.subheader-nav > ul {
  width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center;
}

.subheader-nav > ul > li { height: 100%; }

.subheader .sub-menu {
  display: none;
  position: absolute;
  left: 0; top: var(--subheader-height);
  width: fit-content; min-width: 240px;
  padding-top: 12px; padding-bottom: 12px;
  white-space: nowrap;
  background: var(--color-subheader-submenu-bg);
  border-top: 1px solid hsl(0 0% 100% / 0.5);
  border-radius: 0 0 10px 10px;
}

.subheader li:hover .sub-menu,
.subheader li:focus .sub-menu { display: block; }

.subheader li.menu-item-has-children:hover:after,
.subheader li.menu-item-has-children:focus:after {
  transform: scale(0.8) translate(0, 10px);
}

.subheader .sub-menu li {
  justify-content: flex-start;
  padding-top: 7px; padding-bottom: 7px;
}
