/* stylelint-disable */
.bbd-mega-menu__content {
  position: relative;
  display: block;
}

.bbd-mega-menu {
  display: none;
  justify-content: space-between;

  @media screen and (min-width: 990px) {
    display: flex;
  }

  .header__menu-item {
    gap: calc(0.75 * var(--spacing));
    text-decoration: none;

    &:hover {
      text-decoration: none;
    }
  }

  .header__menu-item {
    padding-inline: var(--spacing);
    transition: all 0.2s ease-in-out;
    text-transform: none;
    font-size: 1.6rem;
    font-weight: var(--font-weight--semibold);

    span {
      line-height: 1.1;
    }

    svg {
      position: relative;
      right: unset;
      transition: all 0.2s ease-in-out;
    }
  }

  .mega-menu[open] > .header__menu-item,
  .header__menu-item:hover,
  .header__menu-item:focus-visible {
    color: rgb(var(--color-foreground-light));

    .header__active-menu-item {
      text-underline-offset: 1rem;
    }

    svg {
      fill: rgb(var(--color-foreground-light));
    }
  }

  .header__menu-item:has(> .header__active-menu-item) {
    color: rgb(var(--color-foreground-light));
  }

  .header__active-menu-item {
    color: rgb(var(--color-foreground-light));
    text-decoration: underline;
    text-underline-offset: 0.6rem;
    transition: text-underline-offset 0.2s ease-in-out;

    & + svg {
      color: rgb(var(--color-foreground-light));
      fill: rgb(var(--color-foreground-light));
    }
  }

  &.content-left {
    flex-direction: row-reverse;

    .bbd-mega-menu__content {
      border-right: 1px solid rgba(var(--color-foreground), 0.08);
      padding-right: 20px;
    }
  }

  &.content-right {
    flex-direction: row;

    .bbd-mega-menu__content {
      padding-left: 20px;
    }
  }

  .button--as-link,
  .button--secondary {
    position: absolute;
    left: 0;
    bottom: 0;
  }

  .button--as-link {
    background: transparent;
    text-transform: none;
    color: rgb(var(--color-shadow));
    border: none;
  }

  .button--secondary {
    background: transparent;
    text-transform: none;
    color: rgb(var(--color-background));
    border: none;
  }
}

.bbd-mega-menu__text {
  position: absolute;
  bottom: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;

  .bbd-mega-menu__text-heading {
    font-weight: 600;
    margin-top: 0;
  }

  .bbd-mega-menu__text-description {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .button {
    margin-top: auto;
  }
}

.bbd-mega-menu__media {
  position: relative;
  align-items: center;
  display: flex;
  flex: 0 1 500px;
  min-height: 500px;

  img,
  a {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.bbd-mega-menu__links {
  flex: 1 1 auto;
  gap: 10px;

  .bbd-mega-menu__column-title.link {
    font-size: 1.4rem;
    font-weight: var(--font-weight--semibold);
    margin-bottom: calc(1.5 * var(--spacing));
    color: rgb(var(--color-foreground-light));
  }

  .link {
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 500;
    border: 1px solid transparent;
  }

  > li {
    break-inside: avoid-column;
    display: grid;
    line-height: 1.2;
    margin-bottom: 10px;
  }

  > li .link:not(.link--active) {
    text-decoration: none;

    &:hover,
    &:focus-visible {
      text-decoration: underline;
    }
  }

  > li ul li {
    padding: 0;
    margin-bottom: calc(0.5 * var(--spacing));
  }

  > li ul li .link {
    text-transform: none;
  }
}

body.mega-menu--open {
  &::before {
    content: '';
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 3;
  }
}
/* stylelint-enable */
