/*
Theme Name: Improving Lives
Theme URI: https://charisgrants.com/
Author: Charis
Author URI: https://charisgrants.com/
Description: Block theme for the Charis "Improving Lives" redesign of charisgrants.com. Design tokens per docs/02-design-system.md (T010), self-hosted fonts (T011), core/button block styles (T013).
Requires at least: 6.9
Requires PHP: 7.4
Version: 0.5.12
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: charis-improving-lives
Tags: block-theme, full-site-editing, one-column
*/

/*
 * Design system (source of truth: docs/02-design-system.md →
 * theme.json → CSS variables).
 * SC-004: no bare hex colors in this file — every color resolves through
 * --wp--preset--color--* / --charis-* tokens. Hex values live only in the
 * theme.json palette and settings.custom, i.e. in the token definitions.
 *
 * Fonts (T011): "Neue Haas Grotesk Display Pro" is self-hosted from
 * assets/fonts/nhg-display-{45-light,55-roman,65-medium,75-bold}.woff2 and
 * declared in theme.json settings.typography.fontFamilies (slug
 * `charis-display`, weights 300/400/600/700, font-display: swap), which WP
 * core emits on the frontend and in the editor. Weight mapping follows the
 * spec: 45 Light = 300 (body), 65 Medium = 600 (headings/controls).
 * Self-hosted Inter (slug `charis-inter`) stays only as the glyph fallback
 * in the display stack (e.g. U+2192, which NHG lacks). Source files are
 * licensed from Monotype (OQ-3) — keep the licence with the project.
 *
 * Requires WP 6.9+: border.radiusSizes presets (6.9) and block style
 * variations in theme.json styles.blocks (6.6).
 */

/*
 * --charis-* mirrors of theme.json settings.custom (02 §6). WP emits the
 * custom namespace as --wp--custom--<a>--<b>; these aliases restore the
 * spec's bare --charis-* names for consumers (header line, focus, buttons).
 */
:root {
	--charis-line-top: var(--wp--custom--charis--line-top);
	--charis-line-orange: var(--wp--custom--charis--line-orange);
	--charis-font-display: var(--wp--custom--charis--font-display);

	/* Single source of truth for corner radii. Figma: card/panel L = 32px
	 * Desktop, 24px Mobile (Mobile / Home category mask 366x104 = 24px, Desktop
	 * mask 234x256 = 32px); M = 24px on both. Tablets use the Mobile grid. */
	--charis-radius-l: 32px;
	--charis-radius-m: 24px;
	--charis-hover-duration: var(--wp--custom--charis--hover-duration);
	--charis-hover-easing: var(--wp--custom--charis--hover-easing);
	--charis-icon-hover-duration: var(--wp--custom--charis--icon-hover-duration);
	--charis-icon-hover-easing: var(--wp--custom--charis--icon-hover-easing);
	--charis-focus-ring: var(--wp--custom--charis--focus-ring);
	--charis-content-width: var(--wp--custom--charis--content-width);
	--charis-section-pad-y: var(--wp--custom--charis--section-pad-y);
	--charis-section-pad-y-mobile: var(--wp--custom--charis--section-pad-y-mobile);
}

/* ---- Site frame (D-13 / T025) --------------------------------------------
 * The 4px tangerine line is the brand connector above every page (02 §6
 * --charis-line-top). The margin reset keeps it flush with the viewport;
 * the header part itself carries the white bar below it. */

html {
	scroll-padding-top: 108px;
}

body {
	margin: 0;

	/* Figma rasterises text with greyscale anti-aliasing. On macOS this matches
	 * it (measured: footer slice 0.35% -> 0.01% mismatch). */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@media (max-width: 767px) {

	html {
		scroll-padding-top: 92px;
	}
}

/* ---- Links (02 §2/§3: brand-red, hover brand-red-hover) ------------------ */

/* Reusable Charis blocks own the colour of their links; keep this fallback for
 * prose/header/footer links only, otherwise a page-level `a:hover` outranks
 * the component styles and paints e.g. a CTA label in its own background. */
a:where(:not(.wp-block-button__link, .wp-element-button, [class*="wp-block-charis-"])):hover {
	color: var(--wp--preset--color--brand-red-hover);
}

/* ---- Focus (02 §6: единый --charis-focus-ring) -------------------------- */

a:focus-visible,
button:focus-visible,
.wp-block-button__link:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
	outline: none;
	box-shadow: var(--charis-focus-ring);
}

/* ---- T013: core/button (D-02, 03-blocks §18) ----------------------------
 * Colors, radius (r-8), padding and type come from theme.json
 * styles.blocks.core/button, incl. the shipped cta / secondary variations.
 * This file adds what theme.json cannot
 * express: flex label layout, the ::after SVG arrow (mask => currentColor,
 * so the arrow colour is always the button's token colour), hover states
 * (02 §6 --charis-hover-duration = 300ms, SC-016) and the +4px arrow
 * shift (spacing 10 = 4px).
 */

/* (0,2,0) on purpose: must outrank core's `.wp-block-button__link {
 * display: inline-block }` no matter whether the core block stylesheet
 * prints before or after the theme stylesheet. */
.wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--20); /* 8px — icon ↔ label (02 §4) */
	box-sizing: border-box;
	min-height: 56px; /* Figma Button: 56px tall, padding 16/24 */
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
	letter-spacing: var(--wp--custom--charis--ls-control);
	text-decoration: none;
	transition:
		background-color var(--charis-hover-duration) var(--charis-hover-easing),
		color var(--charis-hover-duration) var(--charis-hover-easing),
		border-color var(--charis-hover-duration) var(--charis-hover-easing);
}

/* SVG arrow (§18): shape via mask, painted with currentColor — no hex. */
.wp-block-button:not(.is-style-secondary, .is-style-line) .wp-block-button__link::after {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background-color: currentcolor;
	-webkit-mask: url(assets/icons/arrow.svg) center / contain no-repeat;
	mask: url(assets/icons/arrow.svg) center / contain no-repeat;
}

/* Figma Button / Icon-Arrow hover: Arrow 1 slides out to the right while
 * Arrow 2 slides in from the left (smart animate, 500ms ease-out). */
@keyframes charis-arrow-swap {

	0% {
		transform: translateX(0);
		opacity: 1;
	}

	45% {
		transform: translateX(100%);
		opacity: 0;
	}

	55% {
		transform: translateX(-100%);
		opacity: 0;
	}

	100% {
		transform: translateX(0);
		opacity: 1;
	}
}

.wp-block-button:not(.is-style-secondary, .is-style-line) .wp-block-button__link:hover::after {
	animation: charis-arrow-swap var(--charis-icon-hover-duration) var(--charis-icon-hover-easing);
}

@media (prefers-reduced-motion: reduce) {

	.wp-block-button .wp-block-button__link:hover::after {
		animation: none;
	}
}

/* Base button (no style picked) = indigo primary; hover brand-indigo-hover.
 * Declared before the variants so equal-specificity variant rules win. */
.wp-block-button .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--brand-indigo-hover);
}

/* cta — big red (§18). Declared here, not only as a theme.json variation:
 * WordPress prints variation CSS only for core/button blocks it sees in the
 * content, and the shared PHP/React button (charis/*) renders outside that. */
.wp-block-button.is-style-cta .wp-block-button__link {
	background-color: var(--wp--preset--color--brand-red);
	color: var(--wp--preset--color--bg-white);
}

/* cta — big red (§18): hover brand-red-hover. */
.wp-block-button.is-style-cta .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--brand-red-hover);
}

/* Component library "Buttons" (Figma): four types, each with default, hover
 * and disabled states.
 *   CTA       red fill, arrow            (is-style-cta)
 *   Primary   indigo fill, arrow         (default)
 *   Secondary red outline, no arrow      (is-style-secondary)
 *   Line      indigo outline, no arrow   (is-style-line)
 *   Link      red text link with arrow   (is-style-link)
 * Outline types fill with a faint tint of their own colour on hover. */
.wp-block-button.is-style-secondary .wp-block-button__link {
	border: 1.5px solid var(--wp--preset--color--brand-red);
	background-color: transparent;
	color: var(--wp--preset--color--brand-red);
}

/* Outline buttons: the stroke sits inside the 56px box (padding − 1.5px). */
.wp-block-button:is(.is-style-secondary, .is-style-line) .wp-block-button__link {
	padding: calc(var(--wp--preset--spacing--40) - 1.5px) calc(var(--wp--preset--spacing--60) - 1.5px);
}

/* Layout helper for blocks: full-width button on phones/tablets
 * (`class` argument of Button::render / CharisButton). */
@media (max-width: 1023px) {

	.wp-block-button.charis-button--stretch,
	.wp-block-button.charis-button--stretch .wp-block-button__link {
		display: flex;
		width: 100%;
	}
}

/* Control/S label on phones (Figma M frames). */
@media (max-width: 767px) {

	.wp-block-button .wp-block-button__link {
		font-size: var(--wp--preset--font-size--fs-control-s);
	}
}

/* Figma Secondary hover: light-peach 30% fill, border + label red-hover. */
.wp-block-button.is-style-secondary .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--brand-red-hover);
	background-color: var(--wp--custom--charis--tint-peach-30);
	color: var(--wp--preset--color--brand-red-hover);
}

.wp-block-button.is-style-line .wp-block-button__link {
	border: 1.5px solid var(--wp--preset--color--brand-indigo);
	background-color: transparent;
	color: var(--wp--preset--color--brand-indigo);
}

/* Figma Line hover: light-blue 40% fill, border + label indigo-hover. */
.wp-block-button.is-style-line .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--brand-indigo-hover);
	background-color: var(--wp--custom--charis--tint-blue-40);
	color: var(--wp--preset--color--brand-indigo-hover);
}

/* Figma "Text Link / Color=CTA": red Control/S 16/24 label, underline, arrow
 * 4px after the label; no box. Same arrow and hover swap as the buttons. */
.wp-block-button.is-style-link {
	display: flex;
	line-height: 24px;
}

.wp-block-button.is-style-link .wp-block-button__link {
	gap: var(--wp--preset--spacing--10);
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	color: var(--wp--preset--color--brand-red);
	font-size: var(--wp--preset--font-size--fs-control-s);
	line-height: 24px;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.wp-block-button.is-style-link .wp-block-button__link:hover {
	background-color: transparent;
	color: var(--wp--preset--color--brand-red-hover);
}

@media (max-width: 767px) {

	.wp-block-button.is-style-link .wp-block-button__link {
		font-size: var(--wp--preset--font-size--fs-control-s);
	}
}

/* Buttons on dark backgrounds (cover): Figma "Mode=Dark bg". */
:is(.wp-block-cover, .wp-block-charis-calculator-banner.is-style-inverted) .wp-block-button .wp-block-button__link {
	background-color: var(--wp--preset--color--bg-white);
	color: var(--wp--preset--color--brand-indigo);
}

:is(.wp-block-cover, .wp-block-charis-calculator-banner.is-style-inverted) .wp-block-button .wp-block-button__link:hover {
	background-color: color-mix(in srgb, var(--wp--preset--color--bg-lightblue) 30%, var(--wp--preset--color--bg-white));
	color: var(--wp--preset--color--brand-indigo-hover);
}

:is(.wp-block-cover, .wp-block-charis-calculator-banner.is-style-inverted) .wp-block-button.is-style-cta .wp-block-button__link {
	color: var(--wp--preset--color--brand-red);
}

:is(.wp-block-cover, .wp-block-charis-calculator-banner.is-style-inverted) .wp-block-button.is-style-cta .wp-block-button__link:hover {
	background-color: color-mix(in srgb, var(--wp--preset--color--bg-lightpeach) 30%, var(--wp--preset--color--bg-white));
	color: var(--wp--preset--color--brand-red-hover);
}

:is(.wp-block-cover, .wp-block-charis-calculator-banner.is-style-inverted) .wp-block-button:is(.is-style-secondary, .is-style-line) .wp-block-button__link {
	border-color: var(--wp--preset--color--bg-white);
	background-color: transparent;
	color: var(--wp--preset--color--bg-white);
}

:is(.wp-block-cover, .wp-block-charis-calculator-banner.is-style-inverted) .wp-block-button:is(.is-style-secondary, .is-style-line) .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--bg-grey);
	background-color: var(--wp--custom--charis--tint-grey-30);
	color: var(--wp--preset--color--bg-grey);
}

