/*
 * Kasey Lynch Content Blocks: front end + editor styles.
 *
 * Colors: each block reads --kl-accent. By default that is your theme's
 * "accent" or "primary" palette color, so changing theme colors updates the
 * blocks. Picking a palette color in a block's settings stores the palette slug,
 * which also follows the theme. Fonts and text color are inherited from the theme.
 */

.kl-block {
	--kl-accent: var(--wp--preset--color--accent, var(--wp--preset--color--primary, #8a9a8c));
	--kl-line: #c4c4c4;
	--kl-soft: #f8f5f1;
	--kl-accent-line: #e3d5cf;
	--kl-accent-soft: #f3ece8;
	box-sizing: border-box;
	clear: both;
	margin: 2.5rem 0;
	line-height: 1.6;
}

@supports ( color: color-mix( in srgb, red, blue ) ) {
	.kl-block {
		--kl-line: color-mix( in srgb, currentColor 28%, transparent );
		--kl-soft: color-mix( in srgb, var( --kl-accent ) 10%, #fff );
		--kl-accent-line: color-mix( in srgb, var( --kl-accent ) 45%, #fff );
		--kl-accent-soft: color-mix( in srgb, var( --kl-accent ) 18%, #fff );
	}
}

.kl-block *,
.kl-block *::before,
.kl-block *::after {
	box-sizing: border-box;
}

.kl-block img {
	display: block;
	max-width: 100%;
	height: auto;
}

.kl-block p {
	margin: 0 0 1em;
}

.kl-block p:last-child {
	margin-bottom: 0;
}

.kl-block h3,
.kl-block h4 {
	margin: 0 0 0.5em;
	line-height: 1.25;
}

/* ---------- Listicle Callout ---------- */

.kl-listicle {
	padding: 2rem;
	border: 1px solid var( --kl-line );
}

.kl-listicle__head {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin: 0 -2rem 0.5rem 0;
}

.kl-listicle__head::after {
	content: "";
	flex: 1 1 auto;
	border-top: 1px solid var( --kl-line );
}

.kl-listicle__title {
	margin: 0;
	font-size: 1.5em;
}

.kl-listicle__item {
	display: grid;
	grid-template-columns: minmax( 0, 200px ) minmax( 0, 1fr );
	gap: 2rem;
	align-items: center;
	margin-top: 2rem;
}

.kl-listicle__media {
	margin: 0;
	display: block;
}

.kl-listicle__media img {
	margin: 0 auto;
	max-height: 220px;
	width: auto;
	object-fit: contain;
}

.kl-listicle__heading {
	font-size: 1.25em;
}

.kl-listicle__heading a {
	color: inherit;
	text-decoration: none;
}

.kl-listicle__heading a:hover,
.kl-listicle__heading a:focus {
	text-decoration: underline;
}

@media ( max-width: 640px ) {
	.kl-listicle {
		padding: 1.25rem;
	}

	.kl-listicle__head {
		margin-right: -1.25rem;
	}

	.kl-listicle__item {
		grid-template-columns: 1fr;
		gap: 1rem;
		text-align: left;
	}

	.kl-listicle__media img {
		max-height: 200px;
		margin: 0;
	}
}

/* ---------- Note Callout ---------- */

.kl-note {
	position: relative;
	margin-left: 1.75rem;
	padding: 1.5rem 1.5rem 1.5rem 3.5rem;
	border: 1px solid var( --kl-line );
	min-height: 5rem;
	display: flex;
	align-items: center;
}

.kl-note__icon {
	position: absolute;
	top: 50%;
	left: 0;
	transform: translate( -50%, -50% );
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: var( --kl-accent );
	color: #fff;
}

.kl-note__body {
	margin: 0;
	font-size: 0.95em;
}

@media ( max-width: 640px ) {
	.kl-note {
		padding: 1.25rem 1rem 1.25rem 2.75rem;
	}
}

/* ---------- Feature Box ---------- */

.kl-feature {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) minmax( 0, 300px );
	gap: 2rem;
	align-items: center;
	padding: 2rem;
	border: 1px solid var( --kl-accent-line );
}

.kl-feature--img-left {
	grid-template-columns: minmax( 0, 300px ) minmax( 0, 1fr );
}

.kl-feature--img-left .kl-feature__media {
	order: -1;
}

.kl-feature__title {
	font-size: 1.5em;
}

.kl-feature__link {
	display: inline-block;
	margin-top: 0.75rem;
	color: inherit;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

.kl-feature__link::after {
	content: " >";
}

a.kl-feature__link:hover,
a.kl-feature__link:focus {
	text-decoration: underline;
}

.kl-feature__media img {
	margin: 0 auto;
	width: 100%;
	max-height: 320px;
	object-fit: contain;
}

@media ( max-width: 640px ) {
	.kl-feature,
	.kl-feature--img-left {
		grid-template-columns: 1fr;
		padding: 1.25rem;
	}

	.kl-feature--img-left .kl-feature__media {
		order: 0;
	}

	.kl-feature__media {
		order: -1;
	}
}

/* ---------- Newsletter Signup ---------- */

.kl-newsletter {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) minmax( 0, 1fr );
	gap: 2.5rem;
	align-items: center;
	padding: 3rem;
	background: var( --kl-soft );
}

.kl-newsletter:not( :has( .kl-newsletter__media ) ) {
	grid-template-columns: 1fr;
}

.kl-newsletter__media img {
	margin: 0 auto;
	max-width: 280px;
	width: 100%;
	border-radius: 10px;
}

.kl-newsletter__eyebrow {
	margin: 0 0 0.5rem;
	text-align: center;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.kl-newsletter__heading {
	margin: 0 0 1.25rem;
	text-align: center;
	font-size: 1.6em;
}

.kl-newsletter__form {
	width: 100%;
}

.kl-newsletter__placeholder {
	display: grid;
	gap: 0.6rem;
}

.kl-newsletter__placeholder span {
	display: block;
	padding: 0.7rem 0.9rem;
	background: #fff;
	border: 1px solid #e5e5e5;
	font-size: 0.9em;
	opacity: 0.8;
}

.kl-newsletter__placeholder .kl-newsletter__placeholder-btn {
	background: #111;
	color: #fff;
	text-align: center;
	letter-spacing: 0.08em;
	border-color: #111;
}

.kl-newsletter__placeholder em {
	font-size: 0.8em;
	opacity: 0.7;
}

@media ( max-width: 700px ) {
	.kl-newsletter {
		grid-template-columns: 1fr;
		padding: 1.5rem;
		gap: 1.5rem;
	}
}

/* ---------- Testimonial Callout ---------- */

.kl-testimonial {
	border: 1px solid var( --kl-accent-line );
	background: #fff;
}

.kl-testimonial__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.9rem 1.5rem;
	background: var( --kl-accent );
	color: #fff;
	font-size: 1.25em;
}

.kl-testimonial__icon {
	display: inline-flex;
	flex: 0 0 auto;
}

.kl-testimonial__body {
	margin: 0;
	padding: 1.25rem 1.5rem 1.5rem;
	border: 0;
	quotes: none;
}

.kl-testimonial__quote {
	margin: 0 0 1.25rem;
	font-style: italic;
}

.kl-testimonial__quote::before {
	content: "\201C";
}

.kl-testimonial__quote::after {
	content: "\201D";
}

.kl-testimonial__body cite {
	display: block;
	font-style: normal;
}

.kl-testimonial__name {
	margin: 0;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	font-style: normal;
}

/* ---------- Editor-only helpers ---------- */

.kl-edit-item {
	align-items: start;
}

.kl-imagepicker {
	display: grid;
	gap: 0.5rem;
	justify-items: start;
}

.kl-imagepicker__img {
	cursor: pointer;
	max-height: 160px;
	width: auto;
}

.kl-edit-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-top: 0.5rem;
}

.kl-edit-add {
	margin-top: 1.5rem;
}

.kl-listicle__item.kl-edit-item {
	padding-top: 1.25rem;
	border-top: 1px dashed var( --kl-line );
}

.kl-feature__media .kl-imagepicker__img {
	max-height: 240px;
}
