@import url("https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap");

:root {
    --font-stack: "Nunito", sans-serif;
    --font-stack--monospace: "Nunito", sans-serif;
}

body {
    font-family: "Nunito", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Nunito", sans-serif;
}


/* Sidebar solid background colour */
.sidebar-drawer {
    background: #262640;
}

/* SVG overlay – absolute on mobile so it collapses with the drawer */
.sidebar-drawer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("octahedral-grid.svg") no-repeat top center / auto 150vh;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

/*
  On desktop, switch the overlay to position: fixed so it stays in place
  while scrolling (avoids background-attachment:fixed Safari flicker).
  Width values mirror Furo's own sidebar-drawer widths at each breakpoint.
*/
@media screen and (min-width: 63em) {
    .sidebar-drawer::before {
        position: fixed;
        top: 0;
        left: 0;
        width: calc(50% - 18.5em);
        min-width: 15em;
        height: 100vh;
    }
}

@media screen and (min-width: 82em) {
    .sidebar-drawer::before {
        width: calc(50% - 26em);
    }
}


/* ── xarray dark-mode fix for Furo "auto" theme ──────────────────────
   xarray's inline <style> only targets explicit body[data-theme="dark"],
   but Furo's auto mode keeps data-theme="auto" and relies on
   @media (prefers-color-scheme: dark).  Mirror the dark palette here
   so xarray widgets remain readable when the OS is in dark mode.
   ─────────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) {
        --xr-font-color0: rgba(255, 255, 255, 1);
        --xr-font-color2: rgba(255, 255, 255, 0.54);
        --xr-font-color3: rgba(255, 255, 255, 0.38);
        --xr-border-color: #555;
        --xr-disabled-color: #888;
        --xr-background-color: var(--color-background-primary, #131416);
        --xr-background-color-row-even: var(--color-background-secondary, #1a1c1e);
        --xr-background-color-row-odd: var(--color-background-hover, #1e2124);
    }
}

/* Also cover the explicit dark toggle (belt-and-suspenders) */
body[data-theme="dark"] {
    --xr-font-color0: rgba(255, 255, 255, 1);
    --xr-font-color2: rgba(255, 255, 255, 0.54);
    --xr-font-color3: rgba(255, 255, 255, 0.38);
    --xr-border-color: #555;
    --xr-disabled-color: #888;
    --xr-background-color: var(--color-background-primary, #131416);
    --xr-background-color-row-even: var(--color-background-secondary, #1a1c1e);
    --xr-background-color-row-odd: var(--color-background-hover, #1e2124);
}



/* ── pandas DataFrame dark-mode fix for Furo "auto" theme ────────────
   Pandas HTML tables use class="dataframe" with no dark-mode awareness.
   Override text, background, and border colours so tables stay readable.
   ─────────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) table.dataframe {
        color: rgba(255, 255, 255, 0.87);
        border-color: #555;
    }

    body:not([data-theme="light"]) table.dataframe th {
        background-color: var(--color-background-secondary, #1a1c1e);
        color: rgba(255, 255, 255, 0.87);
        border-color: #555;
    }

    body:not([data-theme="light"]) table.dataframe td {
        background-color: var(--color-background-primary, #131416);
        color: rgba(255, 255, 255, 0.87);
        border-color: #555;
    }

    body:not([data-theme="light"]) table.dataframe tbody tr:nth-child(odd) td {
        background-color: var(--color-background-hover, #1e2124);
    }

    body:not([data-theme="light"]) table.dataframe tbody tr:hover td {
        background-color: #2a2d31;
    }
}



/* Dropdown container in the brand slot (above search bar) */
.ek-project-selector-brand {
    padding: 0.4rem 0.75rem 0.6rem;
}

/* Related projects dropdown */
.ek-project-selector {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ek-project-selector select {
    flex: 1;
    min-width: 0;
    background: #131320;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: auto;
}

.ek-project-selector select:focus {
    border-color: #FCE54B;
}

/* Homepage card styling */
.sd-card .sd-card-img-top {
    height: 100px;
    width: auto;
    object-fit: contain;
    margin: 1rem auto 0 auto;
    display: block;
    background: transparent;
    filter: brightness(0.8) invert(0.1);
    transition: filter 0.2s ease;
}


/* Dark mode when user explicitly selects dark */
[data-theme="dark"] .sd-card .sd-card-img-top {
    filter: invert(1) brightness(0.6);
}

/* Dark mode when theme = auto and system prefers dark */
@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) .sd-card .sd-card-img-top {
        filter: invert(1) brightness(0.6);
    }
}


body[data-theme="dark"] table.dataframe {
    color: rgba(255, 255, 255, 0.87);
    border-color: #555;
}

body[data-theme="dark"] table.dataframe th {
    background-color: var(--color-background-secondary, #1a1c1e);
    color: rgba(255, 255, 255, 0.87);
    border-color: #555;
}

body[data-theme="dark"] table.dataframe td {
    background-color: var(--color-background-primary, #131416);
    color: rgba(255, 255, 255, 0.87);
    border-color: #555;
}

body[data-theme="dark"] table.dataframe tbody tr:nth-child(odd) td {
    background-color: var(--color-background-hover, #1e2124);
}

body[data-theme="dark"] table.dataframe tbody tr:hover td {
    background-color: #2a2d31;
}



@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) table.eh-table {
        color: rgba(255, 255, 255, 0.87);
        border-color: #555;
    }

    body:not([data-theme="light"]) table.eh-table th {
        background-color: var(--color-background-secondary, #1a1c1e);
        color: rgba(255, 255, 255, 0.87);
        border-color: #555;
    }

    body:not([data-theme="light"]) table.eh-table td {
        background-color: var(--color-background-primary, #131416);
        color: rgba(255, 255, 255, 0.87);
        border-color: #555;
    }

    body:not([data-theme="light"]) table.eh-table tbody tr:nth-child(odd) td {
        background-color: var(--color-background-hover, #1e2124);
    }

    body:not([data-theme="light"]) table.eh-table tbody tr:hover td {
        background-color: #2a2d31;
    }
}

body[data-theme="dark"] table.eh-table {
    color: rgba(255, 255, 255, 0.87);
    border-color: #555;
}

body[data-theme="dark"] table.eh-table th {
    background-color: var(--color-background-secondary, #1a1c1e);
    color: rgba(255, 255, 255, 0.87);
    border-color: #555;
}

body[data-theme="dark"] table.eh-table td {
    background-color: var(--color-background-primary, #131416);
    color: rgba(255, 255, 255, 0.87);
    border-color: #555;
}

body[data-theme="dark"] table.eh-table tbody tr:nth-child(odd) td {
    background-color: var(--color-background-hover, #1e2124);
}

body[data-theme="dark"] table.eh-table tbody tr:hover td {
    background-color: #2a2d31;
}



.nboutput .stderr {
    display: none;
}

.wy-table-responsive table td,
.wy-table-responsive table th {
    white-space: inherit;
}



/*

.wy-side-nav-search {
    background-color: #5d89bb;
}

.rst-content dl.xr-attrs dt {
    all: revert;
    font-size: 95%;
    white-space: nowrap;
}

.rst-content dl.xr-attrs dd {
    font-size: 95%;
}

.xr-wrap {
    font-size: 85%;
}

.wy-table-responsive table td,
.wy-table-responsive table th {
    white-space: inherit;
}


.wy-side-nav-search .wy-dropdown>a img.logo,
.wy-side-nav-search>a img.logo {
    width: 180px;
}

*/
