/*
Theme Name: chris-alexander.com
Theme URI: https://www.chris-alexander.com
Description: Theme used for the site https://www.chris-alexander.com. Classic PHP theme, modernized: responsive, accessible markup, current WordPress APIs.
Version: 2.0.0
Author: Chris Alexander
Author URI: https://www.chris-alexander.com
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chris_alexander
*/

/* Color Scheme
   The original palette is unchanged. The "-text" variants are slightly darker
   versions of green/blue used only for small text, so it meets WCAG AA contrast. */
:root {
	--ca-tan: #e0ddcc;
	--ca-body: #666666;
	--ca-menu: #696969;
	--ca-green: #619415;
	--ca-green-text: #4f7a10;
	--ca-blue: #4f86b1;
	--ca-blue-text: #3a6f99;
	--ca-orange: #ff9650;
	--ca-cream: #faf8ee;
	--ca-serif: "museo-1", Georgia, "Times New Roman", serif;
	--ca-sans: Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend,
input, textarea, p, blockquote, th, td, figure, header, footer, main, nav, article, section {
	margin: 0;
	padding: 0;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { color: #000; background: #fff; font: 1rem/1.5 var(--ca-sans); }
table { border-collapse: collapse; border-spacing: 0; }
fieldset, img { border: 0; }
address, caption, cite, code, dfn, em, strong, th, var { font-style: normal; font-weight: normal; }
li { list-style: none; }
caption, th { text-align: left; }
h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: normal; }
q::before, q::after { content: ''; }
abbr, acronym { border: 0; font-variant: normal; }
sup, sub { line-height: 0; vertical-align: text-top; }
sub { vertical-align: text-bottom; }
input, textarea, select { font-family: inherit; font-size: inherit; font-weight: inherit; }
pre, code, kbd, samp, tt { font-family: monospace; }
img, embed, object, video, iframe { max-width: 100%; }
img, video { height: auto; }
main, article, header, footer, nav, section, figure { display: block; }

/* ---------- Base elements ---------- */
em { font-style: italic; font-size: inherit; }
strong, b { color: #000000; font-weight: bold; }

code {
	border: dashed var(--ca-orange) 2px;
	padding: 10px;
	display: block;
	font-size: 0.75rem;
	overflow-x: auto;
}

a:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 2px solid var(--ca-blue-text);
	outline-offset: 2px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: #fff;
	clip: auto;
	clip-path: none;
	color: #000;
	display: block;
	font-size: 1rem;
	height: auto;
	left: 5px;
	padding: 10px 16px;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ---------- Page frame ---------- */
#page {
	max-width: 850px;
	padding: 0 1rem;
}
#page::after { content: ""; display: block; clear: both; }

.alert {
	width: 100%;
	border: var(--ca-orange) solid 3px;
	margin: 20px 0;
}
#page .alert p {
	margin: 10px 10px 5px 10px;
	font-style: italic;
	color: var(--ca-blue-text);
}

/* ---------- Header / logotype ---------- */
.site-title {
	position: relative;
	font-family: "tandelle-1", Impact, "Arial Narrow", sans-serif;
	font-size: clamp(3rem, 17.6vw, 150px);
	color: var(--ca-tan);
	line-height: .9em;
	overflow-wrap: anywhere;
}
.site-title a,
.site-title a:link,
.site-title a:visited,
.site-title a:hover {
	text-decoration: none;
	color: var(--ca-tan);
}

/* ---------- Content column ---------- */
#content {
	float: right;
	position: relative;
	padding-bottom: 20px;
	width: 600px;
	max-width: 100%;
	z-index: 10;
	min-height: 400px;
}
.post {
	padding-left: 15px;
	padding-bottom: 30px;
}

#content h2.title {
	font-family: var(--ca-serif);
	font-size: 1.625rem;
}
#content h2.title a:link,
#content h2.title a:visited,
#content h2.title a:hover {
	margin-left: -15px;
	color: var(--ca-green);
	text-decoration: none;
}

p.dateline {
	margin-left: -15px;
	font-size: .875rem;
	color: var(--ca-green-text);
	margin-bottom: 10px;
	font-family: var(--ca-serif);
}

#content a:link,
#content a:visited { text-decoration: none; color: var(--ca-blue-text); }
#content a:hover { text-decoration: none; color: var(--ca-menu); }

/* Links inside post text are underlined so they don't rely on color alone */
.entry a:link,
.entry a:visited { text-decoration: underline; text-underline-offset: 2px; }

