/* ============================================================
   The Equation page — one-off layout (loads after theme.css on
   /equation/ only).
   ============================================================ */

/* Hero: "The Equation:" kicker tight above the h1. */
.ao-eq-hero .ao-eq-hero__kicker {
	margin-bottom: 0;
	font-family: var(--wp--preset--font-family--slab);
}

.ao-eq-hero .ao-eq-hero__kicker + .wp-block-heading {
	margin-top: 0.25rem;
}

/* Beside the teal arrows on black, the design sets the link in white. */
.is-style-band-black .ao-arrow--teal a {
	color: var(--wp--preset--color--white);
}

.ao-eq-hero .wp-block-column > p:not(.ao-arrow) + .ao-arrow {
	margin-top: var(--wp--preset--spacing--60);
}

/* Phones: the neon wall is a banner, not a screenful, so the headline
   shows above the fold. */
@media (max-width: 781px) {
	.ao-eq-hero img {
		width: 100%;
		max-height: 34svh;
		object-fit: cover;
	}
}

/* From 782px the neon wall runs off the left edge (.ao-bleed-start), so the
   band needs less top padding to clear the header. */
@media (min-width: 782px) {
	.wp-block-group.is-style-band-black.ao-eq-hero {
		padding-top: var(--wp--preset--spacing--50);
	}
}

/* Tablet: the 66/34 desktop split leaves the copy too narrow. */
@media (min-width: 782px) and (max-width: 1099px) {
	.ao-eq-hero .wp-block-column:first-child {
		flex-basis: 55% !important;
	}
	.ao-eq-hero .ao-eq-hero__text {
		flex-basis: 45% !important;
	}
}

/* Desktop: as designed, the copy floats over the photo's dark right edge
   and reaches a little into the right gutter, so from about 1280px the
   headline holds one line (two below). Negative margins keep its flex
   footprint at 34%. */
@media (min-width: 1100px) {
	.ao-eq-hero .ao-eq-hero__text {
		position: relative;
		z-index: 1;
		flex-basis: calc(34% + 10% + var(--wp--preset--spacing--40)) !important;
		margin-inline: -10% calc(-1 * var(--wp--preset--spacing--40));
	}
}

/* Copy sits indented under its eyebrow, as in the design. */
@media (min-width: 782px) {
	.ao-eq-copy {
		padding-inline-start: var(--wp--preset--spacing--50);
	}
}

.ao-eq-copy > * + * {
	margin-top: 0.75rem;
}

.ao-eq-copy h3 + p {
	margin-top: 0.25rem;
}

/* Stacked: the Multiplier's heading and copy lead, the diagram follows. */
@media (max-width: 781px) {
	.ao-eq-multiplier > .wp-block-column:last-child {
		order: -1;
	}
}

/* "Ideas fade. / Motivation drops. / Progress stalls." steps down. */
.ao-cascade > p {
	margin: 0;
}

.ao-cascade > p:nth-child(2) {
	padding-inline-start: 1em;
}

.ao-cascade > p:nth-child(3) {
	padding-inline-start: 2em;
}

/* ------------------------------------------------------------
   Triangle diagram: client art with real-text labels laid over it.
   Labels flank the top corners; the result word sits under the apex.
   ------------------------------------------------------------ */
.ao-eqtri {
	container-type: inline-size;
	display: grid;
	grid-template-columns: 1fr 3fr 1fr;
	grid-template-areas:
		"purpose art positivity"
		". result .";
	column-gap: 0;
	align-items: start;
	max-width: 640px;
	margin-inline: auto;
}

.ao-eqtri > * {
	margin: 0;
}

.ao-eqtri__art {
	grid-area: art;
}

.ao-eqtri__art img {
	display: block;
	width: 100%;
	height: auto;
}

.ao-eqtri__label {
	position: relative;
	z-index: 1;
	color: color-mix(in srgb, var(--wp--preset--color--black) 78%, transparent);
	line-height: 1.3;
}

.ao-eqtri__label p {
	margin: 0;
}