/* Disabled: same shape, faded and inert. */
.wp-block-button .wp-block-button__link:is([aria-disabled="true"], :disabled) {
	opacity: 0.6; /* Figma Button State=Disabled: opacity 60% */
	pointer-events: none;
	cursor: not-allowed;
}

/* ---- T026: core blocks (03 §4) -------------------------------------------
 * Declarative styling (type scale, colours, gaps, radii) lives in theme.json
 * styles.elements / styles.blocks. This section covers what theme.json cannot
 * express: ::marker/::before ornaments, contextual colour flips inside the
 * dark group/cover variations, responsive table scrolling and media ratios.
 * SC-004: every colour resolves through --wp--preset--color--* / --charis-*.
 */

/* Context tokens for nested group variations: the innermost variation wins,
 * so the light-peach group restores indigo headings and red links when nested
 * inside a dark cover. Defaults: normal light layout. */
:root {
	--charis-context-heading: var(--wp--preset--color--brand-indigo);
	--charis-context-link: var(--wp--preset--color--brand-red);
	--charis-context-link-hover: var(--wp--preset--color--brand-red-hover);
	--charis-context-marker: var(--wp--preset--color--brand-indigo);
}

/* The remaining light group variation resets the context when nested inside
 * a dark cover/section. */
.wp-block-group.is-style-on-lightpeach {
	--charis-context-heading: var(--wp--preset--color--brand-indigo);
	--charis-context-link: var(--wp--preset--color--brand-red);
	--charis-context-link-hover: var(--wp--preset--color--brand-red-hover);
	--charis-context-marker: var(--wp--preset--color--brand-indigo);
}

.wp-block-cover {
	--charis-context-heading: var(--wp--preset--color--bg-white);
	--charis-context-link: var(--wp--preset--color--bg-white);
	--charis-context-link-hover: var(--wp--preset--color--brand-lavender);
	--charis-context-marker: var(--wp--preset--color--bg-white);
}

/* Dark contexts flip headings and links to the light tokens; ordinary
 * light sections keep the global brand-indigo/red pair. */
.wp-block-cover :is(h1, h2, h3, h4, h5, h6, .wp-block-heading) {
	color: var(--charis-context-heading);
}

.wp-block-cover a:not(.wp-block-button__link):not(.wp-element-button):not(.wp-block-social-link-anchor) {
	color: var(--charis-context-link);
}

.wp-block-cover a:not(.wp-block-button__link):not(.wp-element-button):not(.wp-block-social-link-anchor):hover {
	color: var(--charis-context-link-hover);
}

/* Lists: brand-indigo markers (::marker cannot be set from theme.json). */
.wp-block-list {
	padding-left: var(--wp--preset--spacing--60);
}

.wp-block-list li::marker {
	color: var(--charis-context-marker);
	font-weight: 600;
}

.wp-block-list li + li {
	margin-top: var(--wp--preset--spacing--20);
}

/* Quote / Pullquote: 4px brand-tangerine rule + hand-written “Quote” ornament
 * (SVG via mask, painted with the token colour — SC-004). */
.wp-block-quote,
.wp-block-pullquote {
	border: 0;
	border-left: 4px solid var(--wp--preset--color--brand-tangerine);
	padding-left: var(--wp--preset--spacing--60);
	margin-block: var(--wp--preset--spacing--70);
}

.wp-block-quote::before,
.wp-block-pullquote::before {
	content: "";
	display: block;
	width: 48px;
	height: 32px;
	margin-bottom: var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--brand-tangerine);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 32'%3E%3Cpath d='M2 30c0-13 6-24 18-29l3.2 5.6C14.5 11.6 11 18.1 11 24h10v8H2Zm26 0c0-13 6-24 18-29l3.2 5.6C40.5 11.6 37 18.1 37 24h10v8H28Z' fill='black'/%3E%3C/svg%3E") left top / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 32'%3E%3Cpath d='M2 30c0-13 6-24 18-29l3.2 5.6C14.5 11.6 11 18.1 11 24h10v8H2Zm26 0c0-13 6-24 18-29l3.2 5.6C40.5 11.6 37 18.1 37 24h10v8H28Z' fill='black'/%3E%3C/svg%3E") left top / contain no-repeat;
}

/* Quote text is an inner core/paragraph — keep Body/L here so the global
 * paragraph default (Body/M) does not win inside the quote. */
.wp-block-quote p,
.wp-block-pullquote p {
	font-size: var(--wp--preset--font-size--fs-body-l);
	font-weight: 300;
	line-height: 32px;
}

.wp-block-quote cite,
.wp-block-pullquote cite {
	display: block;
	margin-top: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--text-placeholder);
	font-size: var(--wp--preset--font-size--fs-body-s);
	font-style: normal;
	font-weight: 300;
	line-height: 24px;
}

/* Captions (fills 03 §4): Body/S + text-placeholder; keeps the theme.json
 * caption element and core's caption defaults from colliding. */
.wp-block-image figcaption,
.wp-block-gallery figcaption,
.wp-block-media-text figcaption,
.wp-block-table figcaption,
.wp-block-embed figcaption,
.wp-block-video figcaption {
	color: var(--wp--preset--color--text-placeholder);
	font-size: var(--wp--preset--font-size--fs-body-s);
	font-weight: 300;
	line-height: 24px;
}

/* Image / Gallery / Media & Text: default radius; core/image radius preset
 * itself is declared in theme.json (its border selector targets the img). */
.wp-block-gallery img {
	border-radius: var(--charis-radius-m, 24px);
}

.wp-block-media-text__media img,
.wp-block-media-text__media video {
	border-radius: var(--charis-radius-l, 32px);
}

/* Cover: brand overlay gradient built from bg-white/brand-indigo alpha.
 * Applied only to the untouched default overlay — an editor-set overlay colour
 * (inline/class background-color) or gradient wins, and the editor dim ratio
 * keeps controlling the opacity. @supports keeps core's fallback overlay in
 * browsers without color-mix(). */
@supports (background-color: color-mix(in srgb, currentcolor 50%, transparent)) {

	.wp-block-cover > .wp-block-cover__background:not([class*="-background-color"]):not([style*="background-color"]):not([style*="gradient"]) {
		background-color: var(--wp--preset--color--brand-indigo);
		background-image: linear-gradient(180deg, color-mix(in srgb, var(--wp--preset--color--bg-white) 8%, transparent) 0%, color-mix(in srgb, var(--wp--preset--color--brand-indigo) 70%, transparent) 100%);
	}
}

/* Separator: line (1px ui-border) and sketch (hand-drawn tangerine line). */
.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--ui-border);
	margin-block: var(--wp--preset--spacing--90);
	opacity: 1;
}

/* Core's 100px default is too short for a brand divider; the native
 * Wide/Dots styles keep their own width. */
.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
	width: 100%;
}

/* Table: Control/M indigo header, ui-border grid, bg-grey-light zebra.
 * The native “Stripes” style keeps its own striping. */
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
}

.wp-block-table thead {
	border-bottom: 1px solid var(--wp--preset--color--ui-border);
}

.wp-block-table tfoot {
	border-top: 1px solid var(--wp--preset--color--ui-border);
}

.wp-block-table th,
.wp-block-table td {
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--ui-border);
	text-align: left;
	vertical-align: top;
}

.wp-block-table th {
	color: var(--wp--preset--color--brand-indigo);
	font-size: var(--wp--preset--font-size--fs-control-m);
	font-weight: 600;
	line-height: 24px;
}

.wp-block-table:not(.is-style-stripes) tbody tr:nth-child(even) td {
	background-color: var(--wp--preset--color--bg-grey-light);
}

@media (max-width: 767px) {

	.wp-block-table {
		overflow-x: auto;
	}

	.wp-block-table table {
		min-width: 640px;
	}
}

/* Details: bg-grey + padding come from theme.json, radius r-8 via CSS
 * (the block has no radius support, so theme.json cannot set it). */
.wp-block-details {
	border-radius: var(--wp--preset--border-radius--r-8);
}

.wp-block-details summary {
	font-size: var(--wp--preset--font-size--fs-control-m);
	font-weight: 600;
	line-height: 24px;
	cursor: pointer;
}

.wp-block-details[open] summary {
	margin-bottom: var(--wp--preset--spacing--40);
}

/* File: filename link with a PDF glyph + indigo button-link (Body/S). */
.wp-block-file {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--fs-body-s);
	line-height: 24px;
}

.wp-block-file > a:first-of-type {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--brand-purple);
	font-weight: 600;
	text-decoration: none;
	transition: color var(--charis-hover-duration) var(--charis-hover-easing);
}

/* Figma Link / Download hover: label red-hover. */
.wp-block-file > a:first-of-type:hover {
	color: var(--wp--preset--color--brand-red-hover);
}

.wp-block-file > a:first-of-type[href$=".pdf"]::before {
	content: "";
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	background-color: currentcolor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 1.75h6.5L16.25 6.5v11.75H5z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M11.5 1.75V6.5h4.75M7.5 11.5h5M7.5 14h3.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 1.75h6.5L16.25 6.5v11.75H5z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M11.5 1.75V6.5h4.75M7.5 11.5h5M7.5 14h3.5' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wp-block-file .wp-block-file__button {
	display: inline-flex;
	align-items: center;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--60);
	border-radius: var(--wp--preset--border-radius--r-8);
	background-color: var(--wp--preset--color--brand-indigo);
	color: var(--wp--preset--color--bg-white);
	font-size: var(--wp--preset--font-size--fs-body-s);
	font-weight: 600;
	line-height: 24px;
	text-decoration: none;
	transition: background-color var(--charis-hover-duration) var(--charis-hover-easing);
}

.wp-block-file .wp-block-file__button:hover {
	background-color: var(--wp--preset--color--brand-indigo-hover);
	color: var(--wp--preset--color--bg-white);
	opacity: 1;
}

/* Embeds / Video: 16:9, no third-party scripts added by the theme; core
 * already emits loading="lazy" for iframes. */
.wp-block-embed.is-type-video .wp-block-embed__wrapper {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--charis-radius-m, 24px);
}

.wp-block-embed.is-type-video .wp-block-embed__wrapper iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.wp-block-video video {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--charis-radius-m, 24px);
	background-color: var(--wp--preset--color--bg-grey);
}

/* Code / Preformatted / Verse: mono + bg-grey come from theme.json; keep
 * long lines inside the block and drop core/code's default gray frame. */
.wp-block-code,
.wp-block-preformatted,
.wp-block-verse {
	overflow-x: auto;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	border: 0;
	border-radius: var(--wp--preset--border-radius--r-8);
}

/* Social Icons: LinkedIn only is a brand rule, but the inserter cannot be
 * filtered without editor JS — styles cover the brand-indigo treatment for
 * now: filled styles become indigo pills with a white glyph, the native
 * “Logos only” style keeps an indigo glyph. */
.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-linkedin {
	background-color: var(--wp--preset--color--brand-indigo);
	color: var(--wp--preset--color--bg-white);
}

.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-linkedin:hover {
	background-color: var(--wp--preset--color--brand-indigo-hover);
}

.wp-block-social-links.is-style-logos-only .wp-social-link-linkedin {
	color: var(--wp--preset--color--brand-indigo);
}

.wp-block-social-links.is-style-logos-only .wp-social-link-linkedin:hover {
	color: var(--wp--preset--color--brand-indigo-800);
}

/* Dark cover: the logo-only LinkedIn glyph needs a light token. */
.wp-block-cover .wp-block-social-links.is-style-logos-only .wp-social-link-linkedin {
	color: var(--wp--preset--color--bg-white);
}

.wp-block-cover .wp-block-social-links.is-style-logos-only .wp-social-link-linkedin:hover {
	color: var(--wp--preset--color--brand-periwinkle);
}

/* ---- Typography preset utilities ----------------------------------------
 * WP emits .has-<slug>-font-size classes from theme.json fontSizes with the
 * font-size only, so an explicit Body/L preset inherits the global 24px body
 * line-height. 02 §3 pairs Body/L (24px) with 32px. Global and low
 * specificity on purpose: ordinary body copy carries no preset class, and
 * quote/card rules that set their own line-height win on specificity. */

.has-fs-body-l-font-size {
	line-height: 32px;
}

/* ---- T025: D/M header, footer and mobile drawer --------------------------
 * Layout for parts/header.html and parts/footer.html. Colours resolve through
 * --wp--preset--color--* / --charis-* (SC-004); every interactive element has
 * a >=44px touch target. Breakpoints: 320-767 / 768-1023 / 1024+ (05).
 */

