/* Ampera · Kontaktų forma (Figma 1103:2008 desktop / 1103:6946 mobile).
   Violet panel left (heading + manager card + overhanging portrait), the live
   CF7 form right. The facet disclosure inside the form is styled globally
   (style.css .ampera-facets); this file skins the raw CF7 controls. */

.ampera-kontaktai {
	position: relative;
	font-family: var(--wp--preset--font-family--telegraf);
}

/* Violet panel: full band height, bleeds to the viewport's left edge; its
   right edge is anchored 616px into the centred 1440px design frame. */
.ampera-kontaktai::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: max(calc((100% - 1440px) / 2 + 616px), 42.8%);
	background: var(--wp--preset--color--violetine);
}

.ampera-kontaktai__inner {
	position: relative; /* paints above the ::before panel */
	max-width: 1296px;
	margin-inline: auto;
	padding-block: 56px;
	padding-inline: 72px;
	display: grid;
	grid-template-columns: minmax(0, 629px) minmax(0, 500px);
	grid-template-rows: auto auto;
	column-gap: clamp(48px, 10.28vw, 148px);
	justify-content: start;
	align-items: start;
}

/* Sub-1440 laptops: the FORM column drives the section height there and
   missed the fold by a hair — tighter band padding closes it (client
   2026-08-10: the section must fit one screen). */
@media (max-width: 1366px) {
	.ampera-kontaktai__inner {
		padding-block: 40px;
	}
}

/* ---- Left: heading + manager card ---- */

.ampera-kontaktai__intro {
	grid-column: 1;
	grid-row: 1;
}

.ampera-kontaktai__heading {
	margin: 0 0 36px;
	font-weight: 800;
	font-size: clamp(36px, 5vw, 60px);
	line-height: 1.2;
}

.ampera-kontaktai__manager {
	margin: 0;
}

.ampera-kontaktai__name {
	margin: 0 0 8px;
	font-weight: 800;
	font-size: 20px;
	line-height: 28px;
}

.ampera-kontaktai__role {
	margin: 0;
	font-size: 14px;
	line-height: 20px;
}

.ampera-kontaktai__contacts {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 40px;
	margin-top: 24px;
}

.ampera-kontaktai__contact {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: inherit; /* keep juoda; global link colour must not bleed in */
	text-decoration: none;
	font-weight: 800;
	font-size: 16px;
	line-height: 24px;
}

.ampera-kontaktai__contact:hover span {
	text-decoration: underline;
}

.ampera-kontaktai__contact svg {
	width: 24px;
	height: 24px;
	flex: none;
}

/* ---- Portrait: fixed 701x510 dark frame, bleeding left past the gutter to
   the viewport edge (701 > 616, so it overhangs onto balta on the right). ---- */

.ampera-kontaktai__photo {
	grid-column: 1;
	grid-row: 2;
	box-sizing: border-box;
	/* Second pass per Domantas: the frame keeps the Figma 701:510 proportion
	   (never flat) but STOPS growing past the 1440 design width, so the whole
	   section fits one screen on wide laptops. */
	width: calc(100% + 72px);
	margin: 16px 0 0 -72px;
	height: auto;
	aspect-ratio: 701 / 510;
	min-height: 300px;
	/* Client 2026-08-10: the whole section must fit ONE screen — the photo
	   yields height first (480px = the section's non-photo parts + the 114px
	   sticky header + slack). Floor 300px: with the 330px floor the section
	   still missed the fold by ~15px on 1280×800 laptops. */
	max-height: max(300px, calc(100vh - 480px));
	background: var(--wp--preset--color--juoda);
	overflow: hidden;
}

