/*
 * MBA Medical: base styles.
 * Tokens come from theme.json (--wp--preset--*, --wp--custom--*). Nothing here repeats a raw color or size
 * that theme.json already defines, except the CTA state colors, which read from --wp--custom--button--*.
 */

/* Font rendering. Figma draws text with grayscale anti-aliasing. macOS browsers default to a heavier "auto" smoothing,
   which makes light text on dark bands (the footer, the Slate and Ink sections) look bolder than the comp even though
   the computed weight is 400. Grayscale smoothing matches the design on macOS and changes nothing on Windows or Linux. */
html {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Text wrapping. The design says "no single-word widows". `pretty` avoids a lone last word without re-flowing lines
   the way `balance` does: the comps break headings at natural points (for example "We're more than a / billing service"),
   so balancing would move words that Figma does not. Progressive enhancement; older browsers wrap normally. */
:where(h1, h2, h3, h4, h5, h6, p, li, figcaption) { text-wrap: pretty; }

/* Each font-size preset carries its Figma line height. Choosing a size in the editor changes both together, so a
   heading set to "Card title" gets 28/36, not the 52 px line height of the plain H3 style. */
.has-small-font-size { line-height: var(--wp--custom--line-height--small); }
.has-nav-font-size { line-height: var(--wp--custom--line-height--nav); }
.has-body-sm-font-size { line-height: var(--wp--custom--line-height--body-sm); }
.has-body-font-size { line-height: var(--wp--custom--line-height--body); }
.has-lead-font-size { line-height: var(--wp--custom--line-height--lead); }
.has-card-font-size { line-height: var(--wp--custom--line-height--card); }
.has-heading-3-font-size { line-height: var(--wp--custom--line-height--heading-3); }
.has-heading-2-font-size { line-height: var(--wp--custom--line-height--heading-2); }
.has-heading-1-font-size { line-height: var(--wp--custom--line-height--heading-1); }
.has-heading-1-home-font-size { line-height: var(--wp--custom--line-height--heading-1-home); }

/* Heading accent: the "selected bold-italic ending". Editors select words, then apply Bold and Italic.
   Slate on light backgrounds, peach on dark backgrounds. The rest of the heading stays regular. */
:is(h1, h2, h3, h4, h5, h6) :is(strong, b) :is(em, i),
:is(h1, h2, h3, h4, h5, h6) :is(em, i) :is(strong, b) {
	color: var(--wp--preset--color--slate);
	font-weight: 700;
	font-style: italic;
}
:is(.has-ink-background-color, .has-slate-background-color, .mba-dark) :is(h1, h2, h3, h4, h5, h6) :is(strong, b) :is(em, i),
:is(.has-ink-background-color, .has-slate-background-color, .mba-dark) :is(h1, h2, h3, h4, h5, h6) :is(em, i) :is(strong, b) {
	color: var(--wp--preset--color--peach);
}

/* Keyboard focus: 2px Slate ring, 3px offset on light surfaces; white ring on dark surfaces. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--slate);
	outline-offset: 3px;
}
:is(.has-ink-background-color, .has-slate-background-color, .mba-dark) :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline-color: var(--wp--preset--color--white);
}

/* Visually hidden text that stays available to screen readers. */
.mba-sr-only {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* ------------------------------------------------------------------ */
/* Buttons ("MBA / CTA" family)                                        */
/* 52px high, radius 10, Inter Medium 16/24. Primary and Inverse 260   */
/* wide, the rest 216. Labels may grow; they never wrap or truncate.   */
/* Color changes only, over 150ms ease-out. No resize between states.  */
/* ------------------------------------------------------------------ */
.wp-block-button .wp-block-button__link {
	align-items: center;
	background-color: var(--wp--custom--button--primary--bg);
	border: 0;
	border-radius: var(--wp--custom--radius--md);
	box-sizing: border-box;
	color: var(--wp--custom--button--primary--label);
	display: inline-flex;
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--nav);
	font-weight: 500;
	justify-content: center;
	line-height: var(--wp--custom--line-height--nav);
	min-height: 52px;
	min-width: 260px;
	padding: 14px 16px;
	text-align: center;
	text-decoration: none;
	transition: background-color var(--wp--custom--motion--fast), color var(--wp--custom--motion--fast), border-color var(--wp--custom--motion--fast);
	white-space: nowrap;
}
.wp-block-button .wp-block-button__link:hover { background-color: var(--wp--custom--button--primary--bg-hover); color: var(--wp--custom--button--primary--label); }
.wp-block-button .wp-block-button__link:active { background-color: var(--wp--custom--button--primary--bg-pressed); }

/* Secondary Warm */
.wp-block-button.is-style-secondary-warm .wp-block-button__link {
	background-color: var(--wp--custom--button--secondary--bg);
	color: var(--wp--custom--button--secondary--label);
	min-width: 216px;
}
.wp-block-button.is-style-secondary-warm .wp-block-button__link:hover { background-color: var(--wp--custom--button--secondary--bg-hover); color: var(--wp--custom--button--secondary--label); }
.wp-block-button.is-style-secondary-warm .wp-block-button__link:active { background-color: var(--wp--custom--button--secondary--bg-pressed); }

/* Inverse Peach, for dark bands */
.wp-block-button.is-style-inverse-peach .wp-block-button__link {
	background-color: var(--wp--custom--button--inverse--bg);
	color: var(--wp--custom--button--inverse--label);
}
.wp-block-button.is-style-inverse-peach .wp-block-button__link:hover { background-color: var(--wp--custom--button--inverse--bg-hover); color: var(--wp--custom--button--inverse--label); }
.wp-block-button.is-style-inverse-peach .wp-block-button__link:active { background-color: var(--wp--custom--button--inverse--bg-pressed); }

/* Outline */
.wp-block-button.is-style-outline .wp-block-button__link {
	background-color: transparent;
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--ink); /* inside stroke, as in Figma; keeps the height at 52 */
	color: var(--wp--custom--button--outline--label);
	min-width: 216px;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background-color: var(--wp--custom--button--outline--bg-hover); color: var(--wp--custom--button--outline--label); }
