/* ==========================================================================
   Breadcrumb Bar — replaces legacy #second_header / .second_header styles
   Dropdowns use the shared .app-dropdown component.
   ========================================================================== */

/* Container — ID override needed because legacy #second_header in header.css has higher specificity */
#second_header.breadcrumb-bar {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0;
    font-family: var(--font-family-primary);
    z-index: 100;
    box-shadow: none;
    border-radius: 0;
    width: auto;
	margin-bottom: var(--spacing-md);
}

/* Breadcrumb list */
.breadcrumb-bar__list {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    list-style: none;


    margin: 0;
    padding: 0;
    min-width: max-content;
}

/* Individual breadcrumb item */
.breadcrumb-bar__item {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-size: var(--font-body-md-size);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    max-width: 300px;
}

/* Separator chevron between items */
.breadcrumb-bar__separator {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
}

.breadcrumb-bar__separator .sym {
    font-size: var(--icon-size-sm);
    font-weight: var(--icon-weight);
}

/* Root label (non-link) */
.breadcrumb-bar__root {
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
}

/* Parent / page-title link */
.breadcrumb-bar__link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: var(--radius-md);
    padding: 2px 4px;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.breadcrumb-bar__link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Current (last) breadcrumb — stronger emphasis */
.breadcrumb-bar__item--current .breadcrumb-bar__link,
.breadcrumb-bar__item--current {
    color: var(--text-primary);
}

/* Dropdown toggle arrow */
.breadcrumb-bar__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 2px;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.breadcrumb-bar__toggle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.breadcrumb-bar__toggle .sym {
    font-size: var(--icon-size-sm);
    font-weight: var(--icon-weight);
    transition: transform var(--transition-fast);
}

.breadcrumb-bar__toggle[aria-expanded="true"] .sym {
    transform: rotate(180deg);
}

/* ========== PAGE ACTIONS (right-aligned) ========== */

.breadcrumb-bar__toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: auto;
}


.breadcrumb-bar__actions {
    display: flex;
    align-items: center;
    position: relative;
}

/* Primary action button */
.breadcrumb-bar__action-btn {
    display: inline-flex;
    align-items: center;
    /* .app-btn owns size, colour and type; the :has() rule below joins the pair */
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-fast);
}

.breadcrumb-bar__action-split {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    /* overlap the neighbour's border so the pair shares one divider line */
    margin-left: -1px;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast);
}

/* When split button is present, remove right radius from main btn.
   --btn-radius follows whichever .app-btn size variant is on the element. */
.breadcrumb-bar__action-btn:has(+ .breadcrumb-bar__action-split) {
    border-radius: var(--btn-radius) 0 0 var(--btn-radius);
}

/* ========== SECONDARY ACTIONS (filter toggle, help, view mode) ========== */

.breadcrumb-bar__secondary {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-body-sm-size);
    color: var(--text-secondary);
}

/* Push secondary to the right when no toolbar is present */
.breadcrumb-bar__list + .breadcrumb-bar__secondary {
    margin-left: auto;
}

.breadcrumb-bar__filter-toggle.toggleopen .filter-icon--off,
.breadcrumb-bar__filter-toggle.toggleclosed .filter-icon--on {
    display: none;
}

.breadcrumb-bar__filter-toggle.toggleopen .filter-icon--on,
.breadcrumb-bar__filter-toggle.toggleclosed .filter-icon--off {
    display: inline;
}

.breadcrumb-bar__help-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.breadcrumb-bar__help-link:hover {
    color: var(--accent);
}

.breadcrumb-bar__help-link .sym {
    font-size: var(--icon-size-md);
    font-weight: var(--icon-weight);
}