.ampera-kontaktai__photo img {
	display: block;
	width: 100%;
	/* Client 2026-08-10 (3rd pass): the source is head-at-top (grey cropped
	   in the file), so the anchor must be TOP — with the viewport height cap
	   the frame can become WIDER than the image ratio, and a bottom anchor
	   then crops from the TOP, i.e. her head. Top-anchored, a too-wide frame
	   crops her lower body instead, which is always safe. */
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/* ---- Right: the CF7 form column, vertically centred in the band ---- */

.ampera-kontaktai__form {
	grid-column: 2;
	grid-row: 1 / 3;
	align-self: center;
	min-width: 0;
	max-width: 500px;
	width: 100%;
}

.ampera-kontaktai__placeholder {
	margin: 0;
	opacity: 0.5;
}

/* CF7 wraps every template line in a <p>. ONE rhythm for every row (client
   2026-08-24: "eilutėse reikia vienodumo tarp tarpų"): the rows inside the
   fields group already sat on 20px, while the groups around them used 16px and
   the checkbox row 24px, so the form visibly changed pace going down.
   Everything is 20px now — change it here and the whole form follows. */
.ampera-kontaktai .wpcf7-form p {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 20px;
}

.ampera-kontaktai .wpcf7-form p:last-of-type {
	margin-bottom: 0;
}

/* El. paštas + Tel. numeris in ONE row (client 2026-08-26). The wrapper comes
   from the CF7 template; CF7's autop puts BOTH field lines into a single <p>
   separated by <br> (measured, not assumed - the first pass styled per-field
   <p>s that do not exist). So the <p> is the flex container, the <br> is
   hidden, and the two control-wrap spans are the halves. The validation tip
   lands inside its control-wrap, so it stays under its own field. */
.ampera-kontaktai .ampera-form__duo {
	margin: 0 0 20px;
}

.ampera-kontaktai .ampera-form__duo p {
	display: flex;
	gap: 24px;
	margin: 0;
}

.ampera-kontaktai .ampera-form__duo br {
	display: none;
}

.ampera-kontaktai .ampera-form__duo .wpcf7-form-control-wrap {
	flex: 1 1 0;
	min-width: 0;
}

@media (max-width: 640px) {
	.ampera-kontaktai .ampera-form__duo p {
		flex-direction: column;
		gap: 20px;
	}
}

/* "Jus domina:" line inside the CF7 template (class on the template markup). */
.ampera-kontaktai .wpcf7-form .ampera-form-title {
	display: block;
	font-weight: 800;
	font-size: 20px;
	line-height: 28px;
}

.ampera-kontaktai .wpcf7-form p:has(.ampera-form-title) {
	margin-bottom: 28px;
}

/* The <legend> ships with NO rule of its own, so it inherited the browser
   default 16px while every field below it is 14px — that is the "viršuje
   didesnis šriftas" the client saw. Match the fields. */
.ampera-kontaktai .ampera-form__legend {
	padding: 0;
	font-size: 14px;
	line-height: 20px;
}

/* The "Jus domina" fieldset ships unstyled from the CF7 template — the browser
   default padding + CF7's <p> margin left a dead band under the checkboxes. */
.ampera-kontaktai .ampera-form__interest {
	margin: 0;
	padding: 12px 16px 16px;
	border: 1px solid rgba(23, 30, 40, 0.3);
}

/* Interest radios (the `interest` field) drawn as the Figma square outline boxes. */
.ampera-kontaktai .wpcf7-radio,
.ampera-kontaktai .wpcf7-checkbox {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
}

.ampera-kontaktai .wpcf7-radio .wpcf7-list-item,
.ampera-kontaktai .wpcf7-checkbox .wpcf7-list-item {
	margin: 0;
}

.ampera-kontaktai .wpcf7-radio .wpcf7-list-item label,
.ampera-kontaktai .wpcf7-checkbox .wpcf7-list-item label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 14px; /* was 16px — one type size across every row. */
	line-height: 20px;
}

.ampera-kontaktai .wpcf7-form p:has(.wpcf7-radio),
.ampera-kontaktai .wpcf7-form p:has(.wpcf7-checkbox) {
	margin-bottom: 20px; /* was 24px — see the one-rhythm note above. */
}

/* ...except inside the interest fieldset, where CF7's paragraph is pure
   plumbing — its margin created a dead band under the checkboxes. */
.ampera-kontaktai .ampera-form__interest p:has(.wpcf7-radio),
.ampera-kontaktai .ampera-form__interest p:has(.wpcf7-checkbox),
.ampera-kontaktai .ampera-form__interest p {
	margin: 0;
}

.ampera-kontaktai .wpcf7-form input[type="radio"],
.ampera-kontaktai .wpcf7-form input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	flex: none;
	background: transparent;
	border: 1px solid var(--wp--preset--color--juoda);
	border-radius: 0;
	cursor: pointer;
}

