@import "../variables";

.cr-breadcrumb {
  ol {
    margin-top: 1em;
    padding-left: 0;
    padding-right: 1em;
    margin-bottom: 1.5em;
    padding-bottom: 1px;
    list-style: none;
    font-size: 0;
  }

  li {
    list-style: none;
    padding: 0;
    margin: 0 0 -1px;
    border-bottom: 1px solid $brand-gray-medium;
    border-left: 1px solid $brand-gray-medium;
    border-top: 1px solid $brand-gray-medium;
    display: inline-block;

    &:first-child a {
      padding-left: 12px;
    }

    &:last-child a {
      text-decoration: none;
      color: $BLACK;
      background: $brand-gray-light;
      cursor: default;

      &::after {
        border-left-color: $brand-gray-light;
      }
    }
  }

  a {
    color: $brand-gray-dark;
    display: inline-block;
    padding: 8px 10px 8px 20px;
    position: relative;
    background-color: $WHITE;
    text-decoration: underline;
    white-space: nowrap;
    font-size: 0.85rem;
    line-height: 18px;

    &::after,
    &::before {
      content: "";
      border-top: 18px solid transparent;
      border-bottom: 18px solid transparent;
      border-left: 15px solid;
      margin-top: -18px;
      position: absolute;
      right: -14px;
      top: 50%;
    }

    &::after {
      border-left-color: $WHITE;
      z-index: 2;
    }

    &::before {
      border-left-color: $brand-gray-medium;
      right: -15px;
      z-index: 1;
    }

    &:hover {
      background: $brand-gray-light;
      color: $brand-secondary;

      &::after {
        border-left-color: $brand-gray-light;
      }
    }
  }

  &.cr-breadcrumb--hide-current li:last-child {
    @extend .sr-only;
  }

  &.cr-breadcrumb--hide-top {
    li:first-child {
      @extend .sr-only;
    }

    li:nth-child(2) a {
      padding-left: 12px;
    }
  }
}