/* theme.json gives core/group a 32px flow gap, which would add vertical
 * margins to children of these flex/grid containers (and break the header
 * row). Spacing below is explicit, so neutralise those margins here. */
.wp-block-group.charis-header > *,
.wp-block-group.charis-header__inner > *,
.wp-block-group.charis-nav > *,
.wp-block-group.charis-menu-drawer > *,
.wp-block-group.charis-menu-drawer__panel > *,
.wp-block-group.charis-menu-drawer__head > *,
.wp-block-group.charis-menu-drawer__nav > *,
.wp-block-group.charis-menu-drawer__foot > *,
.wp-block-group.charis-footer > *,
.wp-block-group.charis-footer__inner > *,
.wp-block-group.charis-footer__top > *,
.wp-block-group.charis-footer__nav > *,
.wp-block-group.charis-footer__bottom > *,
.wp-block-group.charis-footer__legal > * {
	margin-block: 0;
}

/* Template-part wrapper: the shared footer is flush with the page shell. */
.charis-footer-part {
	margin-block-start: 0;
}

/* Header (Figma D / Header + M / Header): 108px desktop, 92px on tablet and
 * mobile, 4px tangerine line painted as an inset shadow. The template-part
 * wrapper only reserves that height in the flow; the bar itself is out of
 * flow (absolute at the top of the page) so the back-scroll behaviour never
 * shifts the layout:
 *   - top of the page: grey bar with the full 228x122 (135x72 on mobile)
 *     two-line logo, scrolls away together with the page;
 *   - scrolling down past the bar: .is-fixed + .is-hidden (slid out);
 *   - scrolling back up: .is-hidden is removed, the white "stuck" bar with
 *     the smaller logo slides in (76px on mobile = 92px minus the 16px
 *     bottom margin, Figma "Mobile / Menu - back scroll"; 108px desktop).
 * State classes are set by assets/js/header.js; without JS the bar simply
 * stays at the top of the page. */
.wp-block-template-part:has(> .charis-header) {
	--charis-header-h: 108px;
	--charis-header-stuck-h: 108px;
	--charis-header-reach: 108px; /* inner pages: bar only; home overrides (logo bottom y150) */
	--charis-header-pad: 40px;

	position: relative;
	z-index: 900;
	height: var(--charis-header-h);
	margin-block: 0;
}

@media (min-width: 1024px) {

	body.home .wp-block-template-part:has(> .charis-header) {
		--charis-header-reach: 150px; /* bottom of the 122px logo (y 28 + 122) */
	}
}

/* Figma M / Header: 390x76 on every inner page (Find support, Scheme detail,
 * About, Benefit calculator); only Mobile / Home has the 92px bar (page
 * "Main", 135x72 logo). The back-scroll bar is 76px everywhere. */
@media (max-width: 1023px) {

	.wp-block-template-part:has(> .charis-header) {
		--charis-header-h: 76px;
		--charis-header-stuck-h: 76px;
		--charis-header-reach: 76px;
	}

	body.home .wp-block-template-part:has(> .charis-header) {
		--charis-header-h: 92px;
		--charis-header-reach: 92px;
	}
}

@media (max-width: 1023px) {

	.wp-block-template-part:has(> .charis-header) {
		--charis-header-pad: 12px;
	}
}

.wp-block-group.charis-header {
	position: absolute;
	inset: 0 0 auto;
	z-index: 900;
	width: 100%;
	height: var(--charis-header-h);
	margin: 0;
	padding: 0;
	background-color: var(--wp--preset--color--bg-grey);
	box-shadow: inset 0 4px 0 var(--wp--preset--color--brand-tangerine);
	transition:
		background-color var(--charis-hover-duration) var(--charis-hover-easing),
		height var(--charis-hover-duration) var(--charis-hover-easing),
		transform var(--charis-hover-duration) var(--charis-hover-easing);
}

/* The fixed drawer lives inside the header, and a transform would turn the
 * header into its containing block: the slide-out transform is therefore only
 * ever set while the drawer is closed (header.js never hides an open menu). */
.wp-block-group.charis-header.is-fixed {
	position: fixed;
}

body.admin-bar .wp-block-group.charis-header.is-fixed {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 782px) {

	body.admin-bar .wp-block-group.charis-header.is-fixed {
		top: 0;
	}
}

.wp-block-group.charis-header.is-hidden {
	transform: translateY(-100%);
}

/* Only used for the one frame in which the bar changes from absolute to
 * fixed, so it does not visibly slide out. */
.wp-block-group.charis-header.is-instant,
.wp-block-group.charis-header.is-instant * {
	transition: none !important;
}

.wp-block-group.charis-header.is-stuck {
	height: var(--charis-header-stuck-h);
	background-color: var(--wp--preset--color--bg-white);
}

.wp-block-group.charis-header__inner {
	position: relative;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0;
	width: 100%;
	max-width: 1280px;
	height: 100%;
	margin-inline: auto;
	padding: 4px var(--charis-header-pad) 0;
	box-sizing: border-box;
}

/* Logo (Figma Logo / Improving Lives). Two lockups, chosen server-side by the
 * body class WordPress puts on the front page (body.home), so there is no
 * JS flicker:
 *   - Home: two-line lockup, 228x122 at x40/y28 on desktop (overhangs the
 *     108px bar), 135x72 at x12/y20 on tablet/mobile; the desktop back-scroll
 *     bar swaps to the one-line lockup (229x58).
 *   - Inner pages (About, Find support, Benefits calculator, scheme detail):
 *     one-line lockup, 228x56 at x40/y28 on desktop in every state; on
 *     tablet/mobile the two-line lockup at 90x48 (x12/y20) in every state.
 * The logo is out of the flex flow, so the artwork may overhang the bar. */
.charis-header__logo {
	position: absolute;
	top: 28px;
	left: var(--charis-header-pad);
	display: block;
	width: 228px;
	height: 56px;
	margin: 0;
	text-decoration: none;
	transition:
		top var(--charis-hover-duration) var(--charis-hover-easing),
		width var(--charis-hover-duration) var(--charis-hover-easing),
		height var(--charis-hover-duration) var(--charis-hover-easing);
}

.charis-header__logo-img {
	position: absolute;
	inset: 0;
	display: block;

	/* Logos are set in Appearance → Logos (CSS variables);
	 * the theme files are only the fallback. */
	background: var(--charis-logo-main, url(assets/images/logo.svg)) no-repeat left top / contain;
	transition: opacity var(--charis-hover-duration) var(--charis-hover-easing);
}

.charis-header__logo-img--compact {
	background-image: var(--charis-logo-compact, url(assets/images/logo-compact.svg));
}

/* Inner pages (default): compact one-line lockup on desktop. */
.charis-header__logo-img--large {
	opacity: 0;
}

.charis-header__logo-img--compact {
	opacity: 1;
}

/* Home: the two-line lockup, 228x122. */
@media (min-width: 1024px) {

	body.home .charis-header__logo {
		width: 228px;
		height: 122px;
	}

	body.home .charis-header__logo-img--large {
		opacity: 1;
	}

	body.home .charis-header__logo-img--compact {
		opacity: 0;
	}

	body.home .wp-block-group.charis-header.is-stuck .charis-header__logo {
		top: 27px;
		width: 229px;
		height: 58px;
	}

	body.home .wp-block-group.charis-header.is-stuck .charis-header__logo-img--large {
		opacity: 0;
	}

	body.home .wp-block-group.charis-header.is-stuck .charis-header__logo-img--compact {
		opacity: 1;
	}
}

/* Tablet / mobile: always the two-line lockup. */
@media (max-width: 1023px) {

	.charis-header__logo {
		top: 20px;
		width: 90px;
		height: 48px;
	}

	.charis-header__logo-img--large {
		opacity: 1;
	}

	.charis-header__logo-img--compact {
		opacity: 0;
	}

	body.home .charis-header__logo {
		width: 135px;
		height: 72px;
	}

	body.home .wp-block-group.charis-header.is-stuck .charis-header__logo {
		width: 90px;
		height: 48px;
	}
}

/* Desktop primary navigation. */
.wp-block-group.charis-nav {
	display: flex;
	align-items: center;
	margin: 0 0 0 auto;
	padding: 0;
}

.charis-nav .wp-block-list.charis-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.charis-nav .wp-block-list li {
	margin: 0;
	list-style: none;
}

.charis-nav__list a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--wp--preset--color--brand-indigo);
	font-size: var(--wp--preset--font-size--fs-control-s);
	font-weight: 600;
	line-height: 24px;
	letter-spacing: var(--wp--custom--charis--ls-control);
	text-decoration: none;
	transition: color var(--charis-hover-duration) var(--charis-hover-easing);
}

/* Figma Component library "Menu link": default Indigo/Brand #251A5D, hover
 * Action/Tangerine hover #C31F13, current (active) Tangerine/Deep #D92315;
 * no underline in any state. */
.charis-header .charis-nav__list a:hover {
	color: var(--wp--preset--color--brand-red-hover);
}

/* Current page (#54): aria-current="page" is set on the server. */
.charis-header .charis-nav__list a[aria-current="page"] {
	color: var(--wp--preset--color--brand-red);
}

.charis-menu-drawer .charis-menu-drawer__list a[aria-current="page"] {
	color: var(--wp--preset--color--brand-periwinkle);
}

/* Sign In: 83x40 outlined pill at 1280 (Figma Button, Secondary type). */
.charis-header .charis-header__signin {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	margin: 0 0 0 64px;
	padding: 0;
}

.charis-header .charis-header__signin .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 40px;
	padding: 6.5px 14.5px; /* Figma 8/16 with the 1.5px stroke inside */
	border: 1.5px solid var(--wp--preset--color--brand-red);
	border-radius: var(--wp--preset--border-radius--r-8);
	background-color: transparent;
	color: var(--wp--preset--color--brand-red);
	font-size: var(--wp--preset--font-size--fs-control-s);
	font-weight: 600;
	letter-spacing: var(--wp--custom--charis--ls-control);
	line-height: 24px;
	text-decoration: none;
	transition:
		color var(--charis-hover-duration) var(--charis-hover-easing),
		border-color var(--charis-hover-duration) var(--charis-hover-easing),
		background-color var(--charis-hover-duration) var(--charis-hover-easing);
}

/* Figma Secondary / Small hover. */
.charis-header .charis-header__signin .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--brand-red-hover);
	background-color: var(--wp--custom--charis--tint-peach-30);
	color: var(--wp--preset--color--brand-red-hover);
}

/* Sign In is a plain outlined pill in the mockups: no arrow suffix. */
.charis-header .charis-header__signin .wp-block-button.is-style-secondary .wp-block-button__link::after {
	display: none;
}

/* Burger: 40x40 outlined button (Figma Button, icon only) with the custom
 * hand-drawn "Icon / Menu" (#52): shape via mask, painted with currentcolor. */
.charis-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin: 0 0 0 12px;
	padding: 0;
	border: 1.5px solid var(--wp--preset--color--brand-indigo); /* Figma Button 40x40: 1.5px */
	border-radius: var(--wp--preset--border-radius--r-8);
	background-color: transparent;
	color: var(--wp--preset--color--brand-indigo);
	cursor: pointer;
	transition:
		color var(--charis-hover-duration) var(--charis-hover-easing),
		border-color var(--charis-hover-duration) var(--charis-hover-easing);
}

.charis-menu-toggle:hover {
	color: var(--wp--preset--color--brand-red);
	border-color: var(--wp--preset--color--brand-red);
}

.charis-menu-toggle__icon,
.charis-menu-drawer__close-icon {
	display: block;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background-color: currentcolor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27none%27%3E%3Cpath d=%27M1.4 3.1C3.6 2.9 5.4 3.4 8 3.1S12.6 2.8 14.6 3.1M1.4 8.1C3.8 7.9 5.6 8.3 8 8S12.4 7.8 14.6 8.1M1.4 12.9C3.6 12.6 5.6 13 8 12.8S12.4 12.6 14.6 12.9%27 stroke=%27black%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27none%27%3E%3Cpath d=%27M1.4 3.1C3.6 2.9 5.4 3.4 8 3.1S12.6 2.8 14.6 3.1M1.4 8.1C3.8 7.9 5.6 8.3 8 8S12.4 7.8 14.6 8.1M1.4 12.9C3.6 12.6 5.6 13 8 12.8S12.4 12.6 14.6 12.9%27 stroke=%27black%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E") center / contain no-repeat;
}

