@font-face {
	font-family: "Pragma";
	src: url("assets/fonts/r.woff2");
	font-weight: regular;
	font-style: regular;
}

@font-face {
	font-family: "Pragma";
	src: url("assets/fonts/b.woff2");
	font-weight: bold;
	font-style: regular;
}

@font-face {
	font-family: "Pragma";
	src: url("assets/fonts/i.woff2");
	font-weight: regular;
	font-style: italic;
}

@font-face {
	font-family: "Pragma";
	src: url("assets/fonts/z.woff2");
	font-weight: bold;
	font-style: italic;
}

:root {
	--theme: #1e9a7c;
	--corner: 4px;
	color: var(--fg);
	background-color: var(--bg);
	font-size: 16px;
	font-family: "Pragma", sans-serif;
	line-height: 1.4;
	tab-size: 2;
	text-decoration-thickness: 1px;
}

@media screen and (prefers-color-scheme: light) {
	:root {
		--fg: #484848;
		--bg: #F6F6F6;
		--block-fg: black;
		--block-bg: white;
		--link-fg: var(--theme);
		--link-hover-fg: var(--theme);
		--link-hover-bg: var(--bg);
	}
}

@media screen and (prefers-color-scheme: dark) {
	:root {
		--fg: #d8d8d8;
		--bg: #161616;
		--block-fg: white;
		--block-bg: black;
		--link-fg: var(--theme);
		--link-hover-fg: var(--theme);
		--link-hover-bg: var(--bg);
	}
}

#container {
	margin: auto;
	width: 50rem;
	height: 100%;
	padding: 5em;
}

nav {
	width: 8rem;
	text-align: right;
	position: fixed;
	display: block;
	align-items: right;
}

nav .title {
	font-size: calc(1em - 2px);
	color: #eeeeee;
	background: var(--theme);
	padding: 0.3em 0.5em;
	width: fit-content;
	align-self: auto;
	border-radius: 0.3em;
}

nav .title:hover {
	color: var(--theme);
	background: #eeeeee;
}

nav .title a:hover {
	color: inherit;
	background: inherit;
}

main {
	width: 40rem;
	margin-left: 10rem;
	text-align: left;
	overflow-x: hidden;
	overflow-y: auto;
	height: 100%;
}

p {
	display: flow-root;
	margin: 1em 0;
}

h1 {
	font-size: calc(1em + 3pt);
	font-weight: 700;
	margin: 4em 1em 2em 1em;
	text-align: center;
}

h2 {
	font-size: calc(1em + 1pt);
	font-weight: 650;
	margin-top: 2em;
}

h2::before {
	content: "> ";
	color: var(--theme);
	font-weight: bold;
}

blockquote {
	display: flow-root;
	/* padding: 0.5em 2em; */
	margin: 0;
	padding-left: calc(2em - 3px);
	border-left: var(--theme) 3px solid;
	border-top-right-radius: var(--corner);
	border-bottom-right-radius: var(--corner);
}

code {
	font-family: "Pragma", monospace;
	color: var(--theme);
}

pre code {
	display: block;
	overflow-x: auto;
	padding: 0.5em 2em;
}

a {
	color: unset;
	text-decoration: unset;
}

a:hover {
	color: var(--link-hover-fg);
	background-color: var(--link-hover-bg);
}

img {
	margin: auto;
	border-radius: var(--corner);
	max-width: 40rem;
	display: block;
}

figcaption {
	margin-top: 0.7em;
	font-size: calc(1em - 2pt);
	text-align: center;
}

figure {
	margin: 2em 0;
	justify-content: center;
}

hr {
	border: none;
	margin: 3em;
}

hr::before {
	color: var(--theme);
	content: '- < ◊ > -';
	display: block;
	text-align: center;
}

/* hr { */
/* border: none; */
/* border-top: 1px solid var(--theme); */
/* color: var(--fg); */
/* overflow: visible; */
/* text-align: center; */
/* height: 5px; */
/* margin: 2em 0; */
/* } */

/* hr:after { */
/* background: var(--bg); */
/* color: var(--theme); */
/* content: '< ◊ >'; */
/* padding: 0 1em; */
/* position: relative; */
/* top: -13px; */
/* } */

table {
	table-layout: fixed;
	border-collapse: collapse;
	margin: 1em 0;
}

table,
td,
th {
	background-color: var(--block-bg);
	color: var(--block-fg);
	border: 1px solid darkgray;
	padding: 0.4em 0.6em;
}

table caption {
	margin: 0.5em;
	padding: 0em;
}

td {
	text-align: left;
}

thead th {
	font-weight: 650;
	width: fit-content;
}

cite {
	float: inline-end;
}

cite::before {
	content: "--- ";
}

dl {
	padding-left: 1em;
}

dt {
	font-weight: bold;
}

dd {
	margin-inline-start: 2em;
}

.cjk {
	font-family: "LXGW WenKai Mono TC", serif;
	font-size: calc(1em + 2pt);
}

.cjk h1 {
	font-size: calc(1em + 4pt);
}

.cjk h2 {
	font-size: calc(1em + 3pt);
}

.katex {
	font-size: inherit;
}

main>:first-child,
.cjk>:first-child {
	margin-top: 0;
	padding-top: 0;
}