:root {
    --text-align: justify;
    --pst-font-size-base: 16px;
    --pst-font-size-milli: 13px;
    --pst-font-family-base: 'Source Sans Pro', var(--pst-font-family-base-system);
    --pst-font-family-heading: var(--pst-font-family-base);
    --pst-font-family-monospace: 'Source Code Pro', var(--pst-font-family-monospace-system);
}
.bd-content p,
.bd-content li { text-align: justify; }

html[data-theme="light"] {
    --braindecode-color-github: #000;
    --braindecode-color-discourse: #000;
    --braindecode-color-discord: #5865F2;
    --braindecode-color-twitter: #55acee;
    --pst-color-border-rgba: rgba(0, 0, 0, 0.125);
    --pst-color-background-rgba: rgba(0, 0, 0, 0.03);
    --pst-color-primary-rgba: rgba(69, 157, 185, 0.2);
    --pst-color-secondary-rgba: rgba(238, 144, 64, 0.2);
    --copybtn-opacity: 0.75;
    /* sphinx-gallery overrides */
    --sg-download-a-background-color: var(--pst-color-primary);
    --sg-download-a-background-image: unset;
    --sg-download-a-border-color: var(--pst-color-border-rgba);
    --sg-download-a-color: #fff;
    --sg-download-a-hover-background-color: var(--pst-color-secondary);
    --sg-download-a-hover-box-shadow-1: none;
    --sg-download-a-hover-box-shadow-2: none;
}
html[data-theme="dark"] {
    --braindecode-color-github: #fff;
    --braindecode-color-discourse: #FFF9AE;  /* color taken from their logo SVG */
    --braindecode-color-discord: #fff;
    --braindecode-color-twitter: #55acee;
    --pst-color-border-rgba: rgba(201, 201, 201, 0.25);
    --pst-color-background-rgba: rgba(255, 255, 255, 0.08);
    --pst-color-primary-rgba: rgba(69, 157, 185, 0.3);
    --pst-color-secondary-rgba: rgba(238, 144, 64, 0.3);
    --copybtn-opacity: 0.25;
    /* sphinx-gallery overrides */
    --sg-download-a-background-color: var(--pst-color-primary);
    --sg-download-a-background-image: unset;
    --sg-download-a-border-color: var(--pst-color-border-rgba);
    --sg-download-a-color: #fff;
    --sg-download-a-hover-background-color: var(--pst-color-secondary);
    --sg-download-a-hover-box-shadow-1: none;
    --sg-download-a-hover-box-shadow-2: none;
}

/* ************************************************************ Sphinx fixes */
dl.field-list {
    grid-template-columns: auto 1fr;
}

/* ********************************************************** Sphinx-gallery */

