/**
 * ACF “Reusable page blocks” (savvi_page_blocks flexible layouts).
 * Cards: 1 col mobile, 2 tablet (768+), 3 desktop (1200+).
 */

.savvi-flex {
	clear: both;
}

.savvi-flex__section {
	padding: 48px 0;
}

/* Slight edge inset on small screens so sections don’t touch viewport */
@media (max-width: 575px) {
	.savvi-flex__section > .container {
		padding-left: max(15px, env(safe-area-inset-left, 0px));
		padding-right: max(15px, env(safe-area-inset-right, 0px));
	}
}

.savvi-flex__section--what {
	background: #f5f5f5;
}

.savvi-flex__section--cards {
	background: #fff;
	padding-top: 32px;
	padding-bottom: 56px;
}

.savvi-flex__section--products {
	padding-top: 0;
}

.savvi-flex__section--contact {
	background: #f5f5f5;
	padding: 48px 0 64px;
	text-align: left;
}

.savvi-flex__heading {
	position: relative;
	padding-bottom: 18px;
	margin-bottom: 24px;
	font-size: 1.75rem;
	font-weight: 700;
	color: #154734;
}

.savvi-flex__heading--center {
	text-align: center;
}

.savvi-flex__heading--center.border-title::after {
	left: 50%;
	transform: translateX(-50%);
}

.savvi-flex__heading--sub {
	margin-top: 32px;
}

/* Employer title: spacing before body (heading may sit in .savvi-flex__employer-heading grid cell). */
.savvi-flex__heading--employer {
	margin-top: 0;
	padding-bottom: 18px;
	/* Space after heading + decorative line before body copy */
	margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
	.savvi-flex__heading--employer {
		margin-bottom: 1.5rem;
		padding-bottom: 20px;
	}
}

.savvi-flex__heading--spaced {
	margin-top: 48px;
}

.savvi-flex__prose {
	font-size: 1rem;
	line-height: 1.65;
	color: #222;
	max-width: 75ch;
}

/* “What is” body: full container width (overrides default 75ch on .savvi-flex__prose). */
.savvi-flex__section--what .savvi-flex__prose--what {
	max-width: none;
	width: 100%;
	text-align: left;
}

.savvi-flex__section--what .savvi-flex__prose--what .wp-block-group,
.savvi-flex__section--what .savvi-flex__prose--what .wp-block-columns,
.savvi-flex__section--what .savvi-flex__prose--what .wp-block-column,
.savvi-flex__section--what .savvi-flex__prose--what .wp-block-paragraph {
	max-width: none;
	width: 100%;
}

.savvi-flex__section--what .savvi-flex__prose--what .alignwide,
.savvi-flex__section--what .savvi-flex__prose--what .alignfull {
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
}

.savvi-flex__section--contact .savvi-flex__prose,
.savvi-flex__section--contact .savvi-flex__prose--employer {
	max-width: none;
	text-align: left;
	width: 100%;
}

.savvi-flex__prose p {
	margin-bottom: 1rem;
}

.savvi-flex__section--contact .savvi-flex__prose p:first-child {
	margin-top: 0;
}

.savvi-flex__prose--employer p:first-child {
	margin-top: 0;
}

.savvi-flex__prose--employer {
	text-align: left;
	width: 100%;
	max-width: none;
	margin-top: 0.25rem;
}

/* Stop block editor alignments from indenting body copy in this section */
.savvi-flex__section--contact .savvi-flex__prose .alignwide,
.savvi-flex__section--contact .savvi-flex__prose .alignfull,
.savvi-flex__section--contact .savvi-flex__prose--employer .alignwide,
.savvi-flex__section--contact .savvi-flex__prose--employer .alignfull {
	margin-left: 0;
	margin-right: 0;
	max-width: 100%;
}

/* Gutenberg wrappers sometimes cap width inside the employer column */
.savvi-flex__employer-left .savvi-flex__prose--employer .wp-block-group,
.savvi-flex__employer-left .savvi-flex__prose--employer .wp-block-columns,
.savvi-flex__employer-left .savvi-flex__prose--employer .wp-block-column,
.savvi-flex__employer-left .savvi-flex__prose--employer .wp-block-paragraph {
	max-width: none;
	width: 100%;
}

/* “Why Savvi” — same rhythm as cards: 1 / 2 / 3 columns */
.savvi-flex__why-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px 24px;
	margin-top: 8px;
	align-items: start;
}

@media (min-width: 768px) {
	.savvi-flex__why-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 28px;
	}
}

@media (min-width: 1200px) {
	.savvi-flex__why-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px 32px;
	}
}

.savvi-flex__why-col {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
}

.savvi-flex__why-check {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin-top: 3px;
	border-radius: 4px;
	background: #e0e0e0;
	box-shadow: inset 0 0 0 2px #bdbdbd;
	position: relative;
}

.savvi-flex__why-check::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 3px;
	width: 6px;
	height: 11px;
	border: solid #80bd03;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.savvi-flex__why-text {
	font-size: 1rem;
	line-height: 1.5;
	color: #222;
	min-width: 0;
}

/* Newsletter & product cards — 1 / 2 / 3 per row */
.savvi-flex__card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin-top: 12px;
	align-items: stretch;
	justify-items: stretch;
	width: 100%;
}

@media (min-width: 768px) and (max-width: 1199px) {
	.savvi-flex__card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 20px;
	}
}

@media (min-width: 1200px) {
	.savvi-flex__card-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 28px 24px;
	}
}

.savvi-flex__card-grid--products {
	margin-top: 16px;
}

/* typography.css sets `article { padding-left: 32px }` — reset for these cards or media sits inset. */
.savvi-flex__card {
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	text-align: center;
	padding: 0 0 20px 0;
	height: 100%;
}

