/*
Theme Name: Clean
Theme URI: https://channelx.biz/
Author: Channel X
Author URI: https://channelx.biz/
Description: A quiet, plugin-free theme. Light or black. Text first, featured images only when you turn them on. Ready for phone, tablet, and desktop.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 7.1
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: clean
Tags: one-column, blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, custom-colors
*/

/* Tokens. data-theme is set in the header, then confirmed from this browser. */

:root,
[data-theme="light"] {
	color-scheme: light;
	--bg: #f3f1eb;
	--text: #1c1b19;
	--muted: #5c574e;
	--line: #ddd9d0;
	--code-bg: #e7e4dc;
	--measure: 38rem;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
	color-scheme: dark;
	--bg: #141311;
	--text: #ece8e1;
	--muted: #b1aa9e;
	--line: #2e2c28;
	--code-bg: #241f1b;
}

/* Base */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.7;
	transition: background-color 150ms ease, color 150ms ease;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
ul,
ol,
dl,
dd {
	margin: 0;
}

img,
video,
svg {
	max-width: 100%;
	height: auto;
}

button,
input,
textarea {
	font: inherit;
	color: inherit;
}

:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--text);
	outline-offset: 3px;
}

::selection {
	background: var(--text);
	color: var(--bg);
}

::placeholder {
	color: var(--muted);
	opacity: 1;
}

a {
	color: inherit;
	text-underline-offset: 0.18em;
}

h1,
h2,
h3,
h4 {
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.25;
}

@media (prefers-reduced-motion: reduce) {
	body {
		transition: none;
	}
}

/* Layout */

.wrap {
	width: min(100% - 2.5rem, var(--measure));
	margin-inline: auto;
}

.site-main {
	flex: 1 0 auto;
	width: 100%;
	padding-block: 2.25rem 3rem;
	overflow-wrap: break-word;
}

.site-main:focus,
.site-main:focus-visible {
	outline: none;
}

h1,
h2,
h3 {
	scroll-margin-top: 5rem;
}

.skip-link {
	position: absolute;
	left: 0.75rem;
	top: 0;
	transform: translateY(-120%);
	background: var(--text);
	color: var(--bg);
	padding: 0.5rem 0.75rem;
	z-index: 100;
	text-decoration: none;
}

.skip-link:focus {
	transform: translateY(0.75rem);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}

.header-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	min-height: 4rem;
	padding-block: 0.65rem;
}

.brand {
	order: 1;
	margin-right: auto;
	min-width: 0;
}

.nav-toggle {
	order: 2;
}

.header-tools {
	order: 3;
}

