/**
 * EyeQBoost – homepage sections.
 *
 * Styles for patterns/home-*.php and patterns/cta-closing.php.
 * Mobile-first. Colours, sizes and spacing come from theme.json presets only.
 *
 * @package eyeqboost
 */

/* ---------------------------------------------------------------
 * Shared section helpers
 * ------------------------------------------------------------- */

.eqb-home-section,
.eqb-cta-closing {
	position: relative;
	overflow: clip;
}

/* Centred section intro: eyebrow, h2, short paragraph. */
.eqb-home-head {
	text-align: center;
}

.eqb-home-head > p:not(.is-style-eqb-eyebrow) {
	color: var(--wp--preset--color--ink-soft);
}

.eqb-home-section .eqb-home-head + * {
	margin-block-start: var(--wp--preset--spacing--60);
}

.eqb-home-section .eqb-home-grid + * {
	margin-block-start: var(--wp--preset--spacing--60);
}

.eqb-home-section h2,
.eqb-home-section h3,
.eqb-cta-closing h2 {
	overflow-wrap: break-word;
	hyphens: auto;
}

/* Standalone "more" link with an arrow. */
.eqb-home-more a {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	text-underline-offset: 0.2em;
}

.eqb-home-more a::after {
	content: "\00a0\2192";
	content: "\00a0\2192" / "";
	display: inline-block;
	text-decoration: none;
}

.eqb-home-section > .eqb-home-more {
	text-align: center;
}

/* ---------------------------------------------------------------
 * Card grids (1 column on phones, more as space allows)
 * ------------------------------------------------------------- */

.wp-block-group.eqb-home-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
}

.wp-block-group.eqb-home-grid > * {
	margin: 0;
	min-width: 0;
}

.eqb-home-grid > .wp-block-group > :first-child {
	margin-block-start: 0;
}

.eqb-home-grid > .wp-block-group > :last-child {
	margin-block-end: 0;
}

@media (min-width: 600px) {
	.wp-block-group.eqb-home-grid--4,
	.wp-block-group.eqb-home-grid--5 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wp-block-group.eqb-home-grid--5 > :nth-child(5) {
		grid-column: 1 / -1;
	}
}