.ampera-kontaktai .wpcf7-form input[type="radio"]:checked,
.ampera-kontaktai .wpcf7-form input[type="checkbox"]:checked {
	background-color: var(--wp--preset--color--juoda);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.55 17.65 4.9 13l1.4-1.4 3.25 3.25 8.15-8.15 1.4 1.4Z' fill='%23FFFFFF'/%3E%3C/svg%3E");
	background-size: 20px 20px;
	background-position: center;
	background-repeat: no-repeat;
}

.ampera-kontaktai .wpcf7-form input[type="radio"]:focus-visible,
.ampera-kontaktai .wpcf7-form input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--wp--preset--color--juoda);
	outline-offset: 2px;
}

/* Underline inputs: 40px rows, hairline bottom border only. */
.ampera-kontaktai .wpcf7-form input[type="text"],
.ampera-kontaktai .wpcf7-form input[type="email"],
.ampera-kontaktai .wpcf7-form input[type="tel"],
.ampera-kontaktai .wpcf7-form textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	height: 40px;
	padding: 12px 8px 8px;
	background: transparent;
	border: 0;
	border-bottom: 1px solid rgba(23, 30, 40, 0.3);
	border-radius: 0;
	color: var(--wp--preset--color--juoda);
	font-family: var(--wp--preset--font-family--telegraf);
	font-size: 14px;
	line-height: 20px;
}

.ampera-kontaktai .wpcf7-form textarea {
	height: 90px;
	resize: none;
}

.ampera-kontaktai .wpcf7-form input[type="text"]::placeholder,
.ampera-kontaktai .wpcf7-form input[type="email"]::placeholder,
.ampera-kontaktai .wpcf7-form input[type="tel"]::placeholder,
.ampera-kontaktai .wpcf7-form textarea::placeholder {
	color: rgba(23, 30, 40, 0.6);
	opacity: 1;
}

.ampera-kontaktai .wpcf7-form input[type="text"]:focus,
.ampera-kontaktai .wpcf7-form input[type="email"]:focus,
.ampera-kontaktai .wpcf7-form input[type="tel"]:focus,
.ampera-kontaktai .wpcf7-form textarea:focus {
	outline: none;
	border-bottom-color: var(--wp--preset--color--juoda);
}

/* The consent sits in its own template <div> that doesn't pick up the row
   rhythm the groups above get (via the p:has(...) rules), so it ended up flush
   against the message field's underline. Give it the same breathing room. */
.ampera-kontaktai .ampera-form__consent {
	margin-top: 20px;
}

/* Consent (acceptance): 20px box + B12 label with underlined privacy link. */
.ampera-kontaktai .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}

.ampera-kontaktai .wpcf7-acceptance .wpcf7-list-item label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 12px;
	line-height: 16px;
}

.ampera-kontaktai .wpcf7-acceptance input[type="checkbox"] {
	width: 20px;
	height: 20px;
}

.ampera-kontaktai .wpcf7-acceptance input[type="checkbox"]:checked {
	background-size: 14px 14px;
}

.ampera-kontaktai .wpcf7-form a {
	color: inherit;
	text-decoration: underline;
}