.wp-block-button.is-style-outline .wp-block-button__link:active { background-color: var(--wp--custom--button--outline--bg-pressed); }

/* Inline Link: text only, no arrow, left aligned, 216 x 52 reserved area. Underline on hover, press, and focus. */
.wp-block-button.is-style-inline-link .wp-block-button__link {
	background-color: transparent;
	border-radius: var(--wp--custom--radius--md);
	color: var(--wp--preset--color--ink);
	justify-content: flex-start;
	min-width: 216px;
	padding-inline: 0;
}
.wp-block-button.is-style-inline-link .wp-block-button__link:hover,
.wp-block-button.is-style-inline-link .wp-block-button__link:focus-visible {
	background-color: transparent;
	color: var(--wp--custom--button--link-hover);
	text-decoration: underline;
	text-underline-offset: 6px;
}
.wp-block-button.is-style-inline-link .wp-block-button__link:active {
	background-color: transparent;
	color: var(--wp--custom--button--link-pressed);
	text-decoration: underline;
	text-underline-offset: 6px;
}

/* Bill Pay: compact navigation utility. 108 x 52, radius 8, 20px icon, 8px gap, Inter Semi Bold. */
.wp-block-button.is-style-bill-pay .wp-block-button__link {
	background-color: var(--wp--custom--button--utility--bg);
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wp--custom--button--utility--label);
	font-weight: 600;
	gap: 8px;
	min-width: 108px;
	padding: 14px 12px;
}
.wp-block-button.is-style-bill-pay .wp-block-button__link::before {
	background-color: currentcolor;
	content: "";
	flex: none;
	height: 20px;
	-webkit-mask: url("../img/icon-bill-pay.svg") center / contain no-repeat;
	mask: url("../img/icon-bill-pay.svg") center / contain no-repeat;
	width: 20px;
}
.wp-block-button.is-style-bill-pay .wp-block-button__link:hover { background-color: var(--wp--custom--button--utility--bg-hover); color: var(--wp--custom--button--utility--label); }
.wp-block-button.is-style-bill-pay .wp-block-button__link:active { background-color: var(--wp--custom--button--utility--bg-pressed); }

/* Disabled: no activation, no hover change. Native disabled on buttons; aria-disabled on links. */
.wp-block-button .wp-block-button__link:is([disabled], [aria-disabled="true"]) {
	background-color: var(--wp--preset--color--disabled-bg);
	box-shadow: none;
	color: var(--wp--preset--color--disabled-text);
	cursor: not-allowed;
	pointer-events: none;
}
.wp-block-button.is-style-outline .wp-block-button__link:is([disabled], [aria-disabled="true"]) { box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--disabled-text); }
.wp-block-button.is-style-inline-link .wp-block-button__link:is([disabled], [aria-disabled="true"]) { background-color: transparent; }
.is-style-inverse-peach .wp-block-button__link:is([disabled], [aria-disabled="true"]) {
	background-color: var(--wp--custom--button--inverse-disabled-bg);
	color: var(--wp--custom--button--inverse-disabled-label);
}

/* Narrow widths: stack CTA groups with 16px spacing, let buttons fill the column, keep 52px height (44px minimum target). */
@media (max-width: 599px) {
	.wp-block-buttons { flex-direction: column; gap: 16px; }
	.wp-block-buttons > .wp-block-button { width: 100%; }
	.wp-block-buttons > .wp-block-button .wp-block-button__link { min-width: 0; width: 100%; }
	.wp-block-buttons > .wp-block-button.is-style-inline-link .wp-block-button__link { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition-duration: 0.01ms !important; }
}
