/* FlowState brand theme for mdBook: blue #5B8DEF -> teal #38BD94. */

:root {
    --fs-blue: #5b8def;
    --fs-teal: #38bd94;
    --fs-grad: linear-gradient(120deg, #5b8def 0%, #38bd94 100%);
    --content-max-width: 820px;
}

html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
code, pre { font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; }

/* Light theme */
.light {
    --bg: #ffffff;
    --fg: #17202e;
    --sidebar-bg: #f5f8fc;
    --sidebar-fg: #2d3748;
    --sidebar-non-existant: #a0aab8;
    --sidebar-active: #3a6fd8;
    --sidebar-spacer: #e3e9f2;
    --scrollbar: #c7d1df;
    --icons: #6b7686;
    --icons-hover: #17202e;
    --links: #3a6fd8;
    --inline-code-color: #1f5f8b;
    --theme-popup-bg: #ffffff;
    --theme-popup-border: #e3e9f2;
    --theme-hover: #eef3fb;
    --quote-bg: #f2f8f6;
    --quote-border: #38bd94;
    --table-border-color: #e3e9f2;
    --table-header-bg: #eef3fb;
    --table-alternate-bg: #f8fafd;
    --searchbar-border-color: #d5deea;
    --searchbar-bg: #ffffff;
    --searchbar-fg: #17202e;
    --searchresults-header-fg: #6b7686;
    --searchresults-border-color: #e3e9f2;
    --searchresults-li-bg: #f5f8fc;
    --search-mark-bg: #c9f0e2;
}

/* Dark themes */
.navy, .coal {
    --bg: #0e131b;
    --fg: #e1e7ef;
    --sidebar-bg: #131a24;
    --sidebar-fg: #c3cddb;
    --sidebar-non-existant: #5d6878;
    --sidebar-active: #8db0f7;
    --sidebar-spacer: #253041;
    --scrollbar: #3a4659;
    --icons: #8794a6;
    --icons-hover: #e8edf4;
    --links: #8db0f7;
    --inline-code-color: #8fd9bf;
    --theme-popup-bg: #161e2a;
    --theme-popup-border: #253041;
    --theme-hover: #1d2736;
    --quote-bg: #142420;
    --quote-border: #38bd94;
    --table-border-color: #253041;
    --table-header-bg: #1a2433;
    --table-alternate-bg: #121923;
    --searchbar-border-color: #2b3749;
    --searchbar-bg: #161e2a;
    --searchbar-fg: #e8edf4;
    --searchresults-header-fg: #8794a6;
    --searchresults-border-color: #253041;
    --searchresults-li-bg: #161e2a;
    --search-mark-bg: #2e6b57;
}

/* Brand bar above the mdBook menu bar */
.fs-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 44px;
    position: relative;
    z-index: 102;
    /* .page has a negative top margin for mdBook's hover placeholder; undo it for this bar and
       let the placeholder sit underneath it, so the menu bar follows directly. */
    margin: var(--menu-bar-height) calc(0px - var(--page-padding)) calc(0px - var(--menu-bar-height));
    padding: 0 20px;
    background: var(--fs-grad);
    color: #fff;
}
.fs-home { display: flex; align-items: center; gap: 9px; color: #fff !important; font-weight: 700; font-size: 1.6rem; text-decoration: none !important; }
.fs-home img { width: 22px; height: 22px; border-radius: 5px; background: rgba(255, 255, 255, .9); padding: 1px; }
.fs-toplinks { display: flex; gap: 18px; }
.fs-toplinks a { color: #fff !important; font-size: 1.4rem; font-weight: 500; opacity: .92; text-decoration: none !important; }
.fs-toplinks a:hover { opacity: 1; text-decoration: underline !important; }
@media (max-width: 520px) { .fs-toplinks a:nth-child(2) { display: none; } }

.menu-title { font-weight: 700; letter-spacing: -.01em; }

/* Sidebar */
.sidebar .sidebar-scrollbox { padding-top: 14px; }
.chapter li.chapter-item { margin-top: .45em; }
.chapter li a.active { font-weight: 600; }

/* Content */
.content main { line-height: 1.65; }
.content h1 { font-size: 2.6rem; letter-spacing: -.02em; padding-bottom: .3em; border-bottom: 3px solid transparent; border-image: var(--fs-grad) 1; }
.content h2 { margin-top: 2em; letter-spacing: -.01em; }
.content h3 { margin-top: 1.6em; }
.content img { border: 1px solid var(--table-border-color); border-radius: 10px; box-shadow: 0 6px 24px rgba(23, 32, 46, .10); margin: 8px 0 4px; }
.content table { width: 100%; font-size: .93em; display: table; }
.content table thead th { text-align: left; }
.content table td, .content table th { padding: 6px 10px; vertical-align: top; }
blockquote { border-radius: 0 8px 8px 0; border-top: none; border-bottom: none; border-left: 4px solid var(--quote-border); padding: 4px 18px; }
kbd {
    display: inline-block; padding: 1px 7px; font-size: .85em; line-height: 1.5;
    border: 1px solid var(--table-border-color); border-bottom-width: 2px; border-radius: 5px;
    background: var(--sidebar-bg); font-family: ui-monospace, Menlo, Consolas, monospace;
}
.content .fs-caption { display: block; font-size: .9em; color: var(--searchresults-header-fg); margin-bottom: 1.4em; }