.charis-menu-toggle[aria-expanded="true"] .charis-menu-toggle__icon,
.charis-menu-drawer__close-icon {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27none%27%3E%3Cpath d=%27M2.6 2.9C5 5.2 6.4 6.8 8 8.1S11.6 11 13.4 13.1M13.4 2.9C11 5.2 9.6 6.8 8 8.1S4.4 11 2.6 13.1%27 stroke=%27black%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27none%27%3E%3Cpath d=%27M2.6 2.9C5 5.2 6.4 6.8 8 8.1S11.6 11 13.4 13.1M13.4 2.9C11 5.2 9.6 6.8 8 8.1S4.4 11 2.6 13.1%27 stroke=%27black%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E");
}

/* Full-screen mobile menu: indigo surface, white links, orange lockup. */
.wp-block-group.charis-menu-drawer {
	position: fixed;
	inset: 4px 0 0;
	z-index: 1000;
	display: block;
	margin: 0;
	padding: 0;
	background-color: var(--wp--preset--color--brand-indigo);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity var(--charis-hover-duration) var(--charis-hover-easing),
		visibility 0s linear var(--charis-hover-duration);
}

.wp-block-group.charis-menu-drawer.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition:
		opacity var(--charis-hover-duration) var(--charis-hover-easing),
		visibility 0s linear 0s;
}

.charis-menu-drawer__backdrop {
	position: absolute;
	inset: 0;
	background-color: var(--wp--preset--color--brand-indigo);
}

.wp-block-group.charis-menu-drawer__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	margin: 0;
	padding:
		calc(16px + env(safe-area-inset-top))
		12px
		calc(32px + env(safe-area-inset-bottom))
		12px;
	overflow-y: auto;
	box-sizing: border-box;
	background-color: var(--wp--preset--color--brand-indigo);
	color: var(--wp--preset--color--bg-white);
	transform: translateX(100%);
	transition: transform var(--charis-hover-duration) var(--charis-hover-easing);
}

.wp-block-group.charis-menu-drawer.is-open .wp-block-group.charis-menu-drawer__panel {
	transform: translateX(0);
}

.wp-block-group.charis-menu-drawer__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	min-height: 72px;
	margin: 0;
	padding: 0;
}

.charis-menu-drawer__logo {
	display: block;
	width: 135px;
	height: 72px;
	margin: 0;
	text-decoration: none;
}

.charis-menu-drawer__logo-img {
	display: block;
	width: 135px;
	height: 72px;
	background: var(--charis-logo-white, url(assets/images/logo-white.svg)) no-repeat left top / contain;
}

.charis-menu-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--wp--preset--color--bg-white);
	border-radius: var(--wp--preset--border-radius--r-8);
	background-color: transparent;
	color: var(--wp--preset--color--bg-white);
	cursor: pointer;
	transition:
		color var(--charis-hover-duration) var(--charis-hover-easing),
		border-color var(--charis-hover-duration) var(--charis-hover-easing);
}

.wp-block-group.charis-menu-drawer__head > .charis-menu-drawer__close {
	margin-block-start: 0;
}

.charis-menu-drawer__close:hover {
	color: var(--wp--preset--color--brand-periwinkle);
	border-color: var(--wp--preset--color--brand-periwinkle);
}

.wp-block-group.charis-menu-drawer__nav {
	display: flex;
	flex: 1;
	flex-direction: column;
	margin: 52px 0 0;
	padding: 0 12px;
}

.charis-menu-drawer .wp-block-list.charis-menu-drawer__list {
	display: flex;
	flex-direction: column;
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.charis-menu-drawer .wp-block-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.charis-menu-drawer__list a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0;
	border: 0;
	color: var(--wp--preset--color--bg-white);
	font-family: var(--charis-font-display);

	/* Figma Mobile / Menu open: H2 mobile 32/40, letter-spacing 0%; links are
	 * inset 24px (12px side margin + 12px). */
	font-size: 32px;
	font-weight: 600;
	line-height: 40px;
	letter-spacing: 0;
	text-decoration: none;
	transition: color var(--charis-hover-duration) var(--charis-hover-easing);
}

.charis-menu-drawer .charis-menu-drawer__list a:hover {
	color: var(--wp--preset--color--brand-periwinkle);
}

.charis-menu-drawer .wp-block-list.charis-menu-drawer__secondary {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 54px 0 0;
	padding: 0;
	list-style: none;
}

.charis-menu-drawer__secondary a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 28px;
	color: var(--wp--preset--color--bg-white);
	font-family: var(--charis-font-display);
	font-size: var(--wp--preset--font-size--fs-control-m);
	font-weight: 600;
	line-height: 24px;
	letter-spacing: 0.04em;
	text-decoration: none;
}

.charis-menu-drawer__secondary a:hover {
	color: var(--wp--preset--color--brand-periwinkle);
}

.charis-menu-drawer__linkedin-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 3px;
	background-color: var(--wp--preset--color--brand-periwinkle);
	color: var(--wp--preset--color--brand-indigo);
	font-family: var(--charis-font-display);
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
}

.charis-menu-drawer__foot {
	margin-top: auto;
	padding: 40px 12px 0;
	color: var(--wp--preset--color--bg-white);
	font-family: var(--charis-font-display);
	font-size: var(--wp--preset--font-size--fs-control-m);
	font-weight: 600;
	line-height: 24px;
	letter-spacing: 0.04em;
}

.charis-menu-drawer__foot a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--wp--preset--color--bg-white);
	text-decoration: none;
}

.charis-menu-drawer .charis-menu-drawer__foot a:hover {
	color: var(--wp--preset--color--brand-periwinkle);
}

/* Footer: one indigo footer on every page, 383px at 1280. */
.wp-block-group.charis-footer {
	margin: 0;
	padding: 0;
	background-color: var(--wp--preset--color--brand-indigo);
	color: var(--wp--preset--color--bg-white);
}

.wp-block-group.charis-footer__inner {
	max-width: 1280px;
	margin-inline: auto;
	padding: 40px 40px 16px; /* Figma D / Footer */
	box-sizing: border-box;
}

.wp-block-group.charis-footer__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 308px 284px;
	gap: 0;
	align-items: start;
	margin: 0;
	padding: 0;
}

.charis-footer__logo-link {
	display: block;
	width: 195px;
	height: 104px;
	margin: 0;
	text-decoration: none;
}

.charis-footer__logo {
	display: block;
	width: 195px;
	height: 104px;
	background: var(--charis-logo-white, url(assets/images/logo-white.svg)) no-repeat left top / contain;
	transition: opacity var(--charis-hover-duration) var(--charis-hover-easing);
}

.charis-footer__logo-link:hover .charis-footer__logo {
	opacity: 0.85;
}

.wp-block-group.charis-footer__nav {
	display: grid;
	grid-template-columns: 304px 288px;
	gap: 0;
	margin: 0;
	padding: 0;
}

.charis-footer .wp-block-list.charis-footer__list {
	display: flex;
	flex-direction: column;
	gap: 16px; /* Figma footer Menu: 24px rows, 16px gap */
	margin: 0;
	padding: 0;
	list-style: none;
}

.charis-footer .wp-block-list.charis-footer__list > li {
	display: flex;
}

.charis-footer .wp-block-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.charis-footer__list a {
	display: inline-flex;
	align-items: flex-start;
	min-height: 24px;
	box-sizing: border-box;
	color: var(--wp--preset--color--bg-white);
	font-size: var(--wp--preset--font-size--fs-control-s);
	font-weight: 600;
	line-height: 24px;
	letter-spacing: var(--wp--custom--charis--ls-control);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 4px;
	transition: color var(--charis-hover-duration) var(--charis-hover-easing), text-decoration-color var(--charis-hover-duration) var(--charis-hover-easing);
}

/* Link hover (Component library, Text link "Dark bg, Hover"): label turns
 * Lavender/500 (#808EE8) and is underlined; the underline fades in. */
.charis-footer .charis-footer__list a:hover {
	color: var(--wp--preset--color--brand-lavender);
	text-decoration-color: currentcolor;
}

.wp-block-group.charis-footer__nav-secondary {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
	padding: 0;
}

.wp-block-group.charis-footer__nav-secondary > * {
	margin-block: 0;
}

.charis-footer__linkedin {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 24px;
	color: var(--wp--preset--color--bg-white);
	font-size: var(--wp--preset--font-size--fs-control-s);
	font-weight: 600;
	line-height: 24px;
	letter-spacing: var(--wp--custom--charis--ls-control);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 4px;
	transition: color var(--charis-hover-duration) var(--charis-hover-easing), text-decoration-color var(--charis-hover-duration) var(--charis-hover-easing);
}

/* Same Text link "Dark bg, Hover" as the other footer links: Lavender/500. */
.charis-footer__linkedin:hover {
	color: var(--wp--preset--color--brand-lavender);
	text-decoration-color: currentcolor;
}

