/* =============================================================================
   FOOTER — desktop (263:18610 · 1440×574) + mobile (83:3445 · 393×651)
   Token layout scaffold in _tokens-layout.css §7 (padding, widths, flex).
   This file adds colours, alignment, component detail, and mobile accordion.
   ============================================================================= */

/* ── Newsletter band ──────────────────────────────────────────────────────── */

.footer__newsletter {
	background: var(--fig-siegel-red);
	align-items: center;
	justify-content: space-between;
}

.footer__newsletter-heading {
	color: var(--fig-siegel-white);
}

/* Form: flex row of .footer__newsletter-fields + button (widths from token) */
.footer__newsletter-form {
	align-items: flex-start;
}

.footer__newsletter-fields {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.footer__newsletter-input-wrap {
	display: flex;
	align-items: center;
	height: 46px;
	padding: 10px 14px 10px 12px;
	background: var(--fig-siegel-white);
	border-radius: var(--r-sm);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	overflow: hidden;
}

.footer__newsletter-input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: 0;
	outline: none;
	color: var(--text-body-primary);
}

.footer__newsletter-input::placeholder {
	color: var(--text-body-primary);
}

/* ── The newsletter strip as a Gravity Form ───────────────────────────────
   Same band, same proportions; Gravity Forms brings its own markup, so the
   designed look is mapped onto it here rather than restated.

   Written against what GF actually renders, which is not what its docs
   suggest: the wrapper is a plain block that does not fill its parent, the
   fields are a grid, and the submit is a <button class="gform_button">, not
   an <input type="submit"> - the first pass styled the input and left the
   button sitting there in GF blue at 77x38.

   The privacy sentence stays in the template, below the form: it is a
   sentence with a link to a page, not a form field. */
.footer__newsletter-form--gf {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.footer__newsletter-form--gf .gform_wrapper {
	width: 100%;
	margin: 0;
}

.footer__newsletter-form--gf .gform_wrapper form {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	margin: 0;
}

.footer__newsletter-form--gf .gform_wrapper .gform_body {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* GF lays the fields out as a grid for its own multi-column forms. One field
   in one column needs none of it. */
.footer__newsletter-form--gf .gform_wrapper .gform_fields {
	display: block;
	margin: 0;
	padding: 0;
}

.footer__newsletter-form--gf .gform_wrapper .gfield,
.footer__newsletter-form--gf .gform_wrapper .ginput_container {
	width: 100%;
	margin: 0;
	padding: 0;
}

/* The hand-built version wrapped the input in a white box; GF gives one
   element, so the box lands on the input itself. Values are the wrapper's. */
.footer__newsletter-form--gf .gform_wrapper input[type="email"],
.footer__newsletter-form--gf .gform_wrapper input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	height: 46px;
	padding: 10px 14px 10px 12px;
	background: var(--fig-siegel-white);
	border: 0;
	border-radius: var(--r-sm);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	color: var(--text-body-primary);
	font: var(--fw-regular) 1rem / 1.5 var(--font-body);
}

.footer__newsletter-form--gf .gform_wrapper input[type="email"]::placeholder {
	color: var(--text-body-primary);
}

.footer__newsletter-form--gf .gform_wrapper .gform_footer {
	flex: 0 0 auto;
	display: block;
	width: auto;
	margin: 0;
	padding: 0;
}

/* The theme's button wears .t-body-sm-exbold from the markup. GF writes its
   own submit, so the same type is set on it here rather than the button
   looking subtly different from every other one on the site. */
.footer__newsletter-form--gf .gform_wrapper .gform_footer button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 46px;
	font: var(--fw-extrabold) 0.9010162354rem / 1.0812194347rem var(--font-body);
	-webkit-appearance: none;
	appearance: none;
}

/* Validation stays legible on the red band: GF's default error text is a dark
   red that all but disappears against it. */
.footer__newsletter-form--gf .gform_wrapper .gfield_validation_message,
.footer__newsletter-form--gf .gform_wrapper .validation_message,
.footer__newsletter-form--gf .gform_wrapper .gform_validation_errors {
	margin-top: 4px;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--fig-siegel-white);
	font: var(--fw-regular) 0.75rem / 1rem var(--font-body);
}

