/*
 * AverionHair Footer
 *
 * A port of the React storefront's SiteFooter. Every colour, size and font here is a custom
 * property, so the settings screen can retune the footer without touching this file - and each
 * falls back to the AverionHair child theme's --avh-* token where there is one, so a site running
 * both never drifts.
 *
 * Scoped to .avh-ft throughout. The one rule that reaches outside it is the theme-footer
 * suppression, which is printed inline from the settings and scoped to body.avh-ft-active.
 */

:root {
	--avh-ft-bg: var(--avh-black, #191410);
	--avh-ft-text: #ffffff;
	--avh-ft-accent: var(--avh-gold, #c29a4f);
	--avh-ft-line: #ffffff;

	--avh-ft-max: var(--avh-container, 1280px);
	/* See the note in class-avh-ft-settings.php: this gap shows the page's colour, not ours. */
	--avh-ft-top: 0px;
	--avh-ft-logo-h: 32px;
	--avh-ft-pad: 64px;

	--avh-ft-font-heading: var(--avh-font-heading, "Fraunces", Georgia, "Times New Roman", serif);
	--avh-ft-font-body: var(--avh-font-body, "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif);

	/* The storefront's easing: a long, decelerating settle rather than a linear slide. */
	--avh-ft-ease: cubic-bezier(0.16, 1, 0.3, 1);

	/* How many link columns are filled in. Printed per-render by the template. */
	--avh-ft-cols: 3;
}

/*
 * Blocksy wraps header + main + its own footer in #main-container with
 * `min-height: calc(100vh - ...)` and `.site-main { flex-grow: 1 }` - the sticky-footer trick that
 * stretches short pages so its real footer still lands at the bottom of the viewport. Hiding that
 * footer (above) removes its own box but not this reservation: .site-main keeps stretching into the
 * space the footer used to occupy, and #main-container's background is `inherit`, so that stretch
 * shows as a plain gap of the page's own background right where ours begins. Confirmed against the
 * theme's own main.min.css, not guessed - see the 2026-09-18 session log.
 *
 * Our footer renders entirely outside #main-container (appended on wp_footer), so it needs none of
 * that reserved space. Scoped to .avh-ft-active so a page where we stand down keeps Blocksy's own
 * sticky-footer behaviour intact.
 */
body.avh-ft-active #main-container {
	min-height: 0 !important;
}

/*
 * ...and then short pages need filling another way, or a page shorter than the screen ends in a
 * band of white BELOW our footer (reported on /track/ at 1917x957, 2026-10-11). The sticky-footer
 * layout, done where it can actually work: on the body, whose children are our header, Blocksy's
 * #main-container and our footer. The content grows to fill the screen, so the footer meets the
 * bottom edge; a long page is unaffected. The admin bar is subtracted (it is margin on <html>), or a
 * signed-in owner would get a page exactly that much too tall.
 *
 * Every other direct child of body is fixed, absolute, a script or hidden, so it lays out the
 * same in a flex column as it did in block flow.
 */
@media screen {
	body.avh-ft-active {
		display: flex;
		flex-direction: column;
		min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	}

	body.avh-ft-active > #main-container {
		flex: 1 0 auto;
	}

	body.avh-ft-active > .avh-ft {
		flex-shrink: 0;
	}
}

/* --- Shell ---------------------------------------------------------------------------------- */

.avh-ft {
	position: relative;
	z-index: 10;
	box-sizing: border-box;
	margin-top: var(--avh-ft-top);
	background: var(--avh-ft-bg);
	color: var(--avh-ft-text);
	font-family: var(--avh-ft-font-body);
	font-size: 15px;
	line-height: 1.6;
	text-align: left;
}

.avh-ft *,
.avh-ft *::before,
.avh-ft *::after {
	box-sizing: border-box;
}

.avh-ft a {
	color: color-mix(in srgb, var(--avh-ft-text) 70%, transparent);
	text-decoration: none;
	transition: color 200ms var(--avh-ft-ease);
}

.avh-ft a:hover,
.avh-ft a:focus-visible {
	color: var(--avh-ft-accent);
}

.avh-ft a:focus-visible,
.avh-ft button:focus-visible,
.avh-ft input:focus-visible {
	outline: 2px solid var(--avh-ft-accent);
	outline-offset: 3px;
}

.avh-ft__inner {
	max-width: var(--avh-ft-max);
	margin-inline: auto;
	padding-inline: 1.5rem;
}

/* --- Typography ----------------------------------------------------------------------------- */

.avh-ft__eyebrow {
	margin: 0;
	color: var(--avh-ft-accent);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.28em;
	line-height: 1.4;
	text-transform: uppercase;
}

.avh-ft__heading {
	margin: 0.5rem 0 0;
	color: var(--avh-ft-text);
	font-family: var(--avh-ft-font-heading);
	font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.avh-ft__lede {
	margin: 0.6rem 0 0;
	color: color-mix(in srgb, var(--avh-ft-text) 60%, transparent);
	font-size: 0.9rem;
}

/* --- Newsletter band ------------------------------------------------------------------------ */

.avh-ft__newsletter {
	border-bottom: 1px solid color-mix(in srgb, var(--avh-ft-line) 10%, transparent);
}

.avh-ft__newsletter-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	align-items: center;
	justify-content: space-between;
	padding-block: calc(var(--avh-ft-pad) * 0.875);
}

.avh-ft__newsletter-copy {
	flex: 1 1 22rem;
	max-width: 30rem;
	min-width: 0;
}

.avh-ft__form {
	flex: 1 1 20rem;
	max-width: 24rem;
	min-width: 0;
	margin: 0;
}

/*
 * An underline, not a box: the storefront's newsletter field is a rule the caret sits on, which
 * reads as editorial rather than as a form.
 */
.avh-ft__field {
	display: flex;
	align-items: center;
	border-bottom: 1px solid color-mix(in srgb, var(--avh-ft-line) 25%, transparent);
	transition: border-color 200ms var(--avh-ft-ease);
}

.avh-ft__field:focus-within {
	border-bottom-color: var(--avh-ft-accent);
}

/*
 * Specific enough to win, and stated twice on purpose.
 *
 * The field is transparent by design, sitting on the footer's dark background with light text. A
 * theme that sets its own background on inputs at a higher specificity turns that into light text
 * on a light box - invisible, with nothing to suggest why. So the background is asserted here as
 * well as the colour: legibility must not depend on winning a specificity contest we cannot see
 * from inside the plugin.
 */
.avh-ft .avh-ft__form .avh-ft__field input,
.avh-ft .avh-ft__field input[type="email"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0.75rem 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	background-image: none;
	color: var(--avh-ft-text);
	/*
	 * Safari and Chrome honour -webkit-text-fill-color over `color` on form controls, and both
	 * apply their own on autofill. Without this the typed text can be the right colour and the
	 * AUTOFILLED text still invisible - which is the harder version of this bug to find, because
	 * it only happens to people whose browser knows their email address.
	 */
	-webkit-text-fill-color: var(--avh-ft-text);
	caret-color: var(--avh-ft-accent);
	font-family: inherit;
	font-size: 0.9rem;
	line-height: 1.4;
	outline: none;
	box-shadow: none;
}

.avh-ft .avh-ft__field input::placeholder {
	color: color-mix(in srgb, var(--avh-ft-text) 40%, transparent);
	-webkit-text-fill-color: color-mix(in srgb, var(--avh-ft-text) 40%, transparent);
	opacity: 1;
}

/*
 * Chrome paints autofilled fields with a hard-coded pale yellow background that no `background`
 * rule can override. The long inset shadow is the standard way to cover it - there is no cleaner
 * one - and it is drawn in the footer's own background colour so the field still reads as
 * transparent.
 */
.avh-ft .avh-ft__field input:-webkit-autofill,
.avh-ft .avh-ft__field input:-webkit-autofill:hover,
.avh-ft .avh-ft__field input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--avh-ft-text);
	-webkit-box-shadow: 0 0 0 100px var(--avh-ft-bg) inset;
	box-shadow: 0 0 0 100px var(--avh-ft-bg) inset;
	caret-color: var(--avh-ft-accent);
}

