/**
 * A2P Homepage Audience Module (Triptych 2b) + fold hero / education
 * Specs: augusto-digital a2p-installer-prototype + client homepage brief
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&family=Roboto+Mono:wght@500&display=swap');

/* ========== First-viewport stack: hero + audience fill browser height (desktop) ========== */
.a2p-home-fold {
	--a2p-text: #414b54;
	--a2p-dark: #2b3238;
	--a2p-light-bg: #F1F3F5;
	--a2p-green: #78BF26;
	--a2p-blue: #0077C8;
	--a2p-white: #fff;
	/* Fallback before JS; audience-module.js overwrites height on this node. */
	--a2p-home-fold-offset: var(--header-bottom, 147px);
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #fff;
	box-sizing: border-box;
}

@media (min-width: 900px) {
	.a2p-home-fold {
		height: calc(100dvh - var(--a2p-home-fold-offset));
		max-height: calc(100dvh - var(--a2p-home-fold-offset));
		min-height: calc(100dvh - var(--a2p-home-fold-offset));
		overflow: hidden;
	}

	.a2p-home-fold .a2p-home-hero {
		flex: 0 1 auto;
		min-height: 0;
		/* Slightly tighter so the shortened triptych still reads as a band. */
		padding-top: 40px;
		padding-bottom: 20px;
	}

	.a2p-home-fold .a2p-audience {
		flex: 1 1 0;
		display: flex;
		flex-direction: column;
		min-height: 0;
		/* Little space above audience content. */
		padding-top: 16px;
		background: transparent;
	}

	.a2p-home-fold .a2p-audience__triptych {
		flex: 1 1 auto;
		/* Fill leftover viewport under the hero (no max-height — that left a white strip). */
		height: 100% !important;
		min-height: 280px !important;
	}

	/*
	 * Short laptop viewports: hero + open-panel copy (64px mono claim + body + CTA)
	 * otherwise overflow the panel top and get clipped by overflow:hidden.
	 */
	@media (max-height: 900px) {
		.a2p-home-fold .a2p-home-hero {
			padding-top: 28px;
			padding-bottom: 12px;
		}

		.a2p-home-fold .a2p-audience {
			padding-top: 8px;
		}

		.a2p-home-fold .a2p-home-hero__eyebrow {
			margin-bottom: 10px;
		}

		.a2p-home-fold .a2p-home-hero__title {
			font-size: clamp(30px, 3.6vw, 44px);
		}

		.a2p-home-fold .a2p-home-hero__lede {
			margin-top: 14px;
			font-size: 16px;
		}

		.a2p-home-fold .a2p-home-hero__actions {
			margin-top: 18px;
			gap: 14px 22px;
		}

		.a2p-home-fold .a2p-audience__triptych {
			min-height: 300px !important;
		}

		.a2p-home-fold .a2p-audience__stat {
			font-size: clamp(40px, 5.2vh, 56px);
			margin-top: 8px;
		}

		.a2p-home-fold .a2p-audience__copy {
			padding: 24px;
		}

		.a2p-home-fold .a2p-audience__body {
			margin-top: 12px;
			font-size: 16px;
		}

		.a2p-home-fold .a2p-audience__cta,
		.a2p-home-fold .a2p-home-module a.a2p-green-btn {
			margin-top: 12px;
			padding: 12px 20px !important;
			min-height: 44px;
		}
	}

	@media (max-height: 800px) {
		.a2p-home-fold .a2p-home-hero {
			padding-top: 20px;
			padding-bottom: 8px;
		}

		.a2p-home-fold .a2p-home-hero__lede {
			margin-top: 10px;
			font-size: 15px;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 2;
			overflow: hidden;
		}

		.a2p-home-fold .a2p-home-hero__actions {
			margin-top: 14px;
		}

		.a2p-home-fold .a2p-home-hero__cta--primary {
			padding: 12px 20px !important;
			min-height: 44px;
		}

		.a2p-home-fold .a2p-audience__stat {
			font-size: clamp(34px, 4.6vh, 48px);
			margin-top: 6px;
		}

		.a2p-home-fold .a2p-audience__stat-label {
			margin-top: 6px;
			font-size: 12px;
		}

		.a2p-home-fold .a2p-audience__copy {
			padding: 20px;
		}

		.a2p-home-fold .a2p-audience__body {
			margin-top: 10px;
			font-size: 15px;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 2;
			overflow: hidden;
		}
	}

	/* JS adds this when open-panel copy still overflows after height media queries. */
	.a2p-home-fold.a2p-home-fold--compact .a2p-home-hero {
		padding-top: 16px;
		padding-bottom: 6px;
	}

	.a2p-home-fold.a2p-home-fold--compact .a2p-home-hero__lede {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	.a2p-home-fold.a2p-home-fold--compact .a2p-audience__stat {
		font-size: clamp(32px, 4.2vh, 44px);
	}

	.a2p-home-fold.a2p-home-fold--compact .a2p-audience__body {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	.a2p-home-fold.a2p-home-fold--compact-sm .a2p-home-hero__lede {
		display: none;
	}

	.a2p-home-fold.a2p-home-fold--compact-sm .a2p-audience__body {
		-webkit-line-clamp: 1;
	}

	.a2p-home-fold.a2p-home-fold--compact-sm .a2p-audience__stat {
		font-size: clamp(28px, 3.8vh, 40px);
	}
}

/* Headline removed — copy lives in .a2p-home-hero (Figma). */
.a2p-home-fold .a2p-audience__head,
.a2p-audience__head {
	display: none !important;
}

/* Hide legacy Elementor video hero (do not delete Elementor content). */
body.home #hero-section-cat-1.home-hero-4,
body.home .home-hero-4,
body.page-home #hero-section-cat-1.home-hero-4 {
	display: none !important;
}

/* ========== Homepage hero (Figma: white text block) ========== */
.a2p-home-hero {
	--a2p-hero-blue: #0077C8;
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	padding: 56px max(24px, calc((100% - 1280px) / 2)) 32px;
	color: var(--a2p-dark, #2b3238);
	background: #fff;
	font-family: 'Roboto', system-ui, sans-serif;
	overflow: hidden;
}

.a2p-home-hero--has-image {
	color: #fff;
	background: transparent;
	padding-top: 64px;
	padding-bottom: 48px;
	min-height: 220px;
}

.a2p-home-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.a2p-home-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.a2p-home-hero__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(43, 50, 56, 0.78) 0%, rgba(43, 50, 56, 0.35) 70%, rgba(43, 50, 56, 0.15) 100%);
}

