/*
 * The Climate Bug design system
 * Layer on top of BlogHash. Note: BlogHash sets html font-size to 62.5%, so 1rem = 10px here.
 * Layout posture: calm, composed, mostly symmetric; generous whitespace; almost no motion.
 */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face {
	font-family: "Merriweather";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("../fonts/merriweather-normal-latin.woff2") format("woff2");
}
@font-face {
	font-family: "Merriweather";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/merriweather-italic-latin.woff2") format("woff2");
}
@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("../fonts/source-sans-3-normal-latin.woff2") format("woff2");
}
@font-face {
	font-family: "Source Sans 3";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/source-sans-3-italic-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
	--cb-forest: #173B32;      /* headings, header text, strong UI */
	--cb-green: #3F6A52;       /* links, buttons (5.8:1 on --cb-bg) */
	--cb-green-hover: #173B32;
	--cb-botanical: #527D63;   /* decorative only (rules, icons) */
	--cb-bg: #F8F7F2;          /* page ground */
	--cb-surface: #FFFFFF;     /* cards, header */
	--cb-sage: #E7EDE5;        /* tinted panels, tags */
	--cb-ink: #26312D;         /* body text */
	--cb-muted: #56635D;       /* meta text (5.9:1 on --cb-bg) */
	--cb-line: #D9E0D7;        /* hairlines */
	--cb-earth: #B68A58;       /* decorative accent only */
	--cb-earth-ink: #85602F;   /* earth tone when used as text */
	--cb-focus: #B68A58;

	--cb-serif: "Merriweather", Georgia, "Times New Roman", serif;
	--cb-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--cb-radius: 6px;
	--cb-measure: 700px; /* ~68 characters of body text */

	/* Map onto BlogHash's own variables */
	--bloghash-primary: var(--cb-green);
	--bloghash-secondary: var(--cb-ink);
	--bloghash-white: var(--cb-surface);
	--bloghash-radius: var(--cb-radius);
	--bloghash-normal-radius: var(--cb-radius);
	--bloghash-font-sans-serif: var(--cb-sans);
}

/* BlogHash dark mode (header toggle) */
[data-darkmode="dark"]:root {
	--cb-forest: #CFE3D6;
	--cb-green: #9CC9AE;
	--cb-green-hover: #CFE3D6;
	--cb-botanical: #7FA88F;
	--cb-bg: #121A17;
	--cb-surface: #18221E;
	--cb-sage: #1F2D27;
	--cb-ink: #E2E8E4;
	--cb-muted: #A6B3AD;
	--cb-line: #2C3934;
	--cb-earth: #D3A874;
	--cb-earth-ink: #D3A874;
	--cb-focus: #D3A874;
	--bloghash-white: var(--cb-surface);
	--bloghash-secondary: var(--cb-ink);
	color-scheme: dark;
}

/* ---------- Base ---------- */
body {
	background-color: var(--cb-bg);
	color: var(--cb-ink);
	font-family: var(--cb-sans);
	font-size: 18px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.page-title,
.site-title,
.widget-title,
.bloghash-widget-title,
.comments-title,
.comment-reply-title,
.author-box-title {
	font-family: var(--cb-serif);
	color: var(--cb-forest);
	font-weight: 700;
	letter-spacing: -0.005em;
	line-height: 1.22;
	text-wrap: balance;
}
h1, .entry-title { line-height: 1.15; }
.entry-title a, .site-title a { color: inherit; }

/* Plain link styling */
a { color: var(--cb-green); }
a:hover { color: var(--cb-green-hover); }

/* Visible keyboard focus everywhere */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--cb-focus) !important;
	outline-offset: 2px;
	box-shadow: none;
}

::selection { background: var(--cb-sage); color: var(--cb-forest); }

/* ---------- Surfaces ---------- */
#page, .site, #main, .site-main { background-color: transparent; }