.charis-footer__linkedin-icon {
	display: inline-flex;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	overflow: hidden;
	background-color: var(--wp--preset--color--bg-white); /* Figma Social Icons, LinkedIn / Negative */
	color: transparent;
	font-size: 0;
	-webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Cpath%20d='M14.8156%200H1.18125C0.528125%200%200%200.515625%200%201.15313V14.8438C0%2015.4813%200.528125%2016%201.18125%2016H14.8156C15.4688%2016%2016%2015.4813%2016%2014.8469V1.15313C16%200.515625%2015.4688%200%2014.8156%200ZM4.74687%2013.6344H2.37188V5.99687H4.74687V13.6344ZM3.55938%204.95625C2.79688%204.95625%202.18125%204.34062%202.18125%203.58125C2.18125%202.82188%202.79688%202.20625%203.55938%202.20625C4.31875%202.20625%204.93437%202.82188%204.93437%203.58125C4.93437%204.3375%204.31875%204.95625%203.55938%204.95625ZM13.6344%2013.6344H11.2625V9.92188C11.2625%209.0375%2011.2469%207.89687%2010.0281%207.89687C8.79375%207.89687%208.60625%208.8625%208.60625%209.85938V13.6344H6.2375V5.99687H8.5125V7.04063H8.54375C8.85938%206.44063%209.63438%205.80625%2010.7875%205.80625C13.1906%205.80625%2013.6344%207.3875%2013.6344%209.44375V13.6344Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Cpath%20d='M14.8156%200H1.18125C0.528125%200%200%200.515625%200%201.15313V14.8438C0%2015.4813%200.528125%2016%201.18125%2016H14.8156C15.4688%2016%2016%2015.4813%2016%2014.8469V1.15313C16%200.515625%2015.4688%200%2014.8156%200ZM4.74687%2013.6344H2.37188V5.99687H4.74687V13.6344ZM3.55938%204.95625C2.79688%204.95625%202.18125%204.34062%202.18125%203.58125C2.18125%202.82188%202.79688%202.20625%203.55938%202.20625C4.31875%202.20625%204.93437%202.82188%204.93437%203.58125C4.93437%204.3375%204.31875%204.95625%203.55938%204.95625ZM13.6344%2013.6344H11.2625V9.92188C11.2625%209.0375%2011.2469%207.89687%2010.0281%207.89687C8.79375%207.89687%208.60625%208.8625%208.60625%209.85938V13.6344H6.2375V5.99687H8.5125V7.04063H8.54375C8.85938%206.44063%209.63438%205.80625%2010.7875%205.80625C13.1906%205.80625%2013.6344%207.3875%2013.6344%209.44375V13.6344Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.wp-block-group.charis-footer__inner > .charis-footer__contact {
	max-width: 900px;
	margin: 96px 0 0; /* Figma: 96px gap under the columns */
	color: var(--wp--preset--color--brand-periwinkle);
	font-size: 14px;
	font-weight: 300;
	letter-spacing: var(--wp--custom--charis--ls-body-s);
	line-height: 18px;
}

.charis-footer__contact a {
	color: var(--wp--preset--color--brand-periwinkle);
	text-decoration: none;
}

.charis-footer .charis-footer__contact a:hover {
	color: var(--wp--preset--color--brand-lavender);
	text-decoration: underline;
}

.wp-block-group.charis-footer__bottom {

	/* Figma "Links": one row, 24px padding, 32px gaps, top rule. */
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0 32px;
	margin-top: 24px;
	padding: 24px 0;
	border-top: 1px solid var(--wp--preset--color--brand-purple);
}

.charis-footer__copyright {
	margin: 0;
	color: var(--wp--preset--color--brand-periwinkle);
	font-size: 14px;
	font-weight: 300;
	letter-spacing: var(--wp--custom--charis--ls-body-s);
	line-height: 18px;
}

.wp-block-group.charis-footer__legal {
	margin: 0;
	padding: 0;
}

.charis-footer .wp-block-list.charis-footer__legal-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.charis-footer .wp-block-list.charis-footer__legal-list > li {
	display: flex;
	line-height: 18px;
}

.charis-footer__legal a {
	display: inline-flex;
	align-items: flex-start;
	box-sizing: border-box;
	color: var(--wp--preset--color--brand-periwinkle);
	font-size: 14px;
	font-weight: 600;
	line-height: 18px;
	letter-spacing: var(--wp--custom--charis--ls-control);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 4px;
	transition: text-decoration-color var(--charis-hover-duration) var(--charis-hover-easing);
}

.charis-footer .charis-footer__legal a:hover {
	color: var(--wp--preset--color--brand-lavender);
	text-decoration-color: currentcolor;
}

/* Focus ring is the single global token (02 §6). */
.charis-header a:focus-visible,
.charis-header button:focus-visible,
.charis-footer a:focus-visible,
.charis-menu-drawer a:focus-visible,
.charis-menu-drawer button:focus-visible {
	outline: none;
	box-shadow: var(--charis-focus-ring);
}

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

/* Tablet: burger replaces the desktop nav, drawer slides over a backdrop. */
@media (max-width: 1023px) {

	/* Tablet shares the mobile header: logo and buttons sit 20px from the
	 * top (Figma M / Header), the buttons are 40px high. */
	.wp-block-group.charis-header__inner {
		align-items: flex-start;
		padding-top: 20px;
	}

	.wp-block-group.charis-nav {
		display: none;
	}

	.charis-menu-toggle {
		display: inline-flex;
	}

	.charis-header .charis-header__signin {
		margin-left: auto;
	}

	/* Tablets use the mobile side margin (12). */
	.wp-block-group.charis-footer__inner {
		padding-inline: 12px;
	}

	.wp-block-group.charis-footer__top {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.wp-block-group.charis-footer__nav {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

@media (min-width: 768px) and (max-width: 1023px) {

	.wp-block-group.charis-menu-drawer__panel {
		width: min(480px, 100%);
		margin-left: auto;
	}
}

/* Mobile: 92px bar (76px when pinned on back scroll). */
@media (max-width: 767px) {

	.wp-block-group.charis-header__inner {
		min-height: 72px;
		padding-inline: 12px;
	}

	.charis-header .charis-header__signin {
		margin-left: auto;
	}

	/* Figma M / Header: Sign in 77x40 (text 14px), 12px gap to the burger. */
	.charis-header .charis-header__signin .wp-block-button__link {
		padding: 6.5px 14.5px;
		font-size: 14px;
	}

	/* Figma M / Footer: 32 12 16 padding; columns gap 48; 56 to the bottom. */
	.wp-block-group.charis-footer__inner {
		padding: 32px 12px 16px;
	}

	.wp-block-group.charis-footer__top {
		grid-template-columns: minmax(0, 1fr);
		gap: 48px;
	}

	.charis-footer__logo-link,
	.charis-footer__logo {
		width: 150px;
		height: 80px;
	}

	.wp-block-group.charis-footer__nav {
		grid-template-columns: minmax(0, 1fr);
		gap: 48px;
		padding-left: 16px;
	}

	.charis-footer__list a,
	.charis-footer__linkedin {
		font-size: 14px;
	}

	.wp-block-group.charis-footer__inner > .charis-footer__contact {
		margin-top: 56px;
		font-size: 14px;
		line-height: 18px;
	}

	.wp-block-group.charis-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
		margin-top: 20px;
		padding: 16px 0;
	}

	.wp-block-group.charis-footer__legal {
		order: 1;
		width: 100%;
	}

	.charis-footer__copyright {
		order: 2;
		line-height: 18px;
	}

	.charis-footer .wp-block-list.charis-footer__legal-list {
		flex-direction: column;
		gap: 24px;
		width: 100%;
	}
}

/* Desktop mockup aligns the nav and Sign In two pixels above the bar centre. */
@media (min-width: 1024px) {

	/* Figma: nav row centre sits at y56, which is the centre of the 108px bar
	 * below its 4px line; no extra offset is needed. */
}

/* Desktop: the drawer is not part of the interaction model. */
@media (min-width: 1024px) {

	.charis-menu-toggle,
	.wp-block-group.charis-menu-drawer {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	.wp-block-group.charis-header,
	.wp-block-group.charis-header__inner,
	.wp-block-group.charis-menu-drawer,
	.wp-block-group.charis-menu-drawer__panel,
	.charis-menu-toggle,
	.charis-menu-toggle__icon,
	.charis-menu-toggle__icon::before,
	.charis-menu-toggle__icon::after,
	.charis-menu-drawer__close,
	.charis-footer__logo,
	.charis-header__logo,
	.charis-nav,
	.charis-header__signin,
	.charis-nav__list a,
	.charis-menu-drawer__list a,
	.charis-footer__list a {
		transition: none;
	}
}

/* Site Editor: the drawer is a normal, visible block so its links and close
 * control stay editable; the frontend hides it until JS adds .is-open. The
 * editor body carries .block-editor-iframe__body, so these rules never apply
 * to visitors. */
body.block-editor-iframe__body .wp-block-group.charis-menu-drawer {
	position: static;
	display: block;
	margin-block-start: var(--wp--preset--spacing--50);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* The header bar is absolutely positioned at a fixed height on the frontend.
 * In the editor the drawer sits inside it as a normal block, so let the bar
 * grow and stay in flow, otherwise the drawer spills over the page below. */
body.block-editor-iframe__body .wp-block-template-part:has(.charis-header),
body.block-editor-iframe__body .wp-block-group.charis-header {
	position: relative;
	height: auto;
}

body.block-editor-iframe__body .charis-menu-drawer__backdrop {
	display: none;
}

body.block-editor-iframe__body .wp-block-group.charis-menu-drawer__panel {
	width: 100%;
	height: auto;
	margin: 0;
	padding: var(--wp--preset--spacing--50);
	overflow: visible;
	transform: none;
}

/* ---- Mobile heading scale (02 §3, ≤767px; media rules, not extra slugs) -- */

@media (max-width: 767px) {

	body :where(h1) {
		font-size: 40px;
		line-height: 48px;
	}

	body :where(h2) {
		font-size: 32px;
		line-height: 40px;
	}

	body :where(h3) {
		font-size: 28px;
		line-height: 36px;
	}

	body :where(h4) {
		font-size: 24px;
		line-height: 32px;
	}

	body :where(h5) {
		font-size: 20px;
		line-height: 28px;
	}
}

/* ---- Global kill-switch (02 §7: prefers-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;
	}
}

/* ---- No-JS navigation ---------------------------------------------------- */

/* No-JS fallback: the burger is inert without the drawer script. */
.charis-nojs-nav {
	flex-basis: 100%;
	width: 100%;
	padding-block: var(--wp--preset--spacing--40);
}

.charis-nojs-nav ul {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding: 0;
	list-style: none;
}

.charis-nojs-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--wp--preset--color--brand-indigo);
	font-size: var(--wp--preset--font-size--fs-control-s);
	font-weight: 600;
	text-decoration: none;
}

.charis-nojs-nav a:focus-visible {
	outline: none;
	box-shadow: var(--charis-focus-ring);
}

@media (min-width: 1024px) {

	.charis-nojs-nav {
		display: none;
	}
}

/* ---- Generic section stack ----------------------------------------------
 * A page composed of section-level blocks that own their backgrounds and
 * vertical padding. The stack only supplies the shared 1200px column and
 * removes inter-section margins. It works in two shapes:
 *   1. a template main wrapping .wp-block-post-content (front page);
 *   2. a core/group canvas placed directly inside .wp-block-post-content
 *      (kitchen sink and other content-composed pages).
 * Zero-specificity padding lets any block with its own horizontal padding
 * (e.g. the full-bleed banner) opt out. */

.wp-block-group.is-style-section-stack {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin-block-start: 0;
	margin-inline: 0;
	padding-inline: 0;
	overflow-x: clip;
}

/* A stack group dropped into the page body is already full-bleed: cancel the
 * generic page alignfull inset so its children own the whole viewport. */
.wp-block-group.is-style-section-stack.alignfull:not(.wp-block-post-content) {
	width: 100%;
	max-width: none;
	margin-inline: 0;
	padding-inline: 0;
}

/* Children of the stack, excluding the post-content wrapper itself, and the
 * children of that wrapper (front page) share one marginless box model. The
 * zero-specificity wrapper preserves the old cascade: an opt-out utility such
 * as .ks-label can still restore its own rhythm. */
:where(.is-style-section-stack) > :not(.wp-block-post-content),
:where(.is-style-section-stack) > .wp-block-post-content > * {
	box-sizing: border-box;
	margin-block-start: 0;
}

:where(.is-style-section-stack) > :not(.wp-block-post-content),
:where(.is-style-section-stack) > .wp-block-post-content > * {
	padding-inline: max(40px, calc((100% - 1200px) / 2));
}

/* Full-bleed sections and the query loop own their inner column. */
:where(.is-style-section-stack) > :is(.alignfull, .wp-block-query),
:where(.is-style-section-stack) > .wp-block-post-content > :is(.alignfull, .wp-block-query) {
	padding-inline: 0;
}

/* Direct prose keeps the 840px reading measure set by the page shell. */
:where(.is-style-section-stack) > :is(p, h2, h3, h4, h5, h6, .wp-block-heading, ul, ol, .wp-block-list, .wp-block-quote, .wp-block-pullquote, .wp-block-table, .wp-block-details, .wp-block-buttons, .wp-block-file, .wp-block-separator, .wp-block-code, .wp-block-preformatted, .wp-block-verse),
:where(.is-style-section-stack) > .wp-block-post-content > :is(p, h2, h3, h4, h5, h6, .wp-block-heading, ul, ol, .wp-block-list, .wp-block-quote, .wp-block-pullquote, .wp-block-table, .wp-block-details, .wp-block-buttons, .wp-block-file, .wp-block-separator, .wp-block-code, .wp-block-preformatted, .wp-block-verse) {
	max-width: 840px;
}

/* Tablets (768-1023) use the mobile grid: side margin 12 (designer,
 * #12/#42/#47/#71). */
@media (max-width: 1023px) {

	:where(.is-style-section-stack) > :not(.wp-block-post-content),
	:where(.is-style-section-stack) > .wp-block-post-content > * {
		padding-inline: var(--wp--preset--spacing--30);
	}

	:where(.is-style-section-stack) > :is(.alignfull, .wp-block-query),
	:where(.is-style-section-stack) > .wp-block-post-content > :is(.alignfull, .wp-block-query) {
		padding-inline: 0;
	}
}

/* ---- Page hero (title + lead) -------------------------------------------
 * Generic section for content-led pages: the page supplies its own H1 and
 * lead in content instead of relying on the legacy page-header template. */

.wp-block-group.is-style-page-hero {
	margin-block: 0;
	padding-block: 16px 40px;
}

/* Inner pages carry the one-line logo (56px, inside the 108px bar): the H1
 * starts 40px under the bar (Figma About, H1 box y148). */
@media (min-width: 1024px) {

	.wp-block-group.is-style-page-hero {
		padding-block-start: 40px;
	}
}

.wp-block-group.is-style-page-hero > .wp-block-group.is-style-container {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--70);
}

.wp-block-group.is-style-page-hero .wp-block-post-title {
	margin: 0;
	color: var(--wp--preset--color--brand-indigo);
	font-family: var(--wp--preset--font-family--charis-display);
	font-size: 64px;
	font-weight: 600;
	letter-spacing: var(--wp--custom--charis--ls-h-1);
	line-height: 72px;
	overflow-wrap: break-word;
}

.wp-block-group.is-style-page-hero .wp-block-post-excerpt {
	max-width: 800px;
	margin: 0;
	color: var(--wp--preset--color--brand-indigo);
	font-family: var(--wp--preset--font-family--charis-display);
	font-size: 32px;
	font-weight: 300;
	line-height: 40px;
}

.wp-block-group.is-style-page-hero .wp-block-post-excerpt__excerpt {
	font: inherit;
}

/* ---- Editorial stack ----------------------------------------------------
 * A grey reading canvas for long editorial pages. The stack owns the column
 * and the rhythm between its section-level blocks; blocks keep their own
 * visuals. This replaces page-scoped About CSS with a reusable group style. */

.wp-block-group.is-style-editorial-stack {
	display: flow-root;
	margin-block: 0;
	padding-inline: max(40px, calc((100% - 1200px) / 2));
	color: var(--wp--preset--color--brand-indigo);
	background-color: var(--wp--preset--color--bg-grey);
}

.wp-block-group.is-style-editorial-stack > * {
	margin-block: 0;
}

/* Block editor: the root container is constrained to the content size, so
 * the stack was clamped to 1200px while its percentage padding still resolved
 * against the (wider) editor canvas. On wide screens the inner column
 * collapsed to a sliver (annotated text wrapped one letter per line). Let the
 * stack span the canvas like it does on the front end. .is-root-container
 * only exists in the editor, so the front end is unaffected. */
.is-root-container > .wp-block-group.is-style-editorial-stack {
	max-width: none;
	margin-inline: 0;
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-banner {
	margin-block-start: 0; /* Figma: Picture+slogan at 408 */
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-banner + .wp-block-charis-annotated-text {
	margin-block-start: 64px;
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-annotated-text + .wp-block-charis-annotated-text {
	margin-block-start: 36px;
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-annotated-text + .wp-block-charis-section-intro {
	margin-block-start: 96px;
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-section-intro + .wp-block-charis-media-callout {
	margin-block-start: 32px;
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-callout + .wp-block-charis-media-callout {
	margin-block-start: 32px;
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-callout + .wp-block-charis-statement {
	margin-block-start: 68px; /* Eligibility pb4 + Big text pt64 */
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-statement + .wp-block-charis-numbers {
	margin-block-start: 16px; /* Big text pb16 */
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-numbers + .wp-block-charis-partner-logos {
	margin-block-start: 40px; /* Partners p40 */
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-partner-logos + .wp-block-charis-quote {
	margin-block-start: 104px; /* Partners pb40 + Stories pt64 */
}

/* Partners followed by anything but the quote (e.g. the white CTA cards
 * band): keep a grey band under the logo cards, not flush with the next
 * section. */
.wp-block-group.is-style-editorial-stack > .wp-block-charis-partner-logos + :not(.wp-block-charis-quote) {
	margin-block-start: 64px;
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-quote + .wp-block-charis-cta-cards {
	margin-block-start: 64px; /* Stories pb64 */
}

.wp-block-group.is-style-editorial-stack > .wp-block-charis-cta-cards.alignfull {
	margin-inline: calc(50% - 50vw);
	padding-inline: 0;
}

@media (max-width: 767px) {

	.wp-block-group.is-style-page-hero {
		padding-block-start: 16px;
	}

	.wp-block-group.is-style-page-hero > .wp-block-group.is-style-container {
		gap: var(--wp--preset--spacing--60);
	}

	.wp-block-group.is-style-page-hero .wp-block-post-title {
		font-size: 40px;
		line-height: 48px;
	}

	.wp-block-group.is-style-page-hero .wp-block-post-excerpt {
		font-size: 24px;
		line-height: 32px;
	}

	.wp-block-group.is-style-editorial-stack {
		padding-inline: var(--wp--preset--spacing--30);
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-banner {
		margin-block-start: 0;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-banner + .wp-block-charis-annotated-text {
		margin-block-start: 56px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-annotated-text + .wp-block-charis-annotated-text {
		margin-block-start: 32px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-annotated-text + .wp-block-charis-section-intro {
		margin-block-start: 52px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-section-intro + .wp-block-charis-media-callout {
		margin-block-start: 32px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-callout + .wp-block-charis-media-callout {
		margin-block-start: 32px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-callout + .wp-block-charis-statement {
		margin-block-start: 72px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-statement + .wp-block-charis-numbers {
		margin-block-start: 16px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-numbers + .wp-block-charis-partner-logos {
		margin-block-start: 96px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-partner-logos + .wp-block-charis-quote {
		margin-block-start: 24px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-quote + .wp-block-charis-cta-cards {
		margin-block-start: 80px;
	}
}

/* ---- Generic block stack ------------------------------------------------
 * A stack of full-bleed section blocks that own their own inner columns and
 * gutters. The stack only removes inter-block margins and horizontal
 * overflow; it never adds a second container. */

.wp-block-group.is-style-block-stack {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin-block-start: 0;
	overflow-x: clip;
}

.wp-block-group.is-style-block-stack > * {
	margin-block-start: 0;
}

/* ---- Section primitives (T039.1) ----------------------------------------
 * Reusable full-width sections + 1200px containers. Page content composes
 * these instead of depending on a per-page template: the section owns the
 * background and the vertical rhythm, the inner container owns the column.
 * Layout only — colours, radii and type resolve through theme.json tokens. */

.wp-block-group.is-style-container {
	box-sizing: border-box;
	width: 100%;
	max-width: 1280px;
	margin-inline: auto;
	padding-inline: 40px;
}

.wp-block-group.is-style-hero,
.wp-block-group.is-style-sheet {
	margin-block: 0;
}

.wp-block-group.is-style-hero {
	padding-block: 16px 80px;
}

/* Inner pages: the H1 sits 40px under the 108px desktop bar (Figma About),
 * 16px under the 92px tablet/mobile bar. */
@media (min-width: 1024px) {

	.wp-block-group.is-style-hero {
		padding-block-start: 40px;
	}
}

/* Tablet/mobile inner pages: 76px bar + 32px (Figma Header p32) = H1 box y108.
 * Home keeps its 92px bar and 16px. */
@media (max-width: 1023px) {

	body:not(.home) .wp-block-group.is-style-hero,
	body:not(.home) .wp-block-group.is-style-page-hero {
		padding-block-start: 32px;
	}
}

.wp-block-group.is-style-sheet {
	padding-block: 20px 100px;
	background-color: var(--wp--preset--color--bg-white);
	border-radius: 56px 56px 0 0;
}

/* A page body that starts flush under the hero and owns its bottom rhythm.
 * Used by pages whose first section is a third-party embed. */
.wp-block-group.is-style-content-section {
	display: flow-root; /* children's top margins stay inside the grey band (no white hole under the hero) */
	padding-block: 0 100px;
}

/* A text row left with only empty paragraphs (content edit) takes no room. */
.wp-block-group.is-style-content-section .wp-block-group.is-style-content-row:not(:has(> :not(p:empty))) {
	display: none;
}

/* Two-column label/body rows used by editorial pages. Figma grid (Benefit
 * calculator "Section / Text blocks"): 12-column grid with 16px gutters,
 * label = 4 columns (389.33 at 1280, the H5 sits in 357.33 + 32px right
 * padding), body = 8 columns (794.67, max 800). */
.wp-block-group.is-style-content-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0 var(--wp--preset--spacing--40);
}

.wp-block-group.is-style-content-row > :first-child {
	grid-column: 1;
	padding-inline-end: var(--wp--preset--spacing--70);
}

.wp-block-group.is-style-content-row > :last-child:not(:first-child) {
	grid-column: 2 / -1;
	max-width: 800px;
}

/* H5 in the label column is 24/28 in Figma; the saved markup carries an
 * inline 32px line-height from the old export. */
.wp-block-group.is-style-content-row > h2.wp-block-heading,
.wp-block-group.is-style-content-row > h3.wp-block-heading {
	line-height: var(--charis-page-h5-line, 28px) !important;
}

.wp-block-group.is-style-content-row > * {
	min-width: 0;
	margin-block: 0;
}

/* Card (white, r-32, 8px frame) that holds a media + copy row. Figma
 * "Card" (Benefit calculator / About): row, padding 8, gap 16, min-height 240
 * (224 inside the frame). The picture is 4 columns (389.33) minus 32 =
 * 357.33 wide and full card height; the copy takes the rest with 24px inner
 * padding. The picture's inner edge (the one facing the copy) is angled. */
.wp-block-group.has-background:has(> .is-style-card-row) {
	box-sizing: border-box;
	overflow: hidden;
	padding: var(--wp--preset--spacing--20) !important;
	border-radius: var(--wp--preset--border-radius--r-32) !important;
}

.wp-block-group.is-style-card-row {
	display: grid;
	grid-template-columns: calc((100% - 16px) / 3 - 32px) minmax(0, 1fr);
	align-items: center;
	gap: 0 var(--wp--preset--spacing--40);
	min-height: 224px;
}

.wp-block-group.is-style-card-row > * {
	min-width: 0;
	margin-block: 0;
}

.wp-block-group.is-style-card-row > :not(.wp-block-image) {
	padding: var(--wp--preset--spacing--60);
}

.wp-block-group.is-style-card-row .wp-block-image {
	align-self: stretch;
	display: flex;
	margin: 0;
	background: var(--wp--preset--color--bg-lightblue);
	border-radius: var(--wp--preset--border-radius--r-24);
	overflow: hidden;

}

/* Photo on the left: the right (inner) points are pulled 8px inward, every
 * corner stays rounded (r-24). shape() draws real arcs; a polygon() here cut
 * kinks into the two inner corners. Without shape(): plain rounded box. */
@supports (clip-path: shape(from 0 0, line to 1px 1px)) {

	.wp-block-group.is-style-card-row .wp-block-image {
		clip-path: shape(from 0 24px, arc to 24px 0 of 24px cw, line to calc(100% - 24px) 8px, arc to 100% 32px of 24px cw, line to 100% calc(100% - 32px), arc to calc(100% - 24px) calc(100% - 8px) of 24px cw, line to 24px 100%, arc to 0 calc(100% - 24px) of 24px cw, close);
	}
}

.wp-block-group.is-style-card-row .wp-block-image img {
	display: block;
	width: 100% !important;
	max-width: none;
	height: 100% !important;
	min-height: 100%;
	object-fit: cover;
	border-radius: 0;
}

/* CTA card closing a page (Figma "Section / Banner": card r32, padding 32 /
 * 24 on mobile, gap 32 / 24, H3 40/48 -> 24/32, full-width CTA on mobile). */
.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) {
	box-sizing: border-box;
	padding: var(--wp--preset--spacing--70) !important;
	border-radius: var(--wp--preset--border-radius--r-32) !important;
}

@media (max-width: 767px) {

	.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) {
		padding: var(--wp--preset--spacing--60) !important;
	}

	.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) > .wp-block-heading {
		font-size: 24px !important;
		line-height: 32px !important;
	}

	.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) > .wp-block-buttons,
	.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) .wp-block-button {
		width: 100%;
	}

	.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) .wp-block-button__link {
		width: 100%;
		box-sizing: border-box;
	}
}

/* Back link: same component as the Scheme hero back link (indigo, 600,
 * custom SVG arrow, no underline). */
.charis-back-link {
	margin-block: 0 36px;
}

body .charis-back-link a:not(.wp-block-button__link):not(.wp-element-button):not([class*="wp-block-charis-"]) {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--brand-purple); /* Figma Back link: content/Muted #4E3F9D */
	font-size: var(--wp--preset--font-size--fs-body-s);
	font-weight: 600;
	letter-spacing: var(--wp--custom--charis--ls-control);
	line-height: 24px;
	text-decoration: none;
	transition: color var(--charis-hover-duration) var(--charis-hover-easing);
}

body .charis-back-link a:not(.wp-block-button__link):not(.wp-element-button):not([class*="wp-block-charis-"]):hover {
	color: var(--wp--preset--color--brand-indigo-hover);
}

.charis-back-link a:focus-visible {
	outline: none;
	box-shadow: var(--charis-focus-ring);
}

.charis-back-link__icon {
	flex: none;
	color: var(--wp--preset--color--brand-indigo-800); /* Figma arrow #362881 */
}

/* Narrow left column for forms and notices inside the 1200 container. */
.wp-block-group.is-style-form-column {
	box-sizing: border-box;
	width: 100%;
	max-width: 800px;
	margin-block: 0;
}

.wp-block-group.is-style-form-column > * {
	margin-block: 0;
}

.wp-block-group.is-style-form-column > * + * {
	margin-block-start: var(--wp--preset--spacing--70);
}

.wp-block-group.is-style-sheet > .wp-block-group.is-style-container {
	display: flex;
	flex-direction: column;
}

.wp-block-group.is-style-sheet-banner {
	margin-block-start: 41px;
}

.wp-block-group.is-style-sheet-banner > .wp-block-charis-calculator-banner {
	flex: 1 1 100%;
	width: 100%;
}

.wp-block-group.is-style-hero .wp-block-post-title {
	margin: 0;
	color: var(--wp--preset--color--brand-indigo);
	font-family: var(--wp--preset--font-family--charis-display);
	font-size: var(--wp--preset--font-size--fs-h-1);
	font-weight: 600;
	letter-spacing: var(--wp--custom--charis--ls-h-1);
	line-height: 72px;
}

@media (max-width: 1023px) {

	.wp-block-group.is-style-content-row {
		display: block;
	}

	.wp-block-group.is-style-content-row > :first-child {
		padding-inline-end: var(--wp--preset--spacing--60);
	}

	.wp-block-group.is-style-content-row > * + * {
		margin-block-start: var(--wp--preset--spacing--40);
	}

	/* Mobile grid (Figma 390): card keeps its 8px frame and r-24, the
	 * picture is 240px high with r-16 and the angled cut, copy below with
	 * 16px padding and a 16px gap. */
	.wp-block-group.has-background:has(> .is-style-card-row) {
		padding: var(--wp--preset--spacing--20) !important;
		border-radius: 24px !important;
	}

	.wp-block-group.is-style-card-row {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: var(--wp--preset--spacing--40);
		min-height: 0;
	}

	.wp-block-group.is-style-card-row .wp-block-image {
		display: block;
		width: 100%;
		height: 240px;
		border-radius: 16px;
	}

	/* Picture above the copy: the LEFT points are pulled 8px inward (r-16). */
	@supports (clip-path: shape(from 0 0, line to 1px 1px)) {

		.wp-block-group.is-style-card-row .wp-block-image {
			clip-path: shape(from 0 24px, arc to 16px 8px of 16px cw, line to calc(100% - 16px) 0, arc to 100% 16px of 16px cw, line to 100% calc(100% - 16px), arc to calc(100% - 16px) 100% of 16px cw, line to 16px calc(100% - 8px), arc to 0 calc(100% - 24px) of 16px cw, close);
		}
	}

	.wp-block-group.is-style-card-row .wp-block-image img {
		height: 100% !important;
	}

	.wp-block-group.is-style-card-row > :not(.wp-block-image) {
		padding: var(--wp--preset--spacing--40);
	}
}

@media (max-width: 767px) {

	.wp-block-group.is-style-container {
		padding-inline: 12px;
	}

	.wp-block-group.is-style-hero {
		padding-block: 16px 23px;
	}

	.wp-block-group.is-style-sheet {
		padding-block: 14px 77px;
		border-radius: var(--charis-radius-l, 24px) var(--charis-radius-l, 24px) 0 0;
	}

	.wp-block-group.is-style-content-section {
		padding-block: 0 77px;
	}

	.wp-block-group.is-style-form-column {
		max-width: none;
	}

	.wp-block-group.is-style-content-row {
		display: block;
	}

	.wp-block-group.is-style-content-row > * + * {
		margin-block-start: var(--wp--preset--spacing--40);
	}

	/* Figma mobile H5 = 20/24. */
	.wp-block-group.is-style-content-row > h2.wp-block-heading,
	.wp-block-group.is-style-content-row > h3.wp-block-heading {
		font-size: 20px !important;
		line-height: 24px !important;
	}

	.wp-block-group.is-style-sheet > .wp-block-group.is-style-container {
		padding-inline: 20px;
	}

	.wp-block-group.is-style-sheet-banner {
		margin-block-start: 44px;
		margin-inline: -8px;
	}

	.wp-block-group.is-style-hero .wp-block-post-title {
		font-size: 40px;
		line-height: 48px;
		letter-spacing: var(--wp--custom--charis--ls-heading);
	}
}

@media (max-width: 1023px) {

	:root {
		--charis-radius-l: 24px;
		--charis-radius-m: 24px;
	}
}

/*
 * Figma M / Home draws the outlined controls (Sign In, burger, "Get help
 * applying", "View all schemes") with an OUTSIDE 1.5px stroke: the layout
 * box stays 77×40 / 40×40 / 366×56 / auto×56 and the stroke hangs 1.5px
 * past it. The border becomes transparent and an outline draws the stroke.
 */
@media (max-width: 767px) {

	.charis-header .wp-block-button.is-style-secondary .wp-block-button__link,
	.wp-block-charis-hero .wp-block-button.is-style-secondary .wp-block-button__link,
	.charis-header .charis-menu-toggle,
	.wp-block-charis-scheme-grid .wp-block-charis-scheme-grid__view-all {
		border-color: transparent;
		outline: 1.5px solid currentcolor;
		outline-offset: 0;
	}

	.charis-header .wp-block-button.is-style-secondary .wp-block-button__link:hover,
	.wp-block-charis-hero .wp-block-button.is-style-secondary .wp-block-button__link:hover,
	.charis-header .charis-menu-toggle:hover,
	.wp-block-charis-scheme-grid .wp-block-charis-scheme-grid__view-all:hover {
		border-color: transparent;
	}

	.charis-header .charis-menu-toggle {
		border-width: 1.5px;
	}
}

/* ---- Pixel audit: About + Benefit calculator, mobile grid (<=1023) --------
 * Figma Mobile (About 160:23437, Landing 197:26704); tablets use the same
 * values. Section paddings are summed into the stack margins. */
@media (max-width: 1023px) {

	/* H1 -> lead: Figma Header p32 12 20 + Text block p4 12 32. */
	.wp-block-group.is-style-page-hero:has(+ .is-style-editorial-stack) {
		padding-block-end: 32px;
	}

	.wp-block-group.is-style-page-hero:has(+ .is-style-content-section) {
		padding-block-end: 24px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-banner {
		margin-block-start: 0;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-banner + .wp-block-charis-annotated-text {
		margin-block-start: 48px; /* Text blocks p48 */
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-annotated-text + .wp-block-charis-annotated-text,
	.wp-block-group.is-style-editorial-stack > .wp-block-charis-section-intro + .wp-block-charis-media-callout,
	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-callout + .wp-block-charis-media-callout {
		margin-block-start: 24px; /* column gap 24 */
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-annotated-text + .wp-block-charis-section-intro {
		margin-block-start: 60px; /* pb56 + Problems p4 */
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-callout + .wp-block-charis-statement {
		margin-block-start: 52px; /* Problems pb4 + Statement p48 */
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-partner-logos + .wp-block-charis-quote {
		margin-block-start: 80px; /* Partners pb32 + Stories p48 */
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-partner-logos + :not(.wp-block-charis-quote) {
		margin-block-start: 40px;
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-quote + .wp-block-charis-cta-cards {
		margin-block-start: 48px; /* Stories pb48 (Useful info p56 is the block padding) */
	}

	/* Benefit calculator landing: rhythm 32 / 24 / 64, bottom 56. */
	.wp-block-group.is-style-content-section {
		padding-block-end: 56px;
	}

	.wp-block-group.is-style-content-section > .wp-block-group.is-style-container > * + * {
		margin-block-start: 32px;
	}

	/* First visible block sits right under the hero (hero pb24), even when an
	 * empty row precedes it or the editor gave it a desktop top margin. */
	.wp-block-group.is-style-content-section > .wp-block-group.is-style-container > :first-child,
	.wp-block-group.is-style-content-section > .wp-block-group.is-style-container > .is-style-content-row:first-child:not(:has(> :not(p:empty))) + * {
		margin-block-start: 0 !important;
	}

	.wp-block-group.is-style-content-section > .wp-block-group.is-style-container > .is-style-content-row + .is-style-content-row {
		margin-block-start: 24px;
	}

	.wp-block-group.is-style-content-section > .wp-block-group.is-style-container > :last-child:not(:first-child) {
		margin-block-start: 64px !important; /* text-block pb32 + CTA section pt32 (overrides inline margin) */
	}

	/* Body/S 16/22 (+6%) in text rows, Body/M 16/24 in the card; indigo text. */
	.wp-block-group.is-style-content-section .is-style-content-row p {
		font-size: 16px;
		line-height: 22px;
		letter-spacing: 0.06em;
		color: var(--wp--preset--color--brand-indigo);
	}

	.wp-block-group.is-style-content-section .is-style-card-row p {
		font-size: 16px;
		line-height: 24px;
		letter-spacing: 0.05em;
		color: var(--wp--preset--color--brand-indigo);
	}

	.wp-block-group.is-style-content-section .is-style-card-row h3.wp-block-heading {
		font-size: 24px !important;
		line-height: 32px !important;
	}

	/* CTA card: H3 -> button gap 24, Control/M 16/24, button padding 16 20
	 * (Figma 366x192). */
	.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) > .wp-block-buttons {
		margin-block-start: 24px !important;
	}

	.wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) .wp-block-button__link {
		padding: 16px 20px !important;
		font-size: 16px;
		line-height: 24px;
	}
}

/* Tablet (768-1023) on About / Benefit calculator: mobile grid, side
 * margin 12. */
@media (min-width: 768px) and (max-width: 1023px) {

	.wp-block-group.is-style-editorial-stack {
		padding-inline: var(--wp--preset--spacing--30);
	}

	.wp-block-group.is-style-page-hero:has(+ .is-style-editorial-stack) > .wp-block-group.is-style-container,
	.wp-block-group.is-style-page-hero:has(+ .is-style-content-section) > .wp-block-group.is-style-container,
	.wp-block-group.is-style-content-section > .wp-block-group.is-style-container {
		padding-inline: var(--wp--preset--spacing--30);
	}
}

/* Tablet = mobile values for the same pages (Figma has no tablet design). */
@media (min-width: 768px) and (max-width: 1023px) {

	.wp-block-group.is-style-page-hero:has(+ .is-style-editorial-stack) .wp-block-post-title,
	.wp-block-group.is-style-page-hero:has(+ .is-style-content-section) .wp-block-post-title {
		font-size: 40px;
		line-height: 48px;
	}

	.wp-block-group.is-style-page-hero:has(+ .is-style-editorial-stack) .wp-block-post-excerpt {
		font-size: 24px;
		line-height: 32px;
	}

	.wp-block-group.is-style-content-section .is-style-content-row > h2.wp-block-heading,
	.wp-block-group.is-style-content-section .is-style-content-row > h3.wp-block-heading {
		font-size: 20px !important;
		line-height: 24px !important;
	}

	.wp-block-group.is-style-content-section .wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) {
		padding: var(--wp--preset--spacing--60) !important;
	}

	.wp-block-group.is-style-content-section .wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) > .wp-block-heading {
		font-size: 24px !important;
		line-height: 32px !important;
	}

	.wp-block-group.is-style-content-section .wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) > .wp-block-buttons,
	.wp-block-group.is-style-content-section .wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) .wp-block-button,
	.wp-block-group.is-style-content-section .wp-block-group.has-background:has(> .wp-block-heading + .wp-block-buttons.is-content-justification-center) .wp-block-button__link {
		width: 100%;
		box-sizing: border-box;
	}
}

/* Tablet: About block typography follows the mobile scale (Figma Mobile). */
@media (min-width: 768px) and (max-width: 1023px) {

	.wp-block-group.is-style-editorial-stack .wp-block-charis-section-intro__heading,
	.wp-block-group.is-style-editorial-stack .wp-block-charis-cta-cards__heading,
	.wp-block-group.is-style-editorial-stack .wp-block-charis-cta-cards__title {
		font-size: 24px;
		line-height: 32px;
	}

	.wp-block-group.is-style-editorial-stack .wp-block-charis-statement__text {
		font-size: 32px;
		line-height: 40px;
	}

	.wp-block-group.is-style-editorial-stack .wp-block-charis-partner-logos__heading {
		font-size: 20px;
		line-height: 24px;
	}

	.wp-block-group.is-style-editorial-stack .wp-block-charis-cta-cards__heading {
		margin-bottom: 0;
	}
}

/* ---- Pixel audit: Benefit calculator page (Inbest widget) ------------------
 * Figma Desktop 195:26292 (1280x1319) and Mobile 198:26939 (390x1745):
 * back link p24 (desktop) / p20 (mobile) under the bar, Header p40|32 above
 * the H1, H1 -> cards 68 desktop / 88 mobile (intro slot 12 + 44|64 + 12),
 * cards column 800 desktop / Fill mobile, Header pb 24|20 -> footer.
 * Tablet = mobile. */
body:has(.wp-block-charis-inbest-calculator) .wp-block-group.is-style-page-hero {
	padding-block: 24px 68px;
}

body:has(.wp-block-charis-inbest-calculator) .wp-block-group.is-style-page-hero > .wp-block-group.is-style-container {
	gap: 40px;
}

body:has(.wp-block-charis-inbest-calculator) .charis-back-link {
	display: flex;
	margin: 0;
	font-size: 16px;
	line-height: 24px;
}

body:has(.wp-block-charis-inbest-calculator) .wp-block-group.is-style-content-section {
	padding-block-end: 24px;
}

body:has(.wp-block-charis-inbest-calculator) .wp-block-charis-inbest-calculator + .wp-block-group {
	margin-block-start: 12px;
}

@media (max-width: 1023px) {

	body:has(.wp-block-charis-inbest-calculator) .wp-block-group.is-style-page-hero {
		padding-block: 20px 66px;
	}

	body:has(.wp-block-charis-inbest-calculator) .wp-block-group.is-style-page-hero > .wp-block-group.is-style-container {
		gap: 32px;
	}

	body:has(.wp-block-charis-inbest-calculator) .wp-block-group.is-style-content-section {
		padding-block-end: 20px;
	}
}

@media (max-width: 767px) {

	body:has(.wp-block-charis-inbest-calculator) .wp-block-group.is-style-page-hero {
		padding-block-end: 88px;
	}
}

/*
 * Figma Benefit calculator "Section / Text blocks": the body column is one
 * Body/S text (16/24, 0.06em) with no gap between paragraphs. Emphasis is
 * bold, not italic, and links are bold tangerine (#FF4F14) with an underline.
 */
.wp-block-group.is-style-content-row > :last-child:not(:first-child) {
	gap: 0;
}

.wp-block-group.is-style-content-row > :last-child:not(:first-child) > * {
	margin-block: 0;
}

.wp-block-group.is-style-content-row p,
.wp-block-group.is-style-content-section .is-style-card-row p {
	color: var(--wp--preset--color--brand-indigo); /* Figma #251A5D (was near-black on desktop) */
}

.wp-block-group.is-style-content-row p {
	font-size: var(--wp--preset--font-size--fs-body-s);
	letter-spacing: var(--wp--custom--charis--ls-body-s);
	line-height: 24px;
}

.wp-block-group.is-style-content-row em {
	font-style: normal;
}

.wp-block-group.is-style-content-row strong {
	font-weight: 700; /* Figma bold; measured against the frame */
}

.wp-block-group.is-style-content-row a,
.charis-page .wp-block-group.is-style-content-row :is(p, li) a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--brand-tangerine); /* Figma #FF4F14 */
	font-weight: 700;
	text-decoration-line: underline;
}

/* Figma Desktop / About "Section / Big text": H4 32/40 with no tracking
 * (the 0.9px inherited from the 18px body made it wrap early), 4px below
 * the header. */
.wp-block-group.is-style-page-hero .wp-block-post-excerpt {
	letter-spacing: var(--wp--custom--charis--ls-heading);
}

@media (min-width: 1024px) {

	.wp-block-group.is-style-page-hero:has(+ .is-style-editorial-stack) .wp-block-post-excerpt {
		margin-top: -4px;
	}
}

/* ---- Pixel audit round 4: About, mobile grid (<=1023) -------------------
 * Figma Mobile / About section tops: Problems intro 1488, cards 1608 and
 * 2112 (two sections with p4 each), Big text pb8, Partners pt32. */
@media (max-width: 1023px) {

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-media-callout + .wp-block-charis-media-callout {
		margin-block-start: 8px; /* Section pb4 + next Section pt4 */
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-statement + .wp-block-charis-numbers {
		margin-block-start: 8px; /* Big text pb8 */
	}

	.wp-block-group.is-style-editorial-stack > .wp-block-charis-numbers + .wp-block-charis-partner-logos {
		margin-block-start: 32px; /* Partners pt32 */
	}
}

/* ---- Core blocks, designer pass (2026-11-09) ---------------------------
 * Brings the rarely used core blocks in line with the Figma language:
 * r-24 media radius, indigo type, lavender hairlines, tangerine accents. */

/* Pullquote / quote: lead the section — larger indigo text, left aligned
 * to match the tangerine rule. */
.wp-block-pullquote {
	text-align: left;
}

.wp-block-pullquote blockquote {
	margin: 0;
	padding: 0;
}

.wp-block-quote p,
.wp-block-pullquote blockquote p {
	color: var(--wp--preset--color--brand-indigo);
	font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem);
	font-weight: 400;
	line-height: 1.35;
	text-wrap: balance;
}

/* Cover: same r-24 as every other media block. */
.wp-block-cover {
	overflow: hidden;
	border-radius: var(--wp--preset--border-radius--r-24);
}

/* Gallery: captions sit under the picture (readable), not on top of it. */
.wp-block-gallery.has-nested-images figure.wp-block-image {
	flex-direction: column;
	justify-content: flex-start;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static;
	max-height: none;
	padding: var(--wp--preset--spacing--30) 0 0;
	background: none;
	color: var(--wp--preset--color--text-placeholder);
	text-align: left;
}

/* Details: hairline frame so it reads on grey and white, chevron instead of
 * the browser triangle. */
.wp-block-details {
	border: 1px solid var(--wp--preset--color--brand-lavender);
	background-color: var(--wp--preset--color--bg-white);
}

.wp-block-details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--brand-indigo);
	list-style: none;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-right: 2px solid var(--wp--preset--color--brand-tangerine);
	border-bottom: 2px solid var(--wp--preset--color--brand-tangerine);
	transform: rotate(45deg);
	transition: transform var(--charis-hover-duration) var(--charis-hover-easing);
}

.wp-block-details[open] summary::after {
	transform: rotate(-135deg);
}

/* Audio: full width, rounded to match video. */
.wp-block-audio audio {
	width: 100%;
	border-radius: var(--wp--preset--border-radius--r-8);
}

/* Code: lavender hairline so the block holds its shape on any surface. */
.wp-block-code {
	border: 1px solid var(--wp--preset--color--brand-lavender);
	background-color: var(--wp--preset--color--bg-white);
}

/* Benefit calculator, phones: Figma Mobile "Text blocks" uses the same
 * pattern as About - H5 label, 24px gap, copy indented 32px (334 wide). The
 * copy gets the trailing tracking back (Figma ignores it at line ends). */
@media (max-width: 767px) {

	.wp-block-group.is-style-content-section .is-style-content-row > * + * {
		margin-block-start: var(--wp--preset--spacing--60);
	}

	.wp-block-group.is-style-content-section .is-style-content-row > :last-child:not(:first-child) {
		padding-inline-start: 32px;
	}

	.wp-block-group.is-style-content-section .is-style-content-row p {
		margin-inline-end: -0.06em;
	}

	/* Figma M H5 label: 20/24, measured ~0.03em on Mobile / Benefit calculator. */
	.wp-block-group.is-style-content-section .is-style-content-row > h2.wp-block-heading,
	.wp-block-group.is-style-content-section .is-style-content-row > h3.wp-block-heading {
		letter-spacing: 0.03em;
	}

	/* Card copy: Figma fits "financial situation, we recommend contacting"
	 * (319.6px with tracking) on one line of the 318px column. */
	.wp-block-group.is-style-content-section .is-style-card-row p {
		margin-inline-end: -2px;
	}

}

/* Benefit calculator card: 12px between paragraphs (16 under the H4) at
 * every width; desktop text rows start 28px under the H1 (Figma). */
.wp-block-group.is-style-content-section .is-style-card-row p + p {
	margin-block-start: 12px;
}

/* "bolder" on the 300-weight copy only reaches 400; Figma uses semibold. */
.wp-block-group.is-style-content-section .is-style-card-row strong {
	font-weight: 700;
}

@media (min-width: 1024px) {

	.wp-block-group.is-style-page-hero:has(+ .is-style-content-section) {
		padding-block-end: 28px;
	}

	/* CTA card -> footer: Figma Section / Banner pb96. */
	.wp-block-group.is-style-page-hero + .wp-block-group.is-style-content-section {
		padding-block-end: 96px;
	}
}

/* ---- Core blocks, designer pass 2: concepts from the Figma pages --------
 * Quote card (white r-32 card, outlined tangerine glyph, bold author line),
 * "Picture + slogan" cover (r-32 photo, big white slogan bottom-left over a
 * soft indigo fade), text columns with indigo lead headings, media & text
 * on a pale card, file as a card. */

.wp-block-pullquote {
	padding: var(--wp--preset--spacing--80);
	border: 0;
	border-radius: var(--wp--preset--border-radius--r-32);
	background-color: var(--wp--preset--color--bg-white);
}

.wp-block-pullquote::before {
	width: 64px;
	height: 42px;
	background-color: var(--wp--preset--color--brand-tangerine);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 32'%3E%3Cpath d='M2 30c0-13 6-24 18-29l3.2 5.6C14.5 11.6 11 18.1 11 24h10v8H2Zm26 0c0-13 6-24 18-29l3.2 5.6C40.5 11.6 37 18.1 37 24h10v8H28Z' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 32'%3E%3Cpath d='M2 30c0-13 6-24 18-29l3.2 5.6C14.5 11.6 11 18.1 11 24h10v8H2Zm26 0c0-13 6-24 18-29l3.2 5.6C40.5 11.6 37 18.1 37 24h10v8H28Z' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.wp-block-pullquote cite {
	margin-top: var(--wp--preset--spacing--60);
	color: var(--wp--preset--color--brand-indigo);
	font-weight: 700;
}

.wp-block-cover {
	min-height: 440px;
	padding: var(--wp--preset--spacing--80);
	border-radius: var(--wp--preset--border-radius--r-32);
}

.wp-block-cover:not([class*="is-position-"]) {
	align-items: flex-end;
	justify-content: flex-start;
}

.wp-block-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to top, color-mix(in srgb, var(--wp--preset--color--brand-indigo) 70%, transparent), transparent 65%);
	pointer-events: none;
}

.wp-block-cover .wp-block-cover__inner-container {
	z-index: 2;
	text-align: left;
}

.wp-block-cover .wp-block-cover__inner-container > h2,
.wp-block-cover .wp-block-cover__inner-container > .wp-block-heading {
	max-width: 18ch;
	font-size: clamp(2rem, 1.4rem + 2vw, 3.5rem);
	line-height: 1.1;
}

.wp-block-cover .wp-block-cover__inner-container > p {
	max-width: 48ch;
}

/* Text columns: bold indigo lead heading + calm body, like the About text
 * blocks. */
.wp-block-column > .wp-block-heading {
	font-size: var(--wp--preset--font-size--fs-h4);
	line-height: 1.3;
}

/* Media & text sits on a pale card so it reads as one component. */
.wp-block-media-text {
	overflow: hidden;
	border-radius: var(--wp--preset--border-radius--r-32);
	background-color: var(--wp--preset--color--bg-lightblue);
}

.wp-block-media-text .wp-block-media-text__content {
	padding: var(--wp--preset--spacing--80);
}

.wp-block-media-text__media img,
.wp-block-media-text__media video {
	border-radius: 0;
}

/* File: a white card with the download button on the right. */
.wp-block-file {
	justify-content: space-between;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	border-radius: var(--wp--preset--border-radius--r-24);
	background-color: var(--wp--preset--color--bg-white);
	border: 1px solid var(--wp--preset--color--brand-lavender);
}

/* Audio / video sit inside the same r-24 rhythm. */
.wp-block-audio audio {
	border-radius: var(--wp--preset--border-radius--r-24);
}

.wp-block-media-text.is-vertically-aligned-center {
	align-items: stretch;
}

.wp-block-media-text.is-vertically-aligned-center > .wp-block-media-text__content {
	align-self: center;
}

.wp-block-media-text__media {
	margin: 0;
}

.wp-block-media-text__media img,
.wp-block-media-text__media video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Image swaps removed (2026-11-12): pictures are Media Library files picked
 * in the blocks, and per-breakpoint art is chosen in the block itself.
 * No CSS here may key on a file name or swap an <img> with content:url(). */

/* Home (Figma Mobile / Home): the hero CTA stack sits 0.5px higher than our
 * integer layout puts it; everything below inherits that half pixel. */
@media (max-width: 767px) {

	.wp-block-charis-hero__buttons {
		margin-top: -0.5px;
	}
}

