:root {
	--mth-accent: #087a67;
	--mth-ink: #10231b;
	--mth-brand: #e9f8f3;
	--mth-base: #f1faf6;
	--mth-dark: #0d1511;
	--mth-dark-panel: #121d17;
	--mth-dark-card: #17231d;
	--mth-warning: #d97706;
	--mth-critical: #b42318;
	--mth-surface: rgba(255, 255, 255, 0.82);
	--mth-muted: #496158;
	--mth-line: rgba(8, 122, 103, 0.22);
	--mth-shadow: 0 16px 48px rgba(16, 35, 27, 0.08);
	--mth-header-height: 58px;
	--mth-page-gutter: clamp(1rem, 3vw, 2.25rem);
	--mth-wide: 1440px;
	color-scheme: light dark;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--mth-header-height) + 1rem);
	-webkit-text-size-adjust: 100%;
}

body.mth-theme {
	min-width: 320px;
	min-height: 100vh;
	margin: 0;
	color: var(--mth-ink);
	background: linear-gradient(135deg, var(--mth-base) 0%, var(--mth-brand) 100%) fixed;
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

body.mth-theme .wp-site-blocks {
	display: flex;
	min-height: 100vh;
	flex-direction: column;
	padding: 0;
}

body.mth-theme .mth-site-main {
	flex: 1 0 auto;
	width: 100%;
}

/* The configured landing page starts directly below the slim header. */
body.mth-theme .mth-landing-main,
body.mth-theme .mth-landing-main > .wp-block-post-content {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

body.mth-theme .mth-landing-main > .wp-block-post-content > .wp-block-paragraph:empty {
	display: none;
}

/* Fallback when a Site Editor database template still renders page.html. */
body.mth-theme.home.page .mth-content-shell {
	padding-top: 0;
	padding-bottom: 0;
}

body.mth-theme.home.page .mth-content-shell > .wp-block-post-content > .wp-block-paragraph:empty {
	display: none;
	margin: 0;
}

body.mth-theme .mth-landing-main > .wp-block-post-content > .mth-scrollytelling,
body.mth-theme.home.page .mth-content-shell > .wp-block-post-content > .mth-scrollytelling {
	margin-block-start: 0;
	margin-block-end: 0;
}

body.mth-theme .mth-app-main {
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 0;
}

body.mth-theme .mth-app-main > .wp-block-post-content {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

body.mth-theme :where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--mth-accent);
	outline-offset: 3px;
}

body.mth-theme a {
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.16em;
}

body.mth-theme a:hover {
	text-decoration-thickness: 0.12em;
}

body.mth-theme :where(img, video, iframe) {
	max-width: 100%;
}

body.mth-theme ::selection {
	color: var(--mth-ink);
	background: var(--mth-brand);
}

/* Slim, editor-controlled site header. */
body.mth-theme .mth-site-header {
	position: sticky;
	z-index: 1000;
	top: 0;
	margin: 0;
	border-bottom: 1px solid var(--mth-line);
	background: rgba(241, 250, 246, 0.92);
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
}

body.admin-bar.mth-theme .mth-site-header {
	top: 32px;
}

body.mth-theme .mth-header-inner {
	min-height: var(--mth-header-height);
	max-width: var(--mth-wide);
	margin-inline: auto;
	padding: 0.35rem var(--mth-page-gutter);
}

body.mth-theme .mth-brand-lockup {
	min-width: 0;
	flex: 0 1 auto;
	gap: 0.6rem;
}

body.mth-theme .mth-brand-lockup .wp-block-site-logo {
	flex: 0 0 auto;
}

body.mth-theme .mth-brand-lockup .wp-block-site-logo img {
	display: block;
	width: 36px;
	height: 36px;
	border-radius: 0.45rem;
	object-fit: contain;
}

body.mth-theme .mth-brand-lockup .wp-block-site-title {
	min-width: 0;
	margin: 0;
	font-size: clamp(0.92rem, 0.82rem + 0.35vw, 1.1rem);
	font-weight: 760;
	line-height: 1.15;
}

body.mth-theme .mth-brand-lockup .wp-block-site-title a {
	display: block;
	max-width: min(42vw, 34rem);
	color: var(--mth-ink);
	overflow: hidden;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.mth-theme .mth-primary-nav {
	font-size: 0.88rem;
	font-weight: 650;
}

body.mth-theme .mth-primary-nav .wp-block-navigation-item__content {
	padding-block: 0.45rem;
	color: var(--mth-ink);
	text-decoration: none;
}

body.mth-theme .mth-primary-nav .current-menu-item > .wp-block-navigation-item__content,
body.mth-theme .mth-primary-nav .wp-block-navigation-item__content:hover {
	color: var(--mth-accent);
}

body.mth-theme .wp-block-navigation__responsive-container-open,
body.mth-theme .wp-block-navigation__responsive-container-close {
	min-width: 40px;
	min-height: 40px;
	padding: 0.45rem;
	border: 1px solid var(--mth-line);
	border-radius: 0.5rem;
	color: var(--mth-ink);
}

body.mth-theme .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--mth-page-gutter);
	color: var(--mth-ink);
	background: var(--mth-base);
}

/* Content keeps comfortable reading width while wide/plugin surfaces get room. */
body.mth-theme .mth-content-shell {
	width: 100%;
	padding: clamp(2rem, 5vw, 4.5rem) var(--mth-page-gutter);
}

