* {
	--main-color: #084447;
	--secondary-color: #d5f7ff;
}

html {
	box-sizing: border-box;
	font-family: sans-serif;
	height: 100%;
	background-color: var(--secondary-color);
	color: var(--main-color);
}

*,
*:before,
*:after {
	box-sizing: inherit;
	margin: 0px;
	padding: 0px;
}

body {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: row;
}

/* Navbar */
.sidebar {
	width: 20%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px;
	background-color: var(--main-color);
	color: var(--secondary-color);
	user-select: none;
}

.sidebar > button.sidebar-toggle {
	display: none;
}

.sidebar > h1 {
	font-size: 1.4em;
	font-weight: bold;
	cursor: pointer;
	text-align: left;
	padding-left: 40px;
	width: 100%;
}

.sidebar > menu#toc-buttons {
	display: flex;
	flex-direction: column;
	align-items: left;
	list-style-type: none;
	width: 100%;
}

.sidebar > menu#toc-buttons > button {
	text-align: left;
	color: inherit;
	font-size: 1.15em;
	padding: 2px;
	background-color: transparent;
	border: none;
	cursor: pointer;
	box-shadow: inset var(--secondary-color) 0 0;

	transition:
		box-shadow 0.1s,
		color 0.1s;
}

.sidebar > menu#toc-buttons > button.toc-button-0 {
	font-weight: bold;
}

.sidebar > menu#toc-buttons > button.toc-button-1 {
	padding-left: 12px;
}

.sidebar > menu#toc-buttons > button.toc-button-2 {
	padding-left: 24px;
}

.sidebar > menu#toc-buttons > button.toc-button-3 {
	padding-left: 36px;
}

.sidebar > menu#toc-buttons > button.active {
	color: var(--main-color);
	box-shadow: inset var(--secondary-color) 20vw 0;
}

/* Language selection */
.sidebar > select#language-select {
	color: var(--main-color);
	font-size: 1em;
	font-weight: bold;
	padding: calc(12px + 0.125em);
	border: none;
	margin: none;
	background-color: var(--secondary-color);
	width: 100%;
}

.sidebar > select#language-select > option {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	padding: inherit;
	border: inherit;
	margin: inherit;
	background-color: inherit;
}

.sidebar > select#language-select > option:hover {
	background-color: var(--main-color);
}

.space-1 {
	flex-grow: 1;
}

.space-2 {
	flex-grow: 2;
}

.space-3 {
	flex-grow: 3;
}

/* Email contact info at the end of navbar */
.sidebar > address {
	margin: 12px;
}

/* Actual pages */
main {
	width: 80%;
	display: flex;
	flex-direction: column;
	background-color: var(--secondary-color);
}

.page-content {
	width: 100%;
	overflow: scroll;
	display: flex;
	flex-direction: column;
	text-align: justify;
	flex-grow: 1;
}

.youtube-embed {
	width: 100%;
	height: 100%;
}

.horizontal {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 1em;
}

.size-4 {
	width: 40%;
}

.size-5 {
	width: 50%;
}

.size-6 {
	width: 60%;
}

.flex-center {
	align-self: center;
}

.center {
	text-align: center;
}

section {
	padding: 1em;
}

section:has(> iframe.youtube-embed) {
	aspect-ratio: 16/9;
}

section > * {
	margin-top: 1em;
}

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

section.horizontal > * {
	margin-top: 0;
}

p.caption {
	margin-bottom: 0;
	color: gray;
	font-size: .8em;
	text-align: center;
}

ul {
	padding-left: 3em;
}

a {
	color: grey;
	text-decoration: underline;
}

a[data-local-href] {
	color: blue;
	cursor: pointer;
	font-weight: bold;
}

a[href] {
	color: blue;
	cursor: pointer;
	font-weight: bold;
}

.page-button {
	display: block;
	width: 100%;
	text-align: center;
	background-color: rgb(83, 83, 83);
	color: var(--secondary-color);
	font-size: 1.25em;
	font-weight: bold;
	padding: 12px;
	border: none;
	text-decoration: none;
}

.page-button[href] {
	cursor: pointer;
	background-color: var(--main-color);
}

.page-button[data-local-href] {
	cursor: pointer;
	background-color: var(--main-color);
}

.marginal {
	width: calc(100% - 2em);
	margin: 1em;
	margin-top: 0;
}

.marginal:last-child {
	margin-bottom: 0;
}

code {
	background-color: #142023;
	color: var(--secondary-color);
	padding: .5em;
	display: flow-root;
	font-family: monospace;
	text-align: left;
	white-space-collapse: preserve;
}

var {
	display: inline-block;
	background-color: #142023;
	color: var(--secondary-color);
	padding: .2em;
	font-style: normal;
	font-family: monospace;
	white-space-collapse: preserve;
}

/* img {
	margin: 1em;
} */

aside {
	text-align: left;
	float: right;
	width: calc(256px - 1em);
	margin: 1em;
	margin-right: 0;
	background-color: #927b40;
	color: white;
}

aside > * {
	padding: .5em;
}

aside > header {
	font-size: 1.25em;
	font-weight: bold;
	border-bottom: solid 1px var(--secondary-color);
}

aside a[data-local-href] {
	color: rgb(219, 182, 0);
}

aside a[href] {
	color: rgb(219, 182, 0);
}

#nav-buttons {
	display: none;
	flex-direction: row;
	margin: 1em;
	gap: 1em;
}

@media only screen and (max-width: 1280px) {
	.sidebar {
		position: fixed;
		left: -256px;
		width: 256px;
		transition: left 0.1s;
	}

	.sidebar.open {
		left: 0;
	}

	.sidebar > button.sidebar-toggle {
		display: block;
		position: absolute;
		top: 0;
		right: -2em;
		width: 2em;
		height: 2em;
		background-color: var(--main-color);
		color: var(--secondary-color);
		font-size: 1.5em;
		font-weight: bold;
		border: none;
		cursor: pointer;
	}

	.sidebar > menu#toc-buttons > button.active {
		box-shadow: inset var(--secondary-color) 256px 0;
	}

	main {
		width: 100%;
	}

	.page-content {
		padding-top: 3em;
	}
}

/* Mobile */
@media only screen and (max-width: 512px) {
	.sidebar {
		width: 100%;
		left: -100%;
	}

	.sidebar.open {
		left: 0;
	}

	.sidebar.open > button.sidebar-toggle {
		right: 0;
	}

	.sidebar > menu#toc-buttons > button.active {
		box-shadow: inset var(--secondary-color) 100vw 0;
	}

	.horizontal {
		flex-direction: column;
	}

	.size-4 {
		width: 100%;
	}

	.size-5 {
		width: 100%;
	}

	.size-6 {
		width: 100%;
	}

	aside {
		float: none;
		width: 100%;
		margin: 0;
		margin-top: 1em;
	}

	aside:first-child {
		margin-top: 0;
	}
}
