/* Variable overrides */
:root {
	--code-max-height: 17.25rem;
}

[data-md-color-scheme="slate"] {
	--md-code-hl-color: #ffffcf1c;
	--md-hue: 225;
	--md-default-bg-color: hsla(var(--md-hue), 15%, 16%, 1);
	--md-default-bg-color--light: hsla(var(--md-hue), 15%, 16%, 0.54);
	--md-default-bg-color--lighter: hsla(var(--md-hue), 15%, 16%, 0.26);
	--md-default-bg-color--lightest: hsla(var(--md-hue), 15%, 16%, 0.07);
	--md-code-bg-color: #16181d;
	--md-primary-fg-color: #2b3540;
	--md-default-fg-color--light: #fff;
	--md-typeset-a-color: #00b0f0;
	--md-code-hl-comment-color: hsla(var(--md-hue), 75%, 90%, 0.43);
	--tabbed-labels-color: rgb(52 58 70);
}

[data-md-color-scheme="default"] {
	--tabbed-labels-color: #7d829e26;
}

/* General admonition styling */
/* TODO: Write this in a way that supports the light theme */
[data-md-color-scheme="slate"] .md-typeset details,
[data-md-color-scheme="slate"] .md-typeset .admonition {
	border-color: transparent !important;
}

.md-typeset :is(.admonition, details) {
	margin: 0.55em 0;
}

.md-typeset .admonition {
	font-size: 0.7rem;
}

.md-typeset .admonition:focus-within,
.md-typeset details:focus-within {
	box-shadow: var(--md-shadow-z1) !important;
}

/* Colors for "summary" admonition */
[data-md-color-scheme="slate"] .md-typeset .admonition.summary {
	background: #353a45;
	padding: 0.8rem 1.4rem;
	border-radius: 0.8rem;
}

[data-md-color-scheme="slate"] .md-typeset .summary .admonition-title {
	font-size: 1rem;
	background: transparent;
	padding-left: 0.6rem;
	padding-bottom: 0;
}

[data-md-color-scheme="slate"] .md-typeset .summary .admonition-title:before {
	display: none;
}

[data-md-color-scheme="slate"] .md-typeset .admonition.summary {
	border-color: #ffffff17 !important;
}

/* Colors for "note" admonition */
[data-md-color-scheme="slate"] .md-typeset .admonition.note {
	background: rgb(43 110 98/ 0.2);
	padding: 0.8rem 1.4rem;
	border-radius: 0.8rem;
}

[data-md-color-scheme="slate"] .md-typeset .note .admonition-title {
	font-size: 1rem;
	background: transparent;
	padding-bottom: 0;
	color: rgb(68 172 153);
}

[data-md-color-scheme="slate"] .md-typeset .note .admonition-title:before {
	font-size: 1.1rem;
	background-color: rgb(68 172 153);
}

.md-typeset .note > .admonition-title:before,
.md-typeset .note > summary:before {
	-webkit-mask-image: var(--md-admonition-icon--abstract);
	mask-image: var(--md-admonition-icon--abstract);
}

/* Colors for "warning" admonition */
[data-md-color-scheme="slate"] .md-typeset .admonition.warning {
	background: rgb(182 87 0 / 0.2);
	padding: 0.8rem 1.4rem;
	border-radius: 0.8rem;
}

[data-md-color-scheme="slate"] .md-typeset .warning .admonition-title {
	font-size: 1rem;
	background: transparent;
	padding-bottom: 0;
	color: rgb(219 125 39);
}

[data-md-color-scheme="slate"] .md-typeset .warning .admonition-title:before {
	font-size: 1.1rem;
	background-color: rgb(219 125 39);
}

/* Colors for "info" admonition */
[data-md-color-scheme="slate"] .md-typeset .admonition.info {
	background: rgb(43 52 145 / 0.2);
	padding: 0.8rem 1.4rem;
	border-radius: 0.8rem;
}

[data-md-color-scheme="slate"] .md-typeset .info .admonition-title {
	font-size: 1rem;
	background: transparent;
	padding-bottom: 0;
	color: rgb(136 145 236);
}

[data-md-color-scheme="slate"] .md-typeset .info .admonition-title:before {
	font-size: 1.1rem;
	background-color: rgb(136 145 236);
}

/* Colors for "example" admonition */
[data-md-color-scheme="slate"] .md-typeset .admonition.example {
	background: rgb(94 104 126);
	border-radius: 0.4rem;
}

[data-md-color-scheme="slate"] .md-typeset .example .admonition-title {
	background: rgb(78 87 105);
	color: rgb(246 247 249);
}

[data-md-color-scheme="slate"] .md-typeset .example .admonition-title:before {
	background-color: rgb(246 247 249);
}

