/* McClure Wealth — child theme CSS.
   theme.json owns colour, type and spacing tokens. This file owns the things
   theme.json cannot express: the sticky header, the block style variations, and
   the accessibility floor (focus rings, reduced motion, scrollable tables).

   Every colour below is a theme.json preset var. Do not hard-code hex here. */

/* ---------------------------------------------------------------- 1. Base */

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Visible keyboard focus everywhere. The old site suppressed outlines. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

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

/* Long content must never push the page sideways. */
.wp-block-table,
.wp-block-preformatted,
.wp-block-code {
	overflow-x: auto;
}

/* -------------------------------------------------------------- 2. Header */

/* Only the white bar sticks; the dark utility bar scrolls away. That is what
   the previous theme did, and TT25's whole-part stickiness cannot express it. */
.mcw-topbar {
	position: relative;
	z-index: 20;
}

.mcw-topbar a {
	color: var(--wp--preset--color--base);
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.mcw-topbar a:hover,
.mcw-topbar a:focus {
	color: var(--wp--preset--color--brand-light);
	border-bottom-color: var(--wp--preset--color--brand-light);
}

.mcw-headerbar {
	position: sticky;
	top: 0;
	z-index: 30;
	background-color: rgba(255, 255, 255, 0.94);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid var(--wp--preset--color--rule);
	transition: box-shadow 0.25s ease;
}

.admin-bar .mcw-headerbar {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.mcw-headerbar .wp-block-site-logo img {
	max-width: 180px;
	height: auto;
}

/* Nav: a 2px accent rule that grows under the current/hovered item. */
.mcw-headerbar .wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.35rem;
}

.mcw-headerbar .wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 2px;
	background-color: var(--wp--preset--color--accent);
	transition: width 0.22s ease;
}

.mcw-headerbar .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.mcw-headerbar .wp-block-navigation .wp-block-navigation-item__content:focus::after,
.mcw-headerbar .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after,
.mcw-headerbar .wp-block-navigation .current-menu-ancestor > .wp-block-navigation-item__content::after {
	width: 100%;
}

/* Submenu panel */
.mcw-headerbar .wp-block-navigation .wp-block-navigation-submenu__container {
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 10px;
	box-shadow: var(--wp--preset--shadow--card);
	padding: 0.5rem 0;
	min-width: 15rem;
}

.mcw-headerbar .wp-block-navigation .wp-block-navigation-submenu__container .wp-block-navigation-item__content {
	padding: 0.5rem 1rem;
}

.mcw-headerbar .wp-block-navigation .wp-block-navigation-submenu__container .wp-block-navigation-item__content::after {
	display: none;
}

@media (max-width: 781px) {
	.mcw-topbar {
		display: none;
	}
}

/* --------------------------------------------------------- 3. Page header */

/* Interior pages open on type, not on a repeated 8 MB stock photograph. */
.mcw-page-header {
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.mcw-page-header .wp-block-post-title {
	margin: 0;
}

/* ------------------------------------------------- 4. Block style: heading */

/* .is-style-mcw-ruled — the section marker. A 44x3px accent rule under the
   heading. This is the one decorative device on the site; everything else earns
   its place by carrying information. */
.is-style-mcw-ruled {
	position: relative;
	padding-bottom: 0.85rem;
}

.is-style-mcw-ruled::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 44px;
	height: 3px;
	background-color: var(--wp--preset--color--accent);
	border-radius: 2px;
}

.has-text-align-center.is-style-mcw-ruled::after {
	left: 50%;
	transform: translateX(-50%);
}

/* On a dark band the rule keeps the accent; the heading itself inherits. */
.has-deep-background-color .is-style-mcw-ruled::after {
	background-color: var(--wp--preset--color--brand-light);
}

/* .is-style-mcw-eyebrow — a small label above a heading. Says what kind of
   thing follows (e.g. "Plan design"), never decorative. */
.is-style-mcw-eyebrow {
	font-family: var(--wp--preset--font-family--text);
	font-size: var(--wp--preset--font-size--legal);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-text);
	margin-bottom: 0.5rem;
	line-height: 1.4;
}

.has-deep-background-color .is-style-mcw-eyebrow,
.has-ink-background-color .is-style-mcw-eyebrow {
	color: var(--wp--preset--color--accent);
}

/* --------------------------------------------- 5. Block style: group/cards */