@media (min-width: 782px) {
	.wp-block-group.eqb-home-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	/* 3 + 2, with the second row centred. */
	.wp-block-group.eqb-home-grid--5 {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.wp-block-group.eqb-home-grid--5 > * {
		grid-column: span 2;
	}

	.wp-block-group.eqb-home-grid--5 > :nth-child(4) {
		grid-column: 2 / span 2;
	}

	.wp-block-group.eqb-home-grid--5 > :nth-child(5) {
		grid-column: 4 / span 2;
	}
}

@media (min-width: 1024px) {
	.wp-block-group.eqb-home-grid--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.wp-block-group.eqb-home-grid--5 {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.wp-block-group.eqb-home-grid--5 > *,
	.wp-block-group.eqb-home-grid--5 > :nth-child(4),
	.wp-block-group.eqb-home-grid--5 > :nth-child(5) {
		grid-column: auto;
	}
}

/* ---------------------------------------------------------------
 * 1. Hero
 * ------------------------------------------------------------- */

.eqb-home-hero::before,
.eqb-home-hero::after {
	content: "";
	position: absolute;
	z-index: 0;
	pointer-events: none;
	background: var(--wp--preset--gradient--brand);
	border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
	opacity: 0.12;
}

.eqb-home-hero::before {
	width: 26rem;
	height: 26rem;
	top: -9rem;
	right: -9rem;
}

.eqb-home-hero::after {
	width: 14rem;
	height: 14rem;
	bottom: -5rem;
	left: -5rem;
	background: var(--wp--preset--gradient--soft);
	opacity: 1;
}

.eqb-home-hero > * {
	position: relative;
	z-index: 1;
}

.eqb-home-hero__title {
	overflow-wrap: break-word;
}

.eqb-home-hero__title mark {
	color: var(--wp--preset--color--magenta);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.eqb-home-hero__title mark {
		background-image: var(--wp--preset--gradient--brand);
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
	}
}

.eqb-home-hero__lead {
	color: var(--wp--preset--color--ink-soft);
}

.eqb-home-hero__trust {
	color: var(--wp--preset--color--ink-soft);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.eqb-home-hero__trust::before {
	content: "";
	display: inline-block;
	width: 0.6em;
	height: 0.6em;
	margin-inline-end: 0.5em;
	border-radius: 50%;
	background: var(--wp--preset--color--sunshine);
	vertical-align: 0.05em;
}

.eqb-home-hero__media {
	margin: 0 auto;
	max-width: 30rem;
}

.eqb-home-hero__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 7 / 6;
	object-fit: contain;
}

@media (min-width: 782px) {
	.eqb-home-hero__media {
		max-width: none;
	}
}

/* ---------------------------------------------------------------
 * 2. The challenge
 * ------------------------------------------------------------- */

.eqb-home-challenge__card::before {
	content: "";
	display: block;
	width: 0.9rem;
	height: 0.9rem;
	margin-block-end: var(--wp--preset--spacing--30);
	border-radius: 50%;
	background: var(--wp--preset--gradient--brand);
}

.eqb-home-challenge__close {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	line-height: 1.2;
	color: var(--wp--preset--color--purple);
}

.eqb-home-head > p.eqb-home-challenge__close {
	color: var(--wp--preset--color--purple);
}

/* ---------------------------------------------------------------
 * 3. Five pillars
 * ------------------------------------------------------------- */

.eqb-home-pillar {
	--eqb-pillar: var(--wp--preset--color--purple);
}

.eqb-home-pillar--blue {
	--eqb-pillar: var(--wp--preset--color--blue);
}

.eqb-home-pillar--magenta {
	--eqb-pillar: var(--wp--preset--color--magenta);
}

.eqb-home-pillar--sunshine {
	--eqb-pillar: var(--wp--preset--color--sunshine);
}

.eqb-home-pillar--purple {
	--eqb-pillar: var(--wp--preset--color--purple);
}

.eqb-home-pillar--lead {
	--eqb-pillar: var(--wp--preset--gradient--brand);
}

.eqb-home-pillar::before {
	content: "";
	display: block;
	width: 2.75rem;
	height: 2.75rem;
	margin-block-end: var(--wp--preset--spacing--40);
	border-radius: 46% 54% 58% 42% / 44% 46% 54% 56%;
	background: var(--eqb-pillar);
}

/* "Learn more" link to each pillar page, pinned to the card bottom. */
.wp-block-group.eqb-home-pillar {
	display: flex;
	flex-direction: column;
}

.eqb-home-pillar > .eqb-home-more {
	margin-block-start: auto;
	padding-block-start: var(--wp--preset--spacing--30);
}

.eqb-home-pillar--lead .eqb-home-more a,
.eqb-page-on-dark .eqb-home-more a {
	color: var(--wp--preset--color--sunshine);
}

/* ---------------------------------------------------------------
 * 4. How it works
 * ------------------------------------------------------------- */

.eqb-home-step__num {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 800;
	line-height: 1;
	color: var(--wp--preset--color--purple);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.eqb-home-step__num {
		width: fit-content;
		background-image: var(--wp--preset--gradient--brand);
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
	}
}

@media (min-width: 782px) {
	.wp-block-group.eqb-home-steps {
		gap: var(--wp--preset--spacing--60);
	}

	.eqb-home-step {
		position: relative;
		overflow: visible;
	}

	/* Dashed connector across the gap to the next step. */
	.eqb-home-step:not(:last-child)::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 100%;
		width: var(--wp--preset--spacing--60);
		border-top: 3px dashed var(--wp--preset--color--purple);
		opacity: 0.6;
	}
}

/* ---------------------------------------------------------------
 * 5. Results
 * ------------------------------------------------------------- */

.eqb-home-stat {
	text-align: center;
}

.eqb-home-stat > p:not(.eqb-home-stat__number) {
	color: var(--wp--preset--color--ink-soft);
}

.eqb-home-stat__number {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	line-height: 1;
	color: var(--wp--preset--color--purple);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.eqb-home-stat__number {
		width: fit-content;
		margin-inline: auto;
		background-image: var(--wp--preset--gradient--brand);
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
	}
}

.eqb-home-footnote {
	color: var(--wp--preset--color--ink-soft);
}

/* ---------------------------------------------------------------
 * 6. Try it
 * ------------------------------------------------------------- */

.eqb-home-try::before {
	content: "";
	position: absolute;
	z-index: 0;
	top: 12%;
	left: -4rem;
	width: 10rem;
	height: 10rem;
	border-radius: 50%;
	background: var(--wp--preset--color--sunshine);
	opacity: 0.35;
	pointer-events: none;
}

.eqb-home-try > * {
	position: relative;
	z-index: 1;
}

.eqb-home-try__icon {
	margin-block-end: 0;
}

.eqb-home-try__icon img {
	width: 4.5rem;
	height: auto;
}

/* ---------------------------------------------------------------
 * 7. Programs
 * ------------------------------------------------------------- */

.eqb-home-program {
	--eqb-accent: var(--wp--preset--color--purple);
	display: flex;
	flex-direction: column;
	border-top: 0.375rem solid var(--eqb-accent);
}

.eqb-home-program--blue {
	--eqb-accent: var(--wp--preset--color--blue);
}

.eqb-home-program--magenta {
	--eqb-accent: var(--wp--preset--color--magenta);
}

.eqb-home-program__age {
	color: var(--wp--preset--color--ink-soft);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.eqb-home-program__list {
	list-style: none;
	padding-inline-start: 0;
}

.eqb-home-program__list li {
	position: relative;
	padding-inline-start: 1.6rem;
}

.eqb-home-program__list li + li {
	margin-block-start: var(--wp--preset--spacing--20);
}

.eqb-home-program__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	background: var(--eqb-accent);
}

.eqb-home-program > .eqb-home-more {
	margin-block-start: auto;
	padding-block-start: var(--wp--preset--spacing--30);
}

/* ---------------------------------------------------------------
 * 8. From the blog
 * ------------------------------------------------------------- */

.eqb-home-posts__head {
	align-items: flex-end;
}

.eqb-home-posts__head > * {
	margin: 0;
}

.eqb-home-section .eqb-home-posts__head + * {
	margin-block-start: var(--wp--preset--spacing--50);
}

.eqb-home-posts__query .wp-block-post-template {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 782px) {
	.eqb-home-posts__query .wp-block-post-template {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.eqb-home-posts__query .wp-block-post-template > li {
	margin: 0;
	min-width: 0;
}

.eqb-home-post-card {
	height: 100%;
	box-sizing: border-box;
}

.eqb-home-post-card > :first-child {
	margin-block-start: 0;
}

.eqb-home-post-card .wp-block-post-featured-image {
	margin-block-end: var(--wp--preset--spacing--40);
	overflow: hidden;
	border-radius: var(--wp--custom--radius--small);
}

.eqb-home-post-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	object-fit: cover;
}

/* No featured image: show a soft branded panel instead. */
.eqb-home-post-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 3 / 2;
	margin-block-end: var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--small);
	background: var(--wp--preset--gradient--soft);
}

