body.filter-active {
  height: 100%;
  left: 0;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.filter {
  // toggle
  &__toggle {
    @include font-style(
      $filter-toggle-font-style,
      $filter-toggle-font-style--l
    );
  }
  // content
  &__content {
    @include font-style('body--l');
  }
  // block
  &__block {
    padding: $spacing--xs $grid-margin--s $baseline * 15;

    .form-group {
      padding-bottom: $spacing--s;
    }

    .form-group .button {
      display: none;
    }

    // accordion
    .accordion .icon {
      top: 0;
    }

    .link-list {
      margin-top: 0;
    }

    .link-list__link {
      @include font-style(
        $filter-link-list-font-style,
        $filter-link-list-font-style--l
      );
    }
  }

  &__clear {
    @include font-style('body--l');
    margin-bottom: $spacing--xs;
  }
  // alert
  &__alert {
    align-items: center;
    display: flex;
    margin-top: $spacing--m;

    .icon {
      margin-right: 10px;
    }

    .icon svg {
      fill: $color-brand--one;
    }
  }
  // related
  &__related {
    margin-top: $spacing--m;
  }
  // links
  &-links {
    padding-bottom: $spacing--s;
  }

  &-links--active {
    align-items: baseline;
    display: flex;
    // chained to add specificity
    .icon.icon {
      cursor: pointer;
      margin-left: 10px;
      top: $baseline * 0.6;
    }

    svg {
      fill: $color-brand--one;
    }
  }
  // seo content
  .seo-content {
    margin-top: $spacing--m;

    p {
      @include font-style('body--m');
    }

    p:last-of-type {
      margin-bottom: 0;
    }
  }
  // rss feed
  .rss-feed {
    align-items: center;
    display: flex;
    margin-top: $spacing--m;

    span {
      color: $color-brand--one;
      cursor: pointer;
    }

    .icon {
      margin-right: 15px;

      svg {
        fill: $color-brand--two;
      }
    }
  }
}

// viewport s - m
@include viewport--l('inversed') {
  .filter {
    color: $color-brand--two;

    p {
      color: $color--disabled;
    }

    &__toggle {
      align-items: center;
      background: $filter-background--l-inversed;
      border-top: 1px solid $color--grey;
      bottom: 0;
      color: $color-brand--two;
      cursor: pointer;
      display: flex;
      height: $baseline * 6;
      justify-content: center;
      left: 0;
      position: fixed;
      right: 0;
      z-index: 1;

      .icon {
        margin-right: 15px;
      }

      .icon svg {
        fill: $color-brand--one;
      }
    }

    &__header,
    &__footer {
      align-items: center;
      background: $filter-background--l-inversed;
      display: flex;
      padding-left: $grid-margin--s;
      padding-right: $grid-margin--s;
      width: 100%;
      z-index: 2;
    }

    &__header {
      border-bottom: 1px solid $color--grey;
      height: $baseline * 8;
      top: calc(100% - 100px);
      transition: $transition-duration--fast;

      .icon {
        cursor: pointer;
        margin-left: auto;
        transition: width $transition-duration--fast;
        .scroll-active & {
          width: 15px;
        }
      }

      .icon svg {
        fill: $color-brand--one;
      }
      .scroll-active & {
        height: $baseline * 5;
      }
    }

    &__title {
      @include font-style($filter-title-font-style);
      transition: $transition-duration--fast;
      .scroll-active & {
        @include font-style($filter-title-font-style--scroll-active);
      }
    }

    &__clear {
      a {
        color: $color-brand--one;
      }
    }

    &__content {
      background: $filter-background--l-inversed;
      bottom: 0;
      height: 0;
      left: 0;
      -webkit-overflow-scrolling: touch;
      overflow-x: hidden;
      overflow-y: scroll;
      position: fixed;
      right: 0;
      transition: height 0.4s ease, visibility $transition-duration--slow ease;
      visibility: hidden;
      z-index: 6;
    }

    &__footer {
      background: $filter-background--l-inversed;
      bottom: 0;
      opacity: 0;
      padding-bottom: $spacing--s;
      padding-top: $spacing--s;
      position: fixed;
      transform: translateY(100%);
      transition: bottom 0.8s ease;

      .button {
        color: $color--white;
        background-color: $color-brand--one;
        border-color: $color-brand--one;

        &:hover {
          background: $color--one-80;
          color: $color--white;
          border: 2px solid $color--one-80;
        }

        &:active {
          background: $color--one-130;
          color: $color--white;
          border: 2px solid $color--one-130;
        }
      }
    }

    .divider {
      border-color: $color--grey;
    }
  }
  // filter active on mobile
  .filter__content--active {
    height: 100%;
    padding-top: $spacing--xl;
    visibility: visible;
    transition: height 0.4s ease;

    .filter__header {
      position: fixed;
      top: 0;
    }

    .filter__footer {
      bottom: 0;
      opacity: 1;
      transform: translateY(0);
      transition: transform $transition-duration--fast
          $transition-duration--slow,
        opacity $transition-duration--fast $transition-duration--slow;
    }
  }
}

// viewport l
@include viewport--l {
  .filter {
    width: grid-columns(3, 12);

    &__toggle {
      margin-bottom: $spacing--xs;
      pointer-events: none;
    }

    &__block {
      padding: 0;
    }

    &__clear {
      margin-bottom: $spacing--s;
    }

    &__block .form-group {
      padding-bottom: $spacing--m;

      .button {
        display: block;
        margin-top: $spacing--s;
      }
    }

    &__block .collapsible__button {
      height: $icon-size;
      top: $baseline * 2.9;
      width: $icon-size;

      &::before,
      &::after {
        top: $baseline * 0.9;
        width: $icon-size;
      }
    }

    .accordion .collapsible__content {
      padding-right: 0;
    }
    // related
    &__related {
      &-title {
        display: block;
        margin-bottom: $baseline * 1.5;
      }

      &-item + &-item {
        margin-top: $spacing--xs;
      }
    }
    // seo content
    .seo-content {
      margin-top: $spacing--m;
    }
  }
}
