
/* Root Variables */
:root {
	--primary-bg: #fff;
	--primary-text: #353d49;
	--secondary-text: #252627;
	--secondary-text: rgb(35,36,40);
	--link-color: #353d49;
	--link-color-hover: green;
	--tag-background: #879094;
	--tag-text-color: #fff;
	--tag-hover: darkgreen;
	--shadow-color: rgba(0, 0, 0, 0.15);
	--borders: #555;
	--header-bg: darkgreen;
	--footer-bg: none; 
	--header-menu-text: gold;
	--header-menu-text-hover: white;
	--footer-menu-text: #252627;
	--footer-menu-text-hover: black; 
	--left-margin-small-screen: 20px;
	--ap-page-title-color: black;
	--ap-category-title-color: black;
	--comment-submit-bg-color:  white;
	--comment-submit-text-color:  black;
	--comment-submit-bg-color-hover: darkgreen;
	--comment-submit-text-color-hover: white;
	--code-background-color: #EEEEEE;
	--pre-background-color: #444444;
	--pre-text-color: #FFFFFF;
/*
*/
}

@media (prefers-color-scheme: dark) {
	:root {
		--primary-bg: #252627;
		--primary-text: #EEE;
		--secondary-text: #DDD;
		--link-color: #9fb1b6;
		--link-color: #EEE;
		--link-color-hover: lightgreen;
		--tag-background: #BBBBBB;
		--tag-text-color: #020;
		--tag-hover: darkgreen;
		--footer-menu-text: white;
		--ap-page-title-color: #DDD;
		--ap-category-title-color: #EEE;
		--comment-submit-bg-color:  #AAA;
		--comment-submit-text-color:  #333;
		--comment-submit-bg-color-hover: darkgreen;
		--comment-submit-text-color-hover: white;
		--code-background-color: #666666;
		--pre-background-color: #CCCCCC;
		--pre-text-color: #000000;
/*
*/
	}

	img {
		opacity: 90%;
	}
}

