/* Breadcrumbs — Figma 1135:21611 (2 / 3 / 4 level, Desktop + Mobile). */

.aayda-breadcrumbs {
  width: 100%;
  min-width: 0;
}

/*
 * One line at every width (2026-12-02, owner request; replaces ML-E D6's "the list wraps first"): the trail never
 * wraps and is held to the breadcrumb's width, so a long title never widens the page. The current page's crumb gives
 * way first (below): the ancestors keep their full width whenever they fit with at least a stub of the current crumb.
 * Only on a trail whose ancestors alone are wider than the line (a narrow phone, five levels) does the crumb just before
 * the current one (the most specific, usually the longest) shrink too, ending in an ellipsis, rather than the trail
 * running past the screen; the others, "Home" first, never shrink.
 */
.aayda-breadcrumbs__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--aayda-numbers-spacing-4);
  min-width: 0;
  max-width: 100%;
}

.aayda-breadcrumbs__item {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--aayda-numbers-spacing-4);
  min-width: 0;
  min-height: 28px;
}

.aayda-breadcrumbs__item:nth-last-child(2):not(:first-child) {
  flex-shrink: 1;
}

.aayda-breadcrumbs__link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aayda-breadcrumbs__item + .aayda-breadcrumbs__item::before {
  display: block;
  flex: 0 0 12px;
  width: 12px;
  height: 28px;
  background: url("../../assets/icons/breadcrumb-separator.svg") center / 12px 28px no-repeat;
  content: "";
}

/*
 * bug-fix-5 batch 2: one breadcrumb on every page, the About Us one (owner reference). Below 1416px the crumbs
 * are SemiBold 14/20, from 1416px Medium 16/26; ancestors #989898 and the current page #364153 at every depth
 * (Figma 1135:21611 colours and sizes). Pages no longer restyle the type or colour, only their own layout.
 */
.aayda-breadcrumbs__link,
.aayda-breadcrumbs__current {
  font-family: var(--aayda-typography-font-primary);
  font-weight: var(--aayda-typography-weight-semi-bold);
  font-size: var(--aayda-typography-size-14);
  line-height: var(--aayda-typography-line-height-14);
  letter-spacing: var(--aayda-typography-letter-spacing-14);
  white-space: nowrap;
}

.aayda-breadcrumbs__link {
  color: var(--aayda-colors-neutral-500);
}

.aayda-breadcrumbs__current {
  color: var(--aayda-colors-gray-800);
}

/*
 * bug-fix-5 (owner request, replacing the earlier "no hover" decision): a crumb that navigates turns blue on
 * hover — Figma's colors/blue/400, the site's link-hover blue. Only real links: a step that is only a label
 * keeps the __link class on a <span> for its grey, so it is excluded by the element, and the current page is
 * never a link. Pointer devices only, so a tap never leaves a crumb blue.
 */
@media (hover: hover) {
  a.aayda-breadcrumbs__link:hover {
    color: var(--aayda-colors-blue-400);
  }
}

/*
 * The current page's crumb takes the room the ancestors leave (a zero basis, so it never takes room from them) and no
 * more than its text needs; a title longer than that room ends in an ellipsis. It keeps at least its separator and a
 * couple of letters, so it never disappears. A title that fits is unchanged; the ellipsis is only drawn, so the whole
 * text stays in the page and is read out in full, and the page's own heading is never shortened.
 */
.aayda-breadcrumbs__item:last-child {
  flex: 1 1 0;
  min-width: calc(12px + var(--aayda-numbers-spacing-4) + 2em);
  max-width: max-content;
}

.aayda-breadcrumbs__current {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1416px) {
  .aayda-breadcrumbs__list {
    align-items: flex-start;
  }

  .aayda-breadcrumbs__item {
    align-items: flex-start;
  }

  .aayda-breadcrumbs__link,
  .aayda-breadcrumbs__current {
    font-weight: var(--aayda-typography-weight-medium);
    font-size: var(--aayda-typography-size-16);
    line-height: var(--aayda-typography-line-height-16);
    letter-spacing: var(--aayda-typography-letter-spacing-16);
  }
}

/*
 * Breadcrumb top spacing (bug-fix-5, owner requirement): the breadcrumb is drawn 12px under the visible top
 * edge of the gray area it sits on, on every page and at every width — and nothing else moves. Its layout
 * box stays where each page's layout puts it (so titles, ledes, top-block heights and the content below keep
 * their exact positions); only its rendering is translated, by the distance js/components/breadcrumbs.js
 * measures. A transform takes no part in layout and is not counted as a layout shift. Without the script the
 * shift is 0 and the breadcrumb stays where it was.
 */
:root {
  --aayda-breadcrumb-offset-top: 12px;
}

.aayda-breadcrumbs {
  transform: translateY(var(--aayda-breadcrumb-shift, 0px));
}
