@import "govuk_publishing_components/individual_component_support";
@import "govuk/components/breadcrumbs/breadcrumbs";

.gem-c-breadcrumbs--inverse .govuk-breadcrumbs__list-item .govuk-breadcrumbs__link {
  &:link,
  &:visited,
  &:hover,
  &:active {
    color: govuk-colour("white");
  }

  &:focus {
    color: $govuk-focus-text-colour;
  }
}

.gem-c-breadcrumbs--inverse .govuk-breadcrumbs__list-item {
  color: govuk-colour("white");
}

.gem-c-breadcrumbs--inverse .govuk-breadcrumbs__list-item::before {
  border-color: govuk-colour("white");
}

.gem-c-breadcrumbs--border-bottom {
  border-bottom: 1px solid $govuk-border-colour;
  padding-bottom: govuk-spacing(1);

  &.govuk-breadcrumbs--collapse-on-mobile {
    @include govuk-media-query($until: tablet) {
      padding-bottom: 0;
    }
  }
}

.govuk-breadcrumbs--collapse-on-mobile {
  @include govuk-media-query($until: tablet) {
    .govuk-breadcrumbs__list-item {
      padding-top: 14px;
      padding-bottom: 14px;
    }

    .govuk-breadcrumbs__list-item::before {
      top: 20px;
    }

    .govuk-breadcrumbs__link::after {
      content: "";
      position: absolute;
      top: 0;
      right: 0;
      left: 0;
      bottom: 0;
    }
  }
}

.gem-c-breadcrumbs[dir="rtl"] {
  text-align: start;

  .govuk-breadcrumbs__list-item {
    float: inline-start;
    margin-inline-end: .625em;
    padding-inline-end: .978em;

    &::before {
      transform: rotate(-135deg);
      left: 0;
      right: -1.2069em;
    }
  }
}

@include govuk-media-query($media-type: print) {
  .gem-c-breadcrumbs {
    font-size: 12pt;
  }

  .gem-c-breadcrumbs,
  .govuk-breadcrumbs {
    .govuk-breadcrumbs__list-item {
      .govuk-breadcrumbs__link:link,
      .govuk-breadcrumbs__link:visited {
        color: $govuk-print-text-colour;
      }

      &::before {
        border-color: $govuk-print-text-colour;
      }
    }
  }
}
