/* ==========================================================================
   Homepage pre-footer
   Fixed-content, movable Gutenberg section.
   ========================================================================== */

.wp-block-studio-zed-homepage-pre-footer {
	margin: 0;
	max-width: none;
	width: 100%;
}

.homepage-pre-footer {
	background: var(--sz-chalk);
	box-sizing: border-box;
	color: var(--sz-graphite);
	height: auto;
	position: relative;
	width: 100%;
}

.homepage-pre-footer__layout {
	align-items: center;
	box-sizing: border-box;
	display: grid;
	gap: clamp(3rem, 6.5vw, 6rem);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	/* Cap the combined columns and gap at 1600px, centered within the section. */
	padding: clamp(4rem, 6.2vw, 7rem) max(var(--layout-margin-desktop), calc((100% - 100rem) / 2));
	min-height: 0;
	overflow: hidden;
	position: relative;
}

/* Bottom section chamfers */
.homepage-pre-footer__layout::before,
.homepage-pre-footer__layout::after {
	background: var(--sz-stone);
	bottom: 0;
	content: "";
	height: var(--chamfer-full-desktop);
	pointer-events: none;
	position: absolute;
	width: var(--chamfer-full-desktop);
	z-index: 3;
}

.homepage-pre-footer__layout::before {
	clip-path: polygon(0 0, 0 100%, 100% 100%);
	left: 0;
}

.homepage-pre-footer__layout::after {
	clip-path: polygon(100% 0, 100% 100%, 0 100%);
	right: 0;
}


/* ==========================================================================
   Image
   ========================================================================== */

.homepage-pre-footer__media {
	/* Keep the image square independently of the copy height. */
	align-self: center;
	aspect-ratio: 1 / 1;
	min-height: 0;
	overflow: hidden;
	position: relative;
}

.homepage-pre-footer__image {
	position: absolute;
	inset: 0;
	display: block;
	height: 100%;
	object-fit: cover;
	object-position: center 80%;
	width: 100%;
}


/* ==========================================================================
   Content
   ========================================================================== */

.homepage-pre-footer__content {
	align-items: center;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 0;
}

.homepage-pre-footer__copy,
.homepage-pre-footer__reviews {
	max-width: 39rem;
	width: 100%;
}

.homepage-pre-footer__heading {
	font-family: var(--font-heading);
	font-size: var(--type-heading-s-size);
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: var(--type-heading-s-line);
	margin: 0 0 1rem;
	text-transform: uppercase;
}

.homepage-pre-footer__copy p {
	font-family: var(--font-body);
	font-size: var(--type-body-r-size);
	font-weight: var(--type-body-r-weight);
	line-height: var(--type-body-r-line);
	margin: 0;
}

.homepage-pre-footer__copy p + p {
	margin-top: 0.75rem;
}


/* ==========================================================================
   Button
   ========================================================================== */

.homepage-pre-footer__button {
	margin-top: 2rem;
}


/* ==========================================================================
   Reviews
   ========================================================================== */

.homepage-pre-footer__reviews {
	align-items: center;
	display: grid;
	gap: clamp(2rem, 4vw, 4.5rem);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: clamp(1.5rem, 2vw, 2.5rem);
}

@media (min-width: 64.0625rem) {
	.homepage-pre-footer__reviews {
		display: flex;
		justify-content: flex-start;
		margin-top: clamp(3rem, 4vw, 5rem);
	}
}

.homepage-pre-footer__review {
	align-items: center;
	display: flex;
	justify-content: center;
	min-width: 0;
	text-align: center;
}

@media (min-width: 64.0625rem) {
	.homepage-pre-footer__review {
		flex: 0 1 auto;
		width: fit-content;
		max-width: 100%;
		justify-content: flex-start;
	}
}

.homepage-pre-footer__review img,
.homepage-pre-footer__review iframe {
	height: auto;
	max-width: 100%;
}


