/* Header */

.page-content::before {
  content: "";
  display: block;
  height: var(--header-height);
}

header-wrapper {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 9;
}

.top-banner {
  transition: max-height 0.5s ease;
  max-height: 5em;
  overflow: clip;
  position: relative;
  z-index: 2;

  .inner {
    background-color: var(--color-lilac);
    text-align: center;
    padding: 8px 24px;
  }

  a {
    color: var(--color-text-light);
    transition: color 0.2s ease;
    &:hover {
      color: var(--color-text);
    }
    &:active {
      color: var(--color-text-light);
    }
  }
}

.scrolling-down .top-banner {
  max-height: 0px;
}

.main-header {
  height: var(--nav-height);
  padding: 24px;
  background-color: var(--color-offwhite);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 3;

  box-shadow: 1px 0px 12px hsla(0, 0%, 0%, 0.05);

  .header-center,
  .header-right {
    display: none;
  }

  /* * {
    min-width: 0;
  } */

  @media (min-width: 900px) {
    display: grid;
    grid-template-columns: 1fr 4fr 1fr;

    .header-center,
    .header-right {
      display: block;
    }
    .mobile-nav {
      display: none;
    }
  }
}

.nav-menu {
  display: flex;
  gap: 16px;
  justify-content: center;

  &.right {
    justify-content: right;
  }
}

.nav-link {
  padding: 0.25em;
  margin: -0.25em;
  display: inline-block;
  border-radius: 4px;

  position: relative;
  z-index: 1;
  transition-property: color, background-color;
  transition-duration: 0.2s;
  transition-timing-function: ease;

  &:hover {
    color: var(--color-text-light);
  }
  &:active {
    color: var(--color-text);
    background-color: hsla(0, 0%, 0%, 0.1);
  }
}

.nav-dropdown-wrapper {
  &:hover,
  &:focus-within {
    &::before {
      position: absolute;
      content: "";
      left: 0;
      right: 0;
      width: 100%;
      height: 7em;
    }

    .nav-dropdown {
      display: flex;
    }
  }
}

.nav-dropdown {
  position: absolute;
  background-color: var(--color-offwhite);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  padding: 24px;
  padding-top: 0;
  top: var(--header-height);
  left: 0;
  right: 0;
  display: none;
  transition: top 0.5s ease;
}

.scrolling-down .nav-dropdown {
  top: var(--nav-height);
}

.mobile-menu-trigger {
  .close {
    display: none;
  }

  &[aria-expanded="true"] {
    .close {
      display: block;
    }
    .open {
      display: none;
    }
  }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: hsla(0, 0%, 100%, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1;
  padding: 128px 24px;
  transition: all 0.25s ease;

  &[aria-hidden="true"] {
    /* display: none; */
    opacity: 0;
    transform: scale(1.3);
    backdrop-filter: blur(0px);
    pointer-events: none;
  }

  &[aria-hidden="false"] {
    /* display: flex; */
    /* opacity: 1 */
  }

  @media (min-width: 900px) {
    display: none;
  }
}

/* Footer */
.footer-main {
  background-color: var(--color-lilac);
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

.footer-row {
  --cols: 1;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(var(--cols), 1fr);

  @media (min-width: 900px) {
    --cols: 4;
  }
}

.footer-block {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.footer-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.footer-link,
.footer-text a {
  color: var(--color-text-light);
  transition: color 0.2s ease;

  &:hover {
    color: var(--color-text);
  }

  &:active {
    color: var(--color-text-light);
  }
}

.bottom-banner {
  background-color: var(--color-black);
  color: var(--color-white);
  padding: 16px 24px;
  gap: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  position: sticky;
  bottom: 0;
}

/* Logo */

.logo {
  height: 2em;
  width: auto;

  .wordmark path {
    transition: all 0.2s ease;
  }

  &.collapsed {
    .wordmark path {
      opacity: 0;
      transform: translateY(-16px);

      &:nth-child(1) {
        transition-delay: 0ms;
      }
      &:nth-child(2) {
        transition-delay: 25ms;
      }
      &:nth-child(3) {
        transition-delay: 50ms;
      }
      &:nth-child(4) {
        transition-delay: 75ms;
      }
      &:nth-child(5) {
        transition-delay: 100ms;
      }
      &:nth-child(6) {
        transition-delay: 125ms;
      }
      &:nth-child(7) {
        transition-delay: 150ms;
      }
      &:nth-child(8) {
        transition-delay: 175ms;
      }
      &:nth-child(9) {
        transition-delay: 200ms;
      }
      &:nth-child(10) {
        transition-delay: 225ms;
      }
      &:nth-child(11) {
        transition-delay: 250ms;
      }
      &:nth-child(12) {
        transition-delay: 275ms;
      }
      &:nth-child(13) {
        transition-delay: 300ms;
      }
      &:nth-child(14) {
        transition-delay: 325ms;
      }
      &:nth-child(16) {
        transition-delay: 350ms;
      }
    }
  }
}