/* Submit: outline button (Figma 1103:2065), theme hover to violetinė. */
.ampera-kontaktai .wpcf7-form .wpcf7-submit{
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* Client 2026-08-24: 219px (the Figma width) read as a slab beside the
	   hairline fields; narrowed so the button hugs its label. */
	min-width: 176px;
	height: 44px;
	padding: 10px 32px;
	margin-top: 20px; /* the consent <div> carries no bottom margin — this IS the row gap */
	background: transparent;
	border: 1px solid var(--wp--preset--color--juoda);
	border-radius: 0;
	color: var(--wp--preset--color--juoda);
	font-family: var(--wp--preset--font-family--telegraf);
	font-weight: 800;
	font-size: 16px;
	line-height: 24px;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.ampera-kontaktai .wpcf7-form .wpcf7-submit:hover{
	background: var(--wp--preset--color--violetine);
	border-color: var(--wp--preset--color--violetine);
	color: var(--wp--preset--color--juoda);
}

.ampera-kontaktai .wpcf7-form .wpcf7-submit:focus-visible{
	outline: 2px solid var(--wp--preset--color--juoda);
	outline-offset: 2px;
}

/* Validation + response (error tone #B15A6E — closest UI-kit pink; noted). */
.ampera-kontaktai .wpcf7-not-valid-tip {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	line-height: 16px;
	color: #b15a6e;
}

.ampera-kontaktai .wpcf7 form .wpcf7-response-output {
	margin: 24px 0 0;
	padding: 12px 16px;
	border: 1px solid var(--wp--preset--color--juoda);
	font-size: 14px;
	line-height: 20px;
}

.ampera-kontaktai .wpcf7 form.invalid .wpcf7-response-output,
.ampera-kontaktai .wpcf7 form.failed .wpcf7-response-output {
	border-color: #b15a6e;
	color: #b15a6e;
}

/* ============================================================
   Mobile (Figma 1103:6946, 375x1059): violet block wraps heading + card,
   210x153 portrait straddles the panel's bottom edge, form stacks below.
   ============================================================ */
@media (max-width: 900px) {
	.ampera-kontaktai::before {
		display: none;
	}

	.ampera-kontaktai__inner {
		display: block;
		padding: 0 24px 48px;
	}

	.ampera-kontaktai__intro {
		box-sizing: border-box;
		width: calc(100% + 24px);
		margin-left: -24px;
		padding: 80px 24px 101px 48px; /* bottom = 24px gap + 77px of portrait on violet */
		background: var(--wp--preset--color--violetine);
	}

	.ampera-kontaktai__heading {
		margin-bottom: 40px;
		font-size: 36px;
		line-height: 40px;
	}

	.ampera-kontaktai__name {
		margin-bottom: 6px;
		font-size: 18px;
		line-height: 28px;
	}

	.ampera-kontaktai__role {
		font-size: 12px;
		line-height: 16px;
	}

	.ampera-kontaktai__contacts {
		flex-direction: column;
		gap: 16px;
	}

	.ampera-kontaktai__contact svg {
		width: 20px;
		height: 20px;
	}

	.ampera-kontaktai__photo {
		position: relative; /* paint above the intro's violet background */
		width: 210px;
		height: 153px;
		min-height: 0; /* the desktop aspect-lock's 330px floor must not win here */
		aspect-ratio: auto;
		margin: -77px 0 0;
	}

	.ampera-kontaktai__form {
		max-width: none;
		margin-top: 24px;
	}

	.ampera-kontaktai .wpcf7-form .ampera-form-title {
		font-size: 18px;
		line-height: 28px;
	}

	.ampera-kontaktai .wpcf7-form p:has(.ampera-form-title) {
		margin-bottom: 24px;
	}

	.ampera-kontaktai .wpcf7-radio,
	.ampera-kontaktai .wpcf7-checkbox {
		justify-content: space-between;
		gap: 16px 8px;
	}

	.ampera-kontaktai .wpcf7-radio .wpcf7-list-item label,
	.ampera-kontaktai .wpcf7-checkbox .wpcf7-list-item label {
		font-size: 14px;
		line-height: 20px;
	}

	.ampera-kontaktai .wpcf7-form input[type="radio"],
	.ampera-kontaktai .ampera-form__interest input[type="checkbox"] {
		width: 26px;
		height: 26px;
	}

	.ampera-kontaktai .wpcf7-form input[type="radio"]:checked,
	.ampera-kontaktai .ampera-form__interest input[type="checkbox"]:checked {
		background-size: 16px 16px;
	}

	.ampera-kontaktai .wpcf7-acceptance input[type="checkbox"] {
		width: 20px;
		height: 20px;
	}

	.ampera-kontaktai .wpcf7-form .wpcf7-submit{
		width: 100%;
		min-width: 0;
		font-size: 14px;
		line-height: 20px;
	}
}

/* Entrance: the portrait rises a beat after the section reveals. */
@media (prefers-reduced-motion: no-preference) {
	.ampera-kontaktai .ampera-kontaktai__photo {
		transition: opacity 1.3s cubic-bezier(0.16, 1, 0.3, 1), transform 1.3s cubic-bezier(0.16, 1, 0.3, 1);
		transition-delay: 0.35s;
	}
	.ampera-kontaktai.ampera-reveal:not(.is-visible) .ampera-kontaktai__photo {
		opacity: 0;
		transform: translateY(24px);
	}
}
