/* Site chrome: stable header geometry and responsive footer rhythm. */

.humpf-header > .alignwide {
	min-height: 48px;
	align-items: center;
}

.humpf-header > .alignwide > .humpf-logo img {
	max-width: 120px;
	transform-origin: left center;
}

.humpf-header-tools,
.humpf-header-tools .wp-block-woocommerce-customer-account {
	align-items: center;
}

.humpf-header-tools .wp-block-woocommerce-customer-account {
	display: flex;
	padding: 0;
}

.humpf-header-tools :is(.wp-block-search__button, .wp-block-woocommerce-customer-account a, .wc-block-mini-cart__button) {
	box-sizing: border-box;
	width: var(--humpf-tap);
	height: var(--humpf-tap);
	flex-shrink: 0;
}

.humpf-header-tools :is(.wp-block-search__button svg, .wc-block-customer-account__account-icon) {
	width: 28px;
	height: 28px;
}

.humpf-header-tools .wc-block-mini-cart__icon {
	width: 32px;
	height: 32px;
}

.humpf-header-tools .wc-block-mini-cart__quantity-badge {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.humpf-header-search.wp-block-search__searchfield-hidden .wp-block-search__inside-wrapper {
	height: var(--humpf-tap);
	align-items: center;
}

/* Anchor the count to the bag, including two-digit counts; retain Woo's hidden state. */
.humpf-header-tools .wc-block-mini-cart__badge {
	position: absolute;
	box-sizing: border-box;
	top: 0;
	right: 0;
	bottom: auto;
	left: auto;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border: 2px solid var(--wp--preset--color--base);
	border-radius: var(--wp--preset--border-radius--pill);
	font-size: 10px;
	font-weight: 700;
	line-height: 14px;
	transform: translate(4px, -15%);
}

/* Only the surface and wordmark change on scroll; rows and hit areas stay put. */
.humpf-header.is-scrolled {
	box-shadow: 0 8px 24px -16px var(--wp--preset--color--base);
}

@supports (backdrop-filter: blur(12px)) {
	.humpf-header.is-scrolled {
		background-color: color-mix(in srgb, var(--wp--preset--color--base) 94%, transparent) !important;
	}

	/* Blur on the sticky wrapper reaches behind its view-transition layer.
	 * Release that containing block when WordPress opens its fixed mobile menu. */
	.wp-site-blocks > header.wp-block-template-part:has(> .humpf-header.is-scrolled):not(:has(.is-menu-open)) {
		backdrop-filter: blur(12px);
	}
}

@media (prefers-reduced-motion: no-preference) {
	body:not(.humpf-no-motion) .humpf-header {
		transition: background-color 180ms var(--humpf-ease), box-shadow 180ms var(--humpf-ease);
	}

	body:not(.humpf-no-motion) .humpf-header > .alignwide > .humpf-logo img {
		transition: transform 180ms var(--humpf-ease);
	}

	body:not(.humpf-no-motion) .humpf-header.is-scrolled > .alignwide > .humpf-logo img {
		transform: scale(0.94);
	}
}

/* Core's custom menu links do not always carry current-menu-item. */
@media (min-width: 600px) {
	.humpf-header .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
		text-decoration-thickness: 2px;
		text-underline-offset: 8px;
	}

	.humpf-header .wp-block-navigation__container > .wp-block-navigation-item > :is(.humpf-is-current, [aria-current="page"]),
	.humpf-header .wp-block-navigation__container > .current-menu-item > .wp-block-navigation-item__content {
		text-decoration-line: underline;
		text-decoration-color: var(--wp--preset--color--accent-1);
	}
}

/* WordPress fixes the owner toolbar above 600px and scrolls it away below that. */
body.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (min-width: 601px) and (max-width: 782px) {
	body.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: var(--wp-admin--admin-bar--height, 46px);
	}
}

@media (max-width: 600px) {
	body.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

/* Footer columns share a baseline; the brand copy stays readable on wide screens. */
.humpf-footer {
	padding-top: var(--wp--preset--spacing--60) !important;
	padding-bottom: var(--wp--preset--spacing--50) !important;
}

.humpf-footer > .wp-block-columns {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: var(--wp--preset--spacing--70);
	align-items: start;
	margin-bottom: 0;
}

.humpf-footer .wp-block-column,
.humpf-footer-links > .wp-block-group {
	min-width: 0;
}

.humpf-footer .humpf-logo img {
	width: 144px !important;
	height: auto;
}

.humpf-footer > .wp-block-columns > .wp-block-column > p {
	max-width: 42ch;
	margin-top: var(--wp--preset--spacing--40);
}

.humpf-footer-links {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
}

.humpf-footer-links .humpf-eyebrow {
	color: var(--wp--preset--color--accent-2) !important;
}

.humpf-footer-links :is(.wp-block-navigation, .wp-block-navigation__container, .wp-block-navigation-item) {
	width: 100%;
}

.humpf-footer .wp-block-navigation-item__content {
	text-decoration-color: transparent;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.humpf-footer .wp-block-navigation-item__content:is(:hover, :focus-visible) {
	color: var(--wp--preset--color--contrast);
	text-decoration-line: underline;
	text-decoration-color: currentColor;
}

.humpf-footer > .wp-block-separator {
	margin-top: var(--wp--preset--spacing--60);
	margin-bottom: 0;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--accent-5);
	opacity: 1;
}

.humpf-footer > .wp-block-group.alignwide:last-child {
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--50);
	margin-top: var(--wp--preset--spacing--50);
	align-items: baseline;
}

/* The home trust strip supplies the shared dividing rule. */
.wp-site-blocks > main:has(> .humpf-trust:last-child) + footer.wp-block-template-part {
	margin-top: 0;
}

.wp-site-blocks > main:has(> .humpf-trust:last-child) + footer .humpf-footer {
	border-top-width: 0 !important;
}

@media (max-width: 1000px) {
	.humpf-footer > .wp-block-columns {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--wp--preset--spacing--60);
	}
}

@media (min-width: 600px) and (max-width: 1000px) {
	.humpf-footer > .wp-block-columns > .wp-block-column > p {
		max-width: 60ch;
	}
}

@media (max-width: 599px) {
	.humpf-footer .humpf-logo img {
		width: 128px !important;
	}

	.humpf-footer .humpf-footer-links {
		gap: var(--wp--preset--spacing--50) !important;
	}

	.humpf-footer-links .wp-block-navigation__container {
		column-gap: var(--wp--preset--spacing--40) !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.humpf-footer > .wp-block-group.alignwide:last-child {
		flex-direction: column;
		align-items: flex-start;
	}
}