.a2p-home-hero__inner {
	position: relative;
	z-index: 1;
	/* Match Figma / content rail (was 760 — forced title wrap). */
	max-width: 1280px;
}

.a2p-home-hero__eyebrow {
	margin: 0 0 16px;
	font: 500 12px/1.4 var(--e-global-typography-a2pmono-font-family, "Roboto Mono"), monospace;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--a2p-hero-blue, #0077C8);
}

.a2p-home-hero--has-image .a2p-home-hero__eyebrow {
	color: rgba(255, 255, 255, 0.9);
}

.a2p-home-hero__title {
	margin: 0;
	font-size: clamp(34px, 4.2vw, 52px);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.08;
	color: inherit;
}

.a2p-home-hero__lede {
	margin: 20px 0 0;
	font-size: 18px;
	line-height: 1.5;
	/* Same column as title (was 640 — wrapped early with empty space). */
	max-width: none;
	color: #58646F;
}

.a2p-home-hero--has-image .a2p-home-hero__lede {
	color: rgba(255, 255, 255, 0.92);
}

.a2p-home-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px 28px;
	margin: 28px 0 0;
}

.a2p-home-hero__cta {
	display: inline-flex !important;
	align-items: center;
	gap: 10px;
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1.2;
	text-decoration: none !important;
	border-radius: 0 !important;
}

/* Same FA arrow as main-nav header CTAs (.header-cta-buttons .e-font-icon-svg). */
.a2p-home-hero__cta .arw {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	flex: none;
}