.bloghash-layout__boxed-separated .bloghash-article,
.bloghash-layout__boxed-separated .widget,
.bloghash-layout__boxed-separated .author-box,
.bloghash-layout__boxed-separated .comments-area,
.bloghash-layout__boxed-separated .post-nav,
.bloghash-layout__boxed-separated .page-header {
	background-color: var(--cb-surface);
	border: 1px solid var(--cb-line);
	border-radius: var(--cb-radius);
	box-shadow: none;
}
.bloghash-layout-shadow .bloghash-article,
.bloghash-layout-shadow .widget { box-shadow: none; }

/* ---------- Header ---------- */
#masthead,
.site-header,
#bloghash-header,
#bloghash-header-inner {
	background-color: var(--cb-surface);
}
#bloghash-header-inner { border-bottom: 1px solid var(--cb-line); }
.site-description {
	font-family: var(--cb-sans);
	color: var(--cb-muted);
	font-size: 14px;
	letter-spacing: 0.01em;
}
.bloghash-nav > ul > li > a,
#bloghash-primary-nav a {
	font-family: var(--cb-sans);
	font-weight: 600;
	font-size: 16px;
	color: var(--cb-forest);
}
.bloghash-nav > ul > li > a:hover,
.bloghash-nav > ul > li.current-menu-item > a { color: var(--cb-green); }

/* ---------- Buttons ---------- */
.bloghash-btn,
.wp-block-button__link,
input[type="submit"],
button[type="submit"],
.bloghash-submit-form-button {
	font-family: var(--cb-sans);
	font-weight: 600;
	letter-spacing: 0.01em;
	border-radius: var(--cb-radius);
	background-color: var(--cb-green);
	border-color: var(--cb-green);
	color: #FFFFFF;
	box-shadow: none;
}
.bloghash-btn:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
	background-color: var(--cb-forest);
	border-color: var(--cb-forest);
	color: #FFFFFF;
}
[data-darkmode="dark"] .bloghash-btn,
[data-darkmode="dark"] .wp-block-button__link,
[data-darkmode="dark"] input[type="submit"],
[data-darkmode="dark"] button[type="submit"] { color: #10201A; }

/* ---------- Article meta and categories ---------- */
.entry-meta,
.entry-meta a,
.posted-on,
.post-author,
.bloghash-breadcrumbs,
.bloghash-breadcrumbs a {
	font-family: var(--cb-sans);
	color: var(--cb-muted);
	font-size: 15px;
}
.post-category .cat-links a,
.cat-links a {
	font-family: var(--cb-sans);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--cb-earth-ink) !important;
	background: transparent !important;
	padding: 0;
}
.cat-links a::before { display: none !important; }

/* ---------- Single article reading experience ---------- */
.single .entry-content,
.page .entry-content {
	font-size: 19px;
	line-height: 1.72;
	color: var(--cb-ink);
}
.single .entry-content > :where(:not(.alignwide):not(.alignfull)) {
	max-width: var(--cb-measure);
}
.entry-content h2 { font-size: 28px; margin-top: 1.8em; margin-bottom: 0.55em; }
.entry-content h3 { font-size: 23px; margin-top: 1.5em; margin-bottom: 0.5em; }
.entry-content h4 { font-size: 19px; margin-top: 1.4em; }
.entry-content p { margin-bottom: 1.15em; }
.entry-content a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--cb-botanical);
	overflow-wrap: anywhere;
}
.entry-content a:hover { text-decoration-color: currentColor; }
.entry-content strong { color: var(--cb-forest); }
.entry-content :where(blockquote) {
	margin: 1.6em 0;
	padding: 0.2em 0 0.2em 1.2em;
	border-left: 3px solid var(--cb-earth);
	background: none;
	font-family: var(--cb-serif);
	font-style: italic;
	color: var(--cb-forest);
}
.entry-content figcaption,
.wp-caption-text {
	font-family: var(--cb-sans);
	font-size: 14px;
	color: var(--cb-muted);
	text-align: left;
}
.entry-content :where(table) {
	font-family: var(--cb-sans);
	font-size: 16px;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}
