@import url('brandingPalette.css');

/* === Breadcrumb: pill-chip "cwh-trail" look on .cwh-breadcrumb ===
   Shared breadcrumb styling. Restyles the existing Bootstrap-style
   <ol class="breadcrumb cwh-breadcrumb"> markup into the CWH pill-chip trail
   (matches the secure & corporate portals). CSS-only — no markup change
   beyond adding the .cwh-breadcrumb class. The last <li> is rendered as the
   "current" gradient pill; prior <li> links are ghost chips that fill on
   hover. Chevrons sit between crumbs. */

.cwh-breadcrumb {
    --bs-breadcrumb-divider: "";
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    row-gap: 8px;
    background: var(--cwh-white);
    border: 1px solid var(--cwh-border);
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 4px 16px rgba(0, 51, 126, 0.06);
    font-family: var(--cwh-font-family);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    list-style: none;
}

.cwh-breadcrumb .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    padding: 0;
    min-width: 0;
    max-width: 100%;
}

.cwh-breadcrumb .breadcrumb-item + .breadcrumb-item {
    padding-left: 0;
}

/* Chevron separator between crumbs */
.cwh-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "\203A";
    color: var(--cwh-light-grey);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 6px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    float: none;
}

/* Current (last / active) crumb: keep the spacing the separator gave but
   hide the glyph, so the title pill is not jammed against the previous chip
   and has no "/" in front of it. */
.cwh-breadcrumb .breadcrumb-item:last-child::before,
.cwh-breadcrumb .breadcrumb-item.active::before {
    content: "" !important;
}

/* Ghost chip — past crumbs (clickable links) */
.cwh-breadcrumb .breadcrumb-item a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-family: var(--cwh-font-family);
    font-weight: var(--cwh-font-medium);
    font-size: clamp(0.8rem, 0.76rem + 0.18vw, 0.9rem);
    color: var(--cwh-middle-blue);
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cwh-breadcrumb .breadcrumb-item a:hover,
.cwh-breadcrumb .breadcrumb-item a:focus {
    background: var(--cwh-light-blue);
    color: var(--cwh-dark-blue);
    transform: translateY(-1px);
    text-decoration: none;
}

.cwh-breadcrumb .breadcrumb-item a:focus-visible {
    outline: 2px solid var(--cwh-open-blue);
    outline-offset: 2px;
}

/* Current crumb — last <li>, or any <li> marked .active. Gradient pill
   on the <li> itself so it works whether the inner content is plain
   text or an <a>. */
.cwh-breadcrumb .breadcrumb-item:last-child,
.cwh-breadcrumb .breadcrumb-item.active {
    background: linear-gradient(135deg, var(--cwh-dark-blue) 0%, #0e4d92 100%);
    color: var(--cwh-white);
    font-family: var(--cwh-font-family);
    font-weight: var(--cwh-font-bold);
    font-size: clamp(0.8rem, 0.76rem + 0.18vw, 0.9rem);
    border-radius: 999px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0, 51, 126, 0.18);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cwh-breadcrumb .breadcrumb-item:last-child a,
.cwh-breadcrumb .breadcrumb-item.active a {
    padding: 0;
    background: transparent;
    color: var(--cwh-white);
    font-weight: var(--cwh-font-bold);
    transform: none;
    box-shadow: none;
}

.cwh-breadcrumb .breadcrumb-item:last-child a:hover,
.cwh-breadcrumb .breadcrumb-item:last-child a:focus,
.cwh-breadcrumb .breadcrumb-item.active a:hover,
.cwh-breadcrumb .breadcrumb-item.active a:focus {
    background: transparent;
    color: var(--cwh-white);
    transform: none;
}

/* Tablet <=768px — slightly tighter chips */
@media (max-width: 768px) {
    .cwh-breadcrumb {
        padding: 5px 8px;
        gap: 4px;
        row-gap: 6px;
    }

    .cwh-breadcrumb .breadcrumb-item a,
    .cwh-breadcrumb .breadcrumb-item:last-child,
    .cwh-breadcrumb .breadcrumb-item.active {
        padding: 7px 14px;
        font-size: 0.82rem;
    }

    .cwh-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        width: 14px;
        font-size: 1rem;
        padding: 0 4px;
    }
}

/* Phone <=520px — cap chip width so a long label can't blow out parent */
@media (max-width: 520px) {
    .cwh-breadcrumb {
        padding: 5px 6px;
        gap: 3px;
        row-gap: 5px;
    }

    .cwh-breadcrumb .breadcrumb-item a,
    .cwh-breadcrumb .breadcrumb-item:last-child,
    .cwh-breadcrumb .breadcrumb-item.active {
        padding: 6px 12px;
        font-size: 0.78rem;
        max-width: 75vw;
    }

    .cwh-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        width: 12px;
        font-size: 0.9rem;
        padding: 0 3px;
    }
}
