/* Fonts: load FK Grotesk Neue from shared static assets. */
@font-face {
	font-family: "FK Grotesk Neue";
	src: url("fonts/FKGroteskNeue-Regular.otf") format("opentype");
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: "FK Grotesk Neue";
	src: url("fonts/FKGroteskNeue-Italic.otf") format("opentype");
	font-style: italic;
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: "FK Grotesk Neue";
	src: url("fonts/FKGroteskNeue-Medium.otf") format("opentype");
	font-style: normal;
	font-weight: 500;
	font-display: swap;
}

@font-face {
	font-family: "FK Grotesk Neue";
	src: url("fonts/FKGroteskNeue-MediumItalic.otf") format("opentype");
	font-style: italic;
	font-weight: 500;
	font-display: swap;
}

@font-face {
	font-family: "FK Grotesk Neue";
	src: url("fonts/FKGroteskNeue-Bold.otf") format("opentype");
	font-style: normal;
	font-weight: 700;
	font-display: swap;
}

@font-face {
	font-family: "FK Grotesk Neue";
	src: url("fonts/FKGroteskNeue-BoldItalic.otf") format("opentype");
	font-style: italic;
	font-weight: 700;
	font-display: swap;
}

/* ImFusion color tokens: light mode brand palette. */
html[data-theme="light"] {
	/* Primary brand color: navbar text/hover, focus rings, active controls, announcement bar. */
	--imf-color-primary: #245EFF;
	/* Link color: article links, inline code, API prefixes. */
	--imf-color-link: #485357;
	/* Accent color: API object names, search focus, targets, notebook input bars, permalinks. */
	--imf-color-accent: #9365FF;
	/* Page chrome background: navbar/header background. */
	--imf-color-background: #FFFFFF;
	/* Foreground on accent fills: back-to-top icon/text. */
	--imf-color-on-accent: #FFFFFF;
}

/* ImFusion color tokens: dark mode brand palette. */
html[data-theme="dark"] {
	/* Primary brand color: navbar hover, focus rings, active controls, announcement bar. */
	--imf-color-primary: #245EFF;
	/* Link color: article links, inline code, API prefixes, navbar text. */
	--imf-color-link: #C6DED2;
	/* Accent color: API object names, search focus, targets, notebook input bars, permalinks. */
	--imf-color-accent: #E2F777;
	/* Page chrome background: navbar/header background. */
	--imf-color-background: #06121D;
	/* Foreground on accent fills: back-to-top icon/text. */
	--imf-color-on-accent: #000000;
}

/* Layout: percentage-based docs width and three-column split. */
html {
	--imf-visible-content-width: 85vw;
	--imf-left-nav-width: 15vw;
	--imf-middle-content-width: 55vw;
	--imf-right-toc-width: 15vw;
	--pst-header-height: 3rem;
	--pst-header-article-height: calc(var(--pst-header-height) * 2 / 3);
}

.bd-page-width {
	max-width: var(--imf-visible-content-width);
}

.bd-sidebar-primary {
	width: var(--imf-left-nav-width);
}

.bd-main .bd-content .bd-article-container {
	max-width: var(--imf-middle-content-width);
}

.bd-sidebar-secondary {
	width: var(--imf-right-toc-width);
}

/* Navbar: align header center items with the article column. */
.bd-header .navbar-header-items__start {
	flex: 0 0 var(--imf-left-nav-width);
	width: var(--imf-left-nav-width);
	max-width: var(--imf-left-nav-width);
}

.bd-header .navbar-header-items {
	flex: 0 0 calc(var(--imf-middle-content-width) + var(--imf-right-toc-width));
	width: calc(var(--imf-middle-content-width) + var(--imf-right-toc-width));
	max-width: calc(var(--imf-middle-content-width) + var(--imf-right-toc-width));
}


/* Install command: a copyable package-specific pip command above article breadcrumbs. */
.imf-install-bar {
	align-items: center;
	border-bottom: 1px solid var(--pst-color-border);
	display: flex;
	margin: -1rem 0 0.5rem 0.6rem;
	padding: 0.2rem 0;
	width: 100%;
}

.imf-install-command {
	align-items: center;
	display: inline-flex;
	font-size: 0.75rem;
	gap: 0.35rem;
}

.imf-install-command__code {
	color: color-mix(in srgb, var(--pst-color-text-muted) 65%, var(--pst-color-background));
	font-size: inherit;
	white-space: nowrap;
}

.imf-install-command__copy {
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--pst-color-text-muted);
	cursor: pointer;
	display: inline-flex;
	height: 1.25rem;
	justify-content: center;
	padding: 0;
	width: 1.25rem;
}

.imf-install-command__copy:hover,
.imf-install-command__copy:focus-visible,
.imf-install-command__copy[data-copied="true"] {
	color: var(--imf-color-primary);
}

@media (max-width: 960px) {
	.imf-install-command {
		max-width: calc(100vw - 2rem);
		overflow-x: auto;
	}
}

/* Branding: scale the navbar logo relative to the surrounding text. */
.navbar-brand.logo .logo__image {
	height: 1.5rem;
	width: auto;
}