body.mth-theme .mth-content-shell > .alignwide {
	max-width: var(--mth-wide);
}

body.mth-theme :where(.wp-block-post-content, .mth-content-shell) > .alignfull {
	width: 100vw;
	max-width: none;
	margin-inline: calc(50% - 50vw);
}

body.mth-theme :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
	max-width: 100%;
	border: 1px solid var(--mth-line);
	border-radius: 0.5rem;
	color: var(--mth-ink);
	background: rgba(255, 255, 255, 0.8);
	font: inherit;
}

body.mth-theme :where(.wp-element-button, .wp-block-button__link) {
	min-height: 42px;
	padding: 0.65rem 1rem;
	border: 1px solid var(--mth-accent);
	border-radius: 0.5rem;
	color: #fff;
	background: var(--mth-accent);
	box-shadow: none;
	transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

body.mth-theme :where(.wp-element-button, .wp-block-button__link):hover {
	background: #066554;
	box-shadow: 0 8px 24px rgba(8, 122, 103, 0.18);
	transform: translateY(-1px);
}

/* Compact footer with the same editable logo and legal navigation. */
body.mth-theme .mth-site-footer {
	margin: 0;
	border-top: 1px solid var(--mth-line);
	color: var(--mth-muted);
	background: rgba(233, 248, 243, 0.76);
}

body.mth-theme .mth-footer-inner {
	min-height: 52px;
	max-width: var(--mth-wide);
	margin-inline: auto;
	padding: 0.45rem var(--mth-page-gutter);
}

body.mth-theme .mth-footer-brand {
	gap: 0.55rem;
}

body.mth-theme .mth-footer-brand .wp-block-site-logo img {
	display: block;
	width: 28px;
	height: 28px;
	border-radius: 0.35rem;
	object-fit: contain;
}

body.mth-theme .mth-footer-title,
body.mth-theme .mth-footer-copy,
body.mth-theme .mth-footer-nav {
	font-size: 0.78rem;
}

body.mth-theme .mth-footer-title {
	margin: 0;
	font-weight: 700;
}

body.mth-theme .mth-footer-title a,
body.mth-theme .mth-footer-nav a {
	color: inherit;
	text-decoration: none;
}

body.mth-theme .mth-footer-nav a:hover {
	color: var(--mth-accent);
	text-decoration: underline;
}

@media (max-width: 782px) {
	body.admin-bar.mth-theme .mth-site-header {
		top: 46px;
	}
}

@media (max-width: 700px) {
	:root {
		--mth-header-height: 54px;
	}

	body.mth-theme .mth-site-header {
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		background: var(--mth-base);
	}

	body.mth-theme .mth-header-inner {
		padding-block: 0.25rem;
	}

	body.mth-theme .mth-brand-lockup .wp-block-site-logo img {
		width: 34px;
		height: 34px;
	}

	body.mth-theme .mth-footer-inner {
		align-items: flex-start;
		flex-direction: column;
		gap: 0.45rem;
	}

	body.mth-theme .mth-primary-nav .wp-block-navigation__responsive-container {
		position: fixed;
		z-index: 100000;
		inset: 0;
		width: 100vw;
		max-width: none;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		margin: 0;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	body.mth-theme .mth-primary-nav .wp-block-navigation__responsive-container.is-menu-open {
		display: flex;
		padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
	}

	body.mth-theme .mth-primary-nav .wp-block-navigation__responsive-container-content,
	body.mth-theme .mth-primary-nav .wp-block-navigation__container {
		width: 100%;
		max-width: none;
		overflow: visible;
	}

	body.mth-theme .mth-primary-nav .wp-block-navigation__responsive-container-content {
		padding-top: 3.5rem;
	}

	html.has-modal-open,
	html.has-modal-open body {
		overflow: hidden;
	}
}

@media (prefers-color-scheme: dark) {
	:root {
		--mth-surface: rgba(23, 35, 29, 0.88);
		--mth-muted: #aec3b8;
		--mth-line: rgba(233, 248, 243, 0.16);
		--mth-shadow: 0 18px 52px rgba(0, 0, 0, 0.3);
	}

	body.mth-theme {
		--wp--preset--color--base: #0d1511;
		--wp--preset--color--contrast: #e9f8f3;
		--wp--preset--color--brand: #17231d;
		color: #e9f8f3;
		background: linear-gradient(135deg, var(--mth-dark) 0%, var(--mth-dark-panel) 100%) fixed;
	}

	body.mth-theme :where(h1, h2, h3, h4, h5, h6),
	body.mth-theme .mth-brand-lockup .wp-block-site-title a,
	body.mth-theme .mth-primary-nav .wp-block-navigation-item__content {
		color: #e9f8f3;
	}

	body.mth-theme .mth-site-header {
		background: rgba(13, 21, 17, 0.92);
	}

	body.mth-theme .mth-site-footer {
		color: var(--mth-muted);
		background: rgba(18, 29, 23, 0.92);
	}

	body.mth-theme :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
		color: #e9f8f3;
		background: var(--mth-dark-card);
	}

	body.mth-theme .wp-block-navigation__responsive-container.is-menu-open {
		color: #e9f8f3;
		background: var(--mth-dark);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	body.mth-theme .mth-site-header {
		background: var(--mth-base);
	}

	@media (prefers-color-scheme: dark) {
		body.mth-theme .mth-site-header {
			background: var(--mth-dark);
		}
	}
}