/*
 * Media area: absolutely positioned img fills the ratio box edge-to-edge (avoids left/right gutters
 * from inline sizing, % heights, or theme img { max-width: 100% }).
 */
.savvi-flex__card-media {
	position: relative;
	width: 100%;
	margin: 0;
	padding: 0;
	flex-shrink: 0;
	align-self: stretch;
	background: #eee;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	line-height: 0;
	text-align: left;
	isolation: isolate;
}

.savvi-flex__card-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none !important;
	object-fit: cover;
	object-position: center;
	display: block;
	margin: 0;
	border: 0;
	transform: scale(1.06);
	transform-origin: center center;
}

.savvi-flex__card--news .savvi-flex__card-media,
.savvi-flex__card--product .savvi-flex__card-media {
	border-radius: 8px 8px 0 0;
}

/* Newsletter “View” — pill CTA aligned with hero / Join-style buttons */
.savvi-flex__card--news .savvi-flex__btn--secondary {
	margin: 8px 16px 0;
	padding: 0 28px;
	min-height: 44px;
	line-height: 44px;
	border-radius: 999px;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	box-shadow: 0 2px 10px rgba(14, 62, 44, 0.18);
	border: 2px solid rgba(14, 62, 44, 0.12);
	background: linear-gradient(180deg, #93d916 0%, #80bd03 55%, #6fa802 100%);
	color: #0e3e2c !important;
}

.savvi-flex__card--news .savvi-flex__btn--secondary:hover {
	color: #fff !important;
	background: linear-gradient(180deg, #8ad010 0%, #73a802 100%);
	border-color: rgba(255, 255, 255, 0.2);
	box-shadow: 0 4px 14px rgba(14, 62, 44, 0.22);
}

.savvi-flex__card-meta {
	margin: 16px 16px 8px;
	font-weight: 600;
	color: #154734;
}

.savvi-flex__card-title {
	margin: 16px 16px 12px;
	font-size: 1.25rem;
	font-weight: 700;
	color: #154734;
}

.savvi-flex__btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 6px;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-decoration: none !important;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.savvi-flex__btn:hover {
	opacity: 0.92;
	transform: translateY(-1px);
}

.savvi-flex__btn--secondary {
	background: #80bd03;
	color: #0e3e2c !important;
	margin: 0 16px 8px;
	align-self: center;
}

.savvi-flex__btn--primary {
	background: #80bd03;
	color: #0e3e2c !important;
	margin: auto 16px 0;
	align-self: center;
}

.savvi-flex__btn--pill {
	background: #80bd03;
	color: #0e3e2c !important;
	border-radius: 999px;
	padding: 12px 28px;
}

.savvi-flex__contact {
	margin-bottom: 28px;
}

@media (min-width: 768px) {
	.savvi-flex__contact {
		margin-bottom: 32px;
	}
}

.savvi-flex__employer {
	text-align: left;
}

.savvi-flex__contact + .savvi-flex__employer {
	margin-top: 8px;
}

/*
 * Employer: .employer-left wraps heading + copy. Tablet uses display:contents so heading can span full grid width.
 * Desktop (992+): one grid row (left | video) so a tall video does not stretch separate heading/copy rows (no huge gap).
 */
.savvi-flex__employer-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
	margin-top: 0;
	align-items: start;
}

.savvi-flex__employer-left {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	width: 100%;
}

.savvi-flex__employer-heading {
	min-width: 0;
	width: 100%;
}

/* Tablet: flatten left column into grid items so heading spans full width, video aligns with body row. */
@media (min-width: 768px) and (max-width: 991px) {
	.savvi-flex__employer-left {
		display: contents;
	}

	.savvi-flex__employer-grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: 12px;
		row-gap: 16px;
		align-items: start;
	}

	.savvi-flex__employer-grid--has-title .savvi-flex__employer-heading {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.savvi-flex__employer-grid--has-title .savvi-flex__employer-copy {
		grid-column: 1;
		grid-row: 2;
	}

	.savvi-flex__employer-grid--has-title .savvi-flex__employer-media {
		grid-column: 2;
		grid-row: 2;
		align-self: start;
	}
}

/* Desktop: left stack + video in one row (no row-span gap under tall embeds). */
@media (min-width: 992px) {
	.savvi-flex__employer-grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: 16px;
		row-gap: 0;
		align-items: start;
	}

	.savvi-flex__employer-media {
		align-self: start;
	}
}

/* Wider viewports: extra inset so employer prose does not sit flush against the video (~3 lines feel). */
@media (min-width: 1440px) {
	.savvi-flex__employer-grid .savvi-flex__employer-copy {
		padding-right: clamp(1.25rem, 2.5vw, 3rem);
	}
}

@media (min-width: 1920px) {
	.savvi-flex__employer-grid .savvi-flex__employer-copy {
		padding-right: clamp(2rem, 3.5vw, 4.5rem);
	}
}

@media (min-width: 2560px) {
	.savvi-flex__employer-grid .savvi-flex__employer-copy {
		padding-right: clamp(2.75rem, 4vw, 6rem);
	}
}

.savvi-flex__employer-copy {
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
}

.savvi-flex__employer-heading .savvi-flex__heading--employer {
	width: 100%;
}

.savvi-flex__employer-copy .savvi-flex__btn--pill {
	align-self: flex-start;
}

.savvi-flex__employer-media {
	min-width: 0;
	align-self: start;
	width: 100%;
}

.savvi-flex__employer-actions {
	margin-top: 16px;
	margin-bottom: 0;
}

.savvi-flex__responsive-video {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	background: #166938;
	border-radius: 8px;
}

.savvi-flex__responsive-video iframe,
.savvi-flex__responsive-video embed,
.savvi-flex__responsive-video object {
	position: absolute;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}
