/**
 * Field Kit — extras that theme.json cannot express.
 * Colors always come from the palette presets so style variations keep working.
 */

/* ---------- Base ---------- */
:root {
	--fk-hairline: 1px solid var(--wp--preset--color--hairline);
	--fk-ease: cubic-bezier(.2, .7, .1, 1);
	--fk-header-h: var(--wp--custom--header--height, 76px);
}

html { scroll-padding-top: calc(var(--fk-header-h) + 1rem); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-primary); }

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

.screen-reader-text:focus {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	padding: .75rem 1rem;
	z-index: 100000;
}

/* Mono label utility (also the "Mono label" paragraph style). */
.fk-label,
.is-style-fk-label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: max(12px, var(--wp--preset--font-size--x-small));
	font-weight: 500;
	letter-spacing: .14em;
	text-transform: uppercase;
	line-height: 1.5;
}
.fk-label--orange { color: var(--wp--preset--color--primary-deep); }

/* Sharp corners everywhere it matters. */
.wp-element-button,
.wp-block-button__link,
.wp-block-search__input,
.wp-block-search__button,
input, select, textarea { border-radius: 0; }

/* ---------- Topographic motif ---------- */
.is-style-fk-topo { position: relative; isolation: isolate; }
.is-style-fk-topo::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-color: currentColor;
	opacity: var(--wp--custom--topo--opacity, .09);
	-webkit-mask: url(../images/topo.svg) center / 1200px auto repeat;
	mask: url(../images/topo.svg) center / 1200px auto repeat;
}
.wp-block-cover.is-style-fk-topo::before { z-index: 1; opacity: .14; color: var(--wp--preset--color--base); }
.wp-block-cover.is-style-fk-topo .wp-block-cover__inner-container { z-index: 2; }

/* ---------- Block styles ---------- */
.is-style-fk-card {
	border: var(--fk-hairline);
	background: var(--wp--preset--color--surface);
}

.wp-block-button.is-style-fk-ghost .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
}
.wp-block-button.is-style-fk-ghost .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}
.has-contrast-color .wp-block-button.is-style-fk-ghost .wp-block-button__link,
.wp-block-cover .wp-block-button.is-style-fk-ghost .wp-block-button__link {
	color: inherit;
	border-color: currentColor;
}

.wp-block-button.is-style-fk-arrow .wp-block-button__link {
	background: none;
	border: 0;
	padding: 0 0 .25em;
	color: inherit;
	border-bottom: 2px solid var(--wp--preset--color--primary);
}
.wp-block-button.is-style-fk-arrow .wp-block-button__link::after { content: " \2192"; transition: margin .2s var(--fk-ease); }
.wp-block-button.is-style-fk-arrow .wp-block-button__link:hover::after { margin-left: .35em; }

.is-style-fk-checklist { list-style: none; padding-left: 0; }
.is-style-fk-checklist li { padding-left: 1.75em; position: relative; margin-bottom: .5em; }
.is-style-fk-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .5em;
	width: .7em;
	height: .7em;
	background: var(--wp--preset--color--primary);
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.wp-block-separator.is-style-fk-dashed {
	border: 0;
	border-top: 2px dashed var(--wp--preset--color--hairline);
	background: none;
}

/* Staggered headline reveal: JS wraps words in .fk-word. */
.fk-js .is-style-fk-reveal .fk-word {
	display: inline-block;
	overflow: hidden;
	vertical-align: bottom;
	/* Room for accents and descenders so letters are never shaved mid-animation. */
	padding: .14em .04em .18em;
	margin: -.14em -.04em -.18em;
}
.fk-js .is-style-fk-reveal .fk-word > span {
	display: inline-block;
	transform: translateY(105%);
	transition: transform .9s var(--fk-ease);
	transition-delay: calc(var(--fk-i, 0) * 70ms);
}
.fk-js .is-style-fk-reveal.is-revealed .fk-word > span { transform: none; }

