@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;
  }
}

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;
}

/* (to be checked) remove error output in a notebook cell */
.nboutput .stderr {
    display: none;
}

/* (to be checked) allows the use of multi-line text cells in a list-table */
.wy-table-responsive table td,
.wy-table-responsive table th {
    white-space: inherit;
}

/* More space for long function names */
.article-container {
  font-size: 90%;
}
