@import '../../globals/scss/vars';
@import '../../globals/scss/colors';
@import '../../globals/scss/typography';
@import '../../globals/scss/spacing';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/css--reset';
@import '../../globals/scss/import-once';

@include exports('content-switcher') {
  .#{$prefix}--content-switcher {
    @include font-family;
    display: flex;
    height: rem(40px);
  }

  .#{$prefix}--content-switcher-btn {
    @include reset;
    @include font-smoothing;
    @include typescale('zeta');
    @include font-family;
    background-color: transparent;
    display: flex;
    align-items: center;
    padding: 0 $spacing-xl;
    margin: 0;
    text-decoration: none;
    border: 1px solid $brand-01;
    color: $brand-01;

    &:focus {
      outline: 1px solid transparent;
      box-shadow: 0 2px 0 0 $color__blue-20, 0 -2px 0 0 $color__blue-20;
      background-color: $brand-02;
      z-index: 2;
      border-color: $brand-02;
      text-decoration: underline;
      color: $inverse-01;
    }

    &:hover {
      cursor: pointer;
    }

    &:hover,
    &:active {
      background-color: $brand-02;
      border-color: $brand-02;
      color: $inverse-01;
    }
  }

  .#{$prefix}--content-switcher__icon {
    margin-right: $spacing-xs;
    fill: currentColor;
    // need to color any child path or g
    * {
      fill: currentColor;
    }
  }

  .#{$prefix}--content-switcher-btn:not(:last-of-type) {
    border-right: none;
  }

  .#{$prefix}--content-switcher-btn:not(:first-of-type) {
    border-left: $content-switcher-option-border;
  }

  .#{$prefix}--content-switcher-btn:first-of-type {
    border-bottom-left-radius: $content-switcher-border-radius;
    border-top-left-radius: $content-switcher-border-radius;

    &:hover {
      border-color: $brand-02;
    }

    &:focus {
      box-shadow: -2px 0 0 0 $color__blue-20, 0 2px 0 0 $color__blue-20, 0 -2px 0 0 $color__blue-20;
      z-index: 0;
    }
  }

  .#{$prefix}--content-switcher-btn:last-of-type {
    border-top-right-radius: $content-switcher-border-radius;
    border-bottom-right-radius: $content-switcher-border-radius;

    &:hover {
      border-color: $brand-02;
    }

    &:focus {
      box-shadow: 2px 0 0 0 $color__blue-20, 0 2px 0 0 $color__blue-20, 0 -2px 0 0 $color__blue-20;
      z-index: 0;
    }
  }

  .#{$prefix}--content-switcher-btn.#{$prefix}--content-switcher--selected {
    background-color: $brand-01;
    color: $inverse-01;
    font-weight: 400;
    outline: 1px solid transparent;

    &:hover {
      border-color: $brand-01;
    }
  }
}