.is-style-mcw-card {
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 14px;
	padding: var(--wp--preset--spacing--40);
	height: 100%;
	transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.is-style-mcw-card:hover {
	box-shadow: var(--wp--preset--shadow--card);
	border-color: var(--wp--preset--color--surface-2);
	transform: translateY(-2px);
}

.is-style-mcw-card > :first-child {
	margin-top: 0;
}

.is-style-mcw-card > :last-child {
	margin-bottom: 0;
}

.is-style-mcw-panel {
	border-left: 3px solid var(--wp--preset--color--brand-light);
	background-color: var(--wp--preset--color--surface);
	border-radius: 0 12px 12px 0;
	padding: var(--wp--preset--spacing--40);
}

/* Equal-height cards in a columns row. */
.is-style-mcw-cards .wp-block-column {
	display: flex;
	flex-direction: column;
}

.is-style-mcw-cards .wp-block-column > .wp-block-group {
	flex: 1;
}

/* ------------------------------------------------- 6. Block style: list */

.is-style-mcw-checks {
	list-style: none;
	padding-left: 0;
}

.is-style-mcw-checks li {
	position: relative;
	padding-left: 1.9rem;
	margin-bottom: 0.6rem;
}

.is-style-mcw-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 0.7rem;
	height: 0.38rem;
	border-left: 2.5px solid var(--wp--preset--color--action);
	border-bottom: 2.5px solid var(--wp--preset--color--action);
	transform: rotate(-45deg);
}

.has-deep-background-color .is-style-mcw-checks li::before {
	border-color: var(--wp--preset--color--brand-light);
}

/* ------------------------------------- 7. Block style: comparison table */

/* The signature element. This business runs on comparisons — CalSavers against
   a 401(k), 3(21) against 3(38), SIMPLE against SEP against Safe Harbor. On the
   old site the most useful of these was a flat JPEG. Here it is a real table:
   readable, selectable, screen-reader navigable, and it scrolls instead of
   breaking the page on a phone. */

.is-style-mcw-compare {
	font-size: var(--wp--preset--font-size--medium);
}

.is-style-mcw-compare table {
	border-collapse: collapse;
	border: 0;
	width: 100%;
}

.is-style-mcw-compare thead th {
	font-family: var(--wp--preset--font-family--text);
	font-size: var(--wp--preset--font-size--legal);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	text-align: left;
	padding: 0 0 0.75rem;
	border: 0;
	border-bottom: 2px solid var(--wp--preset--color--ink);
	white-space: nowrap;
}

.is-style-mcw-compare tbody th,
.is-style-mcw-compare tbody td {
	padding: 0.95rem 1.25rem 0.95rem 0;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	vertical-align: top;
}

.is-style-mcw-compare tbody tr td:first-child,
.is-style-mcw-compare tbody tr th:first-child {
	font-weight: 600;
	color: var(--wp--preset--color--ink);
	width: 34%;
}

.is-style-mcw-compare tbody tr:last-child td,
.is-style-mcw-compare tbody tr:last-child th {
	border-bottom: 0;
}

.is-style-mcw-compare tbody tr:hover td,
.is-style-mcw-compare tbody tr:hover th {
	background-color: var(--wp--preset--color--surface);
}

/* The column being argued for. Add class "mcw-col-ours" in the table's
   Advanced panel, or wrap the cell text — the tint is the only emphasis. */
.is-style-mcw-compare .mcw-col-ours {
	background-color: var(--wp--preset--color--brand-wash);
}

.is-style-mcw-compare figcaption {
	margin-top: 0.85rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

@media (max-width: 600px) {
	.is-style-mcw-compare table {
		min-width: 34rem;
	}
}

/* ------------------------------------------------ 8. Block style: image */

.is-style-mcw-framed img {
	border-radius: 14px;
	box-shadow: var(--wp--preset--shadow--raised);
}

/* ------------------------------------------------------------ 9. Content */

/* Comfortable measure for prose without forcing it on layout blocks. */
.wp-block-post-content > p,
.wp-block-post-content > ul,
.wp-block-post-content > ol {
	max-width: 70ch;
}

.wp-block-post-content > .alignwide > p {
	max-width: none;
}

/* A lead paragraph directly after a page heading. */
.mcw-lead {
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.6;
	color: var(--wp--preset--color--muted);
}

/* Buttons sitting on a dark band invert to the light brand green. */
.has-deep-background-color .wp-block-button__link {
	background-color: var(--wp--preset--color--brand-light);
	border-color: var(--wp--preset--color--brand-light);
	color: var(--wp--preset--color--deep);
}

.has-deep-background-color .wp-block-button__link:hover,
.has-deep-background-color .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--deep);
}

