.selector {
  .content-block__title {
    display: flex;
    flex-wrap: wrap;
  }

  &__title {
    cursor: pointer;
    height: $baseline * 4;
    overflow: hidden;
    padding-right: 60px;
    position: relative;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: grid-columns(6, 6);


    .icon {
      /*@include svg-base64('chevron-down', $color-brand--two);*/
      position: absolute;
      right: 25px;
      top: $baseline * 1.2;
      transform: rotate(0deg);
      transition: transform $transition-duration--fast;
    }
  }

  .text--emphasis {
    margin-right: 10px;
  }

  &__title.active .icon {
    transform: rotate(180deg);
    transition: transform $transition-duration--fast;
  }

  .content-block__title .selector__title {
    display: inline-block;
  }

  &__content {
    opacity: 0;
    max-height: 0;

    ul {
      max-height: 0;
    }

    &--link {
      display: block;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    a {
      color: $color-brand--two;
      text-decoration: none;
      transition: color 0.2s;
    }
  }

  &__content.active {
    @include font-style('title--xxs', 'title--s');
    background: $color-brand--four;
    border-radius: $border-radius--l;
    margin-top: $baseline * 1.5;
    max-height: $baseline * 18;
    opacity: 1;
    padding: $spacing--s 0 $spacing--m;
    position: absolute;
    transform: translateY(-$baseline * 0.5);
    transition: opacity $transition-duration--fast, visibility $transition-duration--fast, transform $transition-duration--fast, max-height 0s ease;
    width: 100%;

    .pointer {
      background: $color-brand--four;
      border-radius: 4px;
      color: transparent;
      content: '';
      left: 23px;
      line-height: $baseline * 2.6;
      position: absolute;
      top: $baseline * -0.6;
      transform: rotate(45deg);
      width: 26px;
    }

    ul {
      overflow-y: scroll;
      -webkit-overflow-scrolling: touch;
      max-height: $baseline * 13.5;
      padding: 0 20px;
    }

    li + li {
      margin-top: $spacing--xs;
    }
  }
}

@include viewport--l {
  .selector {
    .header__content {
      width: grid-columns(7, 12);
    }

    .media-block {
      width: grid-columns(5, 12);
    }

    &__title {
      padding-right: 80px;
      height: $baseline * 6;
      max-width: grid-columns(6, 6);

      .icon.hidden--until-l {
        height: $baseline * 4;
        top: $baseline * 2;
        width: 40px;
      }
    }

    .text--emphasis {
      margin-right: 15px;
    }

    &__content.active {
      margin-top: $baseline * 2.6;
      max-height: $baseline * 25;
      padding: $spacing--m 0 $baseline * 4;
      width: grid-columns(6, 6);

      ul {
        max-height: $baseline * 19;
        padding: 0 30px;
        transition: max-height 0s ease;
      }

      li + li {
        margin-top: $spacing--s;
      }
    }
  }
}


.bg-brand {
  &--dark-blue, &--red {
    .selector__title::before {
      /*@include svg-base64('chevron-down', $color-brand--four);*/
    }
  }

  &--dark-blue a.selector__content--link:hover,
  &--blue a.selector__content--link:hover,
  &--off-white a.selector__content--link:hover {
    color: $color-brand--one;
  }

  &--red a.selector__content--link:hover {
    color: $color-brand--five;
  }

  &--turquoise a.selector__content--link:hover {
    color: $color-brand--three;
  }

  &--yellow a.selector__content--link:hover {
    color: $color-brand--six;
  }

  &--off-white .selector__content.active {
    background: $color-brand--white;

    .pointer {
      background: $color-brand--white;
    }
  }
}

@include viewport--l {
  .bg-brand {
    &--dark-blue, &--red {
      .selector__title::before {
        /*@include svg-base64('chevron-down-40', $color-brand--four);*/
      }
    }
  }
}