.entry p {
	font-size: 1.125rem;
	color: var(--ca-body);
	padding-bottom: 10px;
	text-align: justify;
	hyphens: auto;
}
.entry img { padding: 10px; max-width: calc(100% - 20px); height: auto; }
.entry h2 { font-family: var(--ca-serif); font-size: 1.375rem; color: var(--ca-green-text); }
.entry h3 { font-size: 1.25rem; padding-top: 10px; color: #434343; }
.entry blockquote { background: url(images/large_quote.png) no-repeat top left; }
.entry blockquote p {
	font-style: italic;
	color: var(--ca-menu);
	display: block;
	padding: 0 20px 20px 50px;
}
.entry ul { padding-left: 30px; padding-bottom: 20px; }
.entry ol { padding-left: 30px; padding-bottom: 20px; }
.entry li {
	font-size: 1.125rem;
	list-style-image: url(images/ca_list_item.jpg);
	color: var(--ca-menu);
}
.entry ol li { list-style-type: decimal; list-style-image: none; }
.entry em { font-size: inherit; }

.alternate_cat img.alignleft { margin: 0 15px 15px 0; padding: 5px; }

.wp-caption {
	background: #fafafa;
	border: 1px solid #dcdcdc;
	padding: 10px 0 10px 10px;
	max-width: 100%;
}
.wp-caption.alignleft { margin: 5px 20px 5px 0; }
.wp-caption.alignright { margin: 5px 0 0 20px; }
.wp-caption.aligncenter { display: block; margin-left: auto; margin-right: auto; margin-bottom: 10px; }
.wp-caption img { border: none; padding: 0; margin-top: 0; max-width: 100%; }
.wp-caption-text { font-size: .75rem; text-align: center; padding: 5px 10px 0 0; }

embed, object {
	display: block;
	margin-left: auto;
	margin-right: auto;
	padding-top: 10px;
	padding-bottom: 10px;
}

ul.post-categories { border: thin black solid; font-style: italic; display: inline; }
ul.about_list { padding-left: 60px; padding-top: 5px; }

.postmetadata {
	font-size: .875rem;
	margin-left: -15px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: dashed 1px var(--ca-menu);
	clear: both;
}

.alignleft { float: left; }
.alignright { float: right; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

/* ---------- Page and post headings ---------- */
.pagehead { position: relative; left: -15px; }
h2.pagehead {
	border-bottom: 1px solid var(--ca-menu);
	margin-bottom: 10px;
	font-weight: bold;
	font-style: normal;
	font-size: 2.25rem;
	line-height: 1.2;
	color: var(--ca-menu);
	text-decoration: none;
}
h2.singlepagehead {
	font-family: var(--ca-serif);
	margin-left: -15px;
	line-height: 1em;
	font-size: 2rem;
	color: var(--ca-green);
	text-decoration: none;
	margin-bottom: 10px;
}

/* ---------- Pagination ---------- */
.navigation { clear: both; overflow: hidden; }
.navigation .nav-previous { float: left; }
.navigation .nav-next { float: right; }
#content .navigation a:link,
#content .navigation a:visited {
	font-family: var(--ca-serif);
	font-size: 1.625rem;
	color: var(--ca-green);
	text-decoration: none;
}

/* ---------- Sidebar navigation ---------- */
#sidebar { float: left; width: 160px; z-index: 10; }
#sidebar li a { text-decoration: none; font-size: 1.25rem; font-weight: bold; }
#sidebar li a:link,
#sidebar li a:visited { color: var(--ca-menu); }
#sidebar li a:hover { color: var(--ca-blue-text); }
#sidebar li.bottom_line { margin-top: 20px; }
#sidebar .sidebar-note { font-size: .75rem; color: #767676; }

/* Current item in the menu */
#sidebar li.current > a,
#sidebar li.current-cat > a,
#sidebar li.current_page_item > a,
#sidebar li.current-menu-item > a,
#sidebar li.current-menu-ancestor > a,
#sidebar li.current-cat-parent > a { color: #000000; }

#sidebar .feed {
	width: 85px;
	margin-top: 30px;
	background: no-repeat right url(images/rss14.png);
}
#sidebar .feed a {
	padding-right: 20px;
	font-size: .875rem;
	font-weight: bold;
	text-decoration: none;
	color: var(--ca-menu);
}

#sitesearch {
	width: 170px;
	margin-top: 50px;
	background-color: var(--ca-cream);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
	padding: 5px 5px 5px 0;
}
#sitesearch label { display: block; font-size: .875rem; color: var(--ca-menu); }
#s { color: var(--ca-body); padding: 3px; margin: 0 0 5px 5px; max-width: 150px; }
#searchsubmit { margin-left: 5px; color: var(--ca-blue-text); padding: 3px; font-size: .875rem; }

