/* Breadcrumb trail (Pages/Shared/_Breadcrumbs.cshtml) - every interior page that sits below a
   section: public detail pages, the admin, the driver's own pages and the exam pages.
   Set in the Eyebrow style (it takes the place of the kicker line above the h1): Chakra Petch
   caps in Muted, links going Telemetry Blue on hover, the current page in Ink. Separators are a
   slanted hairline - the speed-bar's skew - drawn in CSS so screen readers only hear the list.

   It never wraps: one line at every width. Each step truncates with an ellipsis (the full label
   is in its title), the parents first and harder than the current page, and the root step
   (Home, Admin, Exams) never shrinks, so the way back out is always readable.

   Rendered as a block child of the page, not inside a flex head, so it always has the full
   column to truncate against. The links carry .crumb, which layout.css's prose-link rule skips. */

.breadcrumbs { margin: 0 0 1.1rem; min-width: 0; }
.breadcrumbs ol {
    display: flex; align-items: center; gap: .55rem;
    margin: 0; padding: 0; list-style: none;
    font-family: var(--font-display); font-weight: 600; font-size: .72rem;
    letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
    white-space: nowrap;
}
.breadcrumbs li { display: flex; align-items: center; gap: .55rem; min-width: 0; flex: 0 3 auto; }
/* The root never shrinks; the current page gives way last. */
.breadcrumbs li:first-child { flex-shrink: 0; }
.breadcrumbs li:last-child { flex-shrink: 1; }
.breadcrumbs li + li::before {
    content: ""; flex: none; width: 1px; height: .9em;
    background: color-mix(in srgb, var(--muted) 55%, transparent);
    transform: skewX(-18deg);
}

.crumb {
    display: block; min-width: 0; max-width: 22rem;
    overflow: hidden; text-overflow: ellipsis;
    /* Room for the focus ring and a slightly taller hit area without moving the text. */
    padding-block: .2rem;
}
a.crumb { color: var(--muted); text-decoration: none; border-radius: .2rem; transition: color .15s ease; }
a.crumb:hover { color: var(--blue-ink); }
a.crumb:focus-visible { color: var(--blue-ink); outline: 2px solid var(--blue); outline-offset: 2px; }
.crumb[aria-current="page"] { color: var(--ink); max-width: 32rem; }

/* Phones: a long trail keeps the root, the direct parent and the current page, and folds the
   steps between into an ellipsis after the root. The folded steps are only visually hidden, so
   a screen reader still hears the whole trail. */
@media (max-width: 40rem) {
    .breadcrumbs { margin-bottom: .9rem; }
    .breadcrumbs ol, .breadcrumbs li { gap: .45rem; }
    .breadcrumbs ol { letter-spacing: .1em; }
    .crumb { max-width: 10rem; }
    .crumb[aria-current="page"] { max-width: none; }

    .breadcrumbs li:not(:first-child):not(:nth-last-child(-n+2)) {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip-path: inset(50%); white-space: nowrap;
    }
    /* Four or more steps means something was folded: mark it after the root, with the same
       slanted hairline as a separator drawn in front of the ellipsis. */
    .breadcrumbs li:first-child:nth-last-child(n+4)::after {
        content: "\2026"; flex: none; letter-spacing: 0;
        padding-left: calc(.45rem + .35em);
        background: linear-gradient(104deg,
            transparent calc(50% - .5px), color-mix(in srgb, var(--muted) 55%, transparent) calc(50% - .5px),
            color-mix(in srgb, var(--muted) 55%, transparent) calc(50% + .5px), transparent calc(50% + .5px))
            left center / .35em .9em no-repeat;
    }
}