/* Theme variable mapping: connect ImFusion tokens to PyData and extension variables. */
html[data-theme="light"],
html[data-theme="dark"] {
	--pst-font-family-base: "FK Grotesk Neue", system-ui, sans-serif;
	--pst-font-family-heading: "FK Grotesk Neue", system-ui, sans-serif;
	--pst-color-primary: var(--imf-color-primary);
	--pst-color-link: var(--imf-color-link);
	--pst-color-link-hover: var(--imf-color-primary);
	--pst-color-link-higher-contrast: var(--imf-color-link);
	--pst-color-inline-code: var(--imf-color-link);
	--pst-color-target: color-mix(in srgb, var(--imf-color-accent) 18%, transparent);
	--mystnb-source-margin-color: var(--imf-color-accent);
}

/* Bootstrap navbar variable mapping: connect ImFusion tokens to header/navbar controls. */
.bd-header,
.navbar {
	background: var(--imf-color-background);
	--bs-navbar-color: var(--imf-color-primary);
	--bs-navbar-hover-color: var(--imf-color-primary);
	--bs-navbar-brand-color: var(--imf-color-primary);
	--bs-navbar-brand-hover-color: var(--imf-color-primary);
	--bs-nav-link-color: var(--imf-color-primary);
	--bs-nav-link-hover-color: var(--imf-color-primary);
}

html[data-theme="dark"] .bd-header,
html[data-theme="dark"] .navbar {
	--bs-navbar-color: var(--imf-color-link);
	--bs-navbar-brand-color: var(--imf-color-link);
	--bs-nav-link-color: var(--imf-color-link);
}

/* Navbar hover: Use primary color as hover-link color in navbar. */
.bd-header ul.navbar-nav > li.nav-item > .nav-link:hover,
.bd-header ul.navbar-nav > li.nav-item > .nav-link:focus {
	color: var(--imf-color-primary);
	text-decoration: none;
}

.bd-header ul.navbar-nav > li.nav-item > .nav-link:hover::before,
.bd-header ul.navbar-nav > li.nav-item > .nav-link:focus::before {
	border-bottom-color: var(--imf-color-primary);
}

.bd-header ul.navbar-nav > li.nav-item.dropdown > .dropdown-toggle:hover,
.bd-header ul.navbar-nav li a.nav-link.dropdown-item:hover,
.bd-header ul.navbar-nav .dropdown button:hover,
.bd-header .nav-link:hover,
.bd-header .nav-link:focus,
.bd-header .navbar-brand:hover,
.bd-header .navbar-brand:focus {
	color: var(--imf-color-primary);
	text-decoration: none;
}

.bd-header ul.navbar-nav > li.nav-item.dropdown > .dropdown-toggle:hover {
	box-shadow: 0 0 0 0.1875rem var(--imf-color-primary);
}

.bd-header .theme-switch-button:hover,
.bd-header .theme-switch-button:focus,
.bd-header .theme-switch-button:focus-visible {
	color: var(--imf-color-primary);
	box-shadow: 0 0 0 0.1875rem var(--imf-color-primary);
	text-decoration: none;
}

/* Header utility icon controls: override the pydata navbar-icon hover accent. */
.bd-header .pst-navbar-icon:hover,
.bd-header .pst-navbar-icon:focus,
.bd-header .pst-navbar-icon:focus-visible {
	color: var(--imf-color-primary);
	text-decoration: none;
	border-bottom: none;
}

.bd-header .pst-navbar-icon:hover::before,
.bd-header .pst-navbar-icon:focus::before,
.bd-header .pst-navbar-icon:focus-visible::before {
	border-bottom: none;
}

/* Search dialog: use the accent color while the popup search box is focused. */
#pst-search-dialog form.bd-search:focus-within {
	border-color: var(--imf-color-accent);
	box-shadow: 0 0 0 0.1875rem var(--imf-color-accent);
}

/* De-emphasize the package and version that identify each search result's source. */
.imfusion-search-source {
	color: var(--pst-color-text-muted);
	font-size: 0.875em;
}

/* API reference: highlight object names and active targets. */
.sig-name,
dt:target,
span.highlighted {
	color: var(--imf-color-accent);
}

.bd-content .sig-prename.descclassname {
	color: var(--pst-color-link);
}

dt:target,
span.highlighted {
	background-color: var(--pst-color-target);
}

/* API reference: reduce vertical spacing between documented objects. */
.bd-content dl.py {
	margin-bottom: 1rem;
}

.bd-content dl.py.class > dd > dl.py {
	margin-bottom: 0.35rem;
}

.bd-content dl.py.class > dd > dl.py:has(> dd:empty) > dd {
	margin: 0;
}

/* Permalinks and back-to-top: use the accent color for page-local anchor affordances. */
.bd-content a.headerlink,
.bd-content a.headerlink:hover,
.bd-content a.headerlink:focus,
.bd-content a.headerlink:visited,
#pst-back-to-top {
	color: var(--imf-color-accent);
}

#pst-back-to-top {
	background-color: var(--imf-color-accent);
	border-color: var(--imf-color-accent);
	color: var(--imf-color-on-accent);
}

#pst-back-to-top:hover,
#pst-back-to-top:focus,
#pst-back-to-top:focus-visible {
	background-color: var(--imf-color-accent);
	border-color: var(--imf-color-accent);
	color: var(--imf-color-on-accent);
	box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--imf-color-accent) 35%, transparent);
}
