/* === BIP UWM — Minimal Custom Styles === */

:root {
    --brand: #009846;
    --brand-hover: #1f1a17;
    --accent: #00a0e3;
    --muted: #73787d;
    --ink: #1f1a17;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: #f0f1f3;
    color: #2d3033;
    font-size: 15px;
}

/* === Top Bar === */
.top-bar {
    background: #fff;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(
        to right,
        var(--accent) 0 33.333%,
        var(--brand) 33.333% 100%
    ) 1;
}
.top-bar-inner { max-width: 75%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; }
.top-bar-branding { display: flex; align-items: center; gap: 24px; min-width: 0; }
.top-bar-bip-logo { display: flex; flex: 0 0 auto; align-items: center; }
.top-bar-bip-logo img { width: auto; height: 48px; }
.top-bar-logo { display: flex; align-items: center; gap: 36px; text-decoration: none; }
.top-bar-logo img { height: 48px; }
.top-bar-links { display: flex; align-items: center; gap: 16px; font-size: .82rem; }
.top-bar-links a { color: #5f6368; text-decoration: none; }
.top-bar-links a:hover { color: var(--accent); }

/* === Sidebar Navigation === */
.side-nav { width: 260px; flex-shrink: 0; }
.side-nav-box { background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; margin-bottom: 16px; }
.side-nav-box .side-nav-heading {
    font-size: .85rem; font-weight: 600; padding: 14px 18px;
    background: #f8f9fa; color: #2d3033;
    border-left: 3px solid var(--accent);
}
.side-nav-box a {
    display: block; padding: 10px 18px 10px 22px;
    color: #2d3033; text-decoration: none; font-size: .85rem;
    border-bottom: 1px solid #f0f1f3; transition: all .15s;
}
.side-nav-box a:last-child { border-bottom: none; }
.side-nav-box a:hover { background: rgba(0, 160, 227, .08); color: var(--accent); padding-left: 26px; }
.side-nav-box a.active { background: rgba(0, 160, 227, .08); color: var(--accent); font-weight: 600; border-left: 3px solid var(--accent); padding-left: 19px; }
.side-nav-sub a { background: #fff; font-size: .82rem; padding: 8px 18px 8px 30px; }
.side-nav-sub a:hover { padding-left: 34px; }
.side-nav-box .side-nav-heading[data-bs-toggle="collapse"] { cursor: pointer; }
.side-nav-collapse-icon {
    font-size: 1rem;
    transition: transform .2s ease;
}
.side-nav-box .side-nav-heading[aria-expanded="true"] .side-nav-collapse-icon { transform: rotate(180deg); }

/* === Layout === */
.main-wrapper { max-width: 1200px; margin: 0 auto; padding: 24px 20px 40px; display: flex; gap: 28px; }
.content-area { flex: 1; min-width: 0; }

/* === Content Card === */
.content-card {
    min-width: 0;
    background: #fff;
    padding: 28px 32px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow-wrap: anywhere;
}
.content-card h2 { font-size: 1.35rem; font-weight: 600; line-height: 1.4; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid #f0f1f3; }
.content-card img,
.content-card video { max-width: 100%; height: auto; }
.content-card iframe { max-width: 100%; }
.content-card pre,
.content-card code { white-space: pre-wrap; overflow-wrap: anywhere; }
.content-card table:not(.table) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* === Cards Grid === */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card-item { background: #fff; border: 1px solid #e0e2e5; border-radius: 4px; padding: 20px; text-decoration: none; color: #2d3033; display: block; transition: box-shadow .2s, border-color .2s; }
.card-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); border-color: var(--accent); text-decoration: none; }
.card-item :is(h2, h4) { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.card-item p { font-size: .85rem; color: #5f6368; }

/* === Bootstrap Overrides === */
a { color: var(--accent); }
a:hover { color: var(--brand-hover); }
.card { border-radius: 8px; }
.card .card-title a { color: #2d3033; text-decoration: none; }
.card .card-title a:hover { color: var(--accent); }
.pagination .page-link { color: #2d3033; }
.pagination .page-link:hover { color: var(--accent); }
.pagination .active .page-link { background: var(--accent); border-color: var(--accent); }

/* === Article Cards === */
.article-card {
    border: none; border-left: 4px solid transparent;
    border-radius: 0 6px 6px 0; box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .2s, border-left-color .2s;
}
.article-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.1); border-left-color: var(--accent); }

/* === Search results === */
.search-result-content { min-width:0;flex:1;overflow-wrap:anywhere; }
.search-match { background:#ffe69c;color:#332701;padding:0 .1em;border-radius:.15em; }
.search-snippet { font-size:.85rem;line-height:1.6;background:rgba(0,160,227,.06);padding:.5rem .75rem;border-radius:.35rem;overflow-wrap:anywhere; }

/* === Article History === */
#article-history-accordion {
    --bs-accordion-active-bg: #fff;
    --bs-accordion-active-color: var(--bs-accordion-color);
    --bs-accordion-btn-active-icon: var(--bs-accordion-btn-icon);
}
.article-history-item {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .75rem;
    padding: 0 1.25rem;
}
.article-history-item-current {
    background: var(--bs-primary-bg-subtle);
    box-shadow: inset 3px 0 0 var(--accent);
}
.article-history-marker {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 1.35rem;
}
.article-history-marker::before,
.article-history-marker::after {
    position: absolute;
    left: 50%;
    z-index: 0;
    width: 2px;
    transform: translateX(-50%);
    background: #ced4da;
    content: "";
}
.article-history-item:not(:first-child) .article-history-marker::before {
    top: 0;
    height: 1.35rem;
}
.article-history-item:not(:last-child) .article-history-marker::after {
    top: calc(1.35rem + 12px);
    bottom: 0;
}
.article-history-dot {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #6c757d;
    box-shadow: 0 0 0 2px #6c757d;
}
.article-history-item-current .article-history-dot {
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}
.article-history-content {
    min-width: 0;
    padding: 1rem 0;
    border-bottom: 1px solid #eceff1;
    overflow-wrap: anywhere;
}
.article-history-item:last-child .article-history-content { border-bottom: 0; }
.article-history-signature { color: #2d3033; }
.article-history-signature:hover { color: var(--accent); }

/* === Breadcrumbs === */
.breadcrumbs { font-size: .82rem; color: #5f6368; margin-bottom: 16px; }
.breadcrumbs a { color: #5f6368; text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }

/* === Footer === */
.footer { background: #2d3033; color: #aaa; font-size: .82rem; padding: 32px 20px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-col { flex: 1; min-width: 200px; }
.footer-col h2 { color: #fff; font-size: .9rem; margin-bottom: 10px; }
.footer-col p, .footer-col a { display: block; color: #aaa; text-decoration: none; margin-bottom: 4px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { max-width: 1200px; margin: 20px auto 0; padding-top: 16px; border-top: 1px solid #444; text-align: center; color: #777; font-size: .78rem; }

/* === Content Card === */
.content-card { background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.content-card h2 { font-size: 1.35rem; font-weight: 600; border-bottom: 2px solid #f0f1f3; }

/* === Responsive === */
@media (max-width: 900px) {
    .main-wrapper {
        width: 100%;
        flex-direction: column;
        gap: 16px;
        padding: 16px 14px 32px;
    }
    .side-nav { width: 100%; }
    .content-area { width: 100%; min-width: 0; }
    .content-card { width: 100%; padding: 22px 20px; }
    .top-bar-inner { width: 100%; max-width: 100%; flex-direction: column !important; gap: 12px; padding: 12px 14px; text-align: center; }
    .top-bar-branding { width: 100%; flex-direction: column; gap: 10px; }
    .top-bar-logo { width: 100%; min-width: 0; flex-direction: column; gap: 8px; }
    .top-bar-links { flex-direction: column !important; align-items: center; gap: 8px; width: 100%; }
    .top-bar-links form { width: 100% !important; max-width: 420px; }
}

@media (max-width: 575.98px) {
    .main-wrapper { padding: 12px 10px 28px; gap: 12px; }
    .content-card { padding: 18px 14px; }
    .content-card h2 { font-size: 1.15rem; }
    .content-card h3 { line-height: 1.4; }
    .breadcrumbs { line-height: 1.65; overflow-wrap: anywhere; }
    .cards-grid { grid-template-columns: minmax(0, 1fr); }
    .card-item { padding: 16px; }
    .article-history-item {
        grid-template-columns: 1.5rem minmax(0, 1fr);
        gap: .5rem;
        padding: 0 .75rem;
    }

    .content-card form .row > .col,
    .content-card form .row > .col-auto {
        width: 100%;
        flex: 0 0 100%;
    }
    .content-card form .row > .col-auto .btn { width: 100%; }

    .content-card .table-borderless,
    .content-card .table-borderless tbody {
        display: block;
        width: 100%;
    }
    .content-card .table-borderless tr {
        display: block;
        padding: 8px 0;
        border-bottom: 1px solid #f0f1f3;
    }
    .content-card .table-borderless tr:last-child { border-bottom: 0; }
    .content-card .table-borderless td {
        display: block;
        width: 100% !important;
        padding: 2px 0 !important;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .content-card .table-borderless td:first-child {
        font-size: .78rem;
        font-weight: 600;
    }

    .content-card .article-card .d-flex,
    .content-card .d-flex.align-items-center {
        min-width: 0;
        flex-wrap: wrap;
    }
.content-card a,
    .content-card .text-break { overflow-wrap: anywhere; word-break: break-word; }
}

/* Navigation captions are native buttons, not document headings. */
.side-nav-heading { display:block;width:100%;margin:0;border:0;text-align:left;font-family:inherit; }
.side-nav-heading a { padding:0;border:0;font-size:inherit; }
.content-card > h1 { font-size:1.35rem;font-weight:600;line-height:1.4;padding-bottom:12px;margin-bottom:16px;border-bottom:2px solid #f0f1f3; }
.content-card .card-title { padding-bottom:0;border-bottom:0; }

.content-card .card-item h2 { padding:0;border:0;font-size:1rem; }