/* Image fade + unblur. */
.fk-js .fk-fade {
	opacity: 0;
	filter: blur(14px);
	transform: scale(1.02);
	transition: opacity .9s var(--fk-ease), filter 1.1s var(--fk-ease), transform 1.2s var(--fk-ease);
}
.fk-js .fk-fade.is-visible { opacity: 1; filter: none; transform: none; }

/* ---------- Header ---------- */
.fk-announcement {
	font-family: var(--wp--preset--font-family--mono);
	font-size: max(12px, var(--wp--preset--font-size--x-small));
	letter-spacing: .14em;
	text-transform: uppercase;
}
.fk-announcement a { color: inherit; }

.fk-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	transition: box-shadow .3s var(--fk-ease), background-color .3s var(--fk-ease);
}
.admin-bar .fk-site-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .fk-site-header { top: 0; } }

.fk-site-header .fk-header-row {
	min-height: var(--fk-header-h);
	transition: min-height .3s var(--fk-ease), padding .3s var(--fk-ease);
}
.fk-site-header.is-condensed .fk-header-row { min-height: var(--wp--custom--header--height-condensed, 56px); }
.fk-site-header.is-condensed { box-shadow: 0 1px 0 var(--wp--preset--color--hairline), 0 12px 30px -24px rgba(21, 23, 20, .5); }
.fk-site-header.is-condensed .wp-block-site-title { font-size: var(--wp--preset--font-size--large) !important; }
.fk-site-header .wp-block-site-title { transition: font-size .3s var(--fk-ease); }

/* Wordmark triangle. */
.fk-wordmark .wp-block-site-title a,
.fk-wordmark .wp-block-site-title {
	display: inline-flex;
	align-items: center;
	gap: .35em;
}
.fk-wordmark .wp-block-site-title a::before,
.fk-wordmark .wp-block-site-title:not(:has(a))::before {
	content: "";
	display: inline-block;
	width: .82em;
	height: .72em;
	background: var(--wp--preset--color--primary);
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
	flex: none;
}

.fk-header-tools .wp-block-search__button { background: transparent; color: inherit; border: 0; padding: .4rem; }
.fk-header-tools .wp-block-search__button svg { fill: currentColor; }
.fk-header-tools .wp-block-search.wp-block-search__searchfield-hidden .wp-block-search__input { border: 0; }
.fk-header-tools .wp-block-search__input { border: var(--fk-hairline); background: var(--wp--preset--color--surface); }

.wp-block-navigation .wp-block-navigation-item__content { padding-block: .35em; }
.wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--primary-deep); }
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { box-shadow: inset 0 -2px 0 var(--wp--preset--color--primary); }

/* Mega menu: the "Shop" submenu (class fk-mega) becomes a panel with a featured card. */
@media (min-width: 782px) {
	.wp-block-navigation .fk-mega > .wp-block-navigation__submenu-container {
		display: grid !important;
		grid-template-columns: minmax(180px, 1fr) minmax(220px, 280px);
		grid-auto-flow: row;
		column-gap: 2rem;
		padding: 1.5rem !important;
		min-width: 560px !important;
		background: var(--wp--preset--color--base) !important;
		color: var(--wp--preset--color--contrast) !important;
		border: var(--fk-hairline) !important;
		box-shadow: var(--wp--preset--shadow--lift);
	}
	.wp-block-navigation .fk-mega > .wp-block-navigation__submenu-container > .wp-block-navigation-item { grid-column: 1; }
	.wp-block-navigation .fk-mega > .wp-block-navigation__submenu-container > .fk-mega-card-slot { grid-column: 2; grid-row: 1 / span 12; }
}
.fk-mega-card-slot { list-style: none; }
@media (max-width: 781px) { .fk-mega-card-slot { display: none; } }
.fk-mega-source { display: none !important; }