.a2p-home-hero__cta .arw .e-font-icon-svg,
.a2p-home-hero__cta .a2p-icon-arw {
	display: block;
	height: 0.9em;
	width: auto;
	flex: none;
	fill: currentColor;
}

.a2p-home-hero__cta--primary {
	background: var(--a2p-hero-blue, #0077C8) !important;
	color: #fff !important;
	border: 0 !important;
	padding: 14px 24px !important;
	min-height: 52px;
}

.a2p-home-hero__cta--primary:hover {
	background: #000 !important;
	color: #fff !important;
}

.a2p-home-hero__cta--secondary {
	background: transparent !important;
	color: var(--a2p-hero-blue, #0077C8) !important;
	border: 0 !important;
	padding: 0 !important;
	min-height: auto;
}

.a2p-home-hero__cta--secondary:hover {
	color: #000 !important;
}

.a2p-home-hero--has-image .a2p-home-hero__cta--secondary {
	color: #fff !important;
}

/* ========== Educational section (Figma Homepage) ========== */
.a2p-home-edu {
	width: 100%;
	background: #F1F3F5;
	padding: 96px max(24px, calc((100% - 1280px) / 2));
	font-family: 'Roboto', system-ui, sans-serif;
	color: var(--a2p-text, #414b54);
}

.a2p-home-edu__inner {
	width: 100%;
}

.a2p-home-edu__head {
	/* Align with edu cards / 1280 content rail (was 720). */
	max-width: 1280px;
	margin: 0 0 48px;
	text-align: left;
}

.a2p-home-edu__title {
	margin: 0;
	font-size: clamp(28px, 3.2vw, 40px);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.15;
	color: var(--a2p-dark, #2b3238);
}

.a2p-home-edu__sub {
	margin: 16px 0 0;
	font-size: 18px;
	line-height: 1.5;
	color: #58646F;
}

.a2p-home-edu__cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	align-items: stretch;
}

.a2p-home-edu__card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 0;
	background: #fff;
	color: inherit;
	text-decoration: none;
	border: 0;
	min-height: 100%;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(43, 50, 56, 0.06);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.a2p-home-edu__card:hover {
	box-shadow: 0 10px 28px rgba(43, 50, 56, 0.14);
	transform: translateY(-2px);
	color: inherit;
}

a.a2p-home-edu__card:hover .a2p-home-edu__card-cta {
	color: #000;
}

.a2p-home-edu__card-media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #E8EBEE;
	flex: 0 0 auto;
}

.a2p-home-edu__card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.a2p-home-edu__card-body-wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	padding: 28px 28px 32px;
	flex: 1 1 auto;
}

.a2p-home-edu__card-label {
	font: 500 11px/1.3 var(--e-global-typography-a2pmono-font-family, "Roboto Mono"), monospace;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #7A8691;
}

.a2p-home-edu__card-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: var(--a2p-dark, #2b3238);
}

.a2p-home-edu__card-body {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	color: #58646F;
	flex: 1 1 auto;
}

/*
 * Inline flow (not flex): when the label wraps, the arrow stays after the
 * last word instead of pinning to the far right of the card column.
 * Last word + arrow are wrapped in .a2p-home-edu__card-cta-end (nowrap).
 */
.a2p-home-edu__card-cta {
	display: block;
	margin-top: 8px;
	max-width: 100%;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--a2p-blue, #0077C8);
}

.a2p-home-edu__card-cta-end {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	vertical-align: baseline;
}

.a2p-home-edu__card-cta .arw {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	margin-left: 0.35em;
	flex: none;
}

.a2p-home-edu__card-cta .arw .e-font-icon-svg,
.a2p-home-edu__card-cta .a2p-icon-arw {
	display: block;
	height: 0.9em;
	width: auto;
	margin-top: 0;
	flex-shrink: 0;
	fill: currentColor;
}

@media (max-width: 899px) {
	.a2p-home-fold {
		height: auto;
		max-height: none;
		min-height: 0;
		overflow: visible;
	}

	.a2p-home-fold .a2p-audience__triptych {
		height: auto !important;
		min-height: 0 !important;
		max-height: none;
	}

	.a2p-home-hero {
		padding: 40px 24px 8px;
	}

	.a2p-home-edu {
		padding: 56px 24px;
	}

	.a2p-home-edu__cards {
		grid-template-columns: 1fr;
	}
}

.a2p-audience {
	--a2p-text: #414b54;
	--a2p-secondary: #58646F;
	--a2p-dark: #2b3238;
	--a2p-light-bg: #F1F3F5;
	--a2p-muted: #c8cbce;
	--a2p-muted-alt: #e0e2e4;
	--a2p-blue: #0077C8;
	--a2p-green: #78BF26;
	--a2p-white: #fff;
	/* Elementor Site Settings → Global Fonts → Monospace */
	--a2p-font-mono: var(--e-global-typography-a2pmono-font-family, "Roboto Mono");
	box-sizing: border-box;
	/* H1: gray band full viewport width */
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	background: var(--a2p-light-bg);
	box-shadow: none;
	font-family: 'Roboto', system-ui, sans-serif;
	color: var(--a2p-text);
	-webkit-font-smoothing: antialiased;
}

/* H3: sit flush on the section below (no strip under the panels) */
body.home .a2p-audience,
body.page-home .a2p-audience,
.a2p-audience {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

body.home .a2p-audience + *,
body.page-home .a2p-audience + *,
body.home main.site-main,
body.page-home main.site-main {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Kill white gap: first Elementor block after the module */
body.home .a2p-audience + main.site-main > .page-content,
body.home .a2p-audience + main.site-main > .page-content > .elementor,
body.home main.site-main > .page-content > .elementor > .e-con:first-child,
body.home main.site-main > .page-content > .elementor > .elementor-section:first-child {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

.a2p-audience *,
.a2p-audience *::before,
.a2p-audience *::after {
	box-sizing: border-box;
}

.a2p-audience__head {
	/* Headline stays readable; gray still full-bleed behind it */
	padding: 56px max(24px, calc((100% - 1280px) / 2)) 32px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 48px;
}

.a2p-audience__head h2 {
	margin: 0;
	font-size: 48px;
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.05;
	color: var(--a2p-text);
	text-align: center;
	max-width: 800px;
}

/* H2: triptych panels span full browser width (edge to edge) */
.a2p-audience__triptych {
	display: flex;
	height: 560px;
	gap: 4px;
	padding: 0;
	margin: 0;
	width: 100%;
}

.a2p-audience__panel {
	position: relative;
	overflow: hidden;
	flex: 1 1 0;
	transition: flex 300ms ease-in-out;
	cursor: pointer;
	background: var(--a2p-dark);
	outline: none;
	min-width: 0;
}

.a2p-audience__panel.is-open {
	flex: 2.2 1 0;
}

.a2p-audience__panel:focus-visible {
	box-shadow: inset 0 0 0 3px var(--a2p-blue);
}

.a2p-audience__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	min-width: 0;
	background: var(--a2p-dark);
}

.a2p-audience__photo--placeholder {
	background:
		linear-gradient(135deg, #3a4249 0%, var(--a2p-dark) 100%);
}

.a2p-audience__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(43, 50, 56, 0) 30%, rgba(43, 50, 56, 0.92) 100%);
	pointer-events: none;
}

.a2p-audience__copy {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 32px;
	color: var(--a2p-white);
	z-index: 1;
}

.a2p-audience__tag {
	display: inline-block;
	font: 500 12px/1.4 var(--a2p-font-mono, "Roboto Mono"), monospace;
	letter-spacing: 0.06em;
	color: var(--a2p-white);
	padding: 0;
	border-radius: 0;
	text-transform: uppercase;
	background: transparent !important;
}

.a2p-audience__tag--installers,
.a2p-audience__tag--architects,
.a2p-audience__tag--owners {
	background: transparent !important;
}

.a2p-audience__stat {
	font: 500 64px/1 var(--a2p-font-mono), monospace;
	letter-spacing: -0.04em;
	margin-top: 12px;
	color: var(--a2p-white);
}

/* Disclaimer footnote marker on claim stats (links to #disclaimer). */
.a2p-audience__stat .a2p-disclaimer-ref {
	color: inherit;
	text-decoration: none;
	margin-left: 0.02em;
}
.a2p-audience__stat .a2p-disclaimer-ref:hover,
.a2p-audience__stat .a2p-disclaimer-ref:focus-visible {
	/*text-decoration: underline;*/
	outline: none;
}
.a2p-audience__stat .a2p-disclaimer-ref sup {
	font-size: 0.38em;
	font-weight: 500;
	line-height: 0;
	vertical-align: super;
	position: relative;
	top: -0.15em;
}

.a2p-audience__stat-label {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.1em;
	color: var(--a2p-muted);
	margin-top: 8px;
	text-transform: uppercase;
}

.a2p-audience__detail {
	display: none;
}

.a2p-audience__panel.is-open .a2p-audience__detail {
	display: block;
}

.a2p-audience__body {
	margin: 20px 0 0;
	font-size: 18px;
	line-height: 1.5;
	color: var(--a2p-muted-alt);
	max-width: 480px;
}

/* Punchlist: homepage module CTAs as filled green buttons (was underline text link). */
.a2p-audience__cta,
.a2p-home-module a.a2p-green-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 16px;
	background: var(--a2p-green) !important;
	color: #fff !important;
	border: 0 !important;
	border-bottom: 0 !important;
	border-radius: 0 !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	padding: 14px 24px !important;
	min-height: 52px;
	line-height: 1.2;
	text-decoration: none !important;
}

.a2p-audience__cta:hover,
.a2p-audience__cta:focus,
.a2p-home-module a.a2p-green-btn:hover,
.a2p-home-module a.a2p-green-btn:focus {
	background: #000 !important;
	color: #fff !important;
}

/* Same FA arrow as main-nav header CTAs (.header-cta-buttons .e-font-icon-svg). */
.a2p-audience__cta .arw {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	flex: none;
}

.a2p-audience__cta .arw .e-font-icon-svg,
.a2p-audience__cta .a2p-icon-arw {
	display: block;
	height: 0.9em;
	width: auto;
	margin-left: 0;
	flex-shrink: 0;
	fill: currentColor;
}

/* Elementor optional: mark a button widget with CSS class a2p-home-green */
body.home .elementor-widget-button.a2p-home-green .elementor-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--a2p-green, #78BF26) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 0 !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	padding: 14px 24px !important;
	min-height: 52px;
	text-decoration: none !important;
}

