/* ============================================
   BREADCRUMB — BROADSHEET EDITORIAL TRAIL
   Not a boxed component. A printed running-folio trail sitting flush on
   the page surface: no frame, no card, no resting shadow, no rounded
   pill. Separators are hairline vertical rules (the column gutter of a
   newspaper), the home marker is a small steel-blue tick, and the only
   interaction is an underline that appears under a hovered ancestor —
   the reader's eye traces the path, the chrome does not announce itself.
   ============================================ */

.breadcrumb-section {
    position: relative;
    padding: 0.75rem 0 0 0;
    z-index: 10;
}

/* No wrapper card — the trail lives on the page surface. A single hairline
   rule beneath the trail closes the orientation strip the way a folio rule
   closes a page header in print. */
.breadcrumb-wrapper {
    position: relative;
    background: transparent;
    border: none;
    border-bottom: var(--rule-w) solid var(--border-color);
    border-radius: 0;
    padding: 0 0 0.625rem 0;
    transition: border-color 0.3s ease;
}

/* No resting shadow, no hover shadow — the strip never lifts. The bottom
   rule simply deepens on interaction (state as color, not elevation). */
.breadcrumb-wrapper:hover {
    border-color: var(--border-strong);
    box-shadow: none;
}

.breadcrumb-section .breadcrumb {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.breadcrumb-section .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    font-size: var(--fs-subtitle);
    font-weight: 500;
    padding: 0;
    transition: color 0.3s ease;
    letter-spacing: 0.005em;
}

/* Separator — a hairline vertical rule (a column gutter), not a chevron
   glyph. Reads as a printed folio divider. */
.breadcrumb-section .breadcrumb-item + .breadcrumb-item::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 0.85em;
    margin: 0 0.625rem;
    flex-shrink: 0;
    background-color: var(--border-strong);
    opacity: 1;
    transition: background-color 0.3s ease;
}

/* The gutter rule ahead of a hovered ancestor warms to the accent. */
.breadcrumb-section .breadcrumb-item:hover + .breadcrumb-item::before {
    background-color: var(--accent-color);
}

.breadcrumb-section .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.175rem 0;
    border-radius: 0;
    /* The underline is the only interaction: hidden at rest, drawn on hover
       with a paper-colored gap so it reads as a typeset rule, not a link
       default. */
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: color 0.3s ease, background-size 0.25s ease;
    position: relative;
}

.breadcrumb-section .breadcrumb-item a:hover {
    color: var(--primary-color);
    background-color: transparent;
    background-size: 100% 1px;
}

/* Visible focus ring on every interactive element (steel-blue, never removed). */
.breadcrumb-section .breadcrumb-item a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

.breadcrumb-section .breadcrumb-item.active {
    color: var(--text-ink);
    font-weight: 700;
}

/* Non-clickable entry: a menu heading (group label) with no destination.
   Styled like a normal ancestor but never interactive. */
.breadcrumb-section .breadcrumb-item.breadcrumb-item-nolink {
    color: var(--text-muted);
    cursor: default;
    padding: 0.175rem 0;
}

/* Breadcrumb Home — a steel-blue tick mark before the home label, the
   broadsheet "return to section front" marker. */
.breadcrumb-section .breadcrumb-item:first-child a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.breadcrumb-section .breadcrumb-item:first-child a::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 0.85em;
    background-color: var(--primary-color);
    flex-shrink: 0;
    transform-origin: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.breadcrumb-section .breadcrumb-item:first-child a i {
    display: none;
}

.breadcrumb-section .breadcrumb-item:first-child a:hover::before {
    background-color: var(--accent-color);
    transform: scaleY(1.15);
}

/* Breadcrumb Dark Mode — token cascade handles the recolor automatically
   (--text-muted, --primary-color, --accent-color, --border-color all
   re-point under dark). No manual override needed. */
html[data-bs-theme="dark"] .breadcrumb-wrapper:hover {
    box-shadow: none;
}

/* Breadcrumb RTL — the gutter rule and home tick are symmetric, so only
   the underline gradient direction needs to mirror (it grows from the
   inline-start edge). */
html[dir="rtl"] .breadcrumb-section .breadcrumb-item a {
    background-position: 100% 100%;
}

/* Breadcrumb Responsive */
@media (max-width: 768px) {
    .breadcrumb-section {
        padding: 0.5rem 0 0;
    }

    .breadcrumb-wrapper {
        padding: 0 0 0.5rem 0;
    }

    .breadcrumb-section .breadcrumb-item {
        font-size: 0.8rem;
    }

    .breadcrumb-section .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 0.5rem;
    }
}

/* Motion sensitivity — preserve state change (color + underline draw) while
   removing only the duration pacing that disturbs vestibular-sensitive
   users. The affordance stays legible through color and the static
   underline at hover end-state. */
@media (prefers-reduced-motion: reduce) {
    .breadcrumb-wrapper,
    .breadcrumb-section .breadcrumb-item,
    .breadcrumb-section .breadcrumb-item + .breadcrumb-item::before,
    .breadcrumb-section .breadcrumb-item a,
    .breadcrumb-section .breadcrumb-item:first-child a::before {
        transition: none;
    }

    /* Suppress the tick grow and gutter-rule draw motion; color alone signals
       the hover state. */
    .breadcrumb-section .breadcrumb-item:first-child a:hover::before {
        transform: none;
    }
}
