/*
 * Yhteydenottolomake, static step one (patterns/yhteydenottolomake.php):
 * intro with the off-seam Wheel on the left, the form (one Custom HTML
 * block, `.kt-lomake`) on the right.
 */

.kt-yhteydenottolomake.wp-block-group {
	position: relative;
}

.kt-yhteydenottolomake .kt-yhteydenottolomake__columns {
	margin-block: 0;
}

.kt-yhteydenottolomake__intro > * {
	margin-block: 0;
}

.kt-yhteydenottolomake .kt-yhteydenottolomake__heading {
	margin-block-start: var(--wp--preset--spacing--40);
	line-height: 0.95;
}

.kt-yhteydenottolomake .kt-yhteydenottolomake__lead {
	max-width: 26rem;
	margin-block-start: var(--wp--preset--spacing--60);
	line-height: 1.45;
}

/*
 * The Wheel (Ø 232 at 1440, centre 9px inside the left page edge), off any
 * seam: level with the checkbox list, below the intro paragraph. The divider
 * row stays in the intro column; its Wheel is positioned against the
 * section (the nearest positioned ancestor), so it reaches the page edge.
 */
.kt-wheel-divider--lomake.wp-block-group {
	--kt-wheel-size: clamp(140px, 16.1vw, 232px);
	--kt-wheel-inset: 9px;
	position: static;
	z-index: auto;
	margin-block-start: calc(var(--wp--preset--spacing--60) + var(--kt-wheel-size) / 2);
}

.kt-wheel-divider--lomake .kt-wheel-divider__wheel {
	top: auto;
	z-index: 0;
}

/* Stacked columns: the Wheel takes its own row between intro and form. */
@media (max-width: 781px) {

	.kt-wheel-divider--lomake.wp-block-group {
		height: auto;
		margin-block-start: var(--wp--preset--spacing--50);
	}

	.kt-wheel-divider--lomake .kt-wheel-divider__wheel {
		position: relative;
		left: calc(var(--kt-wheel-inset) - var(--kt-wheel-size) / 2 - var(--wp--style--root--padding-left, 16px));
		transform: none;
	}
}

/* The form ---------------------------------------------------------------- */

.kt-lomake {
	position: relative;
	z-index: 1;
	max-width: 40rem;
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.4;
}

.kt-lomake > * {
	margin-block: 0;
}

/* Three-step indicator; the line under it is red under the current step. */
.kt-lomake__steps {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
	margin: 0;
	padding: 0 0 var(--wp--preset--spacing--30);
	border-block-end: 2px solid var(--wp--preset--color--grey-light);
	list-style: none;
}

.kt-lomake__step {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.kt-lomake__step-number {
	display: grid;
	flex: none;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background-color: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--2-xl);
	font-weight: 600;
	line-height: 1;
}

.kt-lomake__step[aria-current="step"] .kt-lomake__step-number {
	width: 4rem;
	height: 4rem;
	background-color: var(--wp--preset--color--red);
}

.kt-lomake__step[aria-current="step"]::after {
	content: "";
	position: absolute;
	inset-inline: 0 calc(-1 * var(--wp--preset--spacing--50));
	bottom: calc(-1 * var(--wp--preset--spacing--30) - 3px);
	height: 4px;
	background-color: var(--wp--preset--color--red);
}

/* "Mitä tarvitset?" and the Palvelu checkboxes. */
.kt-lomake__needs {
	min-width: 0;
	margin: var(--wp--preset--spacing--70) 0 0;
	padding: 0;
	border: 0;
}

.kt-lomake__needs legend {
	padding: 0;
}

.kt-lomake .kt-lomake__heading {
	margin: 0;
	font-size: var(--wp--preset--font-size--display-xl);
	line-height: 1;
}

.kt-lomake .kt-lomake__help {
	margin-block: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
}

.kt-lomake__options {
	display: grid;
	gap: 12px;
}

.kt-lomake__option {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	min-height: 3.625rem;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--grey-light);
	background-color: var(--wp--preset--color--beige);
	cursor: pointer;
}

.kt-lomake__option input {
	flex: none;
	width: 1.75rem;
	height: 1.75rem;
	margin: 0;
	accent-color: var(--wp--preset--color--red);
	cursor: pointer;
}

.kt-lomake__option:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--near-black);
	outline-offset: 2px;
}

/* "Muu aihe:" */
.kt-lomake .kt-lomake__field {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	margin-block-start: var(--wp--preset--spacing--30);
}

.kt-lomake__field input {
	width: 100%;
	min-height: 3.625rem;
	padding-inline: var(--wp--preset--spacing--30);
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--grey-light);
	border-radius: 0;
	background-color: var(--wp--preset--color--white);
	color: inherit;
	font: inherit;
}

/* "Kohteen tiedot →": a small primary button, visually active but inert. */
.kt-lomake .kt-lomake__actions {
	display: flex;
	justify-content: flex-end;
	margin-block-start: var(--wp--preset--spacing--40);
}

.kt-lomake .kt-lomake__next {
	padding: 10px var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--sm);
	cursor: default;
}

.kt-lomake__next::after {
	content: "\2192" / "";
	margin-inline-start: 0.35em;
}

/* Phones: the three steps stay on one row, labels under smaller circles. */
@media (max-width: 599px) {

	.kt-lomake__steps {
		flex-wrap: nowrap;
		gap: var(--wp--preset--spacing--20);
	}

	.kt-lomake__step {
		flex: 1 1 0;
		flex-direction: column;
		gap: var(--wp--preset--spacing--20);
		font-size: var(--wp--preset--font-size--sm);
		text-align: center;
	}

	.kt-lomake__step-number,
	.kt-lomake__step[aria-current="step"] .kt-lomake__step-number {
		width: 2.75rem;
		height: 2.75rem;
		font-size: var(--wp--preset--font-size--lg);
	}

	.kt-lomake__step[aria-current="step"]::after {
		inset-inline: 0;
	}
}