[data-md-color-scheme="slate"] .md-typeset .admonition.example code {
	background: transparent;
	color: #fff;
}

/* Move the sidebars to the edges of the page */
.md-main__inner.md-grid {
	margin-left: 0;
	margin-right: 0;
	max-width: unset;
	display: flex;
	justify-content: center;
}

.md-sidebar--primary {
	margin-right: auto;
}

.md-sidebar.md-sidebar--secondary {
	margin-left: auto;
}

.md-content {
	max-width: 56rem;
}

/* Maintain content positioning even if sidebars are disabled */
@media screen and (min-width: 76.1875em) {
	.md-sidebar {
		display: block;
	}

	.md-sidebar[hidden] {
		visibility: hidden;
	}
}

/* Sidebar styling */
@media screen and (min-width: 76.1875em) {
	.md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link {
		text-transform: uppercase;
	}

	.md-nav__title[for="__toc"] {
		text-transform: uppercase;
		margin: 0.5rem;
	}

	.md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link {
		color: rgb(133 142 159);
		margin: 0.5rem;
	}

	.md-nav__item .md-nav__link {
		position: relative;
	}

	.md-nav__link:is(:focus, :hover):not(.md-nav__link--active) {
		color: unset;
	}

	.md-nav__item
		.md-nav__link:is(:focus, :hover):not(.md-nav__link--active):before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		opacity: 0.2;
		z-index: -1;
		background-color: grey;
	}

	.md-nav__item .md-nav__link--active:before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		opacity: 0.15;
		z-index: -1;
		background-color: var(--md-typeset-a-color);
	}

	.md-nav__link {
		padding: 0.5rem 0.5rem 0.5rem 1rem;
		margin: 0;
		border-radius: 0 10px 10px 0;
		font-weight: 600;
		overflow: hidden;
	}

	.md-sidebar__scrollwrap {
		margin: 0;
	}

	[dir="ltr"]
		.md-nav--lifted
		.md-nav[data-md-level="1"]
		> .md-nav__list
		> .md-nav__item {
		padding: 0;
	}

	.md-nav__item--nested .md-nav__item .md-nav__item {
		padding: 0;
	}

	.md-nav__item--nested .md-nav__item .md-nav__item .md-nav__link {
		font-weight: 300;
	}

	.md-nav__item--nested .md-nav__item .md-nav__item .md-nav__link {
		font-weight: 400;
		padding-left: 1.25rem;
	}
}

/* Table of Contents styling */
@media screen and (min-width: 60em) {
	[data-md-component="sidebar"] .md-nav__title[for="__toc"] {
		text-transform: uppercase;
		margin: 0.5rem;
		margin-left: 0;
	}

	[data-md-component="toc"] .md-nav__item .md-nav__link--active {
		position: relative;
	}

	[data-md-component="toc"] .md-nav__item .md-nav__link--active:before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		opacity: 0.15;
		z-index: -1;
		background-color: var(--md-typeset-a-color);
	}

	[data-md-component="toc"] .md-nav__link {
		padding: 0.5rem 0.5rem;
		margin: 0;
		border-radius: 10px 0 0 10px;
	}
	[dir="ltr"] .md-sidebar__inner {
		padding: 0;
	}

	.md-nav__item {
		padding: 0;
	}
}

/* Font changes */
.md-typeset {
	font-weight: 300;
}

.md-typeset h1 {
	font-weight: 500;
	margin: 0;
	font-size: 2.5em;
}

.md-typeset h2 {
	font-weight: 500;
}

.md-typeset h3 {
	font-weight: 600;
}

/* Intro section styling */
p.intro {
	font-size: 0.9rem;
	font-weight: 500;
}

/* Hide invisible jump selectors */
h2#overview {
	visibility: hidden;
	height: 0;
	margin: 0;
	padding: 0;
}

/* Code blocks */
.md-typeset pre > code {
	border-radius: 16px;
}

.md-typeset .highlighttable .linenos {
	max-height: var(--code-max-height);
	overflow: hidden;
}

.md-typeset .tabbed-block .highlighttable code {
	border-radius: 0;
}

.md-typeset .tabbed-block {
	border-bottom-left-radius: 8px;
	border-bottom-right-radius: 8px;
	overflow: hidden;
}

.js .md-typeset .tabbed-labels {
	background: var(--tabbed-labels-color);
	border-top-left-radius: 8px;
	border-top-right-radius: 8px;
}

.md-typeset .tabbed-labels > label {
	font-weight: 400;
	font-size: 0.7rem;
	padding-top: 0.55em;
	padding-bottom: 0.35em;
}

.md-typeset pre > code {
	max-height: var(--code-max-height);
}

/* Reduce height of outdated banner */
.md-banner__inner {
	margin: 0.45rem auto;
}
