/*
Theme Name: Sure Wealth
Theme URI: https://surewealthllc.com
Author: Sure Wealth Solutions
Description: Custom FSE block theme for Sure Wealth Solutions. No page builders. Tokens from the SureWealth Figma collection.
Version: 0.4.9
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: surewealth
License: GNU General Public License v2 or later
*/

/* Tokens live in theme.json. A11y / interaction polish lives here. */

/*
 * Spacing system (validated on staging):
 * - Root / has-global-padding: spacing|110 (64px) desktop; custom.section.padMobile (24px) ≤781px
 * - Content column: layout.contentSize 1200px centered inside full bands
 * - Vertical band pads: hero/services 110, trust 70, cta 100, header/footer as declared
 * - Type: body LH 1.5; display H1 1.1; H2 1.18; H3 1.3; kicker tracking 2px
 */

/* Mobile gutters — theme.json root padding is desktop 64px; shrink for narrow viewports */
@media (max-width: 781px) {
	.wp-site-blocks {
		--wp--style--root--padding-left: var(--wp--custom--section--pad-mobile, 24px);
		--wp--style--root--padding-right: var(--wp--custom--section--pad-mobile, 24px);
	}
}

/*
 * Sticky header (Figma condensed-on-scroll). z-index 20 keeps the bar above
 * band grain. The WP nav overlay lives inside this stacking context, so the
 * CMP must stay *below* 20 (see surewealth-ops consent.css z-index: 15)
 * or it paints over the open mobile menu (UIUX-F-001).
 */
.sw-site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background-color: var(--wp--preset--color--white, #ffffff);
}
.sw-site-header.is-condensed {
	padding-top: 8px !important;
	padding-bottom: 8px !important;
}
.sw-hero,
.sw-cta-band,
.sw-band-ink {
	isolation: isolate;
}
.sw-hero > *:not(hr),
.sw-cta-band > *:not(hr) {
	position: relative;
	z-index: 1;
}
html.exp-texture .sw-hero::after,
html.exp-texture .sw-cta-band::after,
html.exp-texture .sw-band-ink::after {
	z-index: 0;
}

.skip-link.screen-reader-text:not(.sw-skip-link) {
	display: none !important;
}
.sw-skip-link {
	position: absolute;
	left: 0.75rem;
	top: 0.75rem;
	z-index: 100000;
	padding: 0.65rem 1rem;
	background: #0e2a47;
	color: #ffffff;
	font-weight: 600;
	text-decoration: none;
	border-radius: 6px;
	transform: translateY(-150%);
	transition: transform 0.15s ease;
}
.sw-skip-link:focus {
	transform: translateY(0);
	outline: 2px solid #b08d57;
	outline-offset: 2px;
}

/* Visible focus (WCAG 2.4.7) — brass ring, 2px offset */
:focus-visible {
	outline: 2px solid #b08d57;
	outline-offset: 2px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
	outline: none;
}

/* Brass as text — deepen for light backgrounds; lighten on dark bands */
.has-brass-color {
	color: #8a6b38 !important;
}
a.has-brass-color,
.has-brass-color a {
	color: #8a6b38 !important;
}
.has-ink-background-color .has-brass-color,
.has-charcoal-background-color .has-brass-color,
.has-ink-background-color .sw-kicker.has-brass-color {
	color: #e2c48a !important;
}

/* Footer meta on charcoal — fade token is too dark for AA */
.has-charcoal-background-color .has-fade-color,
footer .has-fade-color {
	color: #a8b0bd !important;
}

/* Touch targets ≥ 24px (WCAG 2.5.8) */
.wp-block-navigation a,
.wp-block-navigation .wp-block-navigation-item__content {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	padding-block: 0.35rem;
}

/*
 * Third-party embeds (OnceHub / similar): never let fluid-media CLS rules
 * collapse iframe height attributes. Fill the content column up to OnceHub's
 * product max (~900px); reserve vertical space so calendars aren't clipped.
 */
iframe[src*="oncehub.com"],
iframe[src*="scheduleonce.com"],
iframe[id^="SOI_"],
#SOIDIV_SureWealthStrategist iframe {
	width: 100% !important;
	max-width: 900px;
	min-height: 550px;
	height: 720px;
}
#SOIDIV_SureWealthStrategist {
	width: 100%;
	max-width: 900px;
	margin-inline: auto;
	min-height: 720px;
}
.wp-block-site-title a,
.sw-header-phone a,
.sw-card-more a,
footer .wp-block-list a,
.wp-block-list a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-block: 0.25rem;
}
footer .wp-block-list li + li {
	margin-top: 0.2rem;
}

