/*
Theme Name: Clear Mental Health
Theme URI: https://clearmentalhealth.blog/
Author: Clear Mental Health
Author URI: https://clearmentalhealth.blog/
Description: A calm editorial WordPress theme for clear, responsible mental health and wellbeing content.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.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: clearmentalhealth
Tags: blog, news, custom-menu, featured-images, accessibility-ready
*/

:root {
	--cmh-ink: #213130;
	--cmh-muted: #60706e;
	--cmh-soft: #f7f4ec;
	--cmh-panel: #ffffff;
	--cmh-sage: #2f7d69;
	--cmh-sage-dark: #205a4b;
	--cmh-blue: #416d89;
	--cmh-coral: #c95f4b;
	--cmh-amber: #edc85a;
	--cmh-line: #dfe7e2;
	--cmh-shadow: 0 16px 40px rgba(33, 49, 48, 0.08);
	--cmh-radius: 8px;
	--cmh-wide: 1180px;
	--cmh-content: 760px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--cmh-soft);
	color: var(--cmh-ink);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 18px;
	line-height: 1.68;
	letter-spacing: 0;
}

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

a {
	color: var(--cmh-sage-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--cmh-coral);
}

.screen-reader-text,
.skip-link {
	position: absolute;
	left: -9999px;
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
	z-index: 999;
	background: var(--cmh-panel);
	border: 2px solid var(--cmh-sage);
	border-radius: var(--cmh-radius);
	color: var(--cmh-ink);
	padding: 0.55rem 0.8rem;
}

.cmh-wrap {
	margin: 0 auto;
	max-width: var(--cmh-wide);
	padding: 0 24px;
}

.cmh-narrow {
	margin: 0 auto;
	max-width: var(--cmh-content);
	padding: 0 24px;
}

.cmh-alert {
	background: #213130;
	color: #f8fbfa;
	font-size: 0.92rem;
	line-height: 1.45;
	padding: 0.55rem 0;
}

.cmh-alert a {
	color: #fff0c2;
	font-weight: 700;
}

.site-header {
	background: rgba(247, 244, 236, 0.96);
	border-bottom: 1px solid var(--cmh-line);
	position: sticky;
	top: 0;
	z-index: 20;
	backdrop-filter: blur(16px);
}

.site-header__inner {
	align-items: center;
	display: flex;
	gap: 1.5rem;
	justify-content: space-between;
	min-height: 76px;
}

.site-branding {
	display: inline-flex;
	flex-direction: column;
	gap: 0.08rem;
	text-decoration: none;
}

.site-title {
	color: var(--cmh-ink);
	font-size: 1.2rem;
	font-weight: 800;
	line-height: 1.1;
}

.site-description {
	color: var(--cmh-muted);
	font-size: 0.78rem;
	font-weight: 650;
	line-height: 1.2;
	text-transform: uppercase;
}

.primary-menu {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem;
	justify-content: flex-end;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-menu a {
	border-radius: 999px;
	color: var(--cmh-ink);
	display: inline-flex;
	font-size: 0.94rem;
	font-weight: 700;
	line-height: 1.1;
	padding: 0.62rem 0.82rem;
	text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
	background: #e4eee9;
	color: var(--cmh-sage-dark);
}

.hero {
	background-image: linear-gradient(90deg, rgba(33, 49, 48, 0.88) 0%, rgba(33, 49, 48, 0.78) 47%, rgba(33, 49, 48, 0.2) 100%), var(--cmh-hero);
	background-position: center;
	background-size: cover;
	color: #fff;
	min-height: 540px;
	padding: 88px 0 76px;
}

.hero__content {
	max-width: 720px;
}

.eyebrow {
	color: #fff0c2;
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hero h1 {
	font-size: clamp(3rem, 7vw, 6.5rem);
	line-height: 0.95;
	margin: 0.7rem 0 1.1rem;
	max-width: 850px;
}

.hero p {
	font-size: 1.22rem;
	line-height: 1.6;
	margin: 0 0 1.5rem;
	max-width: 680px;
}

.button-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.cmh-button,
.wp-block-button__link,
button,
input[type="submit"] {
	align-items: center;
	background: var(--cmh-sage);
	border: 1px solid var(--cmh-sage);
	border-radius: var(--cmh-radius);
	color: #fff;
	display: inline-flex;
	font-weight: 800;
	gap: 0.45rem;
	line-height: 1.1;
	padding: 0.86rem 1rem;
	text-decoration: none;
}

.cmh-button:hover,
.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover {
	background: var(--cmh-sage-dark);
	color: #fff;
}

.cmh-button--light {
	background: #fff;
	border-color: #fff;
	color: var(--cmh-ink);
}

.cmh-button--light:hover {
	background: #fff0c2;
	border-color: #fff0c2;
	color: var(--cmh-ink);
}

.cmh-section {
	padding: 70px 0;
}

.cmh-section--white {
	background: #fff;
}

.section-heading {
	display: grid;
	gap: 0.7rem;
	grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.45fr);
	margin-bottom: 2rem;
}

.section-heading h2,
.archive-title,
.entry-title {
	font-size: clamp(2rem, 4vw, 3.25rem);
	line-height: 1.05;
	margin: 0;
}

.section-heading p {
	color: var(--cmh-muted);
	margin: 0;
}

.category-grid,
.post-grid,
.resource-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-card,
.post-card,
.resource-card,
.trust-card {
	background: var(--cmh-panel);
	border: 1px solid var(--cmh-line);
	border-radius: var(--cmh-radius);
	box-shadow: var(--cmh-shadow);
	padding: 1.2rem;
}

.category-card {
	min-height: 180px;
}

.category-card__mark {
	background: var(--cmh-amber);
	border-radius: 999px;
	display: inline-block;
	height: 12px;
	margin-bottom: 1rem;
	width: 42px;
}

.category-card:nth-child(2n) .category-card__mark {
	background: var(--cmh-blue);
}

.category-card:nth-child(3n) .category-card__mark {
	background: var(--cmh-coral);
}

.category-card h3,
.post-card h2,
.post-card h3,
.resource-card h3,
.trust-card h3 {
	font-size: 1.22rem;
	line-height: 1.2;
	margin: 0 0 0.7rem;
}

.category-card p,
.post-card p,
.resource-card p,
.trust-card p {
	color: var(--cmh-muted);
	font-size: 0.98rem;
	margin: 0;
}

.post-card {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-height: 270px;
}

.post-card__meta,
.entry-meta,
.source-check {
	color: var(--cmh-muted);
	font-size: 0.88rem;
	font-weight: 650;
}

.post-card__link {
	margin-top: auto;
	font-weight: 800;
}

.editorial-band {
	background: #213130;
	color: #f8fbfa;
}

.editorial-band p {
	color: #dbe8e3;
}

.trust-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trust-card {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.18);
	box-shadow: none;
}

