/**
 * Newsletter — Figma 340:1966 + Gravity Forms (theme-safe overrides).
 * Field + arrow are two cells: input has no right border; submit keeps full 1px frame (left edge = divider).
 *
 * @package Love_Beauty_Skin
 */

/* Tame Gravity Forms foundation grid/spacing inside this block only */
.newsletter-section .gform_wrapper {
	--gf-form-gap-y: 0;
	--gf-form-gap-x: 0;
	--gf-form-footer-margin-y-start: 0;
	--gf-form-footer-gap: 0;
	--gf-field-gap-y: 0;
	--gf-field-gap-x: 0;
	width: 100%;
	max-width: min(34.5rem, 100%); /* ~450px field + padded arrow column */
	margin: 0;
}

.newsletter-section {
	width: 100%;
	padding: 40px 0;
	background-color: #fff;
	position: relative;
	z-index: 1;
}

/* Hairline inset 20px from each side; 40px gap above the line */
.newsletter-section::after {
	content: "";
	display: block;
	margin-top: 40px;
	margin-left: 20px;
	margin-right: 20px;
	border-bottom: 1px solid #d9a9a9;
	border-bottom: 1px solid var(--lbs-color-accent-pink);
}

/*
 * global.css uses .site-main .content-area > * + * { margin-top: -0.5rem }, which pulls
 * the next section up and covers this block’s bottom border — reset the following sibling.
 */
.site-main .content-area > .newsletter-section + * {
	margin-top: 0;
}

.newsletter-section__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1.25rem, 3vw, 2rem);
	width: 100%;
	max-width: var(--lbs-container-max);
	margin-inline: auto;
	padding-inline: var(--lbs-space-header-x);
	box-sizing: border-box;
}

.newsletter-section__heading {
	margin: 0;
	flex: 1 1 12rem;
	max-width: 43.1875rem;
	font-family: var(--lbs-font-display);
	font-weight: 400;
	font-size: 2.5rem;
	line-height: 1.2;
	letter-spacing: 0.04em;
	color: var(--lbs-color-nav);
}

@media (max-width: 47.9375rem) {
	.newsletter-section__heading {
		font-size: clamp(1.75rem, 5vw, 2.5rem);
	}
}

.newsletter-section__form {
	flex: 1 1 17rem;
	min-width: min(100%, 17rem);
	max-width: min(100%, 36rem);
	width: 100%;
}

/* Form = horizontal strip: [ field column ] [ footer / submit ] */
.newsletter-section .gform_wrapper form {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
}

.newsletter-section .gform_heading {
	display: none;
}

.newsletter-section .gform-body,
.newsletter-section .gform_body {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 28.125rem;
	margin: 0;
	padding: 0;
}

/* Gravity 2.7+ often uses CSS grid on .gform_fields — override for our row layout */
.newsletter-section .gform_fields {
	display: flex !important;
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0 !important;
	row-gap: 0 !important;
	column-gap: 0 !important;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	grid-template-columns: none !important;
}

.newsletter-section .gfield {
	margin: 0;
	padding: 0;
	border: none;
	width: 100%;
	max-width: none;
}

.newsletter-section .gfield--type-email,
.newsletter-section .gfield--type-text,
.newsletter-section .gfield--type-textarea {
	padding: 0;
}

.newsletter-section .ginput_container,
.newsletter-section .ginput_container_email,
.newsletter-section .ginput_container_textarea {
	margin: 0;
	width: 100%;
	min-width: 0;
}