.avh-ft__field button {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: color-mix(in srgb, var(--avh-ft-text) 70%, transparent);
	cursor: pointer;
	transition: color 200ms var(--avh-ft-ease), transform 200ms var(--avh-ft-ease);
}

.avh-ft__field button:hover {
	color: var(--avh-ft-accent);
	transform: translateX(2px);
}

.avh-ft__form.is-busy .avh-ft__field button {
	opacity: 0.4;
	pointer-events: none;
}

.avh-ft__consent {
	margin: 0.7rem 0 0;
	color: color-mix(in srgb, var(--avh-ft-text) 45%, transparent);
	font-size: 0.72rem;
	line-height: 1.5;
}

.avh-ft__note {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0.7rem 0 0;
	font-size: 0.85rem;
}

.avh-ft__note.is-ok {
	color: var(--avh-ft-accent);
}

.avh-ft__note.is-error {
	color: #e8a0a0;
}

/*
 * The honeypot. Hidden from people without display:none, because some bots skip fields that are
 * display:none precisely to avoid this trap - and kept out of the tab order and the accessibility
 * tree so nobody using a keyboard or a screen reader can land in it by accident.
 */
.avh-ft__hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Columns -------------------------------------------------------------------------------- */

.avh-ft__cols {
	display: grid;
	gap: 2.5rem;
	grid-template-columns: 1fr;
	padding-block: var(--avh-ft-pad);
}

