/**
 * Redesign header and footer.
 *
 * Values reference theme.json tokens so the design system stays single-source.
 * The mobile breakpoint (921px) matches Astra's own so the two agree about
 * when the layout becomes narrow.
 */

/* ---------------------------------------------------------------- Logo */

.wpa-logo {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	text-decoration: none;
	line-height: 1;
	color: var(--wp--preset--color--ink);
}

.wpa-logo:hover,
.wpa-logo:focus {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

/*
 * The lockup as a file. Height is stated and width follows, so the image
 * occupies the same box the CSS lockup did and the header does not shift while
 * it loads. The footer sits on ink and takes the white wordmark, a hair smaller
 * to match the type scale down there.
 */
.wpa-logo--svg { line-height: 0; }

.wpa-logo--svg img {
	display: block;
	height: 24px;
	width: auto;
}

.wpa-logo--footer.wpa-logo--svg img { height: 23px; }

.wpa-logo__word {
	font-family: var(--wp--preset--font-family--brand);
	font-weight: 800;
	font-size: 23px;
	letter-spacing: -0.03em;
	line-height: 1;
}

.wpa-logo__accent {
	color: var(--wp--preset--color--accent);
	font-size: 26px;
}

.wpa-logo__dot {
	width: 16px;
	height: 16px;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.wpa-logo__dot::after {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: #fff;
}

/*
 * Footer lockup. Per the comp the footer variant is slightly smaller than the
 * header (22/25/15 vs 23/26/16), and the dot's inner circle is knocked out in
 * the footer background colour rather than white.
 */
.wpa-footer .wpa-logo,
.wpa-logo--footer {
	color: var(--wp--preset--color--surface);
}

.wpa-logo--footer .wpa-logo__word   { font-size: 22px; }
.wpa-logo--footer .wpa-logo__accent { font-size: 25px; }
.wpa-logo--footer .wpa-logo__dot    { width: 15px; height: 15px; }
.wpa-logo--footer .wpa-logo__dot::after { background: var(--wp--preset--color--ink); }

/* Footer social buttons. */
.wpa-social {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

.wpa-social a {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: rgba(255, 255, 255, .07);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #c2c6dc;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.wpa-social a:hover,
.wpa-social a:focus {
	background: rgba(255, 255, 255, .14);
	color: var(--wp--preset--color--surface);
}

/* ---------------------------------------------------------------- Header */

.wpa-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, 0.85);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--wp--preset--color--stroke-subtle);
}

.wpa-header__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 40px;
	height: 72px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.wpa-nav__list,
.wpa-mobile-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpa-nav__list {
	display: flex;
	align-items: center;
	gap: 32px;
}

.wpa-nav__list a {
	font-size: 15px;
	font-weight: 500;
	color: var(--wp--preset--color--ink-secondary);
	text-decoration: none;
}

.wpa-nav__list a:hover,
.wpa-nav__list a:focus {
	color: var(--wp--preset--color--primary);
}

/* Touch target, as in the footer: the padding grows the hit area and the equal
 * negative margin cancels it, so the 72px header row is unaffected. */
.wpa-nav__list a {
	display: inline-block;
	padding-block: 4px;
	margin-block: -4px;
}

.wpa-header__actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

.wpa-header__login {
	font-size: 15px;
	font-weight: 600;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	white-space: nowrap;
}

.wpa-header__cta {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
	font-size: 15px;
	font-weight: 600;
	padding: 10px 20px;
	border-radius: 10px;
	text-decoration: none;
	white-space: nowrap;
}

.wpa-header__cta:hover,
.wpa-header__cta:focus {
	background: var(--wp--preset--color--primary-hover);
	color: var(--wp--preset--color--surface);
}

/* ------------------------------------------------------ Mobile toggle */

.wpa-header__toggle {
	display: none;
	background: none;
	border: 1px solid var(--wp--preset--color--stroke);
	border-radius: 10px;
	width: 44px;
	height: 44px;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.wpa-header__bars,
.wpa-header__bars::before,
.wpa-header__bars::after {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: var(--wp--preset--color--ink);
	position: relative;
}

.wpa-header__bars::before,
.wpa-header__bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.wpa-header__bars::before { top: -6px; }
.wpa-header__bars::after  { top: 6px; }

.wpa-mobile-nav {
	border-top: 1px solid var(--wp--preset--color--stroke-subtle);
	padding: 16px 40px 24px;
	background: var(--wp--preset--color--surface);
}

.wpa-mobile-nav__list a {
	display: block;
	padding: 12px 0;
	font-size: 16px;
	font-weight: 500;
	color: var(--wp--preset--color--ink-secondary);
	text-decoration: none;
	border-bottom: 1px solid var(--wp--preset--color--stroke-subtle);
}

.wpa-mobile-nav .wpa-header__cta {
	display: inline-block;
	margin-top: 16px;
}

@media (max-width: 921px) {
	.wpa-header__inner { padding: 0 24px; }
	.wpa-nav,
	.wpa-header__actions { display: none; }
	.wpa-header__toggle { display: inline-flex; }
	.wpa-mobile-nav { padding-inline: 24px; }
}

@media (min-width: 922px) {
	.wpa-mobile-nav { display: none; }
}

/* ---------------------------------------------------------------- Footer */

/*
 * The footer pattern renders inside our own <footer>, outside the normal
 * content flow, so WordPress's root padding never reaches it - its columns sat
 * flush to the viewport edge at every width below the 1200px content size.
 * Constrain and pad it explicitly instead.
 */
.wpa-footer__band {
	/*
	 * The band used to be a block group carrying `has-ink-background-color`.
	 * Rendering it as plain markup dropped that class with it, leaving white
	 * text on no background - so the colour is stated here, where it belongs
	 * now that the footer is not built from blocks.
	 */
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ink-faint);
	padding-left: 40px;
	padding-right: 40px;
	/* The comp opens the footer at 64px and closes the link grid at 48px, above
	 * the rule. This band used to borrow .wpa-section-sm for its padding, which
	 * quietly tied it to the stat-band value; it now carries its own class. */
	padding-top: 64px;
	padding-bottom: 48px;
}

.wpa-footer__grid {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

@media (max-width: 921px) {
	.wpa-footer__band {
		padding-left: 24px;
		padding-right: 24px;
	}
}

.wpa-footer__legal {
	background: var(--wp--preset--color--ink);
	border-top: 1px solid var(--wp--preset--color--ink-secondary);
}

.wpa-footer__legal p {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 40px;
	font-size: 13px;
	color: var(--wp--preset--color--ink-faint);
}

@media (max-width: 921px) {
	.wpa-footer__legal p { padding-inline: 24px; }
}

.wpa-footer__legal-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 40px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.wpa-footer__legal-inner p { margin: 0; padding: 0; font-size: 13px; color: #7c8199; }
.wpa-footer__legal-links { display: flex; gap: 22px; font-size: 13px; }
.wpa-footer__legal-links a { color: #7c8199; text-decoration: none; }
.wpa-footer__legal-links a:hover { color: var(--wp--preset--color--surface); }

@media (max-width: 921px) { .wpa-footer__legal-inner { padding-inline: 24px; } }

/*
 * Touch target size for the footer links.
 *
 * At 14px with the comp's line height these links are 17px tall, under the
 * 24px WCAG 2.5.8 minimum for a pointer target. The padding grows the hit
 * area and the equal negative margin cancels it again, so the outer box - and
 * therefore every surrounding position - is unchanged. The design is
 * untouched; only the area that responds to a finger changes.
 */
.wpa-footer__links a,
.wpa-footer__legal-links a {
	display: inline-block;
	padding-block: 4px;
	margin-block: -4px;
}

/* ---------------------------------------------------- Footer layout
 *
 * The footer used to be block markup and borrowed core's columns styling for
 * its grid, and preset classes for its colours and sizes. Now that it renders
 * from menus and Customizer settings, it carries its own. Flex - not grid -
 * because the breakpoint rules in patterns.css size these columns with
 * flex-basis, and those are already measured against the comp.
 */
.wpa-footer__grid {
	display: flex;
	gap: 40px;
	/*
	 * 1120px, not 1200. The comp's wrap is a 1200px box with 40px of padding,
	 * so its columns occupy 1120 - the same content width as the legal strip
	 * below, whose own wrap is padded the same way. At 1200 the columns sat
	 * 40px to the left of the copyright line they are supposed to align with.
	 */
	max-width: 1120px;
}

/* The comp's grid is `1.6fr 1fr 1fr 1fr`. Equivalent flex grow factors on a
 * zero basis divide the space the same way, so the columns land where the
 * comp puts them without switching this to a grid and losing the breakpoint
 * rules in patterns.css, which size these with flex-basis. */
.wpa-footer__col { flex: 1 1 0; min-width: 0; }
.wpa-footer__col--brand { flex: 1.6 1 0; }

.wpa-footer-title {
	color: var(--wp--preset--color--surface);
	font-weight: 700;
	font-size: 14px;
	margin: 0 0 16px;
}

.wpa-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 11px;
}

.wpa-footer__links li { margin: 0; }

.wpa-footer__links a {
	font-size: 14px;
	color: var(--wp--preset--color--ink-faint);
	text-decoration: none;
}

.wpa-footer__links a:hover,
.wpa-footer__links a:focus { color: var(--wp--preset--color--surface); }

.wpa-footer-brand { margin: 0 0 16px; }

.wpa-footer__blurb {
	font-size: 14px;
	line-height: 1.6;
	color: var(--wp--preset--color--ink-faint);
	margin: 0 0 18px;
	max-width: 300px;
}

.wpa-footer__rating {
	font-size: 13px;
	color: #8b90b5;
	margin: 0 0 20px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.wpa-footer__stars { color: var(--wp--preset--color--warning); font-size: 15px; letter-spacing: 1px; }

.wpa-footer__social { margin: 0; }

/* The legal strip is a menu now, so it needs list resets the old inline
 * anchors did not. */
.wpa-footer__legal-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 22px;
	flex-wrap: wrap;
}

.wpa-footer__legal-list li { margin: 0; }
.wpa-footer__legal-list a { color: #7c8199; text-decoration: none; font-size: 13px; }
.wpa-footer__legal-list a:hover { color: var(--wp--preset--color--surface); }

/* Touch target, matching the rule above for the column links. */
.wpa-footer__legal-list a {
	display: inline-block;
	padding-block: 4px;
	margin-block: -4px;
}
