/*
 * Site footer (ABE Factors design, Figma component "Group 323", 1728 x 709).
 * Markup: footer.php, template-parts/footer-top.php, [site_social_links] (shortcodes/site_social_links.php)
 * and the Contact Form 7 newsletter form (template in the comment of section 5).
 *
 *   Background  Charcoal #241F21, text white (15.6:1)
 *   Logo        132px wide, Steel #BDC2BA
 *   Text        Red Hat Display 18px; headings Bold 18/30; bottom row 14px
 *   Columns     about 175, newsletter 611, contact 1136, menu at the content edge (1728px canvas)
 *
 * 1. Footer box
 * 2. Top row: logo and columns
 * 3. Headings, text and links
 * 4. Contact column and social links
 * 5. Newsletter form (Contact Form 7)
 * 6. Bottom row: copyright, credit, legal links
 * 7. Tablet and mobile
 */

/* ------------------------------------------------------------------
 * 1. Footer box
 * ------------------------------------------------------------------ */
.site-footer {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--white);
}

/* Focus target of the "Skip to footer" link; the landmark itself needs no ring. */
#site-footer:focus {
	outline: 0;
}

.section_footer {
	padding-top: 65px;
	padding-bottom: 52px;
	font-size: var(--wp--preset--font-size--body);
	line-height: 30px;
	font-weight: 400;
}

.section_footer .footer-inner {
	margin: 0 auto;
}

.section_footer p {
	margin: 0;
}

/* ------------------------------------------------------------------
 * 2. Top row: logo, then four columns
 * ------------------------------------------------------------------ */
.section_footer .footer_logo {
	margin-bottom: 38px;
}

.section_footer .footer-logo-link {
	display: block;
	width: fit-content;
	line-height: 0;
	color: var(--wp--preset--color--steel); /* inline SVG logo uses currentColor */
}

.section_footer .footer-logo-img,
.section_footer .footer-logo-svg {
	display: block;
	width: 132px;
	max-width: 100%;
	height: auto;
}

/* Column starts as in the design: 0, 436, 961 (of 1378), menu column ends on the content edge. */
.section_footer .footer_columns {
	display: grid;
	grid-template-columns: 31.68% 38.06% minmax(0, 1fr) max-content;
	align-items: start;
}

.section_footer .footer_about {
	max-width: 350px; /* 326px of text, as in the design, + 24px before the next column */
	padding-right: 24px;
}

.section_footer .footer_newsletter {
	max-width: 441px; /* 417px field + room before the next column */
	padding-right: 24px;
}

.section_footer .footer_contact {
	padding-right: 24px;
}

.section_footer .about_text {
	line-height: 26px;
}

/* ------------------------------------------------------------------
 * 3. Headings, text and links
 * ------------------------------------------------------------------ */
.section_footer .footer_title {
	margin: 0;
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 700;
	line-height: 30px;
	letter-spacing: 0;
	text-transform: none;
}

.section_footer a {
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

/* Hover and focus: yellow and underlined, so the change does not rely on colour alone. */
.section_footer a:hover,
.section_footer a:focus-visible {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.section_footer ul.menu,
.section_footer .footer_contact_list,
.section_footer .site_social_links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.section_footer ul.menu li,
.section_footer .footer_contact_list li,
.section_footer .site_social_links li {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Current page in the footer menus: underlined (it also has aria-current="page"). */
.section_footer ul.menu a[aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.section_footer .footer_nav ul.menu a {
	display: inline-block;
	line-height: 30px;
}

/* ------------------------------------------------------------------
 * 4. Contact column and social links
 * ------------------------------------------------------------------ */
.section_footer .footer_contact_list .email {
	line-height: 26px;
}

.section_footer .footer_contact_list .site_address {
	line-height: 26px;
	margin-bottom: 4px;
}

.section_footer .footer_contact_list a {
	overflow-wrap: anywhere; /* long e-mail addresses in narrow columns */
}

/* 44px targets around 21px icons; the negative margin keeps the first icon on the column edge. */
.section_footer .site_social_links {
	display: flex;
	flex-wrap: wrap;
	margin-left: -11.5px;
}

.section_footer .site_social_links a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	font-size: 21px;
	line-height: 1;
}

.section_footer .site_social_links a:hover,
.section_footer .site_social_links a:focus-visible {
	text-decoration: none;
}

/* ------------------------------------------------------------------
 * 5. Newsletter form (Contact Form 7)
 *
 * Form template (Contact > Contact Forms > Newsletter > Form):
 *
 *   <div class="newsletter-field">
 *   <label for="newsletter-email">E-mail address</label>
 *   [email* newsletter-email id:newsletter-email autocomplete:email]
 *   </div>
 *   <button type="submit" class="btn_submit">Submit</button>
 *
 * The label sits on the line like the placeholder in the design and moves up while the field has focus or
 * a value (js/footer.js adds .is-filled), so a visible label is always there (WCAG 3.3.2).
 * ------------------------------------------------------------------ */
.section_footer .newsletter_form {
	max-width: 417px;
}

.section_footer .newsletter_form form.wpcf7-form {
	display: block;
}

.section_footer .newsletter-field {
	position: relative;
	padding-top: 25px; /* room for the label when it moves up; puts the line where the design has it */
}

.section_footer .newsletter-field label {
	position: absolute;
	top: 32px; /* padding-top + input padding-top */
	left: 3px;
	margin: 0;
	color: rgba(189, 194, 186, 0.8); /* Steel, 6:1 on charcoal */
	font-size: var(--wp--preset--font-size--body);
	font-weight: 400;
	line-height: 30px;
	letter-spacing: 0;
	text-transform: none;
	pointer-events: none;
	transition: top 0.15s ease, font-size 0.15s ease, line-height 0.15s ease, color 0.15s ease;
}

.section_footer .newsletter-field:focus-within label,
.section_footer .newsletter-field.is-filled label {
	top: 0;
	color: var(--wp--preset--color--steel);
	font-size: var(--wp--preset--font-size--small-14);
	line-height: 16px;
}

.section_footer .newsletter-field .wpcf7-form-control-wrap {
	position: static;
	display: block;
	margin: 0;
}

.section_footer .newsletter-field input[type="email"] {
	display: block;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 7px 3px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--steel);
	border-radius: 0;
	background-color: transparent;
	box-shadow: none;
	color: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--body);
	line-height: 30px;
}

.section_footer .newsletter-field input[type="email"]:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

/* Error state: thicker yellow line + the message below (CF7 also sets aria-invalid). */
.section_footer .newsletter-field input[aria-invalid="true"] {
	border-bottom: 2px solid var(--wp--preset--color--primary);
}

.section_footer .newsletter_form .wpcf7-not-valid-tip {
	margin: 8px 0 0;
	padding: 0;
	border-radius: 0;
	background: none;
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--small-16);
	font-weight: 500;
	line-height: 24px;
	letter-spacing: 0;
}