@media (min-width: 640px) {
	.avh-ft__cols {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.avh-ft__brand {
		grid-column: span 2;
	}
}

@media (min-width: 1024px) {
	/*
	 * The brand column is twice a link column, as in the storefront. The count comes from the
	 * template, so a shop with two columns gets two - not three with a hole where one was.
	 */
	.avh-ft__cols {
		/*
		 * The fallback inside var() is not decoration. If --avh-ft-cols were missing, repeat()
		 * would be invalid at computed-value time - and that does not fall back to an earlier
		 * declaration, it resets the property to `none`, collapsing every column into one.
		 */
		grid-template-columns: 2fr repeat(var(--avh-ft-cols, 3), minmax(0, 1fr));
	}
	.avh-ft__brand {
		grid-column: span 1;
	}
}

.avh-ft__brand {
	min-width: 0;
}

/*
 * EVERY image in the brand slot, capped by one rule. `height: auto` was what let a Customizer logo
 * render at its natural size - several hundred pixels tall on a wordmark.
 */
.avh-ft__brand img,
.avh-ft__logo,
.avh-ft img.custom-logo {
	display: block;
	width: auto;
	height: var(--avh-ft-logo-h);
	max-width: 100%;
	object-fit: contain;
	object-position: left center;
}

.avh-ft__wordmark {
	display: inline-block;
	color: var(--avh-ft-text);
	font-family: var(--avh-ft-font-heading);
	font-size: 1.45rem;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

.avh-ft__brand-text {
	max-width: 22rem;
	margin: 0.85rem 0 0;
	color: color-mix(in srgb, var(--avh-ft-text) 60%, transparent);
	font-size: 0.875rem;
	line-height: 1.7;
}

/* --- Social --------------------------------------------------------------------------------- */

.avh-ft__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

.avh-ft__social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.4rem 0.875rem;
	border: 1px solid color-mix(in srgb, var(--avh-ft-line) 15%, transparent);
	border-radius: 999px;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	transition: border-color 200ms var(--avh-ft-ease), color 200ms var(--avh-ft-ease);
}

.avh-ft__social-link:hover {
	border-color: var(--avh-ft-accent);
}

/* An icon needs a circle, not a pill: a round button around a square glyph reads as a mark. */
.avh-ft__social-link.is-icon {
	width: 2.35rem;
	height: 2.35rem;
	padding: 0;
}

.avh-ft__social-link.is-icon .avh-ft__social-icon {
	display: block;
	flex: none;
	width: 18px;
	height: 18px;
}

/* Brand colour: on hover by default, always when chosen. Logos without one (the black ones) keep
   the footer's colour and get the accent ring like any other link. */
.avh-ft__social--tint-hover .avh-ft__social-link.has-brand:hover,
.avh-ft__social--tint-hover .avh-ft__social-link.has-brand:focus-visible {
	border-color: var(--avh-ft-brand);
	color: var(--avh-ft-brand);
}

.avh-ft__social--tint-brand .avh-ft__social-link.has-brand {
	color: var(--avh-ft-brand);
}

.avh-ft__social--tint-brand .avh-ft__social-link.has-brand:hover,
.avh-ft__social--tint-brand .avh-ft__social-link.has-brand:focus-visible {
	border-color: var(--avh-ft-brand);
}

/* --- Link columns --------------------------------------------------------------------------- */

.avh-ft__col {
	min-width: 0;
}

.avh-ft__col-title {
	margin: 0;
	color: color-mix(in srgb, var(--avh-ft-text) 40%, transparent);
	font-family: var(--avh-ft-font-body);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.28em;
	line-height: 1.4;
	text-transform: uppercase;
}

.avh-ft .avh-ft__menu {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
}

.avh-ft .avh-ft__menu li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.avh-ft .avh-ft__menu li::before,
.avh-ft .avh-ft__menu li::marker {
	content: none;
}

/* --- Bottom bar ----------------------------------------------------------------------------- */

.avh-ft__bottom {
	border-top: 1px solid color-mix(in srgb, var(--avh-ft-line) 10%, transparent);
}

.avh-ft__bottom-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	align-items: center;
	justify-content: space-between;
	padding-block: 1.5rem;
	color: color-mix(in srgb, var(--avh-ft-text) 45%, transparent);
	font-size: 0.75rem;
}

.avh-ft__promise {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
}

.avh-ft__promise svg {
	flex: 0 0 auto;
	color: var(--avh-ft-accent);
}

.avh-ft .avh-ft__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.avh-ft .avh-ft__legal li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.avh-ft .avh-ft__legal li::before,
.avh-ft .avh-ft__legal li::marker {
	content: none;
}

.avh-ft__copyright {
	font-variant-numeric: tabular-nums;
}

/* On a phone the bottom bar is three stacked pieces; centring them stops them reading as a
   ragged left column of unrelated fragments. */
@media (max-width: 639px) {
	.avh-ft__bottom-inner {
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
	}
}

/* --- Motion --------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.avh-ft a,
	.avh-ft__field,
	.avh-ft__field button,
	.avh-ft__social-link {
		transition: none;
	}
	.avh-ft__field button:hover {
		transform: none;
	}
}

/* --- Print ---------------------------------------------------------------------------------- */

/* A footer full of navigation is noise on paper, and it is never what someone printed the page
   for. The legal line is the part worth keeping. */
@media print {
	.avh-ft__newsletter,
	.avh-ft__cols {
		display: none;
	}
	.avh-ft {
		margin-top: 1rem;
		background: none;
		color: #000;
	}
	.avh-ft__bottom-inner {
		color: #000;
	}
}