/* ---------- Comments ---------- */
h3#comments,
h3#reply-title,
.comments-title,
.comment-reply-title {
	font-size: 1.25rem;
	color: var(--ca-menu);
	border-bottom: 2px solid var(--ca-orange);
	margin-bottom: 10px;
}
ol.commentlist { margin: 0; padding: 0; }
ol.commentlist li.comment {
	margin-bottom: 20px;
	padding: 10px;
	border-bottom: dotted 3px var(--ca-menu);
}
ol.commentlist li.bypostauthor {
	border: dotted 3px var(--ca-orange);
	background-color: var(--ca-cream);
}
ol.commentlist ol.children { margin-left: 20px; margin-top: 10px; }
.commentlist .comment-author { display: flex; align-items: center; gap: 10px; }
.commentlist .comment-author .fn { font-size: .875rem; font-style: normal; }
.commentlist li.bypostauthor .comment-author .fn,
.commentlist li.bypostauthor .comment-author .fn a { color: var(--ca-blue-text); }
.commentlist .comment-metadata { font-size: .75rem; color: var(--ca-green-text); margin-left: 70px; }
.commentlist .comment-content p,
.commentlist .comment-awaiting-moderation {
	margin: 10px 0 10px 10px;
	font-size: .875rem;
	color: var(--ca-menu);
}
.commentlist .reply { font-size: .875rem; margin-left: 10px; }
img.avatar { border: solid 5px var(--ca-orange); padding: 1px; }

.comment-form p { font-size: .875rem; color: var(--ca-green-text); margin: 10px 0 10px 10px; }
.comment-form label { display: block; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	color: var(--ca-body);
	padding: 3px;
	font-size: 1rem;
}
.comment-form .form-submit input { color: var(--ca-blue-text); padding: 3px 10px; font-size: .875rem; }

/* ---------- 404 ---------- */
.errorpage { min-height: 400px; }
p.message { font-size: 1.25rem; color: #767676; padding-bottom: 20px; }

/* ---------- Footer ---------- */
#footer {
	position: relative;
	width: 100%;
	padding-bottom: 20px;
	background-color: var(--ca-tan);
	border-top: dotted black 1px;
	clear: both;
}
#footer a:link,
#footer a:visited { text-decoration: none; color: var(--ca-blue-text); }
#footer a:hover { text-decoration: none; color: var(--ca-menu); }
#footer .credit { text-align: center; clear: both; font-size: .875rem; }

#foot_contain { position: relative; max-width: 850px; padding: 0 1rem; }

.footer_box {
	background-color: #FFFFFF;
	margin-bottom: 20px;
	color: var(--ca-menu);
}
.footer_box h2 { border-bottom: 1px solid #000000; }
.footer_box ul { padding: 5px 10px 10px 5px; }
.footer_box p { padding: 5px 10px; }
#footer h2 { padding: 5px; font-size: 1.125rem; color: #FFFFFF; }
#footer .footer_box h2 a { text-decoration: none; color: #FFFFFF; }
#footer h3 { font-size: .875rem; font-family: var(--ca-serif); margin-bottom: 5px; }
#footer h3.title a:link,
#footer h3.title a:visited { color: var(--ca-green-text); }
#footer h3.title a:hover { color: var(--ca-body); }

#ontheweb { position: relative; margin-top: 20px; }
/* Dark heading text on the orange bar keeps it readable */
#footer #ontheweb h2 { background-color: var(--ca-orange); color: #2b2b2b; }
#footer #ontheweb h2 a:link,
#footer #ontheweb h2 a:visited { color: #2b2b2b; }
.web_entries {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.web_entry { position: relative; padding: 10px 1.5%; min-width: 0; }
.web_entry p { font-size: .75rem; margin-bottom: 6px; padding: 0; }
.web_entry blockquote {
	padding: 0px 10px 5px 20px;
	font-style: italic;
	background: url(images/small_quote.png) no-repeat top left;
}

#bottom_level {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 0 10px;
}
#twitter, #popular_posts { position: relative; }
#twitter h2, #popular_posts h2 { background-color: var(--ca-blue); }
#popular_posts li { padding-top: 5px; margin-left: 20px; list-style: disc; }
#popular_posts li a { font-size: .875rem; }

/* ---------- Small screens ---------- */
@media (max-width: 800px) {
	#sidebar { float: none; width: auto; margin-bottom: 1.5rem; }
	#sidebar ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
	#sidebar li.bottom_line { margin-top: 0; }
	#sitesearch { width: 100%; max-width: 340px; margin-top: 1rem; box-sizing: border-box; padding-left: 5px; }
	#sidebar .feed { margin-top: 1rem; }

	#content { float: none; width: auto; }
	.post { padding-left: 0; }
	.pagehead { left: 0; }
	h2.pagehead { font-size: 1.875rem; }
	h2.singlepagehead { font-size: 1.625rem; margin-left: 0; }
	#content h2.title a:link,
	#content h2.title a:visited,
	#content h2.title a:hover,
	p.dateline,
	.postmetadata { margin-left: 0; }
	.entry p { text-align: left; hyphens: manual; }
}
