/**
 * Global theme layer (tokens come from theme.json).
 */

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--atlas-header-offset, 4.5rem);
}

#why,
#map,
#stories,
#partner,
#interest {
	scroll-margin-top: var(--atlas-header-offset, 4.5rem);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

html,
body,
.wp-site-blocks {
	overflow-x: clip;
}

.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-color: var(--wp--preset--color--forest-dark);
	clip: auto !important;
	clip-path: none;
	color: var(--wp--preset--color--cream);
	display: block;
	height: auto;
	left: 0.5rem;
	padding: 0.75rem 1rem;
	text-decoration: none;
	top: 0.5rem;
	width: auto;
	z-index: 100000;
}

.atlas-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--forest-dark);
	color: var(--wp--preset--color--cream);
	text-decoration: none;
	border-radius: 4px;
}

.atlas-skip-link:focus {
	left: 1rem;
	top: 1rem;
	outline: 2px solid var(--wp--preset--color--amber-light);
	outline-offset: 2px;
}

.wrap,
body.page-template-default:not(.home) .wp-site-blocks > .wp-block-post-content {
	max-width: var(--wp--style--global--wide-size, 1120px);
	margin-inline: auto;
	padding-inline: 2.5rem;
}

/* Header — sticky on the template-part wrapper so it survives page scroll */
header.wp-block-template-part:has(.atlas-site-header) {
	position: sticky;
	top: 0;
	z-index: 100;
}

.atlas-site-header {
	position: relative;
	z-index: 1;
}

.atlas-header {
	background: rgba(255, 255, 255, 0.95);
	border-bottom: 1px solid var(--wp--preset--color--border);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

header.wp-block-template-part:has(.atlas-site-header.is-scrolled) .atlas-header,
.atlas-site-header.is-scrolled .atlas-header {
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 1px 0 color-mix(in srgb, var(--wp--preset--color--border) 80%, transparent);
}

.atlas-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 3.75rem;
	gap: 1.25rem;
}

.atlas-header__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--wp--preset--color--forest);
	text-decoration: none;
}

.atlas-brand__name {
	display: inline-flex;
	align-items: center;
	gap: 0.42em;
}

.atlas-brand__ai {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.22em 0.24em 0.2em;
	border: 0;
	border-radius: 0.34em;
	background: var(--wp--preset--color--amber);
	color: #fff;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.025em;
	line-height: 1;
}

.atlas-header__nav-list,
.atlas-mobile-menu__list,
.atlas-footer__nav-list {
	display: flex;
	align-items: center;
	gap: 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.atlas-header__link:not(.btn),
.atlas-mobile-menu__link:not(.btn) {
	color: var(--wp--preset--color--sub);
	text-decoration: none;
}

.atlas-header__link:not(.btn):hover,
.atlas-header__link:not(.btn).is-active {
	color: var(--wp--preset--color--forest);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--amber);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}

.atlas-mobile-menu__link:not(.btn):hover,
.atlas-mobile-menu__link:not(.btn).is-active {
	color: var(--wp--preset--color--forest);
	font-weight: 600;
}

.atlas-footer__nav a:hover,
.atlas-footer__nav a:focus-visible {
	color: var(--wp--preset--color--cream);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--amber-light);
	text-underline-offset: 0.3em;
	text-decoration-thickness: 1.5px;
}

.atlas-header__cta.is-active {
	outline: 2px solid var(--wp--preset--color--amber);
	outline-offset: 2px;
}

.atlas-header__menu-toggle {
	display: none;
	background: transparent;
	border: 0;
	padding: 0;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}

.atlas-header__menu-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.atlas-header__menu-icon--close {
	display: none;
}

.atlas-header__menu-toggle[aria-expanded="true"] .atlas-header__menu-icon--open {
	display: none;
}

.atlas-header__menu-toggle[aria-expanded="true"] .atlas-header__menu-icon--close {
	display: inline-flex;
}

.atlas-mobile-menu {
	position: fixed;
	top: var(--atlas-header-offset, 3.75rem);
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 299;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	background-color: #ffffff;
	background-color: var(--wp--preset--color--white);
	-webkit-overflow-scrolling: touch;
}

.atlas-mobile-menu[hidden] {
	display: none !important;
}

.atlas-mobile-menu__nav {
	width: 100%;
	padding-block: 0;
}