/* Secondary (outline) button. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 1px;
	border-color: var(--wp--preset--color--action);
	color: var(--wp--preset--color--action);
	background-color: transparent;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--action);
	color: var(--wp--preset--color--base);
}

.has-deep-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	border-color: var(--wp--preset--color--deep-muted);
	color: var(--wp--preset--color--base);
}

/* Responsive embeds (Vimeo/YouTube/Maps) keep their aspect ratio. */
.wp-block-embed iframe,
.mcw-map iframe {
	width: 100%;
	border: 0;
	display: block;
	border-radius: 14px;
}

.mcw-map iframe {
	aspect-ratio: 16 / 7;
	min-height: 260px;
}

/* ------------------------------------------------------------ 10. Footer */

.mcw-footer a {
	color: var(--wp--preset--color--base);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mcw-footer a:hover,
.mcw-footer a:focus {
	color: var(--wp--preset--color--brand-light);
}

.mcw-footer .wp-block-heading {
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--lead);
}

/* Compliance copy: quieter than body text, but never below 4.5:1 on #17172a. */
.mcw-legal {
	font-size: var(--wp--preset--font-size--legal);
	line-height: 1.65;
	color: var(--wp--preset--color--deep-muted);
}

.mcw-legal a {
	color: var(--wp--preset--color--deep-muted);
}

.mcw-footer .wp-block-social-links .wp-social-link {
	background-color: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.22);
}

.mcw-footer .wp-block-social-links .wp-social-link:hover {
	background-color: var(--wp--preset--color--brand-light);
}

.mcw-footer .wp-block-social-links .wp-social-link a {
	color: var(--wp--preset--color--base);
}

/* Constant Contact's embedded signup form, restyled to match. */
.mcw-signup .ctct-form-wrapper,
.mcw-signup .ctct-form-embed {
	background: transparent !important;
	padding: 0 !important;
}

.mcw-signup input[type="text"],
.mcw-signup input[type="email"] {
	width: 100%;
	padding: 0.7rem 0.85rem;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background-color: rgba(255, 255, 255, 0.06);
	color: var(--wp--preset--color--base);
	border-radius: 8px;
}

/* -------------------------------------------------------- 11. Form fields */

/* Gravity Forms 3.0 ships the "orbital" theme, whose wrapper classes are
   .gform-theme--foundation / --framework / --orbital — NOT the older
   .gravity-theme. Styling the old class silently does nothing, and the form quietly
   keeps GF's default blue.

   Orbital exposes a documented CSS custom-property API, so drive it from our tokens
   rather than fighting its selectors. This survives GF updates; overriding its
   compiled selectors would not. */

.gform_wrapper.gform-theme,
.gform_wrapper.gform-theme--framework {
	/* type */
	--gf-ctrl-font-family: var(--wp--preset--font-family--text);
	--gf-ctrl-label-font-family: var(--wp--preset--font-family--text);
	--gf-ctrl-label-font-size: var(--wp--preset--font-size--small);
	--gf-ctrl-label-font-weight: 600;
	--gf-ctrl-label-color-primary: var(--wp--preset--color--ink);
	--gf-ctrl-label-color-secondary: var(--wp--preset--color--muted);
	--gf-ctrl-desc-font-size: var(--wp--preset--font-size--small);
	--gf-ctrl-desc-color: var(--wp--preset--color--muted);

	/* fields */
	--gf-ctrl-bg-color: var(--wp--preset--color--base);
	--gf-ctrl-color: var(--wp--preset--color--body);
	--gf-ctrl-border-color: var(--wp--preset--color--rule);
	--gf-ctrl-border-color-hover: var(--wp--preset--color--muted);
	--gf-ctrl-border-color-focus: var(--wp--preset--color--action);
	--gf-ctrl-radius: 8px;
	--gf-ctrl-size: var(--gf-ctrl-size-lg);

	/* buttons — the submit control is a <button>, and its colour comes from these
	   properties, not from any selector we could write */
	--gf-ctrl-btn-font-family: var(--wp--preset--font-family--text);
	--gf-ctrl-btn-font-weight: 700;
	--gf-ctrl-btn-radius: 999px;
	--gf-ctrl-btn-padding-x: 1.9rem;
	--gf-ctrl-btn-bg-color-primary: var(--wp--preset--color--action);
	--gf-ctrl-btn-bg-color-hover-primary: var(--wp--preset--color--action-hover);
	--gf-ctrl-btn-bg-color-focus-primary: var(--wp--preset--color--action-hover);
	--gf-ctrl-btn-border-color-primary: var(--wp--preset--color--action);
	--gf-ctrl-btn-border-color-hover-primary: var(--wp--preset--color--action-hover);
	--gf-ctrl-btn-border-color-focus-primary: var(--wp--preset--color--action-hover);
	--gf-ctrl-btn-color-primary: var(--wp--preset--color--base);
	--gf-ctrl-btn-color-hover-primary: var(--wp--preset--color--base);

	/* accents GF uses for focus rings, required marks and validation */
	--gf-color-primary: var(--wp--preset--color--action);
	--gf-local-color-primary: var(--wp--preset--color--action);
}