.site-title {
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.site-title a,
.custom-logo-link {
	text-decoration: none;
	color: inherit;
}

.custom-logo {
	display: block;
	width: auto;
	max-height: 2.25rem;
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nav-toggle,
.theme-toggle,
.search-toggle {
	appearance: none;
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 2px;
	min-height: 2.75rem;
	padding: 0.35rem 0.7rem;
	font-size: 0.8125rem;
	line-height: 1;
	cursor: pointer;
}

.nav-toggle:hover,
.theme-toggle:hover,
.search-toggle:hover {
	border-color: var(--text);
}

[data-theme="light"] .when-dark,
[data-theme="dark"] .when-light {
	display: none;
}

.site-nav {
	display: none;
	order: 4;
	flex: 1 0 100%;
	min-width: 0;
	padding-bottom: 0.85rem;
}

.site-nav.is-open {
	display: block;
}

.menu,
.footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.menu a {
	display: flex;
	align-items: center;
	min-height: 2.75rem;
	text-decoration: none;
}

.menu a:hover,
.current-menu-item > a,
.current_page_item > a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0 0 0.25rem 0.9rem;
}

.search-panel:not([hidden]) {
	padding-bottom: 1rem;
}

.search-form {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

.site-main .search-form {
	margin-top: 1.25rem;
}

.search-field,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 2px;
	background: transparent;
	color: var(--text);
}

.search-field {
	flex: 1;
	min-width: 0;
}

textarea {
	min-height: 8rem;
	resize: vertical;
	line-height: 1.5;
}

.search-submit,
.comment-form .submit {
	appearance: none;
	cursor: pointer;
	background: var(--text);
	color: var(--bg);
	border: 1px solid var(--text);
	border-radius: 2px;
	min-height: 2.75rem;
	padding: 0.5rem 0.95rem;
}

.search-submit:hover,
.comment-form .submit:hover {
	opacity: 0.86;
}

/* Pages and posts */

.page-header {
	margin-bottom: 2rem;
}

.page-title,
.single .entry-title,
.page .entry-title {
	font-size: clamp(1.75rem, 4.4vw, 2.25rem);
}

.archive-description {
	margin-top: 0.75rem;
	color: var(--muted);
}

.archive-description > * + * {
	margin-top: 0.75rem;
}

.archive-description > :last-child {
	margin-bottom: 0;
}

.site-intro {
	margin-bottom: 2rem;
	color: var(--muted);
}

.entry-list {
	display: flex;
	flex-direction: column;
}

.entry-list > .entry + .entry {
	margin-top: 2.25rem;
	padding-top: 2.25rem;
	border-top: 1px solid var(--line);
}

.entry-meta,
.pinned,
.edit-link,
.entry-terms {
	color: var(--muted);
	font-size: 0.8125rem;
}

.entry-meta {
	margin-bottom: 0.35rem;
}

.meta-sep {
	padding-inline: 0.2rem;
}

.pinned {
	margin-bottom: 0.35rem;
}

.entry-list .entry-title {
	font-size: clamp(1.35rem, 3vw, 1.7rem);
}

.entry-title a,
.wp-block-latest-posts__post-title {
	text-decoration: none;
}

.entry-title a:hover,
.wp-block-latest-posts__post-title:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.entry-summary {
	margin-top: 0.75rem;
}

.featured-image {
	margin: 1rem 0 0;
}

.single .featured-image,
.page .featured-image {
	margin: 1.25rem 0 1.5rem;
}

.featured-image img,
.wp-block-latest-posts__featured-image img {
	display: block;
	width: 100%;
	height: auto;
}

.entry-list .featured-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.featured-image figcaption,
.wp-caption-text,
.wp-block-image figcaption,
.wp-block-gallery figcaption,
.wp-block-embed figcaption {
	margin-top: 0.45rem;
	color: var(--muted);
	font-size: 0.8125rem;
}

.entry-content {
	margin-top: 1.25rem;
}

.page .entry-content,
.single .entry-content {
	margin-top: 0;
}

.entry-content > * + * {
	margin-top: 1.05em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 1.7em;
}

.entry-content h2 {
	font-size: 1.45rem;
}

.entry-content h3 {
	font-size: 1.2rem;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.25rem;
}

.entry-content li + li {
	margin-top: 0.35rem;
}

.entry-content a:hover {
	text-decoration-thickness: 2px;
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

.entry-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
	margin-top: 2rem;
}

.page-links {
	margin-top: 1.5rem;
	font-size: 0.875rem;
}

.edit-link {
	margin-top: 1.5rem;
}

.edit-link a {
	text-decoration: none;
}

.edit-link a:hover {
	text-decoration: underline;
}

/* Blocks that ship in the content */

.wp-block-latest-posts {
	list-style: none;
	padding-left: 0;
}

.wp-block-latest-posts > li + li {
	margin-top: 2.25rem;
	padding-top: 2.25rem;
	border-top: 1px solid var(--line);
}

.wp-block-latest-posts__post-title {
	display: block;
	font-size: clamp(1.35rem, 3vw, 1.7rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.25;
}

.wp-block-latest-posts__post-date {
	display: block;
	margin-top: 0.35rem;
	color: var(--muted);
	font-size: 0.8125rem;
}

.wp-block-latest-posts__post-excerpt {
	margin-top: 0.75rem;
}

blockquote,
.wp-block-quote,
.wp-block-pullquote {
	padding-left: 1rem;
	border-left: 2px solid var(--text);
	color: var(--muted);
}

.wp-block-quote cite,
.wp-block-pullquote cite,
blockquote cite {
	display: block;
	margin-top: 0.55rem;
	font-size: 0.875rem;
	font-style: normal;
	color: var(--muted);
}

pre {
	max-width: 100%;
	overflow-x: auto;
	padding: 0.9rem 1rem;
	background: var(--code-bg);
	font-family: var(--mono);
	font-size: 0.875rem;
	line-height: 1.55;
}

code {
	font-family: var(--mono);
}

:not(pre) > code {
	font-size: 0.92em;
	background: var(--code-bg);
	padding: 0.1em 0.32em;
	border-radius: 2px;
}

hr,
.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--line);
	margin-block: 2rem;
}

mark {
	background: var(--code-bg);
	color: inherit;
}

.wp-block-table,
.entry-content table {
	max-width: 100%;
}

.wp-block-table {
	overflow-x: auto;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
}

.entry-content th,
.entry-content td {
	padding: 0.5rem 0.65rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.alignleft {
	float: left;
	max-width: min(50%, 16rem);
	margin: 0.25rem 1.15rem 0.8rem 0;
}

.alignright {
	float: right;
	max-width: min(50%, 16rem);
	margin: 0.25rem 0 0.8rem 1.15rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

body .wp-block-button__link,
body .wp-element-button {
	display: inline-block;
	background: var(--text);
	background-color: var(--text);
	color: var(--bg);
	text-decoration: none;
	padding: 0.55rem 0.9rem;
	border-radius: 2px;
	border: 1px solid var(--text);
	font-size: 0.9375rem;
	line-height: 1.4;
}

body .wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	background-color: transparent;
	color: var(--text);
}

.wp-block-image img,
.wp-block-gallery img {
	height: auto;
}

/* Lists of posts, previous and next */

.navigation {
	margin-top: 2.5rem;
}

.pagination .nav-links,
.comments-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.85rem;
	align-items: center;
}