.atlas-mobile-menu__list {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	width: 100%;
}

.atlas-mobile-menu__list > li {
	width: 100%;
}

.atlas-mobile-menu__link {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.atlas-mobile-menu__list > li:last-child {
	padding: 1.25rem 1.25rem 1.75rem;
	box-sizing: border-box;
}

.atlas-mobile-menu__link--cta {
	display: flex;
	justify-content: center;
	width: 100%;
	margin: 0;
	padding: 0.6875rem 1.375rem;
	border-bottom: 0;
	text-align: center;
}

body.atlas-menu-open header.wp-block-template-part:has(.atlas-site-header) {
	z-index: 300;
}

@media (max-width: 47.5rem) {
	.atlas-header__nav { display: none; }
	.atlas-header__menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
	}

	body.atlas-menu-open .atlas-site-header {
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		z-index: 301;
		width: 100%;
	}

	.wrap,
	body.page-template-default:not(.home) .wp-site-blocks > .wp-block-post-content {
		padding-inline: 1.25rem;
	}

	.atlas-mobile-menu__link:not(.atlas-mobile-menu__link--cta) {
		padding-inline: 1.25rem;
	}

	.block-atlas-hero,
	.block-atlas-stats,
	.block-atlas-pillars,
	.block-atlas-commitment,
	.block-atlas-map,
	.block-atlas-stories,
	.block-atlas-steps,
	.block-atlas-supporters,
	.block-atlas-newsletter,
	.block-atlas-embedded-form {
		padding-block: 3.5rem;
	}

	.btn {
		min-height: 2.75rem;
		padding: 0.75rem 1.25rem;
	}

	.atlas-footer-disclaimer__text {
		font-size: 11px;
		padding-inline: 0.25rem;
	}
}

body.atlas-menu-open { overflow: hidden; }

/* Shared buttons */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6875rem 1.375rem;
	border-radius: 7px;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
	text-decoration: none;
	white-space: nowrap;
}

.btn-primary {
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--cream);
	border-color: var(--wp--preset--color--forest);
}

.btn-primary:hover {
	background: var(--wp--preset--color--forest-dark);
	border-color: var(--wp--preset--color--forest-dark);
	color: var(--wp--preset--color--cream);
}

.btn-ghost {
	background: transparent;
	color: var(--wp--preset--color--sub);
	border: 1px solid currentColor;
}

.btn-ghost:hover {
	background: var(--wp--preset--color--forest-xl);
	color: var(--wp--preset--color--ink);
}

.btn-outline {
	background: transparent;
	color: var(--wp--preset--color--forest);
	border: 1px solid currentColor;
}

.btn-outline:hover {
	background: var(--wp--preset--color--forest-xl);
	color: var(--wp--preset--color--forest);
}

.btn:focus-visible,
.atlas-header__brand:focus-visible,
.atlas-header__link:focus-visible,
.atlas-mobile-menu__link:focus-visible,
.atlas-footer__nav a:focus-visible,
.atlas-header__menu-toggle:focus-visible,
.block-atlas-map__sub-link:focus-visible {
	outline: 2px solid var(--wp--preset--color--amber);
	outline-offset: 2px;
}

/* Footer disclaimer */
.atlas-footer-disclaimer {
	padding: 1.5rem 0;
	background: var(--wp--preset--color--surface);
	border-top: 1px solid var(--wp--preset--color--border);
}

.atlas-footer-disclaimer__text {
	margin: 0;
	max-width: 52rem;
	margin-inline: auto;
	font-size: 10px;
	line-height: 1.5;
	text-align: center;
	color: var(--wp--preset--color--muted);
}

/* Footer */
.atlas-site-footer {
	background: var(--wp--preset--color--forest-dark);
	padding: 2.75rem 0;
}

.atlas-footer__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.25rem;
	flex-wrap: wrap;
}

.atlas-footer__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	font-weight: medium;
	color: var(--wp--preset--color--cream);
}

.atlas-footer__tagline {
	margin: 0.25rem 0 0;
	color: rgba(237, 229, 208, 0.82);
}

.atlas-footer__nav a {
	color: rgba(237, 229, 208, 0.88);
	text-decoration: none;
}

@media (max-width: 40rem) {
	.atlas-footer__inner { flex-direction: column; align-items: flex-start; }
	.atlas-footer__nav-list { flex-wrap: wrap; gap: 1rem; }
}