.entry-content :where(th, td) { border: 1px solid var(--cb-line); padding: 8px 12px; }
.entry-content :where(th) { background: var(--cb-sage); color: var(--cb-forest); }
.entry-content :where(hr) { border: 0; border-top: 1px solid var(--cb-line); }
.entry-content :where(code) { background: var(--cb-sage); border-radius: 3px; padding: 0 4px; }

/* Tags under posts */
.post-tags a {
	font-family: var(--cb-sans);
	font-size: 14px;
	background: var(--cb-sage);
	color: var(--cb-forest);
	border-radius: var(--cb-radius);
}

/* Author box */
.author-box { background: var(--cb-sage) !important; border-color: var(--cb-sage) !important; }

/* ---------- Post cards and archives ---------- */
.bloghash-post-item .entry-title,
.bloghash-article .entry-title { font-size: clamp(20px, 2vw, 24px); }
.single .entry-header .entry-title { font-size: clamp(30px, 4vw, 42px); }
.bloghash-post-item .entry-summary,
.bloghash-post-item .entry-content,
.bloghash-article .entry-summary { color: var(--cb-ink); font-size: 17px; }
.entry-media img,
.post-thumb img { border-radius: var(--cb-radius); }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea, select {
	font-family: var(--cb-sans);
	background: var(--cb-surface);
	color: var(--cb-ink);
	border: 1px solid var(--cb-line);
	border-radius: var(--cb-radius);
}
input::placeholder, textarea::placeholder { color: var(--cb-muted); opacity: 1; }

/* ---------- Footer ---------- */
#colophon, .site-footer, #bloghash-copyright {
	background-color: var(--cb-forest);
	color: #E4ECE6;
	font-family: var(--cb-sans);
}
#colophon a, #bloghash-copyright a { color: #FFFFFF; }
[data-darkmode="dark"] #colophon,
[data-darkmode="dark"] #bloghash-copyright { background-color: #0C1311; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
	body { font-size: 17px; }
	.single .entry-content { font-size: 18px; }
	.entry-content h2 { font-size: 24px; }
	.entry-content h3 { font-size: 20px; }
}

/* ---------- Refinements after first render ---------- */

/* Remove BlogHash's decorative blurred colour blobs (red/teal glow) */
.bloghash-glassmorphism .block,
span.block.one,
span.block.two { display: none !important; }

/* Centre the single-article reading column inside the wide article box */
.single .bloghash-article > :where(.entry-header, .entry-content, .entry-footer, .post-category, .author-box),
.single .bloghash-article .entry-content > * {
	margin-left: auto;
	margin-right: auto;
}
.single .bloghash-article > :where(.entry-header, .entry-footer, .post-category, .author-box) {
	max-width: var(--cb-measure);
}
.single .bloghash-article .entry-content { max-width: none; }

/* Wider reading column on phones: lighter gutters, borderless article card */
@media (max-width: 600px) {
	.bloghash-container { padding-left: 16px; padding-right: 16px; }
	.single.bloghash-layout__boxed-separated #content > article.bloghash-article {
		padding: 20px 0;
		border-left: 0;
		border-right: 0;
		border-radius: 0;
		background: transparent;
		border-top: 0;
	}
}

/* Tagline and menu colours need higher specificity than BlogHash's header rules */
#masthead .site-description,
#bloghash-header .site-description { color: var(--cb-muted); }
#masthead .bloghash-nav a,
#bloghash-header .bloghash-nav a { color: var(--cb-forest); }
#masthead .bloghash-nav a:hover,
#bloghash-header .bloghash-nav a:hover { color: var(--cb-green); }
[data-darkmode="dark"] #masthead .bloghash-nav a { color: var(--cb-ink); }

