/*  spm1d documentation theme
 *
 *  The palette is taken from the wordmark:  teal above the dashed rule,
 *  gray below it, on a white-to-pale-cyan ground.  The hex values are the
 *  sampled interior colors of the mark, not approximations of them.
 */

:root {
	--spm1d-teal        : #0e6e84;
	--spm1d-teal-dark   : #0a5263;
	--spm1d-teal-light  : #2eb0ce;
	--spm1d-teal-pale   : #e6f4f8;
	--spm1d-gray        : #8b9296;
	--spm1d-gray-dark   : #5c6569;
	--spm1d-gray-light  : #c5ccd0;
	--spm1d-rule        : #2c686e;
	--spm1d-rule-light  : #78c4d0;
	--spm1d-wash        : #f6ffff;
}


html[data-theme="light"] {
	--pst-color-primary             : var(--spm1d-teal);
	--pst-color-primary-bg          : var(--spm1d-teal-pale);
	--pst-color-primary-highlight   : var(--spm1d-teal-dark);
	--pst-color-secondary           : var(--spm1d-gray-dark);
	--pst-color-secondary-bg        : #eceff0;
	--pst-color-secondary-highlight : #434b4f;
	--pst-color-accent              : var(--spm1d-rule);
	--pst-color-accent-bg           : var(--spm1d-wash);
	--pst-color-link                : var(--spm1d-teal);
	--pst-color-link-hover          : var(--spm1d-teal-dark);
	--pst-color-inline-code         : var(--spm1d-teal-dark);
	--pst-color-heading             : #1a2226;
	--pst-color-border              : var(--spm1d-gray-light);
	--pst-color-table-heading-bg    : var(--spm1d-teal-pale);
}


html[data-theme="dark"] {
	--pst-color-primary             : var(--spm1d-teal-light);
	--pst-color-primary-bg          : #08343f;
	--pst-color-primary-highlight   : #6fd3e8;
	--pst-color-secondary           : var(--spm1d-gray-light);
	--pst-color-secondary-bg        : #262c2f;
	--pst-color-secondary-highlight : #e2e7e9;
	--pst-color-accent              : var(--spm1d-rule-light);
	--pst-color-link                : var(--spm1d-teal-light);
	--pst-color-link-hover          : #6fd3e8;
	--pst-color-inline-code         : var(--spm1d-teal-light);
	--pst-color-table-heading-bg    : #08343f;
}


/*  the dashed rule from the wordmark, reused as the page-title underline  */
.bd-article h1 {
	padding-bottom : 0.35rem;
	border-bottom  : 2px dashed var(--spm1d-rule);
}

html[data-theme="dark"] .bd-article h1 {
	border-bottom-color : var(--spm1d-rule-light);
}


/*  keep the sidebar mark clear of the title beneath it  */
.bd-sidebar-primary .navbar-brand img {
	max-width  : 13rem;
	margin     : 0.35rem 0 0.5rem 0;
}


/*  API signatures:  teal name, gray punctuation and defaults  */
dt.sig > .sig-name {
	color : var(--spm1d-teal);
}

html[data-theme="dark"] dt.sig > .sig-name {
	color : var(--spm1d-teal-light);
}


/*  the color-mode control is a single-push toggle;  see theme-toggle.js  */
.theme-switch-container .dropdown-menu {
	display : none !important;
}

.theme-switch-container .theme-switch-button::after {
	display : none !important;
}


/*  ---- layout:  narrower sidebars, wider article  -------------------- */
:root {
	--pst-sidebar-secondary: 18rem;
}
/*  a contents entry longer than the sidebar wraps instead of being cut off
    (the theme keeps a code literal on one line)  */
.bd-sidebar-secondary .toc-entry a,
.bd-sidebar-secondary .toc-entry a .pre {
	white-space   : normal;
	overflow-wrap : anywhere;
}
@media (min-width: 992px) {
	.bd-sidebar-primary {
		flex-basis: 15%;
		width: 15%;
		max-width: 16rem;
		padding: 2rem 0.75rem 1rem;
	}
	/*  the theme hides the sidebar with margin-left: -20%, its own default
	    width;  hide exactly this narrower width instead, or the article is
	    pushed off the left edge of the page.  Older theme versions mark the
	    hidden state with a checkbox, newer ones with .pst-sidebar-hidden  */
	input#pst-primary-sidebar-checkbox:checked ~ .bd-container .bd-sidebar-primary,
	.bd-sidebar-primary.pst-sidebar-hidden {
		margin-left: calc(-1 * min(15%, 16rem));
	}
}
.bd-page-width {
	max-width: 100rem;
}
.bd-main .bd-content .bd-article-container {
	max-width: 80em;
}