/* The required marker is the one place orange appears as small text; the token is
   the AA-safe variant, not the brand orange. */
.gform_wrapper .gfield_required {
	color: var(--wp--preset--color--accent-text);
}

/* Match the focus ring used everywhere else on the site. */
.gform_wrapper :where(input, select, textarea, button):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* GF positions the real radio/checkbox input absolutely, so any styled choice row
   must establish a containing block or the control lands off-screen. */
.gform_wrapper .gchoice {
	position: relative;
}

.gform_confirmation_message {
	background-color: var(--wp--preset--color--brand-wash);
	border-left: 3px solid var(--wp--preset--color--action);
	border-radius: 0 12px 12px 0;
	padding: var(--wp--preset--spacing--40);
}

.gform_confirmation_message > :first-child { margin-top: 0; }
.gform_confirmation_message > :last-child { margin-bottom: 0; }

/* The form sits inside the contact panel; drop GF's own outer spacing. */
.is-style-mcw-panel .gform_wrapper { margin: 0; }

/* --------------------------------------------------------- 12. Print/misc */

@media print {
	.mcw-headerbar,
	.mcw-topbar,
	.wp-block-navigation {
		display: none !important;
	}
}

/* Header row: logo left, nav + CTA right, on one line until the tablet break.
   The nav is the flexible element — it shrinks before anything wraps. */
.mcw-headerbar > .wp-block-group {
	flex-wrap: nowrap;
	gap: 1.5rem;
}

.mcw-headerbar > .wp-block-group > .wp-block-site-logo {
	flex: 0 0 auto;
}

.mcw-headerbar > .wp-block-group > .wp-block-group {
	flex: 1 1 auto;
	justify-content: flex-end;
	min-width: 0;
}

.mcw-headerbar .wp-block-navigation {
	flex-wrap: nowrap;
}

@media (max-width: 1100px) {
	.mcw-headerbar .wp-block-navigation:not(.is-responsive) {
		font-size: 0.875rem;
	}
	.mcw-headerbar > .wp-block-group {
		gap: 1rem;
	}
}

@media (max-width: 900px) {
	.mcw-headerbar .wp-block-buttons {
		display: none;
	}
}

/* WooCommerce injects a mini-cart and an account icon into the navigation block.
   The store is demo content and is being removed; until then, keep them out of
   the header. Delete this rule once WooCommerce is gone. */
.mcw-headerbar .wp-block-woocommerce-mini-cart,
.mcw-headerbar .wp-block-woocommerce-customer-account {
	display: none !important;
}

/* ------------------------------------------------- 13. Dark band inversion */

/* theme.json sets heading colour globally to ink, which wins over a group's
   textColor — so headings on a dark band render near-black on near-black.
   Invert everything that sits on the deep surface, and use the light brand
   green for links there (7.9:1 on #17172a; the darker action green is 2.8:1). */
.has-deep-background-color :is(h1, h2, h3, h4, h5, h6),
.has-deep-background-color .wp-block-heading,
.has-deep-background-color .wp-block-post-title,
.mcw-footer :is(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--base);
}

.has-deep-background-color a:where(:not(.wp-element-button):not(.wp-block-social-link-anchor)) {
	color: var(--wp--preset--color--brand-light);
	text-underline-offset: 3px;
}

.has-deep-background-color a:where(:not(.wp-element-button)):hover,
.has-deep-background-color a:where(:not(.wp-element-button)):focus {
	color: var(--wp--preset--color--base);
}

/* The eyebrow keeps the accent orange on dark — 7.2:1, and it is the only
   place the orange appears as text. */
.has-deep-background-color .is-style-mcw-eyebrow,
.mcw-footer .is-style-mcw-eyebrow {
	color: var(--wp--preset--color--accent);
}