/* Font Faces */
@font-face {
	font-family: 'Source Sans 3';
	src: url('/fonts/SourceSans3-VariableFont_wght.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: 'Fira Code';
	src: url('/fonts/FiraCode-VariableFont_wght.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: 'JetBrains Mono';
	src: url('/fonts/JetBrainsMono-Regular.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}


/* Base Elements Styles */
html {
	background-color: var(--primary-bg);
	font-size: 20px;
}

body {
/*	font-family: 'OpenSauceOne', serif; */
	font-family: 'Source Sans 3', serif;
	font-size: 1.0em;
	color: var(--secondary-text);
	min-height: 100vh;
	margin: 0 auto;
	line-height: 1.5;
}

p {
	margin-bottom: 1.6em;
}

a,
a:visited {
	color: var(--link-color);
	text-decoration: underline;
	position: relative;
	transition: color 0.3s ease;
}

a:hover,
a:focus {
	color: var(--link-color-hover);
}

details {
	padding: 0.5rem 0;
}

ul {
	padding: 0;
}

img {
	max-width: 100%;
}

figure {
	display: flex;
	justify-content: center;
	align-items: center;
}

figcaption {
	text-align: center;
	font-size: 1.0rem;
}

.form-container {
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 300px;

	/* TODO: Code copied from comment submission; make generic rather than duplicating */
	button {
		width: 100%;
		background-color: var(--comment-submit-bg-color);
		color: var(--comment-submit-text-color);
	}
	button:hover, button:focus {
		background-color: var(--comment-submit-bg-color-hover);
		color: var(--comment-submit-text-color-hover);;
	}
}

@media (max-width: 800px) {
	.form-container {
		justify-content: start;
		align-items: start;
	}
}

form {
	display: flex;
	flex-direction: column;
	background: var(--primary-bg);
	border-radius: 8px;
	width: 100%;
	max-width: 400px;
}

label {
	margin: 10px;
	font-size: 0.85rem;
	color: var(--primary-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--shadow-color);
	border-radius: 4px;
	box-sizing: border-box;
	background-color: #CCC;
	box-shadow: 0 4px 8px var(--shadow-color);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
	border-color: var(--link-color);
	outline: none;
	background-color: #FFF;
}

button {
	width: 50%;
	padding: 10px;
	margin: 15px auto;
	color: var(--primary-text);
	background-color: var(--primary-bg);
	border: 2px solid black;
	border-radius: 20px;
	cursor: pointer;
	transition: background-color 0.3s;
	font-size: 0.9rem;
}

button:hover, button:focus {
	background-color: var(--header-bg);
	color: var(--primary-bg);
}

::placeholder {
	color: var(--primary-bg);
}

.hidden {
	display: none;
}


/* Navigation Styles */
nav ul {
	display: flex;
	margin: 0.5rem 0;
	padding: 0;
}

nav ul li {
	display: inline;
	list-style: none;
/*	margin: 0.2rem 0; */
	margin: 0rem 1rem 0rem 0rem;
}

nav.menu ul li {
	margin: 0 0.7rem 0 0;
}

/* logo in upper left corner */
div.menu {
	margin: 0.5rem 0;
}

header nav a {
	text-decoration: none;
	color: var(--header-menu-text);
}

header nav a:visited { 
	text-decoration: none;
	color: var(--header-menu-text);
}

header nav a:hover { 
	text-decoration: none;
	color: var(--header-menu-text-hover);
}

main a, main a:visited { 
	text-decoration: underline;
	text-decoration-thickness: 1px;
	color: var(--link-color);
}

main a:hover, main a:focus {
	text-decoration: underline;
	color: var(--link-color-hover);
}

footer nav a {
	text-decoration: none;
	color: var(--footer-menu-text);
}

footer nav a:visited { 
	text-decoration: none;
	color: var(--footer-menu-text);
}

footer nav a:hover { 
	color: var(--link-color-hover);
	font-weight: bold;
}

.container {
	display: flex;
	margin: 0rem auto;
	max-width: 800px;
	justify-content: center;
	align-items: center;
}

.row {
	flex-direction: row;
}

.col {
	flex-direction: column;
}

aside.tableOfContentContainer {
	position: webkit-sticky;
	position: sticky;
	top: 100px;
	align-self: start;
	min-width: 200px;
	font-size: 0.9rem;
}

nav#TableOfContents li.active::before {
	content: "\279c";
	display: inline-block;
	width: 20px;
	margin-left: -20px;
}

nav#TableOfContents ul {
	list-style: none;
	display: flex;
	flex-direction: column;
}
.pages a.active {
	font-weight: black;
}

/* Header Styles */
header {
	display: flex;
	justify-content: space-between;
	padding: 10px 20px;
	max-width: 800px;
	width: 800px;
	margin: auto; /* center logo and menu */
	background: var(--header-bg);
	flex-direction: row;
}


header .menu img {
	height: 50px;
}

header .menu a {
	text-decoration: none;
	color: var(--header-menu-text);
}

header .menu a:visited {
	text-decoration: none;
	color: var(--header-menu-text);
}

header .menu a:hover {
	text-decoration: none;
	color: var(--header-menu-text-hover);
}

/* Hero Section Styles */
.hero {
	margin: 0rem auto;
	max-width: 800px; /* new */
/*
	background-size: cover;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 0 2rem;
*/
}

.hero h1 {
	margin: 1.5rem;
	font-size: 2rem;
	color: var(--primary-text);
}

.hero p,
.hero .subtitle {
	margin: 0;
}

/* Search Styles */

.hero .search form {
	padding: 2rem;
}

.form-inline {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-radius: 5px;
}

.form-inline input[type="text"] {
	flex-grow: 1;
	padding: 8px 12px;
	border: 1px solid var(--primary-bg);
	border-radius: 4px;
	outline: none;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-inline input[type="text"]:focus {
	border-color: var(--shadow-color);
}

.form-inline button {
	min-height: 34px;
	padding: 8px 16px;
	background-color: var(--link-color);
	color: var(--primary-bg);
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.3s;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-inline button:hover {
	background-color: var(--link-color);
}

ul.search-results {
	list-style-type: none;
}

ul.search-results li {
	padding: 0.5rem 1rem;
}

ul.search-results li a {
	font-weight: bold;
}

/* Blog Cards Styles */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 3rem;
	padding: 20px;
}

.card {
	background-color: transparent;
}

.card img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 10px;
	box-shadow: 0 16px 48px var(--shadow-color);
}

.card .text {
	padding: 0 1rem;
}

.card .text .small {
	font-size: 0.9rem;
}

.card a {
	color: var(--primary-text);
}

.blog-link, .blog-link:visited {
	text-decoration: none !important;
	color: var(--primary-text);
	margin-bottom: 0
}

/* Contact Section */
.contact {
	text-align: center;
	margin: 5rem auto;
}

/* Post Styles */
.post {
	padding: 0 1rem;
}

.post ul {
	padding-left: 2rem;
}

.post-data {
	font-size: 0.9rem;
}

.tag-container {
	display: block;
	min-height: 26px;
	min-width: 0em;
}

.tag {
	display: inline-block;
	padding: 0px 10px;
	font-size: 16px;
	border-radius: 15px;
	text-decoration: none;
	margin-right: 0.25rem;
	margin-top: 0.25rem;
	background-color: var(--tag-background);
	transition: background-color 0.3s ease, color 0.3s ease;
}

.tag, a.tag, a:visited.tag {
	color: var(--tag-text-color);
	text-decoration: none !important;
}

a:hover.tag {
	background-color: var(--tag-hover);
	color: white;
}

/* Footer Styles */

footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	color: var(--primary-text);
	font-size: 0.8rem;
	max-width: 800px; 
	width: 800px; 
	margin: auto; /* center logo and menu */
	background: var(--footer-bg);
	flex-direction: row;
}

footer div {
	min-width: 5rem;
}

@media (prefers-color-scheme: dark) {
	footer .social-media a,
	footer .social-media a img {
		filter: brightness(50%) invert(75%);
	}
}

footer .social-media a img {
	height: 20px;
	padding: 0.5rem;
}

footer .logo {
	display: flex;
	flex-direction: column;
	align-items: center;
}

footer .logo img {
	height: 50px;
}

footer .logo p {
	margin: 5px 0 0;
	font-size: 0.8rem;
}

/* Pagination Styles */
.pagination {
	min-width: 90%;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
}

.pagination .pages {
	a {
		padding: 0 1rem;
	}
}

/* Markdown Styles */

.post h2 {
	margin-top: 1.3rem;
	margin-bottom: 0px;
}

.post h1 {
}

figure {
	flex-direction: column;
}

.e-content .img-caption,
.e-content figcaption>p {
	text-align: center;
	font-style: italic;
	max-width: 800px;
	margin: 1rem auto;
	font-size: 1rem;
	color: var(--secondary-text);
}

blockquote {
	border-left: 3px solid var(--borders);
	width: 70%;
	margin: 0 auto
}

blockquote p {
	margin-left: 1rem;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem auto
}

table th {
	font-size: .9rem;
}

@media (max-width:370px) {
	table th {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
	}
}


@media (max-width:420px) {
	table tr {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
	}
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem auto
}

table th {
	font-size: .9rem;
}

@media (max-width:370px) {
	table th {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
	}
}


@media (max-width:420px) {
	table tr {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
	}
}

table td,
table th {
	padding: 5px;
	text-align: left;
	border: 1px solid var(--borders)
}
table td,
table th {
	padding: 5px;
	text-align: left;
	border: 1px solid var(--borders)
}

/* Responsive Styles */

/* For phones */
@media (max-width: 600px) {


	aside.tableOfContentContainer {
		display: none;
	}
}

/*
.container {
	margin: 0rem auto;
	max-width: 800px;
}
*/

.post {
	max-width: 800px;
	padding: 0 2rem;
}

nav ul {
	padding: 0 !important;
}


.card-title {
	margin-block-start: 0;
	margin-block-end: 0;
}

a:hover.card-title {
	color: var(--link-color-hover);
}

.card-reading-time {
	color:gray;
	font-size:0.9rem;
	line-height: 1.0;
}

.card-summary {
	line-height: 1.2;
/*
	text-align: center;
	font-style: italic;
	*/
	max-width: 800px;
	margin: 1em auto;
	font-size: 1em;
	color: var(--secondary-text);
}

.card-header {
	font-size: 0.8rem;
	line-height: 1.2;
}


.post-header {
	font-size: 0.9rem;
	line-height: 1.2;
}

/* Styles for List of all Posts */
.list-posts {
}

.list-info {
	color: red;  
	margin: 0px 0rem; 
}

.list-title {
}

.list-reading-time {
}

.list-publish-date {
}

.list-description  {
	margin: 0px 0rem; 
}

.recent-posts  {
	text-align:center;
	margin-top: 0px;
	margin-bottom: 0px;
	padding: 0 2rem;
}

@media (max-width: 800px) {
	header {
		flex-direction: column;
	}

	footer {
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
		padding-left: var(--left-margin-small-screen);
	}

	.cards {
		grid-template-columns: 1fr;
	}

	.card-summary {
		text-align: left;
		width: 300px;
		max-width: 300px;
	}

	body {
		/* background-color: lightblue;  For debugging */
	}

	h1 {
		text-align:left;
	}

	.hero {
		align-items: flex-start;
	}

	.hero h1 {
		margin-left: var(--left-margin-small-screen);
	}

	.hero div {
		padding: 0 0 0 0;
	}

	.recent-posts  {
		text-align:left;
		padding: 0 0;
	}

	.post {
		margin:  0 0 0 var(--left-margin-small-screen);
		padding: 0 0 0 0;
	}
}

/* Styles for Recent Posts page */
.recent-title, a.recent-title, a:visited.recent-title {
	color: black;
	text-decoration: normal;
}

.recent-title {
	color: green;
	font-weight: bold;
	font-size: 1.5em;
}

.recent-summary {
	color: blue;
}

div.recent-title:link, div.recent-title:visited {
	color: blue;
}

div.recent-title:active, div.recent-title:hover  {
	color: orange;
}

/* Styles for all-posts.html */

.footer-posts-list   {
	display: flex;
	align-self: center;
	justify-content: center;
	flex-direction: column;
	font-size: 1.0rem;
}

.all-posts-container {
	display: flex;
	align-self: center;
	flex-direction: column;
}

.all-posts {
	display: flex;
	align-self: center;
	flex-direction: column;
	line-height: 1.2;
	max-width: 600px;
	text-decoration: none;
}

.ap-category {
	margin: 0px 0px 0px 0px;
}

a.ap-category-title {
	font-weight: bold;
	font-size:   1.5em;
	color: var(--ap-category-title-color);
	text-decoration: none;
}


.ap-post-head1 {
	display: flex;
	justify-content: space-between;
	flex-direction: row;
	margin: 1rem 0px 0px 20px;
	margin-block-start: 0;
	margin-block-end:   0;
}

a.ap-page-title,
a.ap-page-title:visited {
	font-weight: bold;
	font-size:   1em;
	color: black;
	color: var(--ap-page-title-color);
	text-decoration: none;
}

a.ap-page-title:hover,
a.ap-page-title:focus {
	color: var(--link-color-hover);
}

.ap-page-date {
	font-size: 0.8em;
}


.ap-post-head2 {
	display: flex;
	justify-content: space-between;
	flex-direction: row;
	margin: 1rem 0px 0px 20px;
	margin-block-start: 0;
	margin-block-end:   0;
}

.ap-read-time {
	margin: 5px 0px 0px 0px;
	font-size: 0.8em;
}

.ap-tags {
	display: flex;
	flex-direction: row;
	margin: 1rem 0px 0px 20px;
	margin-block-start: 0;
	margin-block-end:   0;
	font-size: 1.0em;
}


.ap-summary {
	margin: -0.7rem 0em 0em 3rem; /* Set to negative to override default for <p> */
	font-size: 1.0em;
}

p.ap-summary {
	margin: 300px 200px 300px 100px;
}

.ap-hr {
	min-width: 600px;
}

.ap-title {
	text-align: center;
}


@media (max-width: 800px) {
	.footer-posts-list   {
		display: flex;
	}

	.all-posts-container {
		margin-left: var(--left-margin-small-screen);
		align-self: start;
	}

	.all-posts {
		display: flex;
		align-self: start;
		flex-direction: column;
		line-height: 1.2;
		max-width: 600px;
	}

	.ap-hr {
		min-width: 400px;
	}

	.ap-post-head1 {
		flex-direction: column;
		margin: 0rem 0px 0px 0px;
	}


	.ap-post-head2 {
		flex-direction: column;
		margin: 0rem 0px 0px 0px;
	}

	.ap-tags {
		margin: 0rem 0px 0px 0px;
	}

	.ap-summary {
		margin: -0.7rem 0rem 0rem 0rem; /* Set to negative to override default for <p> */
		max-width: 400px;
	}

	.ap-title {
		text-align: left;
	}

}

/*
 * Comments
 */
.comments {
	display: flex;
	align-self: center;
	flex-direction: column;
	line-height: 1.2;
	max-width: 600px;
/*	min-width: 400px; */
	font-size: 1.0rem;
}

/* Comment list */
.comment-list {
}

.comment-item {
	margin-bottom: 20px;
	/* box-shadow: 10px 10px 5px 12px lightgray; */
	flex-grow: 1;
	padding: 8px 12px;
	border: 1px solid var(--primary-bg);
	border-radius: 4px;
	outline: none;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.comment-header {
	display: flex;
	justify-content: space-between;
	align-self: start;
	flex-direction: row;
	font-weight: semibold;
}

.comment-uname {
}

.comment-date {
}

.comment-content {
}


/* Comment add */
.comment-add {
	margin: 20px 0 20px 0;
}

.comment-add-title {
	font-weight: bold;
}

.comment-add-container {
	display: flex;
	align-self: start;
	flex-direction: column;
	.comment-submit {
		align-self: center;
		min-width: 200px;
		button {
			width: 100%;
			background-color: var(--comment-submit-bg-color);
			color: var(--comment-submit-text-color);
		}
		button:hover, button:focus {
			background-color: var(--comment-submit-bg-color-hover);
			color: var(--comment-submit-text-color-hover);;
		}
	}
}

.comment-add-comment {

	textarea {
		width:  400px;
		height: 100px;
		color: darkgreen;
	}
}


@media (max-width: 800px) {
	.comments {
		align-self: start;
	}
}

@media (max-width: 650px) {
	.comments {
		max-width: 400px;
	}
}

/* Base style for code blocks */

.highlight {
}

pre,
code {
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: break-word;
}

code {
	background-color: var(--code-background-color);
}

pre {
	font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
/*
*/
	border-radius: 8px;
	overflow-x: auto;
	padding: 1em;
	line-height: 1.4;
	margin-bottom: 20px;
	transition: all 0.3s ease-in-out;
	code {
		font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
		font-size: 0.8em;
		padding: 0em 0em;
	}
}


li > code, p > code {
	font-size: 0.8rem;
}

h1 > code {
	font-size: inherit;
	padding: 0;
}

h2 > code {
	font-size: inherit;
	padding: 0;
}

.highlight {
	pre {
		background-color: var(--pre-background-color) !important;
		code {
			color: var(--pre-text-color);
		}
	}
}

.title-container {
	padding: 0 2rem;
	display: flex;
	flex-direction: row;
	justify-content: start;
	align-items: start;
	margin: 10px 0 0 0;
	.title-text {
		padding: 0 0;
		h1 {
			margin: 10px;
			text-align: left;
		}
	}
	.title-image {
		padding: 0 0;
		h1 {
			margin: 10px;
		}
	}
}

.title-container-no-image {
	padding: 0 2rem;
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	margin: 10px 0 0 0;
	.title-text {
			padding: 0 0;
			h1 {
				margin: 10px;
				text-align: center;
			}
	}
}

@media (max-width: 800px) {
	.title-container {
		flex-direction: column;
		align-items: start;
		.title-text, .title-image {
			margin-left: var(--left-margin-small-screen);
			h1 {
				margin-left: 0px;
			}
		}
	}

	.title-container-no-image {
		justify-content: start;
		.title-text {
			margin-left: var(--left-margin-small-screen);
			h1 {
				margin-left: 0px;
				text-align:left;
			}
	}
}