.footer__newsletter-form--gf .gform_wrapper .gform_confirmation_message {
	color: var(--fig-siegel-white);
}

/* Mobile stacks, the way the hand-built form always did: field over
   full-width button. align-items has to be stretch for that - the row above
   aligns to flex-start, which in a column leaves the field at its content
   width, 199px inside a 343px band. */
@media (max-width: 767px) {
	.footer__newsletter-form--gf .gform_wrapper form {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.footer__newsletter-form--gf .gform_wrapper .gform_body,
	.footer__newsletter-form--gf .gform_wrapper .gform_footer {
		width: 100%;
	}
}

.footer__newsletter-privacy {
	color: var(--fig-siegel-white);
}

.footer__newsletter-privacy a {
	color: var(--fig-siegel-white);
	text-decoration: underline;
}

.footer__newsletter-btn,
.footer__newsletter-form--gf .gform_wrapper .gform_footer button {
	flex-shrink: 0;
	width: 177px;
	padding: 14px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: var(--r-sm);
	color: var(--fig-siegel-white);
	cursor: pointer;
	white-space: nowrap;
	transition: background var(--dur-fast) linear;
}

@media (hover: hover) and (pointer: fine) {
	.footer__newsletter-btn:hover,
	.footer__newsletter-form--gf .gform_wrapper .gform_footer button:hover {
		background: rgba(255, 255, 255, 0.22);
		/* See enquiry.css - GF's own hover turns the label #515151, which on the
		   red band is all but unreadable. */
		color: var(--fig-siegel-white);
	}
}

.footer__newsletter-btn:focus-visible {
	outline: 2px solid var(--fig-siegel-white);
	outline-offset: 2px;
}

/* Tablet: token already stacks to column + sets widths 100%. Add alignment. */
@media (max-width: 1023px) {
	.footer__newsletter {
		align-items: stretch;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.footer__newsletter {
		padding-top: 32px;
		padding-bottom: 32px;
	}
	.footer__newsletter-heading {
		text-align: center;
	}
	.footer__newsletter-form {
		flex-direction: column;
		gap: 12px;
	}
	/* Both submits, and from here rather than from the Gravity Forms block
	   further up: that block's selector has the same specificity as the
	   width: 177px rule below it, so an override written there loses on
	   source order and the button stayed 177px wide in a 343px band. */
	.footer__newsletter-btn,
	.footer__newsletter-form--gf .gform_wrapper .gform_footer button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.footer__newsletter-btn { transition: none; }
}

/* ── Main body ────────────────────────────────────────────────────────────── */

.footer__main {
	background: var(--fig-siegel-white);
}

/* Token sets padding-left only; add flex layout here. */
.footer__row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
}

/* ── Brand + mobile legal wrapper ─────────────────────────────────────────── */

.footer__brand-legal {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

/* ── Brand column ─────────────────────────────────────────────────────────── */

.footer__brand {
	display: flex;
	flex-direction: column;
	gap: 24px;
	flex-shrink: 0;
}

.footer__logo-link { display: block; }

.footer__logo {
	display: block;
	width: 64px;
	height: auto;
}

.footer__tagline {
	color: var(--text-body-primary);
}

/* ── Brand column, desktop ────────────────────────────────────────────────
   Supplied spec: logo 104 x 104, 12px from the logo to the tagline, tagline
   #333333 at 20px. The logo was 64px wide with its height left to the image,
   and the tagline took the body grey, #6b6d6f.

   Scoped to desktop because that is what the spec covers; the mobile footer
   keeps the values it has until there are numbers for it.

   20px needs no rule: .t-h6 on the tagline is already 20/24, so the size
   comes from the type scale rather than a second declaration of it. */
@media (min-width: 768px) {
	.footer__logo {
		width: 104px;
		height: 104px;
		/* contain, not cover: the uploaded mark is square (512x512) and fills
		   the box exactly, but the bundled fallback is the 139x33 wordmark and
		   a square box would squash it. */
		object-fit: contain;
	}

	/* 12px from the logo to the tagline, 24 from the tagline to the socials.
	   One column gap cannot be two values, so the gap is the smaller of them
	   and the socials carry the difference. */
	.footer__brand {
		gap: 12px;
	}

	.footer__socials {
		margin-top: 12px;
	}

	.footer__tagline {
		color: var(--fig-siegel-black);
	}
}

.footer__socials {
	display: flex;
	align-items: center;
	gap: 21.6px; /* Figma: measured gap between icon visual bounds */
}

.footer__social-link {
	display: flex;
	align-items: center;
	
	color: var(--text-body-primary);
	text-decoration: none;

	transition: opacity var(--dur-base) ease-out;
}

.footer__social-link svg { display: block; }

@media (hover: hover) and (pointer: fine) {
	.footer__social-link:hover { opacity: 0.7; }
}

.footer__social-link:focus-visible {
	outline: 2px solid var(--fig-siegel-black);
	outline-offset: 2px;
	border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
	.footer__social-link { transition: none; }
}

/* ── Mobile-only legal (right side of brand row on mobile) ────────────────── */

.footer__legal-mobile {
	display: none;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.footer__legal-mobile .footer__legal-link,
.footer__legal-mobile .footer__legal-menu a,
.footer__copyright-mobile {
	color: var(--bg-inverse-tertiary);
	text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
	.footer__legal-mobile .footer__legal-link:hover,
	.footer__legal-mobile .footer__legal-menu a:hover { text-decoration: underline; }
}

/* ── Tablet: the brand column had nothing between it and the nav ───────────
   Reported at 784 wide, and measured there: .footer__row carries
   padding-left: 32px and no padding-right, and no gap at all. At the design
   width space-between hides both - there is room to spare - but once the row
   is only as wide as its contents the brand column's right edge lands at
   x=160 and the first nav column starts at x=160, so "Bond for Life." sits
   against "Industrial & Construction", and the nav's last column runs to the
   viewport edge with no gutter.

   A 32px gap and a matching right gutter, which is the tablet gutter the
   responsive rules already specify. The nav keeps wrapping as it did - three
   columns then two - and still fits with no horizontal scroll.

   The bottom padding comes down with it: 128px is the figure under a single
   row of columns at 1440, and under a wrapped nav at this width it reads as
   a hole between the links and the legal bar. */
@media (min-width: 768px) and (max-width: 1023px) {
	.footer__row {
		gap: 32px;
		padding-right: 32px;
	}

	.footer__main {
		padding-bottom: 64px;
	}
}

/* ── Nav columns ──────────────────────────────────────────────────────────── */

.footer__nav {
	display: flex;
	gap: 34px;
	/* Five 142px columns and four 34px gaps is a hard 846. This was
	   flex-shrink: 0, which pinned that width and pushed the document past the
	   viewport anywhere below roughly 1050 - 93px over at 768, still 25px over
	   at 1024 - putting a horizontal scrollbar on every page of the site.

	   Wrapping rather than shrinking keeps the drawn 142px column intact; at
	   the design width the row still fits on one line, so nothing moves on
	   desktop. flex-wrap alone would not have been enough: flex-shrink: 0 lets
	   the container keep its max-content width, so there is never a line to
	   wrap at. It has to be allowed to narrow first. */
	flex-wrap: wrap;
	flex-shrink: 1;
	min-width: 0;
}

@media (max-width: 1023px) {
	.footer__nav { gap: 32px; }
}

/* <details> as column container; strip UA disclosure styles */
.footer__nav-col {
	width: 142px;
}

/* Column heading (also a <summary>) */
.footer__nav-heading {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	/* Aktiv Bold 12/16, uppercase, wide tracking — mirrors .t-caption */
	font: var(--fw-bold) 0.75rem/1rem var(--font-heading);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	color: var(--bg-inverse-tertiary);
	padding-bottom: 16px;
	cursor: default;
	-webkit-user-select: none;
	user-select: none;
}

.footer__nav-heading::-webkit-details-marker,
.footer__nav-heading::marker { display: none; }

/* Desktop: links always visible; toggle icon hidden */
.footer__nav-toggle { display: none; }

.footer__nav-links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Tighter gap on Contact and News columns */
.footer__nav-col--tight .footer__nav-links {
	
}

.footer__nav-link,
.footer__nav-links a {
	color: var(--text-link);
	text-decoration: none;
	display: block;
	min-height: 20px;
	font: var(--fw-regular) 0.8009033203rem/0.9610840082rem var(--font-body);
}

@media (hover: hover) and (pointer: fine) {
	.footer__nav-link:hover,
	.footer__nav-links a:hover { text-decoration: underline; }
}

.footer__nav-link:focus-visible,
.footer__nav-links a:focus-visible {
	outline: 2px solid var(--fig-siegel-black);
	outline-offset: 2px;
	border-radius: var(--r-sm);
}

/* Desktop: force <details open> display despite UA hiding content */
@media (min-width: 768px) {
	.footer__nav-links {
		display: flex !important; /* override UA display:none when <details> is closed */
	}
}

/* ── Legal bar — desktop ──────────────────────────────────────────────────── */

.footer__legal {
	background: var(--bg-primary);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.footer__copyright,
.footer__legal-link {
	color: var(--bg-inverse-tertiary);
	text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
	.footer__legal .footer__legal-link:hover,
	.footer__legal .footer__legal-menu a:hover { text-decoration: underline; }
}

.footer__legal-links {
	display: flex;
	align-items: center;
	gap: 16px;
}

.footer__legal-menu {
	display: flex;
	align-items: center;
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer__legal-menu a {
	color: var(--bg-inverse-tertiary);
	text-decoration: none;
	font: var(--fw-regular) 0.8009033203rem/0.9610840082rem var(--font-body);
}

.footer__legal-menu--mobile {
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.footer__legal-icon { display: block; flex-shrink: 0; }

/* =============================================================================
   MOBILE ≤ 767px — accordion nav, brand+legal row, no gray legal bar
   ============================================================================= */

@media (max-width: 767px) {

	/* Token sets padding-block 64px 128px desktop — override for mobile */
	.footer__main {
		padding-block: 32px 16px;
	}

	/* Column layout: nav first (order 1), brand-legal second (order 2) */
	.footer__row {
		flex-direction: column;
		gap: 32px;
		padding-left: 0; /* children handle their own horizontal padding */
	}

	/* Brand + mobile legal side-by-side */
	.footer__brand-legal {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
		padding-inline: var(--gutter-footer);
		order: 2;
		width: 100%;
	}

	.footer__brand {
		gap: 12px;
	}

	/* Show mobile legal block; hide desktop legal bar */
	.footer__legal-mobile {
		display: flex;
		padding-top: 0;
	}

	.footer__legal { display: none; }

	/* Nav: accordion columns stacked full-width */
	.footer__nav {
		order: 1;
		flex-direction: column;
		gap: 0;
		width: 100%;
		border-top: 1px solid var(--fig-neutral-100);
	}

	.footer__nav-col {
		width: 100%;
		border-bottom: 1px solid var(--fig-neutral-100);
	}

	/* Summary: tappable accordion header — Aktiv Bold 12/16 uppercase */
	.footer__nav-heading {
		/* .t-h7 values: Aktiv Bold 12px/16px */
		font: var(--fw-bold) 0.75rem/1rem var(--font-heading);
		letter-spacing: var(--ls-wide);
		text-transform: uppercase;
		color: var(--fig-neutral-900);
		padding: 12px var(--gutter-footer);
		cursor: pointer;
	}

	/* Show + icon; rotate to × when panel is open */
	.footer__nav-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		width: 16px;
		height: 16px;
		transition: transform var(--dur-fast) linear;
	}

	.footer__nav-col[open] .footer__nav-toggle {
		transform: rotate(45deg);
	}

	/* Links list inside accordion — UA display:none governs; no override here */
	.footer__nav-links {
		padding: 4px var(--gutter-footer) 16px;
		gap: 12px;
	}

	.footer__nav-col--tight .footer__nav-links {
		gap: 12px; /* uniform gap on mobile */
	}

	.footer__nav-link,
	.footer__nav-links a {
		min-height: 36px;
		display: flex;
		align-items: center;
	}
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
	.footer__nav-toggle { transition: none; }
}

/* Figma mobile footer order: Products, Resources, About, News, Contact. */
@media (max-width: 767px) {
	.footer__nav-col--contact { order: 5; }
	.footer__nav-col--news { order: 4; }
}
/* Exact mobile footer geometry from Figma node 83:3445. */
@media (max-width: 767px) {
	.footer__newsletter {
		height: 267px;
		padding: 38px 16px;
		gap: 16px;
		box-sizing: border-box;
	}
	.footer__newsletter-label {
		width: 100%;
		padding-bottom: 0;
	}
	.footer__newsletter-heading {
		font: var(--fw-bold) 1.25rem/1.5rem var(--font-heading);
	}
	.footer__newsletter-form { gap: 16px; }
	.footer__newsletter-fields { gap: 6px; }
	.footer__newsletter-input-wrap { height: 40px; }
	.footer__newsletter-privacy {
		font: var(--fw-regular) 0.9010162354rem/1.0812194347rem var(--font-body);
	}
	.footer__newsletter-btn {
		height: 47px;
		padding: 14px;
	}

	.footer__main { padding-block: 32px 16px; }
	/* 48, not 32. The nav's last row carries a rule along its bottom edge and
	   the logo block starts straight after it, so at 32 the mark read as
	   sitting on the line rather than below it. Reported as crammed. */
	.footer__row { gap: 48px; }
	/* Keep the Figma 200px collapsed footprint, but allow an open panel to
	 * participate in normal flow instead of overlapping the rows below it. */
	.footer__nav {
		height: auto;
		min-height: 200px;
	}
	.footer__nav-col {
		height: auto;
		min-height: 40px;
		box-sizing: border-box;
	}
	.footer__nav-heading {
		height: 40px;
		padding-block: 12px;
		box-sizing: border-box;
	}
	.footer__brand-legal {
		width: 100%;
		height: 104px;
		padding-inline: 16px;
		box-sizing: border-box;
		align-items: flex-end;
	}
	.footer__brand { gap: 12px; }
	.footer__socials { gap: 14px; }
	.footer__social-link {
		min-width: 16px;
		min-height: 16px;
		width: 16px;
		height: 16px;
	}
	.footer__social-link svg {
		max-width: 16px;
		max-height: 16px;
	}
}
/* Remove browser paragraph margins so Footer matches Figma's auto-layout boxes. */
.footer__newsletter-heading,
.footer__newsletter-privacy,
.footer__copyright,
.footer__copyright-mobile,
.footer__tagline {
	margin: 0;
}

.footer__newsletter-input-wrap {
	box-sizing: border-box;
}

/* ── Above the 1440 design frame ──────────────────────────────────────────── */
/*
   Same reasoning as header.css: the footer bars keep their full-bleed
   backgrounds (the red newsletter strip and the grey legal bar run edge to
   edge), while their content caps at the 1440 frame and centres. The padding
   form is used on the two bars because they have no inner wrapper to cap.
   All no-ops at 1440 and below.
*/
.footer__newsletter,
.footer__legal {
	padding-inline: max(
		var(--gutter-footer),
		calc((100% - var(--content-w-footer)) / 2)
	);
}

.footer__row {
	box-sizing: border-box;
	max-width: var(--page-w);
	margin-inline: auto;
}

/*
   The newsletter and legal bars keep their FULL-BLEED backgrounds at every
   width — only their content is held to the design frame, by the padding-inline
   rule above. Do not add max-width here: that rule's `max()` resolves 100%
   against the containing block (the full-width footer), so capping the bar
   double-counts the offset and squeezes the content to 840px at 1920 instead
   of the 1320 it should be.
*/
