* {
	box-sizing: border-box;
	margin: 0;
}

/* Global focus outline reset */
*:focus:not(:focus-visible) {
	outline: none;
}

:root {
	--user-font-scale: 1rem - 16px;
	--max-width: calc(100% - 1rem);
}

@media (min-width: 50em) {
	:root {
		--max-width: 46em;
	}
}

@media (prefers-reduced-motion: no-preference) {
	:root {
		scroll-behavior: smooth;
	}
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	font-family: var(--font-body);
	font-size: 1rem;
	font-size: clamp(0.9rem, 0.75rem + 0.375vw + var(--user-font-scale), 1rem);
	line-height: 1.5;
	max-width: 100vw;
}

nav ul {
	list-style: none;
	padding: 0;
}

.content > section > * + *,
.content > section > blockquote > * + * {
	margin-top: 1.25rem;
}

.content > section > * + :is(ul, ol) {
	margin-top: 0.3rem;
}

.content > section > :first-child {
	margin-top: 0;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin-bottom: 1rem;
	font-weight: bold;
	line-height: 1;
}

h1,
h2 {
	max-width: 40ch;
}

:is(h2, h3):not(:first-child) {
	margin-top: 3rem;
}

:is(h4, h5, h6):not(:first-child) {
	margin-top: 2rem;
}

h1 {
	font-size: 3.25rem;
	font-weight: 800;
}

h2 {
	font-size: 2.5rem;
}

h3 {
	font-size: 1.75rem;
}

h4 {
	font-size: 1.3rem;
}

h5 {
	font-size: 1rem;
}

.heading-wrapper {
	--icon-size: 1rem;
}

.heading-wrapper:not(:first-child) {
	margin-block: 0;
}
.heading-wrapper:not(:first-child):is(.level-h2, .level-h3) {
	margin-top: 3rem;
}

.heading-wrapper:not(:first-child):is(.level-h4, .level-h5, .level-h6) {
	margin-top: 2rem;
}

.heading-wrapper > * {
	display: inline;
	margin-bottom: 0;
}

.heading-wrapper > .anchor-link {
	position: relative;
	inset-inline-start: 0.75rem;
	width: var(--icon-size);
	height: var(--icon-size);
	color: var(--theme-text-light);
	text-decoration: none;
}

/* Float anchor links to the left of headings on larger screens. */
@media (min-width: 50em) {
	.heading-wrapper {
		display: flex;
		flex-direction: row-reverse;
		justify-content: flex-end;
		align-items: baseline;
		margin-inline-start: calc(-1 * var(--icon-size));
	}

	.heading-wrapper > .anchor-link {
		inset-inline-start: -0.75rem;
	}

	.heading-wrapper .anchor-icon {
		position: relative;
		bottom: var(--icon-baseline, 0);
	}

	.heading-wrapper.level-h2 .anchor-icon {
		--icon-baseline: 0.35rem;
	}

	.heading-wrapper.level-h3 .anchor-icon {
		--icon-baseline: 0.15rem;
	}
}

@media (hover: hover) {
	.heading-wrapper > .anchor-link {
		opacity: 0;
	}

	.heading-wrapper:hover > .anchor-link,
	.anchor-link:focus {
		opacity: 1;
	}
}

p,
.content ul {
	line-height: 1.65em;
}

p,
.content ul {
	color: var(--theme-text-light);
}

small,
.text_small {
	font-size: 0.833rem;
}

a {
	color: var(--theme-accent);
	text-underline-offset: 0.08em;
	align-items: center;
	gap: 0.5rem;
}

article > section :is(ul, ol) > * + * {
	margin-top: 0.25rem;
}

article > section nav :is(ul, ol) > * + * {
	margin-top: inherit;
}

article > section li > :is(p, pre, blockquote):not(:first-child) {
	margin-top: 1rem;
}

article > section nav :is(ul, ol) {
	padding-left: inherit;
}

article > section nav {
	margin-top: 1rem;
	margin-bottom: 2rem;
}

article > section ::marker {
	font-weight: bold;
	color: var(--theme-text-light);
}