.trust-card h3 {
	color: #fff;
}

.trust-card p {
	color: #dbe8e3;
}

.site-main {
	min-height: 56vh;
}

.page-header,
.single-header {
	background: #fff;
	border-bottom: 1px solid var(--cmh-line);
	padding: 64px 0 44px;
}

.single-header .entry-title {
	max-width: 920px;
}

.single-header .dek {
	color: var(--cmh-muted);
	font-size: 1.2rem;
	max-width: 830px;
}

.article-shell {
	display: grid;
	gap: 2.4rem;
	grid-template-columns: minmax(0, 1fr) 270px;
	padding: 52px 0 76px;
}

.entry-content {
	background: #fff;
	border: 1px solid var(--cmh-line);
	border-radius: var(--cmh-radius);
	box-shadow: var(--cmh-shadow);
	padding: clamp(1.25rem, 5vw, 3rem);
}

.entry-content h2,
.entry-content h3 {
	line-height: 1.16;
	margin: 2rem 0 0.65rem;
}

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

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

.entry-content p,
.entry-content li {
	max-width: 72ch;
}

.entry-content blockquote,
.safety-note {
	background: #f2f8f5;
	border-left: 4px solid var(--cmh-sage);
	border-radius: var(--cmh-radius);
	margin: 1.4rem 0;
	padding: 1rem 1.1rem;
}

.entry-content blockquote p,
.safety-note p {
	margin: 0;
}

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

.article-aside {
	align-self: start;
	position: sticky;
	top: 104px;
}

.aside-box {
	background: #fff;
	border: 1px solid var(--cmh-line);
	border-radius: var(--cmh-radius);
	padding: 1rem;
}

.aside-box h2 {
	font-size: 1rem;
	line-height: 1.2;
	margin: 0 0 0.55rem;
}

.aside-box p {
	color: var(--cmh-muted);
	font-size: 0.9rem;
	margin: 0 0 0.7rem;
}

.post-list {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
}

.pagination {
	margin: 2rem 0 0;
}

.page-numbers {
	background: #fff;
	border: 1px solid var(--cmh-line);
	border-radius: var(--cmh-radius);
	display: inline-flex;
	margin: 0 0.2rem 0.35rem 0;
	padding: 0.45rem 0.68rem;
	text-decoration: none;
}

.page-numbers.current {
	background: var(--cmh-sage);
	color: #fff;
}

.site-footer {
	background: #182625;
	color: #dbe8e3;
	padding: 48px 0 26px;
}

.site-footer a {
	color: #fff0c2;
}

.footer-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(0, 1fr) minmax(250px, 0.55fr);
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 1rem;
	justify-content: flex-end;
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-note {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	color: #afc4bd;
	font-size: 0.9rem;
	margin-top: 2rem;
	padding-top: 1.4rem;
}

input[type="email"],
input[type="text"],
textarea {
	background: #fff;
	border: 1px solid var(--cmh-line);
	border-radius: var(--cmh-radius);
	color: var(--cmh-ink);
	font: inherit;
	padding: 0.85rem 0.9rem;
	width: 100%;
}

.newsletter-form {
	display: grid;
	gap: 0.65rem;
	grid-template-columns: minmax(0, 1fr) auto;
	margin-top: 1.2rem;
	max-width: 620px;
}

@media (max-width: 920px) {
	.site-header__inner,
	.footer-grid,
	.section-heading,
	.article-shell {
		grid-template-columns: 1fr;
	}

	.site-header__inner {
		align-items: flex-start;
		flex-direction: column;
		gap: 0.9rem;
		padding: 0.95rem 24px;
	}

	.primary-menu,
	.footer-menu {
		justify-content: flex-start;
	}

	.hero {
		min-height: auto;
		padding: 68px 0 56px;
	}

	.category-grid,
	.post-grid,
	.resource-grid,
	.trust-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.article-aside {
		position: static;
	}
}

@media (max-width: 640px) {
	body {
		font-size: 17px;
	}

	.cmh-wrap,
	.cmh-narrow {
		padding: 0 18px;
	}

	.hero h1 {
		font-size: 3.1rem;
	}

	.category-grid,
	.post-grid,
	.resource-grid,
	.trust-grid,
	.newsletter-form {
		grid-template-columns: 1fr;
	}

	.primary-menu a {
		padding: 0.5rem 0.58rem;
	}

	.entry-content {
		border-left: 0;
		border-right: 0;
		border-radius: 0;
		margin-left: -18px;
		margin-right: -18px;
	}
}