/* backreference links: restore hover decoration that SG removes */
a.sphx-glr-backref-instance:hover {
    text-decoration: underline;
}
/* backreference links: make non-Brainde func/meth calls resemble regular code */
a[class^="sphx-glr-backref-module"] { color: var(--pst-color-text); }
/* backreference links: make Braindecode calls bold and colorful */
a[class^="sphx-glr-backref-module-braindecode"] {
    font-weight: 600;
    color: rgb(var(--pst-color-link));
}
/* suppress redundant note at top of every tutorial and signature at the end */
div.sphx-glr-download-link-note,
p.sphx-glr-signature {
    visibility: hidden;
    height: 0;
    margin: 0;
    padding: 0;
}
/* script/notebook download buttons */
.sphx-glr-download a.download {
    /* ↓↓↓↓↓↓↓ these two rules copied from sphinx-design */
    box-shadow: 0 .125rem .25rem var(--sd-color-shadow) !important;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
/* Report embedding */
iframe.sg_report {
    width: 95%;
    height: 70vh;
    margin: 20px auto;
    display: block;
    border-style: solid;
}
/* Disable thumbnail tooltips on hover */
.sphx-glr-thumbcontainer[tooltip]:hover::before,
.sphx-glr-thumbcontainer[tooltip]:hover::after {
    display: none;
}

/* ******************************** make HTML'd pandas dataframes scrollable */
table.dataframe {
    display: block;
    overflow: auto;
}

/* ********************************* Long API titles need to wrap for mobile */
div[id^="braindecode-"] h1,
div[id^="examples-using-"] h2 {
    word-break: break-word;
}

/* ******************************************* in-text sidebar callout boxes */
div.sidebar,
aside.sidebar {
    background-color: var(--pst-color-primary-rgba);
    border-color: rgb(var(--pst-color-info));
}

/* **************************************************************** homepage */
img.logo {
    max-width: 500px;
    width: 100%;
}

/* ************************************* homepage quick links & funders list */
ul.quicklinks {
    font-weight: 600;
}
ul.quicklinks a:hover {
    text-decoration: none;
}
ul.funders li {
    margin-left: 36px;
    text-indent: -36px;
    padding-bottom: 9px;
}
ul.funders li img {
    width: 30px;
    max-height: 24px;
    object-fit: contain;
}

/* these two also affect collapsible divs */
h5.card-header {
    margin-top: 0px;
    margin-bottom: 0px;
}
h5.card-header::before {
    height: 0px;
    margin-top: 0px;
}

/* ******************************************************** version dropdown */
.dropdown {
    padding: 0 .5rem;  /* match other items in the hamburger menu */
}
.dropdown-toggle {
    font-weight: 600;
}

/* ********************************************* sphinx-design compatibility */
.sd-dropdown {
    border: 1px solid var(--pst-color-border-rgba) !important;
    box-shadow: 1px 1px 1px var(--pst-color-shadow);
}
.sd-card-header {
    border-bottom: 1px solid var(--pst-color-border-rgba) !important;
    background-color: var(--pst-color-background-rgba) !important;
}
.sd-card-footer {
    border-top: 1px solid var(--pst-color-border-rgba) !important;
    background-color: var(--pst-color-background-rgba) !important;
}
p.btn a {
    color: unset;
}
/* remove this when
   https://github.com/pydata/pydata-sphinx-theme/issues/733 is addressed
   ↓↓↓↓↓↓↓↓↓ */
.sd-btn-primary {
    background-color: var(--pst-color-link) !important;
    border-color: var(--pst-color-link) !important
}
.sd-btn-primary:hover {
    background-color: var(--pst-color-link-hover) !important;
    border-color: var(--pst-color-link-hover) !important
}

/* ****************************************************** navbar quick links */

#navbar-icon-links i.fa-github-square::before {
    color: var(--braindecode-color-github);
}
#navbar-icon-links i.fa-twitter-square::before {
    color: var(--braindecode-color-twitter);
}
#navbar-icon-links i.fa-discourse::before {
    color: var(--braindecode-color-discourse);
}
#navbar-icon-links i.fa-discord::before {
    color: var(--braindecode-color-discord);
}
/* *********************************************************** contrib guide */
ul.icon-bullets {
    list-style-type: none;
    padding-left: 2em;
    text-indent: -1.5em;
}
.small-stack {
    font-size: 0.5em;
}
/* *********************************************************** copy button */
button.copybtn {
    /* always show; https://sphinx-copybutton.readthedocs.io/en/latest/use.html#modify-the-copy-button-s-css */
    opacity: var(--copybtn-opacity);
 }

/* *********************************************************** miscellaneous */
.hidden {
    display: none;
}
img.hidden {
    visibility: hidden;
}
/*model grid*/
/* For the horizontally scrolling model cards */
.horizontal-scroll-container {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  padding-bottom: 1rem; /* Add some space for the scrollbar */
}

/* Ensure the grid itself doesn't wrap, allowing it to overflow */
.horizontal-scroll-container > .sd-grid {
  flex-wrap: nowrap;
}

/* Give the cards a minimum width so they don't get too squished */
.horizontal-scroll-container .sd-card {
  min-width: 250px;
}

/* Grey out images marked as unavailable */
figure.unavailable img,
img.unavailable {           /* covers :class: on the image */
  filter: grayscale(100%);
  opacity: 0.45;
}

/* Optional “Unavailable” ribbon – only shows if the class is on the figure */
figure.unavailable { position: relative; }
figure.unavailable::after {
  content: "Unavailable";
  position: absolute;
  top: 0.6rem; right: -0.6rem;
  transform: rotate(15deg);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem; font-weight: 600;
  background: rgba(128,128,128,0.25);
  border: 1px solid rgba(128,128,128,0.45);
  border-radius: 0.25rem;
  pointer-events: none;
}
.plot-caption{ font-size:.9em; color: var(--pst-color-text-muted, #6c757d); }


/* Narrow the primary (left) sidebar on desktop */
@media (min-width: 992px) {
  :root { --leftbar: clamp(13rem, 16vw, 16rem); } /* try 14–16rem if you prefer */
  .bd-sidebar-primary {
    flex: 0 0 var(--leftbar);
    max-width: var(--leftbar);
  }
}

/* Smaller fonts + tighter spacing in the left sidebar */
.bd-sidebar { --pst-sidebar-font-size: 0.85rem; }            /* default ~0.9rem */
.bd-sidebar .sidebar-title { margin: .25rem 0 .25rem; }

/* Reduce vertical space between items */
.bd-sidebar nav .nav-link { padding: .12rem .25rem; line-height: 1.15; }
.bd-sidebar nav .nav-item { margin-bottom: 0; }

/* Slim the active indicator bar */
.bd-sidebar nav .nav-link.active,
.bd-sidebar nav .active > .nav-link { border-left-width: 2px; }