/*  ---- gallery figures:  one panel per image, full article width ---- */
.sphx-glr-single-img {
	width: 100%;
	max-width: 800px;
	margin: 0.5rem auto;
}
.sphx-glr-horizontal li.sphx-glr-multi-img {
	width: 100%;
	max-width: 800px;
}
.sphx-glr-horizontal li.sphx-glr-multi-img img {
	width: 100%;
	max-width: 800px;
}
/*  the dark gallery images (see _ext/scraper_lightdark.py) sit in an only-dark
 *  container and are already drawn for the dark theme:  no dimming and no
 *  white backing  */
html[data-theme="dark"] .bd-content .only-dark img {
	filter: none;
	background-color: transparent;
}

/*  ---- gallery thumbnails:  twice the default size  ------------------
    sg_gallery.css loads after this file, so the overrides are marked  */
.sphx-glr-thumbnails {
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
	gap: 18px !important;
}
.sphx-glr-thumbcontainer .figure {
	width: 300px !important;
}
.sphx-glr-thumbcontainer img {
	max-width: 300px !important;
	max-height: 210px !important;
	width: 300px;
}

/*  ---- gallery colors from the logo palette  ------------------------
    sg_gallery.css loads after this file and sets these variables on the
    html element, so the selectors add :root to outrank its own  */
