:root {
    --bfmc-navy: #102a43;
    --bfmc-blue: #1671b8;
    --bfmc-blue-dark: #0d507f;
    --bfmc-red: #e31b23;
    --bfmc-ink: #1d2b36;
    --bfmc-muted: #536777;
    --bfmc-surface: #f4f7fa;
    --bfmc-line: #dbe4eb;
}

body {
    color: var(--bfmc-ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.wy-nav-side {
    background: var(--bfmc-navy);
}

.wy-side-nav-search {
    background: linear-gradient(145deg, #122c46, #16466c);
    padding: 1.25rem 1rem 1.15rem;
}

.wy-side-nav-search > a,
.wy-side-nav-search .wy-dropdown > a {
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.4;
}

.wy-side-nav-search input[type="text"] {
    border: 0;
    border-radius: 0.4rem;
    box-shadow: none;
    margin-top: 0.9rem;
    padding: 0.6rem 0.75rem;
}

.wy-side-nav-search > .bfmc-site-home {
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 0.35rem;
    color: #fff;
    display: flex;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.45rem;
    justify-content: center;
    margin: 0.95rem 0 0;
    padding: 0.55rem 0.7rem;
}

.wy-side-nav-search > .bfmc-site-home:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
    color: #92c4e8;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    margin-top: 1.15rem;
}

.wy-menu-vertical a {
    color: #e6edf3;
}

.wy-menu-vertical a:hover {
    background: #183b59;
}

.wy-menu-vertical li.current {
    background: #fff;
}

.wy-menu-vertical li.current > a {
    border-right: 3px solid var(--bfmc-red);
    color: var(--bfmc-navy);
}

.wy-nav-content-wrap {
    background: var(--bfmc-surface);
}

.wy-nav-content {
    background: #fff;
    box-shadow: 0 0 32px rgba(16, 42, 67, 0.05);
    max-width: 1180px !important;
    min-height: 100vh;
    padding: 2.75rem 3.25rem 3.5rem;
}

.rst-content h1 {
    color: var(--bfmc-navy);
    font-size: 2.35rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    margin-bottom: 1.65rem;
}

.rst-content h2 {
    color: var(--bfmc-navy);
    font-size: 1.55rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 2.7rem 0 1.25rem;
    padding-bottom: 0.55rem;
    position: relative;
}

.rst-content h2::after {
    background: var(--bfmc-red);
    bottom: 0;
    content: "";
    height: 3px;
    left: 0;
    position: absolute;
    width: 44px;
}

.rst-content h3,
.rst-content h4 {
    color: var(--bfmc-navy);
}

.rst-content p,
.rst-content li {
    line-height: 1.68;
}

.rst-content a {
    color: var(--bfmc-blue-dark);
    text-decoration-color: rgba(13, 80, 127, 0.32);
    text-underline-offset: 0.16em;
}

.rst-content a:hover {
    color: var(--bfmc-blue);
}

.home-hero {
    background: linear-gradient(120deg, #102a43 0%, #143b5a 62%, #0b577f 100%);
    border-radius: 0.8rem;
    box-shadow: 0 14px 30px rgba(16, 42, 67, 0.18);
    color: #eef5fa;
    margin: 0 0 2rem;
    overflow: hidden;
    padding: 2.45rem 2.65rem 2.55rem;
    position: relative;
}

.home-hero::after {
    background: var(--bfmc-red);
    content: "";
    height: 5px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.home-hero .rubric {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.025em;
    margin: 0 0 0.8rem;
}

.home-hero > p:not(.rubric) {
    color: #dce8f1;
    font-size: 1.05rem;
    margin-bottom: 1.55rem;
    max-width: 740px;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.home-actions p {
    margin: 0;
}

.home-actions a {
    background: #fff;
    border-radius: 0.35rem;
    color: var(--bfmc-navy);
    display: inline-block;
    font-weight: 600;
    padding: 0.65rem 1.05rem;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.home-actions p:last-child a {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.48);
    color: #fff;
}

.home-actions a:hover {
    background: #e9f2f8;
    color: var(--bfmc-navy);
    transform: translateY(-1px);
}

.path-grid,
.topic-grid {
    display: grid;
    gap: 1rem;
}

.path-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.path-step {
    border-left: 3px solid var(--bfmc-red);
    padding: 0.35rem 1rem 0.35rem 1.15rem;
}

.path-step .rubric {
    color: var(--bfmc-navy);
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.path-step p:last-child {
    color: var(--bfmc-muted);
    margin-bottom: 0;
}

.topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-card {
    background: #fff;
    border: 1px solid var(--bfmc-line);
    border-radius: 0.55rem;
    box-shadow: 0 3px 12px rgba(16, 42, 67, 0.045);
    padding: 1.1rem 1.25rem 1.2rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topic-card:hover {
    border-color: #b5cfdf;
    box-shadow: 0 7px 18px rgba(16, 42, 67, 0.09);
}

.topic-card .rubric {
    color: var(--bfmc-navy);
    font-size: 1.1rem;
    font-weight: 650;
    margin: 0 0 0.4rem;
}

.topic-card p:last-child {
    color: var(--bfmc-muted);
    margin: 0;
}

.topic-card a {
    font-weight: 600;
}

.topic-card-wide {
    grid-column: 1 / -1;
}

.rst-content .admonition {
    border-radius: 0.35rem;
    box-shadow: none;
    overflow: hidden;
}

.rst-content .note,
.rst-content .tip {
    background: #edf6fb;
}

.rst-content div[class^="highlight"] pre {
    border-radius: 0.35rem;
    font-size: 0.9rem;
    line-height: 1.55;
    padding: 1rem 1.1rem;
}

.wy-table-responsive {
    border-radius: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.rst-content table.docutils {
    border: 1px solid var(--bfmc-line);
    box-shadow: none;
}

.rst-content table.docutils th {
    background: var(--bfmc-navy);
    color: #fff;
}

.rst-content table.docutils th,
.rst-content table.docutils td {
    padding: 0.65rem 0.8rem;
    white-space: normal !important;
    overflow-wrap: break-word;
}

.rst-content table.docutils tr:nth-child(even) td {
    background: #f7f9fb;
}

.hardware-width-80 table.docutils {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

.rst-content img:not(.math) {
    border-radius: 0.35rem;
    height: auto;
}

.rst-content a.image-reference img,
.rst-content img.bfmc-lightbox-trigger {
    cursor: zoom-in;
}

.rst-content img.bfmc-lightbox-trigger:focus {
    box-shadow: 0 0 0 3px rgba(22, 113, 184, 0.38);
    outline: none;
}

.rst-content .align-center:not(table) {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-height: 560px;
    object-fit: contain;
}

a.reference.external {
    font-weight: 600;
}

.image-row {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin: 0.65rem 0 1.25rem;
}

.image-row img {
    height: auto;
    width: 150px;
}

table.borderless,
table.borderless td,
table.borderless th,
table.borderless tr {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

table.borderless img {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.bfmc-lightbox {
    align-items: center;
    background: rgba(9, 20, 31, 0.9);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 3.5rem 2.5rem 2.5rem;
    position: fixed;
    z-index: 9999;
}

.bfmc-lightbox[hidden] {
    display: none;
}

.bfmc-lightbox__image {
    border-radius: 0.4rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
    max-height: calc(100vh - 6rem);
    max-width: calc(100vw - 5rem);
    object-fit: contain;
}

.bfmc-lightbox__close {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 50%;
    color: var(--bfmc-navy);
    cursor: pointer;
    display: flex;
    font-size: 1.45rem;
    font-weight: 500;
    height: 2.5rem;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 1.25rem;
    top: 1.15rem;
    width: 2.5rem;
}

.bfmc-lightbox__close:hover,
.bfmc-lightbox__close:focus {
    background: #eaf2f7;
    outline: 2px solid var(--bfmc-blue);
    outline-offset: 2px;
}

body.bfmc-lightbox-open {
    overflow: hidden;
}

.wy-nav-content footer > hr,
.wy-nav-content footer > div[role="contentinfo"] {
    display: none;
}

/* The project does not expose a documentation version selector. */
div.rst-versions {
    display: none;
}

@media screen and (max-width: 920px) {
    .wy-nav-content {
        padding: 2rem 1.6rem 2.5rem;
    }

    .rst-content h1 {
        font-size: 1.9rem;
    }

    .home-hero {
        padding: 1.8rem 1.45rem 1.9rem;
    }

    .path-grid,
    .topic-grid {
        grid-template-columns: 1fr;
    }

    .topic-card-wide {
        grid-column: auto;
    }

    .bfmc-lightbox {
        padding: 3.5rem 0.8rem 1rem;
    }

    .bfmc-lightbox__image {
        max-height: calc(100vh - 4.5rem);
        max-width: calc(100vw - 1.6rem);
    }
}