/* Header phone — evergreen ink for AA on white header */
.sw-site-header a[href^="tel:"],
header a[href^="tel:"] {
	color: #14352b;
	font-weight: 500;
}

/* Secondary + ghost button styles (UIUX-F-007). Outline is core; these are extras. */
.wp-block-button.is-style-secondary .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 1px solid var(--wp--preset--color--ink, #0e2a47);
	color: var(--wp--preset--color--ink, #0e2a47);
}
.has-ink-background-color .wp-block-button.is-style-secondary .wp-block-button__link,
.has-ink-background-color .wp-block-button.is-style-outline .wp-block-button__link,
.has-charcoal-background-color .wp-block-button.is-style-secondary .wp-block-button__link,
.has-charcoal-background-color .wp-block-button.is-style-outline .wp-block-button__link {
	border-color: var(--wp--preset--color--mist, #afc0d0);
	color: var(--wp--preset--color--ivory, #f7f4ec);
	background: transparent;
}
.wp-block-button.is-style-ghost .wp-block-button__link {
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--evergreen, #14352b);
	padding-left: 0;
	padding-right: 0;
	text-decoration: none;
}
.has-ink-background-color .wp-block-button.is-style-ghost .wp-block-button__link,
.has-charcoal-background-color .wp-block-button.is-style-ghost .wp-block-button__link {
	color: var(--wp--preset--color--ivory, #f7f4ec);
}

/* Mobile overlay: wordmark + hamburger in the bar; phone + CTA inside the modal */
.sw-nav-overlay-cta {
	display: none;
}
.wp-block-navigation__responsive-container.is-menu-open .sw-nav-overlay-cta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin-top: 1.5rem;
}
.sw-nav-overlay-phone {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	font-weight: 500;
	color: #14352b;
}
.sw-nav-overlay-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 15px 26px;
	border-radius: 6px;
	background: var(--wp--preset--color--brass, #b08d57);
	color: var(--wp--preset--color--ink, #0e2a47);
	font-weight: 600;
	text-decoration: none;
}
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
@media (max-width: 781px) {
	.sw-site-header:not(.sw-header-funnel) .sw-header-phone,
	.sw-site-header:not(.sw-header-funnel) .sw-header-cta {
		display: none !important;
	}
	.sw-site-header .is-content-justification-space-between {
		flex-wrap: nowrap;
	}
}

/* Footer / dark bands: evergreen/ink links fail AA — use mist */
footer a:where(:not(.wp-element-button)),
.has-charcoal-background-color a:where(:not(.wp-element-button)),
.has-ink-background-color a:where(:not(.wp-element-button)) {
	color: #c5d0dc !important;
}
footer a:where(:not(.wp-element-button)):hover,
.has-charcoal-background-color a:where(:not(.wp-element-button)):hover,
.has-ink-background-color a:where(:not(.wp-element-button)):hover {
	color: #ffffff !important;
}

/* Kickers on dark bands */
.has-ink-background-color .sw-kicker,
.has-charcoal-background-color .sw-kicker,
.has-ink-background-color .has-evergreen-color {
	color: #ece6d8 !important;
}

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

/*
 * Classic post HTML (96/100 posts are not Gutenberg). Theme.json styles
 * headings globally; this restores article rhythm the X theme used to own.
 */
.wp-block-post-content > h1:first-child {
	/* Template already prints the post title. */
	display: none;
}
.sw-article .wp-block-post-content h2,
.sw-article .entry-content h2 {
	margin-top: 2rem;
	margin-bottom: 0.75rem;
}
.sw-article .wp-block-post-content h3,
.sw-article .entry-content h3 {
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
}
.sw-article .wp-block-post-content p,
.sw-article .entry-content p,
.sw-article .wp-block-post-content li,
.sw-article .entry-content li {
	line-height: 1.65;
}
.sw-article .wp-block-post-content p + p,
.sw-article .entry-content p + p {
	margin-top: 1rem;
}
.sw-article .wp-block-post-content ul,
.sw-article .wp-block-post-content ol,
.sw-article .entry-content ul,
.sw-article .entry-content ol {
	padding-left: 1.25rem;
	margin: 1rem 0;
}
.sw-video-slot {
	position: relative;
	width: 100%;
	max-width: 720px;
	aspect-ratio: 16 / 9;
	margin: 1.25rem 0;
	background: #ece6d8;
	border-radius: 12px;
	overflow: hidden;
}
.sw-video-slot iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.sw-archive-item {
	border-bottom: 1px solid #e7e0d0;
}
.sw-archive-item .wp-block-post-title {
	margin-top: 0.5rem;
	margin-bottom: 0.25rem;
}
.sw-archive-item .wp-block-post-excerpt {
	margin-top: 0.5rem;
}