.newsletter-section .gfield_label,
.newsletter-section .gform-field-label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Shared field chrome — beat GF theme input shadows / radius */
.newsletter-section .gform_wrapper input[type="email"],
.newsletter-section .gform_wrapper input[type="text"],
.newsletter-section .gform_wrapper input[type="tel"],
.newsletter-section .gform_wrapper input[type="url"],
.newsletter-section .gform_wrapper textarea {
	display: block;
	width: 100%;
	height: 4.5rem !important;
	min-height: 4.5rem !important;
	max-height: 4.5rem;
	margin: 0;
	padding: 0 1.5rem;
	font-family: var(--lbs-font-body);
	font-weight: 400;
	font-size: 1.25rem !important;
	line-height: 1.4;
	letter-spacing: 0.0125em;
	color: var(--lbs-color-nav);
	background-color: #fff !important;
	border: 1px solid var(--lbs-color-accent-pink) !important;
	border-right: none;
	border-radius: 0 !important;
	box-shadow: none !important;
	box-sizing: border-box;
	vertical-align: middle;
	-webkit-appearance: none;
	appearance: none;
}

.newsletter-section .gform_wrapper textarea {
	resize: none;
	overflow-y: hidden;
	padding-top: 1.125rem;
	padding-bottom: 1.125rem;
}

.newsletter-section .gform_wrapper input::placeholder,
.newsletter-section .gform_wrapper textarea::placeholder {
	color: var(--lbs-color-accent-pink);
	opacity: 1;
}

.newsletter-section .gform_wrapper input:focus,
.newsletter-section .gform_wrapper textarea:focus {
	outline: 2px solid var(--lbs-color-accent-pink);
	outline-offset: 2px;
}

/* Inline submit field (button location = inline) */
.newsletter-section .gfield--type-submit {
	flex: 0 0 auto;
	width: auto;
	max-width: none;
	align-self: stretch;
}

.newsletter-section .gfield--type-submit .ginput_container {
	display: flex;
	align-items: stretch;
	height: 100%;
}

.newsletter-section .gform_footer {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	gap: 0;
}

.newsletter-section .gform_footer input[type="hidden"] {
	display: none;
}