body.home .elementor-widget-button.a2p-home-green .elementor-button:hover {
	background: #000 !important;
	color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
	.a2p-audience__panel {
		transition: none;
	}
}

/* Tablet / mobile: stack, all content visible, no expand/collapse */
@media (max-width: 899px) {
	.a2p-audience {
		margin: 0;
		box-shadow: none;
	}

	.a2p-audience__head {
		padding: 40px 24px 24px;
	}

	.a2p-audience__head h2 {
		font-size: 32px;
	}

	.a2p-audience__triptych {
		flex-direction: column;
		height: auto;
		gap: 4px;
		padding: 0;
	}

	.a2p-audience__panel,
	.a2p-audience__panel.is-open {
		flex: none;
		height: 320px;
		min-height: 320px;
		cursor: default;
	}

	.a2p-audience__detail {
		display: block !important;
	}

	.a2p-audience__stat {
		font-size: 48px;
	}

	.a2p-audience__copy {
		padding: 24px;
	}

	.a2p-audience__cta,
	.a2p-home-module a.a2p-green-btn {
		min-height: 44px;
	}
}

@media (max-width: 480px) {
	.a2p-audience__head h2 {
		font-size: 28px;
	}

	.a2p-audience__stat {
		font-size: 40px;
	}

	.a2p-audience__body {
		font-size: 16px;
	}
}