article > section iframe {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

a > code {
	position: relative;
	color: var(--theme-text-accent);
	text-underline-offset: var(--padding-block);
}

a:hover,
a:focus {
	text-decoration: underline;
}

a:focus {
	outline: 2px solid currentColor;
	outline-offset: 0.25em;
}

strong {
	font-weight: 600;
	color: inherit;
}

/* Supporting Content */
code {
	--border-radius: 3px;
	--padding-block: 0.2rem;
	--padding-inline: 0.3rem;
	font-family: var(--font-mono);
	font-size: 0.85em;
	color: var(--theme-code-inline-text);
	background-color: var(--theme-code-inline-bg);
	padding: var(--padding-block) var(--padding-inline);
	margin: calc(var(--padding-block) * -1) 0;
	border-radius: var(--border-radius);
	word-break: break-word;
}

pre.astro-code > code {
	all: unset;
}

/*RTL Fix Code dir*/
[dir='rtl'] code {
	unicode-bidi: plaintext;
}

table,
pre {
	position: relative;
	--padding-block: 1rem;
	--padding-inline: 2rem;
	padding: var(--padding-block) var(--padding-inline);
	padding-right: calc(var(--padding-inline) * 2);
	margin-left: calc(var(--padding-inline) * -1);
	margin-right: calc(var(--padding-inline) * -1);
	font-family: var(--font-mono);

	line-height: 1.5;
	font-size: 0.85em;
	overflow-y: hidden;
	overflow-x: auto;
}

thead {
	font-family: var(--font-body);
}

table {
	width: 100%;
	padding: var(--padding-block) 0;
	margin: 0;
	border-collapse: collapse;
}

/* Zebra striping */
tbody tr:nth-of-type(odd) {
	background: var(--theme-divider);
}
th {
	font-weight: bold;
}
td,
th {
	padding: 6px;
	text-align: left;
}

pre {
	--glow-border: 1px solid var(--theme-glow-highlight);
	border-top: var(--glow-border);
	border-bottom: var(--glow-border);
	box-shadow: 0 0 var(--theme-glow-blur) var(--theme-glow-diffuse), inset 0 0 var(--theme-glow-blur) var(--theme-glow-diffuse);
	/* override inline styles generated by shiki */
	background-color: var(--theme-code-bg) !important;
	color: var(--theme-code-text) !important;
}

blockquote code {
	background-color: var(--theme-bg);
}

@media (min-width: 37.75em) {
	pre {
		--padding-inline: 1.25rem;
		border: var(--glow-border);
		margin-left: 0;
		margin-right: 0;
	}
}

pre:focus {
	outline: 4px solid var(--theme-accent);
}

blockquote {
	margin: 2rem 0 2rem 0;
	padding: 1.25em 1.5rem;
	border-left: 8px solid var(--theme-divider);
	background-color: var(--theme-bg-offset);
	border-radius: 0 0.25rem 0.25rem 0;
	line-height: 1.7;
}

img {
	max-width: 100%;
}

.flex {
	display: flex;
	align-items: center;
}

button {
	display: flex;
	align-items: center;
	justify-items: center;
	gap: 0.25em;
	padding: 0.33em 0.67em;
	border: 0;
	background: var(--theme-bg);
	display: flex;
	font-size: 1rem;
	align-items: center;
	gap: 0.25em;
	border-radius: 99em;
	color: var(--theme-text);
	background-color: var(--theme-bg);
}

h2.heading {
	font-size: 1rem;
	font-weight: 700;
	padding: 0.1rem 1rem;
	text-transform: uppercase;
	margin-bottom: 0.5rem;
	margin-top: 1.5rem;
}

.header-link {
	font-size: 1rem;
	padding: 1px 0 1px 0;
	padding-inline-start: 1rem;
	border-inline-start: 4px solid var(--theme-divider);
	transition: border-inline-start-color 100ms ease-out;
}

.header-link:hover,
.header-link:focus,
.header-link:focus-within {
	border-inline-start-color: var(--theme-accent-secondary);
}
.header-link:hover a,
.header-link a:focus {
	color: var(--theme-text);
	text-decoration: underline;
}
.header-link svg {
	opacity: 0.6;
}
.header-link:hover svg {
	opacity: 0.8;
}
.header-link a {
	display: inline-flex;
	gap: 0.5em;
	width: 100%;
}

.header-link.depth-3 {
	padding-left: 2rem;
}
.header-link.depth-4 {
	padding-left: 3rem;
}

[dir='rtl'] .header-link.depth-3 {
	padding-left: 0;
	padding-right: 2rem;
}
[dir='rtl'] .header-link.depth-4 {
	padding-left: 0;
	padding-right: 3rem;
}

.header-link a {
	font: inherit;
	color: var(--theme-text-light);
	text-decoration: none;
}

/* Screenreader Only Text */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

.focus\:not-sr-only:focus,
.focus\:not-sr-only:focus-visible {
	position: static;
	width: auto;
	height: auto;
	padding: 0;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
}

:target {
	scroll-margin: calc(var(--theme-sidebar-offset, 5rem) + 2rem) 0 2rem;
}
