/*
 * .breadcrumbs — trail at the top of the footer on inner pages
 * (template-parts/global/breadcrumbs.php; none on the front page).
 * Figma: footer D 337:12866 (back-to) / M 337:12376.
 *
 * Phones: 12 px, 40 px above and below, line under the row in the container.
 * From 768 px: 18 px, 20 px above and below, line across the full width.
 * A chevron at 10 % between items, the current page at 50 %; the current page keeps
 * one line and is cut with an ellipsis (Matt 1.9, 2026-10-23): on phones it takes a row
 * of its own, from 768 px it fills the rest of the trail's row.
 */

/* .breadcrumbs — full-width line from 768 px */
.breadcrumbs {
  /* @media (width >= 48em) .breadcrumbs */
  @media (width >= 48em) {
    border-bottom: 1px solid rgba(26, 121, 191, 0.1);
  }
}

/* .breadcrumbs__list — 10 → 20 px between items; long trails wrap */
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem clamp(0.625rem, 0.3611rem + 0.9880vw, 1.25rem);
  padding: 2.5rem 0;
  border-bottom: 1px solid rgba(26, 121, 191, 0.1);
  color: var(--nv-navy);
  font-weight: 500;
  font-size: clamp(0.75rem, 0.5916rem + 0.5928vw, 1.125rem);
  line-height: 1;
  letter-spacing: -0.02em;

  /* @media (width >= 48em) .breadcrumbs__list */
  @media (width >= 48em) {
    padding: 1.25rem 0;
    border-bottom: 0;
  }
}

/* .breadcrumbs__item — chevron before every item but the first */
.breadcrumbs__item {
  display: flex;
  align-items: center;
  gap: clamp(0.625rem, 0.3611rem + 0.9880vw, 1.25rem);
  min-width: 0;
  overflow-wrap: anywhere;

  /* .breadcrumbs__item + .breadcrumbs__item::before — 16 → 20 px chevron */
  & + &::before {
    content: "";
    flex-shrink: 0;
    width: clamp(1rem, 0.8945rem + 0.3952vw, 1.25rem);
    height: clamp(1rem, 0.8945rem + 0.3952vw, 1.25rem);
    background: url("../../img/icons/breadcrumbs-chevron.svg") center / contain no-repeat;
    opacity: 0.1;
  }
}

/* .breadcrumbs__item--current */
.breadcrumbs__item--current {
  flex: 1 1 100%;
  color: rgba(19, 33, 50, 0.5);

  /* @media (width >= 48em) .breadcrumbs__item--current — the same row as the trail */
  @media (width >= 48em) {
    flex-basis: 0;
  }
}

/* .breadcrumbs__text — one line, cut with an ellipsis */
.breadcrumbs__text {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* .breadcrumbs__link */
.breadcrumbs__link {
  color: inherit;
  transition: color 0.3s ease;

  /* .breadcrumbs__link:focus-visible */
  &:focus-visible {
    outline: 0.125rem solid var(--nv-blue-light);
    outline-offset: 0.25rem;
  }
}

/* @media (hover: hover) .breadcrumbs__link:hover */
@media (hover: hover) and (pointer: fine) {
  .breadcrumbs__link:hover {
    color: var(--nv-blue-light);
  }
}

/*
 * Phase-2 pages only (Figma back-to bars): the trail is grey and the current page dark, the reverse of the
 * sprint-2 pages; on phones the current page stays in the trail's row when it fits.
 */

/* :is(.postid-78 … .page-slug-erp-readiness-assessment) .breadcrumbs__link — trail at 50 % */
:is(.postid-78, .postid-79, .postid-80, .postid-81, .page-id-124, .page-id-125, .page-id-126, .page-id-127, .page-slug-erp-readiness-assessment, .page-id-116, .page-id-117, .page-id-119, .page-id-122, .page-slug-frequently-asked-questions) .breadcrumbs__link {
  color: rgba(19, 33, 50, 0.5);
}

/* @media (hover: hover) :is(…) .breadcrumbs__link:hover — the hover blue stays */
@media (hover: hover) and (pointer: fine) {
  :is(.postid-78, .postid-79, .postid-80, .postid-81, .page-id-124, .page-id-125, .page-id-126, .page-id-127, .page-slug-erp-readiness-assessment, .page-id-116, .page-id-117, .page-id-119, .page-id-122, .page-slug-frequently-asked-questions) .breadcrumbs__link:hover {
    color: var(--nv-blue-light);
  }
}

/* :is(…) .breadcrumbs__item--current — navy; own row on phones only when it does not fit the first one */
:is(.postid-78, .postid-79, .postid-80, .postid-81, .page-id-124, .page-id-125, .page-id-126, .page-id-127, .page-slug-erp-readiness-assessment, .page-id-116, .page-id-117, .page-id-119, .page-id-122, .page-slug-frequently-asked-questions) .breadcrumbs__item--current {
  flex-basis: auto;
  color: var(--nv-navy);

  /* @media (width >= 48em) :is(…) .breadcrumbs__item--current */
  @media (width >= 48em) {
    flex-basis: 0;
  }
}
