/* Light */
:root {
	color-scheme: light dark;
	--text-color: #223236;
	--link-color: #0877a0;
	--link-visited: #7a4f98;
	--chrome-text: #fff;
	--nav-link-color: #fff;
	--header-background: #05645f;
	--nav-background: #07857f;
	--tagline-color: #fff;
	--dateline-color: #a8412c;
	--separator-color: #d9dad5;
	--highlight-shadow: #fff;
	--footer-background: #0d3b3d;
	--footer-text: #a8cfcc;
	--footer-link: #d3efec;
	--footer-link-hover: #fff;
	--body-background: #f0f2f3;
	--content-background: #f0f2f3;
	--content-width: 600px;
	--header-content-height: 30.6px;
	--blockquote-border: #e0a526;
	--blockquote-color: rgb(0, 0, 0, 0.68);
	--heading-color: var(--text-color);
	--body-font: Georgia, 'Times New Roman', serif;
	--heading-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	--mono-font: "SF Mono", Menlo, "Courier", monospace;
}

/* Dark mode */

@media (prefers-color-scheme: dark) {
	:root {
		--text-color: #cfdcde;
		--body-background: #101416;
		--content-background: #171c1f;
		--link-color: #6cc8ec;
		--link-visited: #c4a2e8;
		--header-background: #063d3b;
		--nav-background: #0c6560;
		--nav-link-color: #e6f5f4;
		--tagline-color: #e0f8f6;
		--dateline-color: #e8947c;
		--separator-color: #2a3236;
		--highlight-shadow: transparent;
		--footer-background: #0c2829;
		--footer-text: #8fb8b5;
		--footer-link: #aecfcc;
		--footer-link-hover: #dcf3f1;
		--blockquote-border: #b8862a;
		--blockquote-color: rgb(255, 255, 255, 0.6);
	}
}

/* Base */

body {
	margin: 0;
	padding: 0;
	font-family: var(--body-font);
	font-size: 1.15em;
	line-height: 1.8em;
	color: var(--text-color);
	background-color: var(--body-background);
}
img {
	max-width: 100%;
	height: auto;
}
a {
	color: var(--link-color);
	text-underline-offset: 3px;
}
a:visited {
	color: var(--link-visited);
}
code, pre {
	font-family: var(--mono-font);
	font-size: 17px;
	white-space: pre-wrap;
}

/* Header */

#header-background {
	background-color: var(--header-background);
	padding: 14px 0;
}
header {
	font-family: var(--heading-font);
	padding: 0 2px;
	height: var(--header-content-height);
	max-width: var(--content-width);
	margin: 0 auto;
	display: flex;
	align-items: baseline;
	gap: 12px;
}
header h1 {
	margin: 0;
	color: var(--chrome-text);
	font-size: 22px;
	font-weight: bold;
	letter-spacing: -0.01em;
	line-height: 1.2;
}
header h1 a {
	color: var(--chrome-text);
	text-decoration: none;
}
header h1 a:hover {
	text-decoration: underline;
}
header h1 a:visited {
	color: var(--chrome-text);
}
header .tagline {
	margin: 0;
	font-size: 17px;
	line-height: var(--header-content-height);
	color: var(--tagline-color);
}

/* Nav band */

#topnav-background {
	background-color: var(--nav-background);
	padding: 6px 0;
}
#topnav {
	max-width: var(--content-width);
	margin: 0 auto;
	padding: 0 2px;
	text-align: right;
	font-family: var(--heading-font);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
}
#topnav a {
	color: var(--nav-link-color);
	text-decoration: none;
	margin-left: 18px;
}
#topnav a:hover {
	text-decoration: underline;
}

/* Content area */

#content-background {
	background-color: var(--content-background);
}

/* Main content */

main {
	max-width: var(--content-width);
	margin: 0 auto;
	padding-top: 62px;
	padding-bottom: 62px;
}

/* Headings */

h1, h2, h3, h4 {
	font-family: var(--heading-font);
	color: var(--heading-color);
	line-height: 1.2em;
}

/* Blog posts */

.weblogPost {
	margin-bottom: 32px;
	padding-bottom: 16px;
}
.weblogPost h3 {
	margin: 10px 0 8px 0;
	font-size: 21px;
	font-weight: bold;
}
.weblogPost h3 a {
	color: var(--heading-color);
	text-decoration: none;
}
.weblogPost h3 a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}
.weblogPost h3 a:visited {
	color: var(--heading-color);
}
.weblogPostBody {
	margin: 0;
	overflow-wrap: break-word;
}
.weblogPostBody p {
	margin: 0 0 14px 0;
}
.weblogPostDateline {
	font-family: var(--heading-font);
	font-size: 17px;
	font-weight: 600;
	color: var(--dateline-color);
	margin-bottom: 10px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--separator-color);
	box-shadow: 0 1px 0 var(--highlight-shadow);
}
.weblogPostDateline a {
	color: var(--dateline-color);
	text-decoration: none;
}
.weblogPostDateline a:visited {
	color: var(--dateline-color);
}
.weblogPostDateline a:hover {
	text-decoration: underline;
}

/* Archive link */

#archiveLink a {
	font-family: var(--heading-font);
	font-size: 17px;
	font-weight: bold;
}

/* Lists and quotes */

ul, ol {
	padding-left: 21px;
	margin: 14px 0 14px 0;
}
blockquote {
	color: var(--blockquote-color);
	border-left: 3px solid var(--blockquote-border);
	padding-left: 18px;
	margin: 24px 0 24px 0;
	font-style: normal;
}

/* Footer */

#footer-background {
	background-color: var(--footer-background);
}
footer {
	max-width: var(--content-width);
	margin: 0 auto;
	font-family: var(--heading-font);
	padding: 32px 2px 36px 2px;
	font-size: 17px;
	color: var(--footer-text);
}
footer a {
	color: var(--footer-link);
}
footer a:visited {
	color: var(--footer-link);
}
footer a:hover {
	color: var(--footer-link-hover);
}
footer p {
	margin: 0;
	line-height: 1.6;
}
footer p + p {
	margin-top: 20px;
}

/* Responsive */

@media (max-width: 700px) {
	header {
		padding: 0 20px;
	}
	#topnav {
		padding: 0 20px;
	}
	main {
		padding: 62px 20px 62px 20px;
	}
	footer {
		padding: 28px 20px 32px 20px;
	}
}

@media (max-width: 480px) {
	header {
		height: auto;
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
	}
	#topnav {
		text-align: left;
	}
	#topnav a {
		margin-left: 0;
		margin-right: 14px;
	}
	main {
		padding-top: 42px;
		padding-bottom: 42px;
	}
	.weblogPost {
		margin-bottom: 16px;
		padding-bottom: 12px;
	}
	blockquote {
		padding-left: 12px;
	}
	ul, ol {
		padding-left: 15px;
	}
}