.fk-mega-card { text-transform: none; letter-spacing: normal; font-family: var(--wp--preset--font-family--body); }
.fk-mega-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; display: block; }
.fk-mega-card h3, .fk-mega-card .wp-block-heading { font-size: var(--wp--preset--font-size--large); margin: .5rem 0 .25rem; }

/* ---------- Hero ---------- */
.fk-hero .wp-block-cover__image-background { will-change: transform; }
.fk-hero .fk-coords { color: var(--wp--preset--color--primary); }
.fk-hero h1 { max-width: 12ch; }

/* ---------- Marquee ---------- */
.fk-marquee {
	overflow: hidden;
	white-space: nowrap;
	-webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.fk-marquee .fk-marquee__track {
	display: inline-flex !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
	width: max-content;
}
.fk-marquee .fk-marquee__track > * { margin: 0 !important; padding-right: 2.5rem; white-space: nowrap; }
.fk-marquee .fk-marquee__track > *::after { content: "\25B2"; color: currentColor; opacity: .55; margin-left: 2.5rem; font-size: .7em; vertical-align: middle; }
.fk-marquee.is-running .fk-marquee__track { animation: fk-marquee var(--fk-marquee-duration, 40s) linear infinite; }
.fk-marquee:hover .fk-marquee__track { animation-play-state: paused; }
@keyframes fk-marquee { to { transform: translateX(-50%); } }

/* ---------- Counters / stats ---------- */
.fk-stat__value {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	line-height: .9;
	font-variant-numeric: tabular-nums;
}
.fk-stat { border-top: 2px solid currentColor; padding-top: 1rem; }

/* ---------- Reviews ---------- */
.fk-review { border-top: var(--fk-hairline); padding-top: 1.25rem; }
.fk-review blockquote, .fk-review .wp-block-quote { border: 0; padding: 0; margin: 0; }
.fk-stars { color: var(--wp--preset--color--primary); letter-spacing: .2em; }

/* ---------- Newsletter ---------- */
.fk-newsletter-form { display: flex; gap: 0; flex-wrap: wrap; max-width: 520px; }
.fk-newsletter-form input[type="email"] {
	flex: 1 1 220px;
	min-height: 52px;
	padding: 0 1rem;
	border: 2px solid currentColor;
	border-right: 0;
	background: transparent;
	color: inherit;
	font: inherit;
}
.fk-newsletter-form input[type="email"]::placeholder { color: inherit; opacity: .6; }
.fk-newsletter-form .wp-element-button { min-height: 52px; }
@media (max-width: 480px) { .fk-newsletter-form input[type="email"] { border-right: 2px solid currentColor; } .fk-newsletter-form .wp-element-button { width: 100%; } }

/* ---------- Posts ---------- */
.fk-note-card .wp-block-post-featured-image { overflow: hidden; }
.fk-note-card .wp-block-post-featured-image img { transition: transform .8s var(--fk-ease); }
.fk-note-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.wp-block-post-title a { text-decoration: none; }
.wp-block-post-title a:hover { color: var(--wp--preset--color--primary-deep); }

.wp-block-query-pagination a { text-decoration: none; }
.wp-block-query-pagination .page-numbers.current { color: var(--wp--preset--color--primary-deep); }

/* ---------- Footer ---------- */
.fk-footer a { text-decoration: none; }
.fk-footer a:hover { text-decoration: underline; }
.fk-footer .fk-footer__big {
	font-size: clamp(4rem, 17vw, 16rem);
	line-height: .8;
	letter-spacing: -.01em;
	opacity: .95;
	overflow: hidden;
	white-space: nowrap;
}

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="tel"], input[type="password"], select, textarea {
	border: 1px solid var(--wp--preset--color--hairline);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	padding: .6em .8em;
	font: inherit;
}