.ao-eqtri__label--purpose {
	grid-area: purpose;
}

.ao-eqtri__label--positivity {
	grid-area: positivity;
	text-align: right;
}

.ao-eqtri__name {
	font-family: var(--wp--preset--font-family--slab);
	font-weight: 700;
	font-size: clamp(1rem, 3.6cqi, 1.35rem);
	line-height: 1.1;
}

.ao-eqtri__label .has-sm-font-size {
	font-size: clamp(0.75rem, 2cqi, 0.8125rem) !important;
	margin-top: 0.35em;
}

/* Perseverance sits inside the inner (gold) triangle. */
.ao-eqtri__middle {
	grid-area: art;
	align-self: start;
	justify-self: center;
	width: 54%;
	margin-top: 16%;
	text-align: center;
	color: var(--wp--preset--color--black);
	line-height: 1.25;
}

.ao-eqtri__middle p {
	margin: 0;
}

.ao-eqtri__middle .ao-eqtri__name {
	font-size: clamp(0.9rem, 3.2cqi, 1.2rem);
}

.ao-eqtri__middle .has-sm-font-size {
	font-size: clamp(0.75rem, 2.2cqi, 0.8rem) !important;
	margin-top: 0.35em;
}

.ao-eqtri__result {
	grid-area: result;
	text-align: center;
	font-family: var(--wp--preset--font-family--slab);
	font-weight: 700;
	font-size: clamp(1.75rem, 7cqi, 2.75rem);
	line-height: 1.05;
	margin-top: 0.5rem !important;
}

/* Narrow: labels move above the art so they never crowd the triangle. */
/* Measured on the diagram's column, so it also stacks at tablet/laptop
   widths where the column is too narrow for side labels. */
.wp-block-column:has(> .ao-eqtri) {
	container-type: inline-size;
}

@container (max-width: 520px) {
	.ao-eqtri {
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"purpose positivity"
			"art art"
			"result result";
		row-gap: 1rem;
		column-gap: 1rem;
	}
	.ao-eqtri__label .has-sm-font-size {
		font-size: 0.8rem !important;
	}
	.ao-eqtri__middle {
		width: 58%;
		margin-top: 15%;
	}
	.ao-eqtri__middle .has-sm-font-size {
		font-size: 0.75rem !important;
	}
}

/* Phones: a full-width diagram towers over its copy. */
@media (max-width: 781px) {
	.ao-eqtri {
		max-width: 320px;
	}
}

/* The formulas above the triangles: one line at desktop, as designed. */
.ao-eq-formula {
	font-size: clamp(1.3rem, 2vw, 1.75rem);
	margin-bottom: var(--wp--preset--spacing--40);
}

.ao-eq-formula__result {
	font-size: 1.2em;
}

/* ------------------------------------------------------------
   Self-assessment: three colored cards, each a 1–5 ordered list
   whose numbers sit in tinted circles to the card's left.
   ------------------------------------------------------------ */
.ao-assess {
	margin-top: var(--wp--preset--spacing--50);
	gap: var(--wp--preset--spacing--50);
}

