/* Base */

html {
	background: #1a1a1a;
	color: #ddd;
	font-size: 18px;
}

body {
	max-width: 800px;
	margin: auto;
	padding: 1em;
	line-height: 1.5;
}

p, li {
	hyphens: none !important;
	word-break: keep-all;
	overflow-wrap: normal;
}

p:has(+ ul) {
	margin-bottom: 0.5em;
}
p + ul {
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}
ul + p {
	margin-top: 0.5em;
}
p:has(+ ol) {
	margin-bottom: 0.5em;
}
p + ol {
	margin-top: 0.5em;
	margin-bottom: 0.5em;
}
ol + p {
	margin-top: 0.5em;
}
li {
	margin-bottom: 0.5em;
}

/* Removes extra space after the final bullet point */
li:last-child {
	margin-bottom: 0;
}

h2,h3,h4,h5,h6 {
	margin-bottom: -0.5em;
}

h2.post-list-title {
	margin-bottom: 0em;
}

h2.project-list-title {
	margin-bottom: 0em;
}

/* Links */

a {
	color: #8ab4f8;
}

a:hover {
	color: #b8d4ff;
}

/* Header and navigation */

.menu {
	padding: 0;
	text-align: center;
	display: flex;
	justify-content: center;
	gap: 0;
}

.menu li {
	display: block;
	margin-left: 2pt;
	margin-right: 2pt;
}

.menu a {
	text-decoration: none;
	background: #333;
	color: #ddd;
	padding: 5px 8px;
	border-radius: 5px;
}

.menu a:hover {
	background: #333;
}

/* Article title */

.title {
	text-align: left;
	font-size: 1em;
	font-weight: normal;
	color: #ddd;
}

/* Article date / metadata */

.article-meta {
	text-align: left;
	font-size: 20px;
	font-weight: normal;
	color: #ddd;
}


/* Footer */

footer {
	text-align: center;
	color: #888;
	font-size: 0.9em;
}

footer a {
	text-decoration: none;
}

hr {
	border: 0;
	border-top: 1px dashed #444;
}

/* Article headings */

article h1 {
	font-size: 1em;
	font-weight: normal;
}

article h2 {
	font-size: 1.2em;
	font-weight: normal;
}

article h3 {
	font-size: 1.05em;
	font-weight: normal;
}

.article-meta h1 {
	margin-bottom: 0;
}
p.date {
	margin-top: 0;
}

/* Code */

pre {
	border: 1px solid #333;
	background: #181818;
	box-shadow: 5px 5px 5px #0a0a0a;
	padding: 1em;
	overflow-x: auto;
	border-radius: 4px;
}

code {
	background: #222;
	padding: 0.1em 0.25em;
	border-radius: 3px;
}

pre code {
	background: none;
	padding: 0;
}

pre,
code {
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* Misc elements */

img,
iframe,
video {
	max-width: 100%;
}

main {
	hyphens: auto;
}

blockquote {
	background: #1b1b1b;
	border-left: 5px solid #555;
	padding: 3px 1em;
	margin-left: 0;
	color: #bbb;
}

/* Tables */

table {
	margin: auto;
	border-top: 1px solid #555;
	border-bottom: 1px solid #555;
	border-collapse: collapse;
}

table thead th {
	border-bottom: 1px solid #444;
}

th,
td {
	padding: 5px 10px;
}

thead,
tfoot,
tr:nth-child(even) {
	background: #1b1b1b;
}

/* Mobile */

@media (max-width: 600px) {
	html {
		font-size: 18px;
	}

	body {
		padding: 0.75em;
	}
}

details {
	/* background-color: #000000; */
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 0.1em 1em;
	margin-bottom: 1em;
	transition: background-color 0.2s ease;
}

/* Style the clickable header row */
summary {
	font-weight: bold;
	cursor: pointer;
	padding: 0.5em 0;
	outline: none; /* Removes default focus outline if preferred */
}

details[open] summary {
	padding-bottom: 0;
}

mjx-container, mjx-container *, .MathJax, .MathJax_Display {
	pointer-events: none !important;
}

.post-content {
  counter-reset: h2;
}

.post-content > h2 { counter-increment: h2; counter-reset: h3; }
.post-content > h3 { counter-increment: h3; counter-reset: h4; }
.post-content > h4 { counter-increment: h4; counter-reset: h5; }
.post-content > h5 { counter-increment: h5; counter-reset: h6; }
.post-content > h6 { counter-increment: h6; }

.post-content > h2::before { content: counter(h2) ". "; }
.post-content > h3::before { content: counter(h2) "." counter(h3) ". "; }
.post-content > h4::before { content: counter(h2) "." counter(h3) "." counter(h4) ". "; }
.post-content > h5::before { content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "; }
.post-content > h6::before { content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "; }
.post-content > .unnumbered {
  counter-increment: none;
  counter-reset: none;
}

.post-content > .unnumbered::before {
  content: none;
}