/* ---------- Late additions ---------- */
.fk-site-header { background: var(--wp--preset--color--base); }
.fk-site-header .fk-announcement { overflow: hidden; max-height: 4rem; transition: max-height .3s var(--fk-ease), padding .3s var(--fk-ease); }
.fk-site-header.is-condensed .fk-announcement { max-height: 0; padding-top: 0 !important; padding-bottom: 0 !important; }
.fk-site-header .fk-mega-source { margin: 0; }
.fk-marquee__track > p {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	text-transform: uppercase;
	line-height: 1;
	letter-spacing: .01em;
}
html:not(.fk-js) .fk-marquee { white-space: normal; -webkit-mask: none; mask: none; }
html:not(.fk-js) .fk-marquee .fk-marquee__track { flex-wrap: wrap !important; width: auto; justify-content: center; row-gap: .5rem !important; }
.editor-styles-wrapper .fk-mega-source { display: block !important; max-width: 320px; border: 1px dashed var(--wp--preset--color--hairline); padding: 1rem; }
.fk-product-summary .wp-block-post-terms.fk-label a { color: var(--wp--preset--color--primary-deep); text-decoration: none; }
.fk-footer-links { list-style: none; }
.fk-footer-links li { margin-bottom: .4em; }
.fk-hero .wp-block-cover__inner-container { position: relative; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
	.fk-js .fk-fade { opacity: 1; filter: none; transform: none; }
	.fk-js .is-style-fk-reveal .fk-word > span { transform: none; }
	.fk-marquee .fk-marquee__track { animation: none !important; }
}

/* ---------- Repair page ---------- */
.fk-repair-hero .wp-block-image img { width: 100%; }
.fk-repair-step { height: 100%; }
.fk-repair-step__num { line-height: 1; margin: 0; font-weight: 800; }
.fk-repair-nofix { list-style: none; padding-left: 0; }
.fk-repair-nofix li { padding-left: 1.5em; position: relative; margin-bottom: .5em; color: var(--wp--preset--color--muted); }
.fk-repair-nofix li::before { content: "—"; position: absolute; left: 0; color: var(--wp--preset--color--primary-deep); }
.fk-faq { border-top: var(--fk-hairline); padding: var(--wp--preset--spacing--30) 0; max-width: 760px; }
.fk-faq:last-of-type { border-bottom: var(--fk-hairline); }
.fk-faq summary { cursor: pointer; font-weight: 600; font-size: var(--wp--preset--font-size--large); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.fk-faq summary::-webkit-details-marker { display: none; }
.fk-faq summary::after { content: "+"; font-family: var(--wp--preset--font-family--mono); color: var(--wp--preset--color--primary-deep); }
.fk-faq[open] summary::after { content: "–"; }
.fk-faq p { margin-top: var(--wp--preset--spacing--20); }

/* ---------- Category help strip ---------- */
.fk-category-help p { margin: 0; }

/* ---------- Newsletter status ---------- */
.fk-newsletter-status { margin-top: var(--wp--preset--spacing--20); font-weight: 600; }
.fk-newsletter-form .fk-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fk-repair-hero .wp-block-button.is-style-fk-ghost .wp-block-button__link { color: var(--wp--preset--color--paper); border-color: var(--wp--preset--color--paper); }
.fk-repair-hero .wp-block-button.is-style-fk-ghost .wp-block-button__link:hover { background: var(--wp--preset--color--paper); color: var(--wp--preset--color--olive); }

/* Newsletter band: everything on the orange uses the full on-primary color (no faded text). */
.fk-newsletter, .fk-newsletter .fk-label, .fk-newsletter p { color: var(--wp--preset--color--on-primary); opacity: 1; }
.fk-newsletter .fk-newsletter-form input[type="email"]::placeholder { opacity: .85; }
.fk-newsletter.is-style-fk-topo::before, .fk-newsletter.is-style-fk-topo::after { opacity: .12; }

/* Anchored sections (/#repair, /#gear-finder) land below the sticky header. */
[id] { scroll-margin-top: 110px; }
