/* AtomicNix cobalt theme overrides for mdBook's navy theme */

.navy {
    --bg: #06102a;
    --fg: #d4e6ff;

    --sidebar-bg: #0b1a3a;
    --sidebar-fg: #c3dbff;
    --sidebar-non-existent: #5d79a8;
    --sidebar-active: #4ea3ff;
    --sidebar-spacer: #1a2f5a;

    --scrollbar: #7cb7ff;

    --icons: #8dbbff;
    --icons-hover: #e3f1ff;

    --links: #61b3ff;

    --inline-code-color: #c6defe;

    --theme-popup-bg: #0e1f45;
    --theme-popup-border: #3d66a3;
    --theme-hover: #19335f;

    --quote-bg: #0d1a38;
    --quote-border: #1f3d70;

    --warning-border: #73c0ff;

    --table-border-color: #203a66;
    --table-header-bg: #1b3261;
    --table-alternate-bg: #0a1632;

    --searchbar-border-color: #5c89c9;
    --searchbar-bg: #132952;
    --searchbar-fg: #ecf6ff;
    --searchbar-shadow-color: #64a9ff;
    --searchresults-header-fg: #99bdee;
    --searchresults-border-color: #3d66a3;
    --searchresults-li-bg: #0d1d3f;
    --search-mark-bg: #376ec6;

    --copy-button-filter: invert(69%) sepia(20%) saturate(1407%) hue-rotate(185deg) brightness(102%) contrast(101%);
    --copy-button-filter-hover: invert(91%) sepia(20%) saturate(728%) hue-rotate(175deg) brightness(106%) contrast(101%);

    --footnote-highlight: #438fff;

    --overlay-bg: rgba(6, 16, 42, 0.58);
}

html.navy,
html.navy body,
html.navy .page-wrapper {
    background:
        radial-gradient(circle at 16% 8%, rgba(76, 146, 255, 0.2), transparent 36%),
        radial-gradient(circle at 86% 0%, rgba(50, 107, 206, 0.2), transparent 30%),
        #06102a;
}

.navy #menu-bar {
    border-bottom-color: #1d3e73;
    box-shadow: 0 1px 0 rgba(124, 183, 255, 0.14);
}

.navy .menu-title {
    color: #e7f3ff;
    letter-spacing: 0.02em;
}

.navy .chapter li a.active,
.navy .chapter li a:hover {
    color: #73c0ff;
    text-shadow: 0 0 10px rgba(100, 169, 255, 0.35);
}

.navy .content a {
    text-underline-offset: 0.14em;
}

.navy #searchbar:focus,
.navy #searchbar.active {
    box-shadow: 0 0 0 2px rgba(100, 169, 255, 0.24);
}

.navy :not(pre) > .hljs {
    background-color: rgba(33, 70, 130, 0.34);
    border: 1px solid rgba(86, 141, 226, 0.32);
}

.logo-compare {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin: 8px 0 20px;
}

.logo-compare figure {
    margin: 0;
    text-align: center;
}

.logo-compare img {
    width: min(280px, 100%);
    height: auto;
    display: block;
}

.logo-compare figcaption {
    margin-top: 8px;
    color: var(--sidebar-fg);
    font-size: 1.4rem;
    letter-spacing: 0.01em;
}

.content pre.mermaid {
    position: relative;
    overflow-x: auto;
    padding: 12px 48px 12px 12px;
    border: 1px solid rgba(86, 141, 226, 0.32);
    border-radius: 10px;
    background-color: rgba(10, 22, 50, 0.72);
}

.content pre.mermaid svg {
    display: block;
    margin: 0 auto;
}

.mermaid-modal-open {
    overflow: hidden;
}

.mermaid-modal[hidden] {
    display: none;
}

.mermaid-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.mermaid-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 16, 42, 0.86);
}

.mermaid-modal__panel {
    position: relative;
    margin: min(4vh, 24px) auto;
    width: min(96vw, 1600px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(86, 141, 226, 0.4);
    border-radius: 14px;
    background: #081631;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.45);
}

.mermaid-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(86, 141, 226, 0.24);
}

.mermaid-modal__title {
    color: #e7f3ff;
}

.mermaid-modal__close {
    border: 1px solid rgba(124, 183, 255, 0.45);
    border-radius: 999px;
    background: rgba(14, 31, 69, 0.92);
    color: #e7f3ff;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    padding: 8px 12px;
}

.mermaid-expand-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(124, 183, 255, 0.45);
    border-radius: 8px;
    background: rgba(14, 31, 69, 0.92);
    color: #e7f3ff;
    cursor: pointer;
    padding: 0;
}

.mermaid-expand-button:hover,
.mermaid-expand-button:focus-visible,
.mermaid-modal__close:hover,
.mermaid-modal__close:focus-visible {
    background: rgba(25, 51, 95, 0.96);
    border-color: rgba(124, 183, 255, 0.7);
}

.mermaid-expand-button svg {
    width: 14px;
    height: 14px;
}

.mermaid-modal__content {
    overflow: auto;
    padding: 20px;
}

.mermaid-modal__content svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
}