.eqb-home-post-card .wp-block-post-date {
	color: var(--wp--preset--color--ink-soft);
}

.eqb-home-post-card .wp-block-post-title {
	margin-block-start: var(--wp--preset--spacing--20);
	overflow-wrap: break-word;
}

.eqb-home-post-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.eqb-home-post-card .wp-block-post-title a:hover,
.eqb-home-post-card .wp-block-post-title a:focus-visible {
	color: var(--wp--preset--color--purple);
	text-decoration: underline;
}

.eqb-home-post-card .wp-block-post-excerpt {
	color: var(--wp--preset--color--ink-soft);
}

.eqb-home-posts__empty {
	padding: var(--wp--preset--spacing--50);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--base);
	text-align: center;
	color: var(--wp--preset--color--ink-soft);
}

/* ---------------------------------------------------------------
 * 9. Testimonials
 * ------------------------------------------------------------- */

.eqb-home-testimonial::before {
	content: "\2605\2605\2605\2605\2605";
	content: "\2605\2605\2605\2605\2605" / "";
	display: block;
	margin-block-end: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--sunshine);
	font-size: var(--wp--preset--font-size--large);
	letter-spacing: 0.15em;
	line-height: 1;
}

.eqb-home-testimonial .wp-block-quote {
	margin: 0;
	padding: 0;
	border: 0;
}

.eqb-home-testimonial .wp-block-quote p {
	font-size: var(--wp--preset--font-size--medium);
}

.eqb-home-testimonial .wp-block-quote cite {
	display: block;
	margin-block-start: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	font-weight: 700;
}

/* ---------------------------------------------------------------
 * 10. For schools band
 * ------------------------------------------------------------- */

.wp-block-group.eqb-home-schools__inner {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	align-items: center;
}

.wp-block-group.eqb-home-schools__inner > * {
	margin: 0;
}

.eqb-home-schools__text > :first-child {
	margin-block-start: 0;
}

.eqb-home-schools__text > :last-child {
	margin-block-end: 0;
}

@media (min-width: 782px) {
	.wp-block-group.eqb-home-schools__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: var(--wp--preset--spacing--60);
	}
}

.eqb-home-schools::before {
	content: "";
	position: absolute;
	top: -3rem;
	right: 8%;
	width: 8rem;
	height: 8rem;
	border-radius: 50%;
	background: var(--wp--preset--gradient--brand);
	opacity: 0.35;
	pointer-events: none;
}

.eqb-home-schools > * {
	position: relative;
	z-index: 1;
}

/* ---------------------------------------------------------------
 * 11. Closing CTA (also used on other pages and single posts)
 * ------------------------------------------------------------- */

.eqb-cta-closing {
	text-align: center;
}

.eqb-cta-closing::before,
.eqb-cta-closing::after {
	content: "";
	position: absolute;
	z-index: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
	opacity: 0.1;
	pointer-events: none;
}

.eqb-cta-closing::before {
	width: 18rem;
	height: 18rem;
	top: -8rem;
	left: -6rem;
}

.eqb-cta-closing::after {
	width: 12rem;
	height: 12rem;
	bottom: -6rem;
	right: -3rem;
}

.eqb-cta-closing > * {
	position: relative;
	z-index: 1;
}

.eqb-cta-closing .wp-block-button__link:hover,
.eqb-cta-closing .wp-block-button__link:focus-visible,
.eqb-home-schools .wp-block-button__link:hover,
.eqb-home-schools .wp-block-button__link:focus-visible {
	box-shadow: var(--wp--preset--shadow--lift);
	outline-color: var(--wp--preset--color--surface);
}

/* Small text on the gradient sits on a darker chip to keep AA contrast. */
.eqb-cta-closing__note {
	width: fit-content;
	margin-inline: auto;
	padding: 0.35em 1em;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--ink);
	background: color-mix(in srgb, var(--wp--preset--color--ink) 40%, transparent);
	font-weight: 700;
}
