/* 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: var(--banner-height); */
  overflow: clip;
  position: relative;
  z-index: 2;
}
.top-banner .inner {
  background-color: var(--color-lilac);
  text-align: center;
  padding: 8px 24px;
}

.top-banner a {
  color: var(--color-text-light);
  transition: color 0.2s ease;
}
.top-banner a:hover {
  color: var(--color-text);
}
.top-banner a: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);
}
.main-header .header-center,
.main-header .header-right {
  display: none;
}

@media (min-width: 900px) {
  .main-header {
    display: grid;
    grid-template-columns: 1fr 4fr 1fr;
  }
  .main-header .header-center,
  .main-header .header-right {
    display: block;
  }
  .main-header .mobile-nav {
    display: none;
  }
}

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

.header-right .nav-menu {
  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;
}
.nav-link:hover {
  color: var(--color-text-light);
}
.nav-link:active {
  color: var(--color-text);
  background-color: hsla(0, 0%, 0%, 0.1);
}

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

.nav-dropdown-wrapper:hover .nav-dropdown,
.nav-dropdown-wrapper:focus-within .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(--nav-height);
  left: 0;
  right: 0;
  display: none;
  transition: top 0.5s ease;
}

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

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

.mobile-menu[aria-hidden="true"] {
  opacity: 0;
  transform: scale(1.3);
  backdrop-filter: blur(0px);
  pointer-events: none;
}

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

/* Footer */
.footer-main {
  /* background-color: var(--color-lilac); */
  position: relative;
  z-index: 1;
  display: grid;
}

.footer-row {
  background-color: var(--color-bg);
  color: var(--color-text);

  padding: 48px 24px;
  gap: 48px 24px;

  display: grid;
  --cols: 1;
  grid-template-columns: repeat(var(--cols), 1fr);
}
@media (min-width: 900px) {
  .footer-row {
    --cols: 4;
  }
}
@media (min-width: 900px) {
  .footer-row .column {
    grid-column: span var(--span);
  }
}

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

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

.footer-text > * {
  max-width: 55ch;
}
.footer-text > *:not(:first-child) {
  margin-top: 1em;
}

.footer-link,
.footer-text a {
  color: var(--color-text-light);
  transition: color 0.2s ease;
}
.footer-link:hover,
.footer-text a:hover {
  color: var(--color-text);
}
.footer-link:active,
.footer-text a:active {
  color: var(--color-text-light);
}
.footer-logos {
  --cols: 2;
  display: grid;
  gap: 48px;
  align-items: stretch;
  justify-items: stretch;
  grid-template-columns: repeat(var(--cols), 1fr);
}
@media (min-width: 900px) {
  .footer-logos {
    --cols: 4;
  }
}

.footer-logo * {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 150px;
}

.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;
      }
    }
  }
}
