/**
 * @file
 * Breadcrumbs.
 */

.breadcrumb {
  padding: 0;
  color: var(--admin-color-text);
  font-size: 0.79rem;
}

.breadcrumb__list,
[dir="rtl"] .breadcrumb__list {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.breadcrumb__item,
.breadcrumb__link {
  display: inline-block;
  text-decoration: none;
  color: var(--admin-color-text);
  font-weight: bold;
  line-height: 1.5rem;
}

.breadcrumb__item + .breadcrumb__item::before {
  display: inline-block;
  padding: 0 0.75rem;
  content: url(../../images/icons/currentColor/arrow-breadcrumb.svg);

  [dir="rtl"] & {
    transform: scaleX(-1);
  }

  @media (forced-colors: active) {
    width: 5px; /* Width and height of the SVG. */
    height: 8px;
    content: "";
    background-color: canvastext;
    mask-image: url(../../images/icons/currentColor/arrow-breadcrumb.svg);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
  }
}

.breadcrumb__link:hover,
.breadcrumb__link:focus {
  text-decoration: none;
}

:where(*),
:is(#extra-specificity-hack, [data-drupal-admin-styles]) {
  .gin-breadcrumb {
    padding: 0;
    color: var(--admin-color-text);
  }

  .gin-breadcrumb-wrapper {
    min-width: 1px;
  }

  .gin-breadcrumb__list {
    overflow: hidden;
    width: auto;
    margin: 0;
    margin-block-start: 0;
    margin-inline-start: calc(var(--admin-space-2xs) * -1);
    padding: 0;
    padding-inline-start: var(--admin-space-2xs);
    list-style-type: none;
    text-overflow: ellipsis;
  }

  .gin-breadcrumb__item,
  .gin-breadcrumb__link,
  .gin-breadcrumb__text {
    display: inline;
    vertical-align: middle;
    text-decoration: none;
    color: var(--admin-color-text-soft);
    font-weight: var(--admin-font-weight-normal);
  }

  .gin-breadcrumb__item {
    font-size: 0;

    & + .gin-breadcrumb__item::before {
      display: inline-block;
      padding: 0 0.5em;
      content: "/";
      vertical-align: middle;
      opacity: 0.3;
      background: none;
      font-size: var(--admin-font-size-xs);

      @media (forced-colors: active) {
        opacity: 1;
      }
    }

    &:first-of-type .gin-breadcrumb__link {
      position: relative;
      padding-inline-start: 1.75em;

      &::before {
        position: absolute;
        display: inline-block;
        width: var(--admin-icon-size-toolbar-secondary);
        height: var(--admin-icon-size-toolbar-secondary);
        content: "";
        transform: translateY(-50%);
        background-color: var(--admin-color-icon);
        inset-block-start: calc(50% - 1px);
        inset-inline-start: 0;
        /* cspell:disable-next-line */
        mask-image: url("../../images/icons/currentColor/backtosite.svg");
        mask-size: 100% 100%;
        mask-position: center center;

        @media (forced-colors: active) {
          background: linktext;
        }
      }

      &:hover::before {
        background-color: var(--admin-color-primary);

        @media (forced-colors: active) {
          background: linktext;
        }
      }
    }

    &:first-of-type + .gin-breadcrumb__item::before {
      width: 1px;
      height: 20px;
      margin-inline-end: 0.75em;
      padding-inline-start: 0.75em;
      padding-inline-end: 0;
      content: "";
      opacity: 0.3;
      border-inline-end: 1px solid var(--admin-color-text);

      @media (forced-colors: active) {
        opacity: 1;
      }
    }
  }

  .gin-breadcrumb__link,
  .gin-breadcrumb__text {
    border-radius: var(--admin-radius-2xs);
    font-size: var(--admin-font-size-xs);
    line-height: 2;
  }

  .gin-breadcrumb__link,
  .gin-breadcrumb__link:link,
  .gin-breadcrumb__link:visited,
  .gin-breadcrumb__link em,
  .gin-breadcrumb__link em:link,
  .gin-breadcrumb__link em:visited,
  .gin-breadcrumb__text,
  .gin-breadcrumb__text:link,
  .gin-breadcrumb__text:visited,
  .gin-breadcrumb__text em,
  .gin-breadcrumb__text em:link,
  .gin-breadcrumb__text em:visited {
    color: var(--admin-color-text-soft);
    font-weight: var(--admin-font-weight-normal);
  }

  .gin-breadcrumb__link em,
  .gin-breadcrumb__text em {
    font-style: italic;
  }

  .gin-breadcrumb__link:hover,
  .gin-breadcrumb__link:hover em {
    color: var(--admin-color-primary-hover);
  }
}