/* Submit: steel pill, ExtraBold, small up-right arrow. Resets the global button look from theme.css. */
.section_footer .newsletter_form .btn_submit,
.section_footer .newsletter_form .btn_submit:hover,
.section_footer .newsletter_form .btn_submit:focus {
	margin-top: 24px;
	height: 40px;
	padding: 0 24px 0 27px;
	gap: 11px;
	border: 0;
	border-radius: 65px;
	background-color: var(--wp--preset--color--steel);
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	justify-content: center;
}

.section_footer .newsletter_form .btn_submit:hover,
.section_footer .newsletter_form .btn_submit:focus-visible {
	background-color: var(--wp--preset--color--primary);
}

.section_footer .newsletter_form .btn_submit::after,
.section_footer .newsletter_form .btn_submit:hover::after {
	content: "\e802";
	width: auto;
	height: auto;
	margin: 0;
	background: none;
	color: inherit;
	font-size: 13px;
	line-height: 1;
	border-radius: 0;
}

.section_footer .newsletter_form .wpcf7-form.submitting .btn_submit {
	opacity: 0.7;
	cursor: progress;
}

.section_footer .newsletter_form .wpcf7-spinner {
	display: none;
}

/* CF7's live region for screen readers: hidden visually (CF7's own CSS does this too). */
.section_footer .newsletter_form .screen-reader-response {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* Result message after sending (CF7 also announces it to screen readers). Empty until then. */
.section_footer .newsletter_form .wpcf7-response-output:empty {
	display: none;
}

/* Result message after sending (CF7 also announces it to screen readers). */
.section_footer .newsletter_form .wpcf7-response-output {
	margin: 16px 0 0;
	padding: 10px 14px;
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--small-16);
	line-height: 24px;
}

/* ------------------------------------------------------------------
 * 6. Bottom row: copyright and credit (left), legal links (right)
 * ------------------------------------------------------------------ */
.section_footer .footer_bottom_row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px 32px;
	margin-top: clamp(64px, 13.4vw, 232px); /* 232px between the last menu line and the copyright at 1728px */
	font-size: var(--wp--preset--font-size--small-14);
	line-height: 24px;
}

/* "|" separators: decorative, silent for screen readers (alt text "" after the slash). */
.section_footer .footer_credit::before {
	content: "|";
	content: "|" / "";
	margin: 0 12px;
}

.section_footer .legal-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.section_footer .legal-menu li + li::before {
	content: "|";
	content: "|" / "";
	margin: 0 14px;
}

.section_footer .legal-menu a {
	display: inline-block;
	line-height: 25px;
}

/* ------------------------------------------------------------------
 * 7. Tablet and mobile
 * ------------------------------------------------------------------ */
@media screen and (max-width: 1100px) {
	.section_footer .footer_columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 48px 40px;
	}

	.section_footer .footer_about,
	.section_footer .footer_newsletter,
	.section_footer .footer_contact {
		max-width: none;
		padding-right: 0;
	}

	.section_footer .about_text {
		max-width: 326px;
	}
}

@media screen and (max-width: 640px) {
	.section_footer {
		padding-top: 48px;
		padding-bottom: 40px;
	}

	.section_footer .footer_logo {
		margin-bottom: 32px;
	}

	.section_footer .footer_columns {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.section_footer .footer_bottom_row {
		flex-direction: column;
		align-items: flex-start;
		margin-top: 56px;
	}

	/* Copyright and credit on their own lines. */
	.section_footer .footer_credit {
		display: block;
	}

	.section_footer .footer_credit::before {
		content: none;
	}
}