/* Submit: <input> — block + bg arrow; horizontal padding = space before/after arrow */
.newsletter-section .gform_footer input[type="submit"],
.newsletter-section .gform_footer input[type="button"],
.newsletter-section .gfield--type-submit input[type="submit"],
.newsletter-section .gfield--type-submit input[type="button"] {
	--nl-arrow-pad-x: 1.625rem;

	display: block;
	width: auto;
	min-width: 6.25rem;
	height: 4.5rem !important;
	min-height: 4.5rem !important;
	margin: 0;
	padding: 0 var(--nl-arrow-pad-x);
	font-size: 0 !important;
	line-height: 0 !important;
	color: transparent !important;
	text-indent: -9999px;
	overflow: hidden;
	cursor: pointer;
	background-color: #fff !important;
	background-image: url("../../images/button-arrow.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 2.125rem auto;
	border: 1px solid var(--lbs-color-accent-pink) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	box-sizing: border-box;
	transition: background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

/* Submit: <button> — GF may add SVG / label text; hide and show arrow only */
.newsletter-section .gform_footer button:not([type="hidden"]),
.newsletter-section .gfield--type-submit button {
	--nl-arrow-pad-x: 1.625rem;

	display: flex !important;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 6.25rem;
	height: 4.5rem !important;
	min-height: 4.5rem !important;
	margin: 0;
	padding: 0.625rem var(--nl-arrow-pad-x);
	font-size: 0 !important;
	line-height: 0 !important;
	color: transparent !important;
	cursor: pointer;
	background-color: #fff !important;
	background-image: url("../../images/button-arrow.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 2.125rem auto;
	border: 1px solid var(--lbs-color-accent-pink) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	box-sizing: border-box;
	transition: background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

/* Gravity Forms form 1 — submit control id from GF */
.newsletter-section #gform_submit_button_1 {
	padding-left: 30px;
	padding-right: 30px;
}

/* GF 2.7+ theme styles often set border:none on .gform_button / theme buttons */
.newsletter-section .gform_footer input.gform_button,
.newsletter-section .gform_footer button.gform_button,
.newsletter-section .gfield--type-submit input.gform_button,
.newsletter-section .gfield--type-submit button.gform_button {
	border: 1px solid var(--lbs-color-accent-pink) !important;
	box-shadow: none !important;
}

.newsletter-section .gform_footer button:not([type="hidden"]) svg,
.newsletter-section .gform_footer button:not([type="hidden"]) .gform-icon,
.newsletter-section .gfield--type-submit button svg,
.newsletter-section .gfield--type-submit button .gform-icon {
	display: none !important;
}

/* No default blue ring / GF shadow on pointer focus; :focus-visible restores pink ring for keyboard */
.newsletter-section .gform_footer input[type="submit"]:focus,
.newsletter-section .gform_footer input[type="button"]:focus,
.newsletter-section .gform_footer button:not([type="hidden"]):focus,
.newsletter-section .gfield--type-submit input:focus,
.newsletter-section .gfield--type-submit button:focus {
	outline: none !important;
	box-shadow: none !important;
}

.newsletter-section .gform_footer input[type="submit"]:active,
.newsletter-section .gform_footer input[type="button"]:active,
.newsletter-section .gform_footer button:not([type="hidden"]):active,
.newsletter-section .gfield--type-submit input:active,
.newsletter-section .gfield--type-submit button:active {
	outline: none !important;
	box-shadow: none !important;
}

.newsletter-section .gform_footer input[type="submit"]::-moz-focus-inner,
.newsletter-section .gfield--type-submit input[type="submit"]::-moz-focus-inner {
	border: 0;
}

.newsletter-section .gform_footer input[type="submit"]:hover,
.newsletter-section .gform_footer input[type="submit"]:focus-visible,
.newsletter-section .gform_footer button:not([type="hidden"]):hover,
.newsletter-section .gform_footer button:not([type="hidden"]):focus-visible,
.newsletter-section .gfield--type-submit input:hover,
.newsletter-section .gfield--type-submit input:focus-visible,
.newsletter-section .gfield--type-submit button:hover,
.newsletter-section .gfield--type-submit button:focus-visible {
	background-color: #faf6f4 !important;
}

.newsletter-section .gform_footer input[type="submit"]:focus-visible,
.newsletter-section .gform_footer button:focus-visible,
.newsletter-section .gfield--type-submit input:focus-visible,
.newsletter-section .gfield--type-submit button:focus-visible {
	outline: 2px solid var(--lbs-color-accent-pink) !important;
	outline-offset: 2px;
	box-shadow: none !important;
}

/* GF ajax spinner sits in footer — keep next to button without breaking row */
.newsletter-section .gform_footer .gform_ajax_spinner,
.newsletter-section .gform_footer img.gform_ajax_spinner {
	align-self: center;
	margin-inline-start: 0.5rem;
}

/* Compact validation summary (“There was a problem…”) */
.newsletter-section .gform_validation_errors {
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.75rem !important;
	max-width: 100%;
	font-family: var(--lbs-font-body);
	box-sizing: border-box;
}

.newsletter-section .gform_validation_errors .gform_submission_error,
.newsletter-section .gform_validation_errors h2.gform_submission_error {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.8125rem !important;
	font-weight: 400 !important;
	line-height: 1.35 !important;
	letter-spacing: 0.01em;
}

.newsletter-section .gform_validation_errors .gform-icon {
	width: 1rem !important;
	height: 1rem !important;
	margin-inline-end: 0.35rem !important;
	vertical-align: -0.15em;
}

.newsletter-section .gform_validation_errors ol,
.newsletter-section .gform_validation_errors ul {
	margin: 0.35rem 0 0 !important;
	padding-left: 1.1rem !important;
	font-size: 0.75rem !important;
	line-height: 1.35 !important;
}

.newsletter-section .validation_message,
.newsletter-section .gfield_description.validation_message {
	margin-top: 0.35rem;
	font-family: var(--lbs-font-body);
	font-size: 0.75rem;
	line-height: 1.35;
}

.newsletter-section .gform_confirmation_message {
	margin: 0;
	font-family: var(--lbs-font-body);
	font-size: 1rem;
	line-height: 1.4;
	color: var(--lbs-color-nav);
}

/* When submit is inline, form body row: field + button */
.newsletter-section .gform_wrapper form:has(.gfield--type-submit) {
	flex-wrap: wrap;
}

.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gform-body,
.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gform_body {
	max-width: none;
	flex: 1 1 auto;
}

.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gform_fields {
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0;
}

.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gfield--type-email,
.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gfield--type-text,
.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gfield--type-textarea {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 28.125rem;
}

.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gfield--type-submit {
	flex: 0 0 auto;
}

.newsletter-section .gform_wrapper form:has(.gfield--type-submit) input[type="email"],
.newsletter-section .gform_wrapper form:has(.gfield--type-submit) input[type="text"],
.newsletter-section .gform_wrapper form:has(.gfield--type-submit) textarea {
	border-right: none !important;
}

/* Viewports ≤640px: keep email + arrow on one row; kill stray vertical gaps; 40px section padding */
@media (max-width: 640px) {
	.newsletter-section {
		padding: 40px 0;
	}

	.newsletter-section::after {
		margin-top: 40px;
	}

	/*
	 * Critical: base layout uses justify-content: space-between + flex-grow on the title.
	 * In a column stack that injects a huge gap between the heading and the form.
	 */
	.newsletter-section__inner {
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		align-content: flex-start;
		gap: 0.5rem;
		row-gap: 0.5rem;
	}

	.newsletter-section__heading {
		flex: 0 0 auto;
		width: 100%;
		max-width: none;
		line-height: 1.15;
	}

	.newsletter-section__form {
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
		max-width: 100%;
	}

	/* Inline-submit markup: base uses flex-wrap:wrap here — forces submit onto a new row when narrow */
	.newsletter-section .gform_wrapper form:has(.gfield--type-submit) {
		flex-wrap: nowrap;
	}

	.newsletter-section .gform_wrapper {
		max-width: 100%;
		margin-block: 0;
		padding-block: 0;
	}

	.newsletter-section .gform-body,
	.newsletter-section .gform_body {
		flex: 1 1 auto;
		min-width: 0;
		max-width: none;
	}

	/* Body + footer stay horizontal (field | submit) */
	.newsletter-section .gform_wrapper form {
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: stretch;
	}

	.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gform_fields {
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: stretch;
	}

	.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gfield--type-email,
	.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gfield--type-text,
	.newsletter-section .gform_wrapper form:has(.gfield--type-submit) .gfield--type-textarea {
		max-width: none;
	}

	/* Connected strip: input meets button */
	.newsletter-section .gform_wrapper input[type="email"],
	.newsletter-section .gform_wrapper input[type="text"],
	.newsletter-section .gform_wrapper textarea {
		border-right: none !important;
		height: 4rem !important;
		min-height: 4rem !important;
		max-height: 4rem;
		padding: 0 1rem;
		font-size: 1rem !important;
	}

	.newsletter-section .gform_footer input[type="submit"],
	.newsletter-section .gform_footer input[type="button"],
	.newsletter-section .gform_footer button:not([type="hidden"]),
	.newsletter-section .gfield--type-submit input[type="submit"],
	.newsletter-section .gfield--type-submit button {
		width: auto;
		min-width: 4.25rem;
		height: 4rem !important;
		min-height: 4rem !important;
		/* Full 1px frame; left edge = vertical divider vs field (Figma 340:1966). */
		border: 1px solid var(--lbs-color-accent-pink) !important;
	}

	.newsletter-section #gform_submit_button_1 {
		padding-left: 2rem;
		padding-right: 2rem;
	}

	.newsletter-section .gform_footer .gform_ajax_spinner,
	.newsletter-section .gform_footer img.gform_ajax_spinner {
		flex-shrink: 0;
	}
}
