/*
 * extra.css
 *
 * GNUS.AI brand colors and GitBook compatibility overrides for MkDocs Material.
 * All colors defined as CSS custom properties — single source of truth.
 * Brand palette: #0096c7 → #00b4d8 → #48cae4 → #90e0ef (cyan-blue ramp)
 */

/* ── Light mode ────────────────────────────────────────────────────────────── */
[data-md-color-scheme="default"] {
    --md-primary-fg-color:              #0096c7;
    --md-primary-fg-color--light:       #48cae4;
    --md-primary-fg-color--dark:        #007ba3;
    --md-primary-bg-color:              #ffffff;
    --md-primary-bg-color--light:       hsla(0, 0%, 100%, 0.7);

    --md-accent-fg-color:               #00b4d8;
    --md-accent-fg-color--transparent:  hsla(195, 100%, 42%, 0.1);

    --md-typeset-a-color:               #0096c7;

    /* Footer — neutral light so text is always legible */
    --md-footer-fg-color:               #333333;
    --md-footer-fg-color--light:        #555555;
    --md-footer-fg-color--lighter:      #777777;
    --md-footer-bg-color:               #f5f5f5;
    --md-footer-bg-color--dark:         #e8e8e8;
}

/* ── Dark mode ─────────────────────────────────────────────────────────────── */
[data-md-color-scheme="slate"] {
    --md-default-fg-color:              hsla(0, 0%, 95%, 1);
    --md-default-fg-color--light:       hsla(0, 0%, 80%, 1);
    --md-default-fg-color--lighter:     hsla(0, 0%, 65%, 1);
    --md-default-fg-color--lightest:    hsla(0, 0%, 45%, 1);

    --md-code-fg-color:                 hsla(0, 0%, 92%, 1);
    --md-typeset-color:                 hsla(0, 0%, 95%, 1);

    --md-primary-fg-color:              #00b4d8;
    --md-primary-fg-color--light:       #48cae4;
    --md-primary-fg-color--dark:        #0096c7;
    --md-primary-bg-color:              #0d1117;

    --md-accent-fg-color:               #90e0ef;
    --md-accent-fg-color--transparent:  hsla(195, 75%, 75%, 0.1);

    --md-typeset-a-color:               #48cae4;
}

/* ── Dark mode typeset ─────────────────────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-typeset,
[data-md-color-scheme="slate"] .md-typeset p,
[data-md-color-scheme="slate"] .md-typeset li,
[data-md-color-scheme="slate"] .md-typeset td,
[data-md-color-scheme="slate"] .md-typeset th { color: var(--md-typeset-color); }

[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4,
[data-md-color-scheme="slate"] .md-typeset h5,
[data-md-color-scheme="slate"] .md-typeset h6 { color: hsla(0, 0%, 98%, 1); }

[data-md-color-scheme="slate"] .md-typeset a:hover           { color: #90e0ef; }
[data-md-color-scheme="slate"] .md-nav__link--active,
[data-md-color-scheme="slate"] .md-nav__link:hover           { color: #48cae4; }
[data-md-color-scheme="slate"] .md-search-result__article mark {
    color: #0d1117;
    background-color: #48cae4;
}

/* ── Sidebar viewport sizing fix ──────────────────────────────────────────── */
:root {
    --gnus-sidebar-width: 16rem;
}

.md-main__inner {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media screen and (min-width: 76.25em) {
    .md-container {
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto;
        height: calc(100vh - 2.4rem);
        overflow: hidden;
    }

    .md-main {
        min-height: 0;
        overflow: hidden;
    }

    .md-main__inner {
        height: 100%;
        min-height: 0;
        margin-top: 0;
        padding-top: 1.5rem;
        overflow: hidden;
    }

    .md-sidebar--primary,
    .md-sidebar--primary .md-sidebar__scrollwrap,
    .md-content {
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0;
    }

    .md-content {
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
    }

    .md-main__inner > .md-sidebar--primary {
        flex: 0 0 var(--gnus-sidebar-width);
    }

    .md-sidebar--primary {
        position: relative;
        width: var(--gnus-sidebar-width);
        min-width: var(--gnus-sidebar-width);
        max-width: var(--gnus-sidebar-width);
    }
}

@media screen and (max-width: 76.234375em) {
    /* Keep the root drawer nav list expanded to intrinsic height on mobile. */
    .md-sidebar--primary .md-nav--primary > .md-nav__list {
        height: auto !important;
        max-height: none !important;
    }
}

.md-main__inner > .md-content,
.md-main__inner > .md-grid {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 10px;
}

.md-main__inner > .md-content > .md-content__inner,
.md-main__inner > .md-grid,
.md-main__inner .md-grid {
    margin-left: 20px !important;
    margin-right: 20px !important;
    max-width: none !important;
}

@media screen and (min-width: 76.25em) {
    .md-sidebar--primary,
    .md-sidebar--primary .md-sidebar__scrollwrap,
    .md-sidebar--primary .md-sidebar__inner {
        min-height: 0;
    }

    .md-sidebar--primary {
        padding-top: 0;
        padding-bottom: 2.5rem;
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .md-sidebar--primary .md-sidebar__scrollwrap {
        width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
    }

    .md-sidebar--primary .md-sidebar__inner {
        width: 100%;
        padding: 0 0.2rem !important;
        box-sizing: border-box;
        overflow: visible;
    }

    .md-sidebar--primary .md-nav--primary,
    .md-sidebar--primary .md-nav--integrated,
    .md-sidebar--primary .md-nav.md-nav--primary,
    .md-sidebar--primary .md-nav.md-nav--integrated {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    .gnus-sidebar-resizer {
        position: absolute;
        top: 0;
        right: -0.25rem;
        width: 0.5rem;
        height: 100%;
        cursor: col-resize;
        z-index: 20;
    }

    body.gnus-sidebar-resizing,
    body.gnus-sidebar-resizing * {
        cursor: col-resize !important;
        user-select: none !important;
    }
}

/* ── GitBook image / figure alignment ─────────────────────────────────────── */
/* GitBook centers figures by default — match that behaviour. */
.md-typeset figure                        { display:block; margin:1rem auto; text-align:center; }
.md-typeset figure img                    { display:inline-block; }

/* <div align="left"> — explicit left alignment. */
.md-typeset div[align="left"]             { text-align:left; }
.md-typeset div[align="left"] figure,
.md-typeset div[align="left"] img         { display:inline-block; margin:0; }

/* <div align="center"> — explicit center alignment. */
.md-typeset div[align="center"]           { text-align:center; }

/* data-full-width="true" — span the full content column width,
   but only for images without an explicit width attribute. */
.md-typeset div[data-full-width="true"]   { width:100%; text-align:left; }
.md-typeset div[data-full-width="true"] figure { display:block; width:100%; margin:1rem 0; }
.md-typeset div[data-full-width="true"] img:not([width]) { width:100%; max-width:100%; display:block; }