.page-numbers {
	color: var(--muted);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
}

.page-numbers.current,
.page-numbers:hover {
	color: var(--text);
}

.page-numbers.current {
	border-bottom: 1px solid var(--text);
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
}

.post-navigation a {
	display: block;
	text-decoration: none;
}

.post-navigation a:hover .nav-title {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.nav-label {
	display: block;
	color: var(--muted);
	font-size: 0.8125rem;
}

.nav-title {
	display: block;
	margin-top: 0.15rem;
}

.no-results p {
	margin-top: 0.75rem;
}

.no-results .search-form {
	margin-top: 1.25rem;
}

/* Comments */

.comments {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
}

.comments-title,
.comment-reply-title {
	font-size: 1.25rem;
}

.comment-list,
.comment-list .children {
	list-style: none;
	padding: 0;
}

.comment-list .children {
	margin-top: 0.5rem;
	padding-left: 1rem;
	border-left: 1px solid var(--line);
}

.comment-body {
	margin-top: 1.25rem;
}

.comment-meta {
	color: var(--muted);
	font-size: 0.875rem;
}

.comment-meta a {
	text-decoration: none;
}

.comment-meta a:hover,
.comment-reply-link:hover {
	text-decoration: underline;
}

.comment-content {
	margin-top: 0.35rem;
}

.comment-reply-link {
	display: inline-block;
	margin-top: 0.35rem;
	font-size: 0.875rem;
}

.comment-form p {
	margin-top: 1rem;
}

.comment-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.875rem;
}

.comments-closed {
	margin-top: 1rem;
	color: var(--muted);
}

/* Footer */

.site-footer {
	border-top: 1px solid var(--line);
	padding-block: 1.35rem 2rem;
	color: var(--muted);
	font-size: 0.875rem;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
	margin-bottom: 0.75rem;
}

.footer-menu a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	color: inherit;
	text-decoration: none;
}

.footer-menu a:hover {
	text-decoration: underline;
}

.colophon {
	margin: 0;
}

/* Wider than a phone */

@media (min-width: 720px) {
	.wrap {
		width: min(100% - 4rem, var(--measure));
	}

	.site-main {
		padding-block: 3.25rem 4rem;
	}

	.header-bar {
		flex-wrap: nowrap;
		min-height: 4.25rem;
		padding-block: 0;
	}

	.nav-toggle {
		display: none;
	}

	.site-nav,
	.site-nav.is-open {
		display: block;
		order: 2;
		flex: 0 1 auto;
		padding: 0;
	}

	.header-tools {
		margin-left: 1rem;
	}

	.menu {
		display: flex;
		align-items: center;
		gap: 1.15rem;
	}

	.menu a {
		min-height: 4.25rem;
	}

	.menu > li {
		position: relative;
	}
}

@media (min-width: 720px) and (hover: hover) {
	.menu .sub-menu {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 11rem;
		padding: 0.35rem 0;
		background: var(--bg);
		border: 1px solid var(--line);
		z-index: 30;
	}

	.menu > li:hover > .sub-menu,
	.menu > li:focus-within > .sub-menu {
		display: block;
	}

	.menu .sub-menu a {
		min-height: 2.5rem;
		padding: 0.35rem 0.85rem;
		white-space: nowrap;
	}
}

@media (min-width: 720px) {
	.post-navigation .nav-links {
		grid-template-columns: 1fr 1fr;
		gap: 1.5rem;
	}

	.post-navigation .nav-next {
		text-align: right;
	}

	.alignleft,
	.alignright {
		max-width: min(45%, 18rem);
	}
}

/* Small phones: keep controls on one line when we can, and don't float images. */

@media (max-width: 719px) {
	.alignleft,
	.alignright {
		float: none;
		display: block;
		max-width: 100%;
		margin: 1rem 0;
	}
}

@media (max-width: 420px) {
	.wrap {
		width: min(100% - 1.5rem, var(--measure));
	}

	.brand {
		flex: 1 0 100%;
	}

	.nav-toggle {
		margin-left: auto;
	}
}

@media print {
	[data-theme="dark"] {
		--bg: #ffffff;
		--text: #000000;
		--muted: #333333;
		--line: #cccccc;
		--code-bg: #f3f3f3;
	}

	.site-header {
		position: static;
		border: 0;
	}

	.header-tools,
	.nav-toggle,
	.search-panel,
	.post-navigation,
	.comments,
	.edit-link {
		display: none;
	}

	body {
		display: block;
		min-height: 0;
		background: #fff;
		color: #000;
	}

	a {
		text-decoration: underline;
	}
}