.ao-assess__card {
	--ao-c: var(--wp--preset--color--magenta);
	position: relative;
	height: 100%;
	box-sizing: border-box;
	margin-inline-start: 2.6rem;
	padding: 0.75rem 1.25rem 1.5rem;
	border-radius: 18px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.ao-assess__card.has-orange-background-color { --ao-c: var(--wp--preset--color--orange); }
.ao-assess__card.has-aqua-background-color   { --ao-c: var(--wp--preset--color--aqua); }

.ao-assess__card h4 {
	margin: 0 0 0.5rem;
	font-size: var(--wp--preset--font-size--lg);
	hyphens: none;
	overflow-wrap: normal;
}

/* Below 1200px three side-by-side cards are too narrow for their slab
   headings and statements: stack them, as on phones. */
@media (max-width: 1199px) {
	.ao-assess {
		flex-wrap: wrap !important;
	}
	.ao-assess > .wp-block-column {
		flex-basis: 100% !important;
	}
}

.ao-scale {
	/* A zero-width-space marker (not list-style:none) hides the numbers yet
	   keeps list semantics in Safari/VoiceOver; the circles are ::before. */
	list-style-type: "\200B";
	margin: 0;
	padding: 0;
	counter-reset: ao-scale;
}

.ao-scale--italic li {
	font-style: italic;
}

.ao-scale li {
	position: relative;
	counter-increment: ao-scale;
	min-height: 2.1rem;
	display: flex;
	align-items: center;
	line-height: 1.25;
	font-size: var(--wp--preset--font-size--base);
}

.ao-scale li + li {
	margin-top: 0.85rem;
}

.ao-scale li::before {
	content: counter(ao-scale);
	position: absolute;
	left: calc(-1.25rem - 2.6rem + 0.15rem);
	top: 50%;
	transform: translateY(-50%);
	width: 2.1rem;
	height: 2.1rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--black) 15%, transparent);
	background: color-mix(in srgb, var(--ao-c) var(--ao-tint, 25%), var(--wp--preset--color--white));
	font-family: var(--wp--preset--font-family--slab);
	font-weight: 700;
	font-style: normal;
	font-size: 1.15rem;
	line-height: 1;
	padding-top: 0.12em;
	box-sizing: border-box;
	/* Dark numerals: they carry meaning, and white fails on the light tints. */
	color: var(--wp--preset--color--black);
	text-shadow: none;
}

.ao-scale li:nth-child(2)::before { --ao-tint: 45%; }
.ao-scale li:nth-child(3)::before { --ao-tint: 65%; }
.ao-scale li:nth-child(4)::before { --ao-tint: 85%; }
.ao-scale li:nth-child(5)::before {
	--ao-tint: 100%;
	border: 2px solid var(--wp--preset--color--black);
}

.ao-assess__close {
	margin-top: var(--wp--preset--spacing--50);
}

.ao-assess__close-row {
	gap: 0.5rem var(--wp--preset--spacing--60);
	align-items: baseline;
}

.ao-assess__close-row > p,
.ao-assess__close > p {
	margin: 0;
}

.ao-assess__close > p {
	margin-top: 0.4rem;
}

/* ------------------------------------------------------------
   Closing CTA
   ------------------------------------------------------------ */
.ao-eq-cta h2 em {
	font-style: italic;
}


.ao-eq-cta .wp-block-image img {
	max-width: min(100%, 270px);
}

.ao-eq-cta .wp-block-button__link {
	white-space: nowrap;
}

/* Tablet: two columns — the copy with the button under it on the left, the
   book on the right, and the organization link along the foot. The book's
   column steps aside (display: contents) so its two blocks can be placed. */
@media (min-width: 782px) and (max-width: 1199px) {
	.wp-block-columns.ao-eq-cta {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
	}
	.ao-eq-cta > .wp-block-column:nth-child(1) {
		grid-area: 1 / 1;
	}
	.ao-eq-cta > .wp-block-column:nth-child(2) {
		grid-area: 2 / 1;
	}
	.ao-eq-cta > .wp-block-column:nth-child(2) .wp-block-buttons {
		justify-content: flex-start;
	}
	.ao-eq-cta > .wp-block-column:nth-child(3) {
		display: contents;
	}
	.ao-eq-cta > .wp-block-column:nth-child(3) > .wp-block-image {
		grid-area: 1 / 2 / 3 / 3;
		margin: 0;
	}
	.ao-eq-cta > .wp-block-column:nth-child(3) > .ao-arrow {
		grid-area: 3 / 1 / 4 / 3;
	}
	.ao-eq-cta .wp-block-image img {
		max-width: 240px;
	}
}

.ao-eq-cta .ao-arrow {
	margin-top: var(--wp--preset--spacing--40);
}

@media (max-width: 781px) {
	.ao-eq-cta .ao-arrow {
		text-align: center;
	}
	.ao-eq-cta .wp-block-image img {
		max-width: 170px;
	}
}
