// wrapper
.footer__wrapper {
  @include font-style('body--m');
  padding-bottom: $baseline * 4;
  padding-top: $baseline * 2.5;
}

// grid
.footer__grid {
  li a {
    @include link-states {
      color: $color--two-50;
    }
  }

  & + & {
    margin-top: $spacing--m;
  }
}

// divider
.footer.bg-brand--dark-blue {
  .divider {
    border-color: $color--two-80;
  }
}

// collapsible
.footer__column {
  .collapsible__button {
    &::after,
    &::before {
      background: $color-brand--four;
    }
  }
}

// info
.footer__info {
  p:last-child {
    margin-bottom: 0;
  }
  // prevent blue color for auto-generated phone number hyperlinks
  a[href^=tel] {
    color: inherit;
    text-decoration: inherit;
  }
}

// search
.footer__search {
  margin-bottom: $spacing--m;
  position: relative;
  width: 100%;

  &-input[type="text"] {
    @include text-ellipsis;
    background: $color--two-80;
    border: 1px solid $color--two-80;
    color: $color--two-50;
    padding-right: 50px;
    transition: background $transition-duration--fast ease-out, border-color $transition-duration--fast ease-out, color $transition-duration--fast ease-out;

    &:active,
    &:focus {
      padding-right: 50px;
    }

    &:focus {
      background: $color-brand--four;
      border: 2px solid $color-brand--four;
      color: $color-brand--two;
    }

    &::-webkit-input-placeholder {
      color: $color--two-50;
    }
  }

  .icon {
    margin-top: -$spacing--xs;
    right: 20px;
    top: $spacing--m;

    svg {
      fill: $color--two-50;
      left: 0;
      position: absolute;
      top: 0;
      transition: fill $transition-duration--faster ease-out;
    }
  }

  &-input:focus + .icon svg {
    fill: $color-brand--one;
  }
}

// info
.footer__info svg {
  fill: $color--two-50;
  margin-right: 5px;
}

// bottom navigation
.footer__bottom-nav {
  margin-bottom: $spacing--m;

  li {
    margin-bottom: $spacing--xs;
  }
}

// social media
.footer .social__list {
  margin-bottom: $spacing--m;

  svg {
    fill: $color--two-50;
    transition: fill $transition-duration--fast ease-out;

    &:hover {
      fill: $color-brand--four;

      .bg-brand--white & {
        fill: $color-brand--two;
      }
    }
  }
}

// footer small
.footer--s {
  .footer__wrapper {
    padding-bottom: $baseline * 4;
    padding-top: $baseline * 4;
  }

  .footer__grid:first-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .social__list {
    margin-bottom: 0;
  }
}

// viewport s/m
@include viewport--l('inversed') {
  .footer {
    &__grid.divider {
      border-bottom: 0;
    }
  }
}

// viewport l
@include viewport--l {
  // wrapper
  .footer__wrapper {
    padding-bottom: $spacing--l;
    padding-top: $spacing--xl;
  }
  // grid
  .footer__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;

    &:first-child {
      padding-bottom: $spacing--l;
    }
  }

  // collapsible
  .footer__column {
    width: grid-columns(3,12);

    .collapsible__button {
      display: none;
    }
  }

  // info
  .footer__info {
    order: 1;
    width: grid-columns(9,12);

    p {
      margin-bottom: $spacing--m;
      width: grid-columns(6,9)
    }
  }
  // search
  .footer__search {
    margin-bottom: $spacing--s;
    margin-left: auto;
    order: 2;
    width: grid-columns(3,12);
  }
  // bottom navigation
  .footer__bottom-nav {
    margin-bottom: 0;
    order: 3;
    width: grid-columns(7,12);

    ul {
      display: flex;
      flex-wrap: wrap;
      margin-bottom: -($spacing--s);

      li {
        margin-top: 0;
        margin-right: 30px;
      }
    }
  }
  // social media
  .footer .social__list {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-bottom: 0;
    order: 4;
    width: grid-columns(5,12);
  }
  // footer small
  .footer--s .footer__wrapper {
    padding-bottom: $spacing--l;
    padding-top: $spacing--l;
  }
}

// override width
.footer__column .extensive-link-list__item {
  width: 100%;
}