/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 64rem) {
	.homepage-pre-footer {
		height: auto;
	}

	.homepage-pre-footer__layout {
		gap: 2.5rem;
		grid-template-columns: minmax(0, 1fr);
		padding: 4rem var(--layout-margin-tablet);
		min-height: 0;
	}

	.homepage-pre-footer__media,
	.homepage-pre-footer__content {
		box-sizing: border-box;
		margin-inline: auto;
		max-width: 39rem;
		width: 100%;
	}

	.homepage-pre-footer__content {
		text-align: center;
	}

	.homepage-pre-footer__image {
		object-position: 53% 62%;
	}

	.homepage-pre-footer__layout::before,
	.homepage-pre-footer__layout::after {
		height: var(--chamfer-full-tablet);
		width: var(--chamfer-full-tablet);
	}

	.homepage-pre-footer__content {
		padding: 0;
	}

	.homepage-pre-footer__reviews {
		gap: 2.5rem;
		margin-top: 4.5rem;
	}
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 48rem) {
	.homepage-pre-footer {
		height: auto;
		padding-top: 0;
	}

	.homepage-pre-footer__layout {
		display: block;
		height: auto;
		min-height: 0;
		padding: 0 0 var(--chamfer-full-mobile);
	}

	/*
	 * Bottom-left and bottom-right chamfers.
	 */
	.homepage-pre-footer__layout::before,
	.homepage-pre-footer__layout::after {
		background: var(--sz-stone);
		bottom: 0;
		content: "";
		height: var(--chamfer-full-mobile);
		pointer-events: none;
		position: absolute;
		width: var(--chamfer-full-mobile);
		z-index: 3;
	}

	.homepage-pre-footer__layout::before {
		clip-path: polygon(0 0, 0 100%, 100% 100%);
		left: 0;
	}

	.homepage-pre-footer__layout::after {
		clip-path: polygon(100% 0, 100% 100%, 0 100%);
		right: 0;
	}


	/* ----------------------------------------------------------------------
	   Mobile image
	   ---------------------------------------------------------------------- */

	.homepage-pre-footer__media {
		aspect-ratio: auto;
		max-width: none;
		height: auto;
		min-height: 0;
		overflow: hidden;
	}


	/* Chalk cap slopes down from the outer corners to the image's top edge. */
	.homepage-pre-footer__media::before {
		background-color: var(--sz-chalk);
		/* Match the testimonial grid's 16 mobile columns and 1px lines. */
		background-image: linear-gradient(to right, var(--sz-grid-line) 1px, transparent 1px);
		background-position: 0 0;
		background-size: 6.25% 100%;
		clip-path: polygon(0 0, 100% 0, calc(100% - var(--chamfer-container-mobile)) 100%, var(--chamfer-container-mobile) 100%);
		content: "";
		height: var(--chamfer-container-mobile);
		inset: 0 0 auto;
		pointer-events: none;
		position: absolute;
		z-index: 1;
	}

	.homepage-pre-footer__image {
		position: static;
		height: auto;
		object-fit: initial;
		object-position: initial;
		width: 100%;
	}


	/* ----------------------------------------------------------------------
	   Mobile content
	   ---------------------------------------------------------------------- */

	.homepage-pre-footer__content {
		max-width: none;
		padding:
			4.25rem
			var(--layout-margin-mobile)
			6.5rem;
		text-align: center;
	}

	.homepage-pre-footer__copy,
	.homepage-pre-footer__reviews {
		margin-inline: auto;
		max-width: 31rem;
	}

	.homepage-pre-footer__heading {
		margin-inline: auto;
		max-width: 20rem;
	}

	.homepage-pre-footer__copy p + p {
		margin-top: 1rem;
	}

	.homepage-pre-footer__button {
		margin-top: 2rem;
	}


	/* ----------------------------------------------------------------------
	   Mobile reviews
	   ---------------------------------------------------------------------- */

	.homepage-pre-footer__reviews {
		display: flex;
		flex-direction: column;
		gap: 4rem;
		margin-top: 5.5rem;
	}

	.homepage-pre-footer__review {
		width: 100%;
	}
}