/* ---------- Shared layout wrapper ---------- */
.cb-wrap {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
}
@media (max-width: 600px) {
	.cb-wrap { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Site footer ---------- */
#colophon.site-footer { padding: 0; border: 0; }
.cb-footer {
	background: var(--cb-forest);
	color: #DCE7E0;
	font-family: var(--cb-sans);
	font-size: 16px;
	line-height: 1.6;
}
[data-darkmode="dark"] .cb-footer { background: #0C1311; }
.cb-footer :where(h2, p, ul) { margin: 0; padding: 0; }
.cb-footer ul { list-style: none; display: grid; gap: 8px; }
.cb-footer a { color: #FFFFFF; text-decoration: none; }
.cb-footer a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.cb-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 32px 48px;
	padding-block: 56px 40px;
}
.cb-footer__name { font-family: var(--cb-serif); font-size: 22px; font-weight: 700; }
.cb-footer__mission { margin-top: 10px !important; max-width: 38ch; color: #DCE7E0; }
.cb-footer__heading {
	font-family: var(--cb-sans);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #E9D3B4;
	margin-bottom: 14px !important;
}
.cb-footer__base {
	padding-block: 18px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	font-size: 14px;
	color: #C2D2C8;
}
@media (max-width: 760px) {
	.cb-footer__grid { grid-template-columns: 1fr 1fr; }
	.cb-footer__brand { grid-column: 1 / -1; }
}

/* ---------- Static pages (About, Contact, policies) ---------- */
.page .bloghash-article > :where(.entry-header, .entry-footer),
.page .bloghash-article .entry-content > :where(:not(.alignwide):not(.alignfull)) {
	max-width: var(--cb-measure);
	margin-left: auto;
	margin-right: auto;
}
.entry-content .cb-lede {
	font-size: 22px;
	line-height: 1.55;
	color: var(--cb-forest);
	font-family: var(--cb-serif);
	font-weight: 400;
	margin-bottom: 1.4em;
}
.entry-content .cb-small { font-size: 15px; color: var(--cb-muted); }

/* Placeholders for the site owner to fill in. Deliberately loud so they are never published by accident. */
.entry-content .cb-todo,
.cb-todo-inline {
	background: #FFF4D6;
	color: #5A3D00;
	border: 2px dashed #B68A58;
	border-radius: var(--cb-radius);
	font-family: var(--cb-sans);
}
.entry-content .cb-todo { padding: 12px 16px; font-size: 16px; }
.cb-todo-inline { padding: 0 4px; }
@media (max-width: 600px) {
	.entry-content .cb-lede { font-size: 19px; }
}

/* ---------- Article components ---------- */
.entry-content .cb-glance {
	background: var(--cb-sage);
	border-radius: var(--cb-radius);
	padding: 18px 22px;
	margin: 1.6em auto 2em;
	font-family: var(--cb-sans);
	font-size: 17px;
}
.entry-content .cb-glance h3 {
	margin: 0 0 8px;
	font-family: var(--cb-sans);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cb-earth-ink);
}
.entry-content .cb-glance ul { margin: 0; padding-left: 1.1em; }
.entry-content .cb-glance li { margin: 4px 0; }
.entry-content .cb-ref {
	font-family: var(--cb-sans);
	font-size: 16px;
	line-height: 1.6;
	padding-left: 1.4em;
	text-indent: -1.4em;
}
.entry-content .cb-related { font-family: var(--cb-sans); font-size: 17px; }
.entry-content .cb-related li { margin: 6px 0; }

/* Original-study link button */
.entry-content .cb-study-link a{display:inline-block;padding:12px 20px;border-radius:999px;background:var(--cb-forest);color:#fff !important;font-family:var(--cb-sans);font-weight:700;font-size:17px;text-decoration:none}
.entry-content .cb-study-link a:hover,.entry-content .cb-study-link a:focus-visible{background:var(--cb-green)}
[data-darkmode=dark] .entry-content .cb-study-link a{background:var(--cb-sage);color:var(--cb-forest) !important}
.entry-content .wp-block-image figcaption{font-family:var(--cb-sans);font-size:15px;text-align:center;opacity:.85}
