/*
 * Only what theme.json cannot express: sticky positioning, the brand mark,
 * scroll reveals, and the handful of --fuel-* overrides the pledge plugin's
 * components need when they sit inside a Nightfall section.
 *
 * Colour, type and spacing tokens all live in theme.json. Nothing here should
 * hard-code a hex value that theme.json already publishes as a preset.
 */

/* ---------- Navigation ---------- */

.fuel-nav {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.fuel-nav__brand {
	gap: 0.75rem;
}

/*
 * The mark from the design: a dark disc with a rust pupil. Drawn rather than
 * shipped as an image so it recolours with the palette and costs no request.
 */
.fuel-nav__brand::before {
	content: "";
	flex: none;
	inline-size: 1.875rem;
	block-size: 1.875rem;
	border-radius: 50%;
	background: radial-gradient(
		circle,
		var(--wp--preset--color--accent) 0 0.34rem,
		var(--wp--preset--color--ink) 0.34rem 100%
	);
}

.fuel-nav__end {
	gap: 1.75rem;
}

.fuel-nav__links a:hover {
	color: var(--wp--preset--color--ink);
}

/*
 * Below this width the design drops the in-page links and keeps only the call
 * to action. They are anchors to sections the visitor scrolls straight past on
 * a phone, and the sticky button is the thing that actually matters there.
 */
@media (max-width: 899px) {
	.fuel-nav__links {
		display: none;
	}
}

.fuel-footer .fuel-nav__brand::before {
	inline-size: 1.75rem;
	block-size: 1.75rem;
}

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

.fuel-footer__label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: 0.625rem;
}

.fuel-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	font-size: 0.875rem;
}

.fuel-footer__list a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.fuel-footer__list a:hover {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
}

.fuel-footer__base {
	font-size: 0.8125rem;
}

/* ---------- Section rhythm ---------- */

.fuel-section {
	padding-block: var(--wp--preset--spacing--60);
}

.fuel-eyebrow {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0;
}

.fuel-rule {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--hairline);
	margin-block: var(--wp--preset--spacing--30);
}

.fuel-lede {
	max-width: 48ch;
}

.fuel-balance {
	text-wrap: balance;
}

.fuel-photo-placeholder {
	aspect-ratio: 4 / 5;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 1.25rem;
	background: repeating-linear-gradient(
		135deg,
		var(--wp--preset--color--track),
		var(--wp--preset--color--track) 11px,
		#e7e0d1 11px,
		#e7e0d1 22px
	);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1.5rem;
	color: var(--wp--preset--color--subtle);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	line-height: 1.5;
}

.fuel-check {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
}

.fuel-check li {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	font-size: 0.9375rem;
	line-height: 1.45;
}

.fuel-check li::before {
	content: "\2713";
	flex: none;
	font-size: 1.125rem;
	line-height: 1.3;
	color: var(--wp--preset--color--positive-ink);
}

.fuel-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.4375rem 0.875rem;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--muted);
}

.fuel-pill::before {
	content: "";
	inline-size: 0.4375rem;
	block-size: 0.4375rem;
	border-radius: 50%;
	background: var(--wp--preset--color--positive);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--positive) 18%, transparent);
}

/* ---------- Nightfall sections ---------- */

/*
 * The pledge form deliberately stays a light card on the dark band, exactly as
 * the design has it, so .fuel-form is not listed here. Only the components that
 * the design shows as dark-on-dark get inverted tokens.
 */
.is-style-nightfall .fuel-progress,
.is-style-nightfall .fuel-notice {
	--fuel-surface: var(--wp--preset--color--surface-invert-soft);
	--fuel-base: var(--wp--preset--color--surface-invert);
	--fuel-ink: var(--wp--preset--color--on-invert);
	--fuel-muted: var(--wp--preset--color--on-invert-muted);
	--fuel-subtle: #857d70;
	--fuel-hairline: var(--wp--preset--color--hairline-invert);
	--fuel-track: var(--wp--preset--color--hairline-invert);
	--fuel-accent: var(--wp--preset--color--accent-soft);
}

.is-style-nightfall .fuel-eyebrow {
	color: var(--wp--preset--color--accent-soft);
}

.is-style-nightfall .fuel-pill {
	border-color: var(--wp--preset--color--hairline-invert);
	color: var(--wp--preset--color--on-invert-muted);
}

.is-style-nightfall .fuel-rule {
	border-top-color: var(--wp--preset--color--hairline-invert);
}

.is-style-nightfall .fuel-check li::before {
	color: var(--wp--preset--color--positive);
}

.is-style-nightfall :where(a, button, summary):focus-visible {
	outline-color: var(--wp--preset--color--accent-soft);
}

/*
 * The Details marker rotation lives in theme.json alongside the rest of the
 * block's styling. The motion opt-out lives here because an @media rule nested
 * inside theme.json block CSS is not something to rely on.
 */
@media (prefers-reduced-motion: reduce) {
	.wp-block-details summary::after {
		transition: none;
	}
}

/* ---------- Reveal on scroll ---------- */

/*
 * Gated twice over: on the .fuel-js class, which only exists once a script has
 * run, and on a motion preference. Either gate failing leaves the content
 * plainly visible rather than permanently transparent.
 */
@media (prefers-reduced-motion: no-preference) {
	.fuel-js .fuel-rise {
		animation: fuel-rise 0.7s ease both;
		animation-timeline: view();
		animation-range: entry 0% cover 22%;
	}
}

@keyframes fuel-rise {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ---------- Editor ---------- */

.editor-styles-wrapper .fuel-nav {
	position: static;
	backdrop-filter: none;
}