html[data-theme="light"]:root {
	--sg-download-a-background-color       : var(--spm1d-teal-pale);
	--sg-download-a-background-image       : linear-gradient(to bottom, var(--spm1d-wash), #cdeaf2);
	--sg-download-a-border-color           : var(--spm1d-teal);
	--sg-download-a-color                  : #08343f;
	--sg-download-a-hover-background-color : #b5e0eb;
	--sg-thumb-hover-border                : var(--spm1d-teal);
	--sg-thumb-box-shadow-color            : #0e6e8440;
	--sg-script-pre                        : #dff0f5;
}
html[data-theme="dark"]:root {
	--sg-download-a-background-color       : #08343f;
	--sg-download-a-background-image       : linear-gradient(to bottom, #0e4a58, #08343f);
	--sg-download-a-border-color           : var(--spm1d-teal-light);
	--sg-download-a-color                  : var(--spm1d-teal-pale);
	--sg-download-a-hover-background-color : var(--spm1d-teal);
	--sg-thumb-hover-border                : var(--spm1d-teal-light);
	--sg-thumb-box-shadow-color            : #2eb0ce40;
	--sg-script-pre                        : #1b4753;
}

/*  ---- example pages:  download buttons side by side, beneath the title ----  */
.sphx-glr-footer-example {
	display: flex;
	justify-content: center;
	gap: 1.5em;
	margin: 0.5em 0 1.5em 0;
}
.sphx-glr-footer-example .sphx-glr-download {
	margin: 0;
}

/* No "Skip to main content" bar on Tab (the theme's keyboard skip link). */
#pst-skip-link,
.skip-link {
  display: none !important;
}



/*  no tooltip on the gallery thumbnails:  the caption beneath each one says
 *  what it is  */
.sphx-glr-thumbcontainer[tooltip]::before,
.sphx-glr-thumbcontainer[tooltip]:hover::before,
.sphx-glr-thumbcontainer[tooltip]:hover::after {
	display : none !important;
}


/*  deprecated arguments (marked by the deprecated_args extension):  red in
 *  the Parameters list, and red + struck through in the signature, with a
 *  note on hover  */
:root {
	--spm1d-deprecated : #b3261e;
}
html[data-theme="dark"] {
	--spm1d-deprecated : #ff7b72;
}
li.deprecated-arg,
li.deprecated-arg code,
li.deprecated-arg em {
	color : var(--spm1d-deprecated);
}
/*  deprecated functions, methods and properties:  red signature with the
 *  suffix " — DEPRECATED"  */
dt.sig.deprecated-member,
dt.sig.deprecated-member * {
	color : var(--spm1d-deprecated);
}
dt.sig .sig-param .deprecated-arg,
dt.sig .sig-param .deprecated-arg * {
	color           : var(--spm1d-deprecated);
	text-decoration : line-through;
}
dt.sig .sig-param .deprecated-arg {
	position : relative;
	cursor   : help;
}
dt.sig .sig-param .deprecated-arg:hover::after {
	content         : "deprecated";
	position        : absolute;
	left            : 0;
	top             : 1.4em;
	padding         : 0.1em 0.5em;
	font-size       : 0.8em;
	font-style      : normal;
	text-decoration : none;
	color           : white;
	background      : var(--spm1d-deprecated);
	border-radius   : 3px;
	white-space     : nowrap;
	z-index         : 10;
}


/*  API pages:  a docstring field list is a CSS grid, and a grid column
 *  takes the intrinsic width of a long doctest line instead of letting the
 *  <pre> scroll, so the whole page overflowed behind the contents sidebar  */
dl.field-list,
dl.field-list > dt,
dl.field-list > dd,
dl.py > dd {
	min-width : 0;
}

/*  collapsible contents sidebar (toc-toggle.js):  a close button in its
 *  corner, and a tab at the right edge of the window to bring it back  */
.toc-toggle {
	border        : 1px solid var(--pst-color-border);
	border-radius : 4px;
	background    : var(--pst-color-background);
	color         : var(--pst-color-text-muted);
	font-size     : 0.85rem;
	line-height   : 1;
	cursor        : pointer;
}
.toc-toggle:hover {
	color        : var(--pst-color-primary);
	border-color : var(--pst-color-primary);
}
.toc-toggle--hide {
	position : absolute;
	top      : 0.6rem;
	right    : 0.6rem;
	width    : 1.5rem;
	height   : 1.5rem;
	padding  : 0;
	font-size: 1rem;
}
.toc-toggle--show {
	display       : none;
	position      : fixed;
	right         : 0;
	top           : 50%;
	z-index       : 1020;
	padding       : 0.4rem 0.3rem;
	writing-mode  : vertical-rl;
	border-right  : none;
	border-radius : 4px 0 0 4px;
}
body.toc-collapsed .bd-sidebar-secondary {
	display : none;
}
body.toc-collapsed .toc-toggle--show {
	display : block;
}


/*  space between the page text and the previous/next links beneath it  */
.prev-next-footer {
	margin-top : 3rem;
}


/*  divider lines between groups of API menu entries;  see sidebar-nav.js  */
.bd-sidenav li.spm1d-divider-after {
	border-bottom  : 1px solid var(--pst-color-border);
	padding-bottom : 0.3rem;
	margin-bottom  : 0.3rem;
}

/*  section labels in the Theory and API menus;  see sidebar-nav.js  */
.bd-sidenav li.spm1d-section {
	list-style : none;
}
.bd-sidenav span.spm1d-section-label {
	display        : block;
	padding        : 0.25rem 0 0.1rem calc(1rem + 4ch);
	font-size      : 0.7rem;
	font-weight    : 600;
	letter-spacing : 0.08em;
	text-transform : uppercase;
	color          : var(--spm1d-teal-light) !important;
}
html[data-theme="dark"] .bd-sidenav span.spm1d-section-label {
	color          : var(--pst-color-primary) !important;
}


/*  expected spm1d warnings and errors quoted in the text (code-block with
 *  class spm1d-warning or spm1d-error):  long messages wrap  */
div.spm1d-warning pre,
div.spm1d-error pre {
	white-space : pre-wrap;
	border-left : 4px solid;
}
html[data-theme="light"] div.spm1d-warning div.highlight,
html[data-theme="light"] div.spm1d-warning pre {
	background        : #fff5dc;
	border-left-color : #e0a020;
}
html[data-theme="light"] div.spm1d-error div.highlight,
html[data-theme="light"] div.spm1d-error pre {
	background        : #fdeceb;
	border-left-color : #d0453a;
}
html[data-theme="dark"] div.spm1d-warning div.highlight,
html[data-theme="dark"] div.spm1d-warning pre {
	background        : #3a2f12;
	border-left-color : #e0a020;
}
html[data-theme="dark"] div.spm1d-error div.highlight,
html[data-theme="dark"] div.spm1d-error pre {
	background        : #3d1d1b;
	border-left-color : #e0605a;
}


/*  Theory page:  the page links indented beneath each group caption  */
section#theory > .toctree-wrapper > ul {
	padding-left : 1.5rem;
}


/*  code output quoted in the text (code-block or parsed-literal with class
 *  spm1d-output):
 *  the same background as sphinx-gallery script output  */
div.spm1d-output div.highlight,
div.spm1d-output pre,
pre.spm1d-output {
	background : var(--sg-script-pre);
}

/*  classes.md (anchor api-classes-spm) and random_data.md (section
 *  generator-classes):  the in-page table of contents lists the classes
 *  only, so their methods and properties are not expanded  */
html:is(:has(#api-classes-spm), :has(#generator-classes)) #pst-page-toc-nav li:has(> a[href^="#spm1d."]) > ul {
	display : none;
}

/*  the theme highlights only the entry of the section in view, which is now a
 *  hidden method or property:  highlight its class instead  */
html:is(:has(#api-classes-spm), :has(#generator-classes)) #pst-page-toc-nav li.active > a.nav-link[href^="#spm1d."] {
	box-shadow  : inset max(3px, .1875rem, .12em) 0 0 var(--pst-color-primary);
	color       : var(--pst-color-primary);
	font-weight : 600;
}
