/**
 * Base: reset, typography, links, buttons, focus, motion, shared utilities.
 *
 * Loaded on the front end and inside the block editor, so anything here has to
 * make sense in both. Page-chrome rules live in layout.css instead.
 */

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

/*
 * Several controls ship hidden and are revealed by script - the hero's pause
 * button, the locator's filters, the carousel's arrows. A display value set
 * later in this file would quietly override the attribute's own display:none,
 * so the attribute is made to win outright.
 */
[hidden] {
	display: none !important;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Anchor targets must clear the sticky header. */
	scroll-padding-top: calc(var(--fcx-header-height) + 1.5rem);
}

body {
	margin: 0;
	background: var(--fcx-paper);
	color: var(--fcx-body);
	font-family: var(--fcx-font-sans);
	font-size: var(--fcx-text-lg);
	line-height: var(--fcx-leading-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img, picture, svg, video {
	max-width: 100%;
	height: auto;
	display: block;
}

:target {
	scroll-margin-top: calc(var(--fcx-header-height) + 1.5rem);
}

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

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.5em;
	color: var(--fcx-ink);
	font-family: var(--fcx-font-display);
	font-weight: 400;
	line-height: var(--fcx-leading-snug);
	letter-spacing: -0.015em;
}

h1 { font-size: var(--fcx-text-4xl); line-height: var(--fcx-leading-tight); }
h2 { font-size: var(--fcx-text-3xl); }
h3 { font-size: var(--fcx-text-2xl); }
h4 { font-size: var(--fcx-text-xl); }
h5, h6 { font-size: var(--fcx-text-lg); font-family: var(--fcx-font-sans); font-weight: 600; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; }
small { font-size: var(--fcx-text-sm); }

blockquote {
	margin: var(--fcx-space-3) 0;
	padding-left: var(--fcx-space-3);
	border-left: 2px solid var(--fcx-green-500);
	color: var(--fcx-ink);
	font-family: var(--fcx-font-display);
	font-size: var(--fcx-text-xl);
	font-style: italic;
}

hr {
	height: 1px;
	margin: var(--fcx-space-4) 0;
	border: 0;
	background: var(--fcx-rule);
}

/*
 * The signature heading: an upright first line and an italic accent second
 * line. Both halves are separate editable fields, so the effect survives any
 * rewrite of the words.
 */
.fcx-heading {
	margin: 0;
	font-family: var(--fcx-font-display);
	font-weight: 400;
	letter-spacing: -0.02em;
	line-height: 1.08;
	text-wrap: balance;
}

.fcx-heading__roman { display: inline; }

.fcx-heading__italic {
	display: inline;
	color: var(--fcx-green-500);
	font-style: italic;
	font-weight: 300;
}

/* On the dark bands the accent switches to the bright lime. */
.is-style-fcx-band-deep .fcx-heading__italic,
.is-style-fcx-band-mid .fcx-heading__italic,
.fcx-quick .fcx-heading__italic,
.fcx-cta .fcx-heading__italic,
.fcx-programmes--dark .fcx-heading__italic,
.fcx-values--dark .fcx-heading__italic {
	color: var(--fcx-lime);
}

.is-style-fcx-band-deep .fcx-heading,
.is-style-fcx-band-mid .fcx-heading,
.fcx-quick .fcx-heading,
.fcx-cta .fcx-heading {
	color: var(--fcx-white);
}

/* ---------------------------------------------------------------------------
 * Links and focus
 * ------------------------------------------------------------------------ */

a {
	color: var(--fcx-green-500);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--fcx-duration) var(--fcx-ease);
}

a:hover,
a:focus-visible { color: var(--fcx-green-700); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--fcx-green-500);
	outline-offset: 3px;
	border-radius: var(--fcx-r-sm);
}

/* On dark green the dark ring vanishes, so switch to the lime. */
.is-style-fcx-band-deep :where(a, button, [tabindex]):focus-visible,
.is-style-fcx-band-mid :where(a, button, [tabindex]):focus-visible,
.fcx-vhero :where(a, button):focus-visible,
.fcx-stats :where(a, button):focus-visible,
.fcx-quick :where(a, button):focus-visible,
.fcx-cta :where(a, button):focus-visible,
.fcx-footer :where(a, button):focus-visible,
.fcx-programmes--dark :where(a, button):focus-visible {
	outline-color: var(--fcx-lime);
}

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------ */

.fcx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 48px;
	padding: 0.8rem 1.5rem;
	border: 1px solid transparent;
	border-radius: var(--fcx-r-sm);
	font-family: var(--fcx-font-sans);
	font-size: var(--fcx-text-base);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--fcx-duration) var(--fcx-ease),
		color var(--fcx-duration) var(--fcx-ease),
		border-color var(--fcx-duration) var(--fcx-ease);
}

.fcx-btn .fcx-arrow { transition: transform var(--fcx-duration) var(--fcx-ease); }
.fcx-btn:hover .fcx-arrow { transform: translate(2px, -2px); }

.fcx-btn--lime {
	background: var(--fcx-lime);
	border-color: var(--fcx-lime);
	color: var(--fcx-green-950);
}

.fcx-btn--lime:hover,
.fcx-btn--lime:focus-visible {
	background: var(--fcx-lime-dim);
	border-color: var(--fcx-lime-dim);
	color: var(--fcx-green-950);
}

.fcx-btn--solid {
	background: var(--fcx-green-800);
	border-color: var(--fcx-green-800);
	color: var(--fcx-white);
}

.fcx-btn--solid:hover,
.fcx-btn--solid:focus-visible {
	background: var(--fcx-green-500);
	border-color: var(--fcx-green-500);
	color: var(--fcx-white);
}

.fcx-btn--ghost {
	background: transparent;
	border-color: var(--fcx-rule-strong);
	color: var(--fcx-ink);
}

.fcx-btn--ghost:hover,
.fcx-btn--ghost:focus-visible {
	background: var(--fcx-ink);
	border-color: var(--fcx-ink);
	color: var(--fcx-paper);
}

/*
 * Written for the dark bands, where it is a white outline on green. On a light
 * surface that is invisible, so the light form is the default and the dark
 * bands opt back in - the way round that fails safe if a new page forgets.
 */
.fcx-btn--outline {
	background: transparent;
	border-color: var(--fcx-rule-strong);
	color: var(--fcx-green-700);
}

.fcx-btn--outline:hover,
.fcx-btn--outline:focus-visible {
	background: var(--fcx-green-500);
	border-color: var(--fcx-green-500);
	color: var(--fcx-white);
}

.fcx-vhero .fcx-btn--outline,
.is-style-fcx-band-deep .fcx-btn--outline,
.is-style-fcx-band-mid .fcx-btn--outline,
.fcx-cta .fcx-btn--outline,
.fcx-quick .fcx-btn--outline {
	border-color: var(--fcx-rule-dark);
	color: var(--fcx-white);
}

.fcx-vhero .fcx-btn--outline:hover,
.fcx-vhero .fcx-btn--outline:focus-visible,
.is-style-fcx-band-deep .fcx-btn--outline:hover,
.is-style-fcx-band-deep .fcx-btn--outline:focus-visible,
.is-style-fcx-band-mid .fcx-btn--outline:hover,
.is-style-fcx-band-mid .fcx-btn--outline:focus-visible,
.fcx-cta .fcx-btn--outline:hover,
.fcx-cta .fcx-btn--outline:focus-visible,
.fcx-quick .fcx-btn--outline:hover,
.fcx-quick .fcx-btn--outline:focus-visible {
	background: var(--fcx-white);
	border-color: var(--fcx-white);
	color: var(--fcx-green-950);
}

/* ---------------------------------------------------------------------------
 * Shared pieces
 * ------------------------------------------------------------------------ */

.fcx-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 1.25rem;
	color: var(--fcx-green-500);
	font-family: var(--fcx-font-sans);
	font-size: var(--fcx-text-eyebrow);
	font-weight: 600;
	letter-spacing: var(--fcx-tracking-eyebrow);
	line-height: 1.4;
	text-transform: uppercase;
}

.fcx-eyebrow--rule::before {
	content: "";
	width: 1.75rem;
	height: 1px;
	flex: none;
	background: currentColor;
}

.fcx-eyebrow--centered { justify-content: center; }

.fcx-eyebrow--centered::before,
.fcx-eyebrow--centered::after {
	content: "";
	width: 1.5rem;
	height: 1px;
	flex: none;
	background: currentColor;
}

.is-style-fcx-band-deep .fcx-eyebrow,
.is-style-fcx-band-mid .fcx-eyebrow,
.fcx-quick .fcx-eyebrow,
.fcx-cta .fcx-eyebrow,
.fcx-programmes--dark .fcx-eyebrow,
.fcx-stats--dark .fcx-eyebrow {
	color: var(--fcx-lime);
}

.fcx-textlink {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: var(--fcx-text-micro);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-decoration: none;
	text-transform: uppercase;
}

.fcx-textlink--dark { color: var(--fcx-ink); }
.fcx-textlink--lime { color: var(--fcx-lime); }

.fcx-textlink--dark:hover,
.fcx-textlink--dark:focus-visible { color: var(--fcx-green-500); }

.fcx-textlink--lime:hover,
.fcx-textlink--lime:focus-visible { color: var(--fcx-white); }

.fcx-textlink .fcx-arrow { transition: transform var(--fcx-duration) var(--fcx-ease); }
.fcx-textlink:hover .fcx-arrow { transform: translate(2px, -2px); }

.fcx-arrow,
.fcx-icon { flex: none; }

/* ---------------------------------------------------------------------------
 * Scroll reveals
 *
 * The offset only ever applies once JavaScript has added .fcx-motion to the
 * document, so content is visible by default and stays visible if the script
 * never runs.
 * ------------------------------------------------------------------------ */

html.fcx-motion [data-fcx-reveal] {
	opacity: 0;
	transition:
		opacity var(--fcx-reveal-duration) var(--fcx-ease),
		transform var(--fcx-reveal-duration) var(--fcx-ease);
	transition-delay: calc(var(--fcx-reveal-index, 0) * var(--fcx-reveal-stagger));
	will-change: opacity, transform;
}

html.fcx-motion [data-fcx-reveal="up"]    { transform: translateY(var(--fcx-reveal-distance)); }
html.fcx-motion [data-fcx-reveal="fade"]  { transform: none; }
html.fcx-motion [data-fcx-reveal="scale"] { transform: scale(0.97); }

html.fcx-motion [data-fcx-reveal].is-revealed {
	opacity: 1;
	transform: none;
	will-change: auto;
}

/* ---------------------------------------------------------------------------
 * Utilities
 * ------------------------------------------------------------------------ */

.fcx-container {
	width: 100%;
	max-width: var(--fcx-container);
	margin-inline: auto;
	padding-inline: var(--fcx-gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	padding: 0.75rem 1.25rem;
	background: var(--fcx-lime);
	color: var(--fcx-green-950);
	border-radius: var(--fcx-r-sm);
	clip: auto;
	clip-path: none;
	font-weight: 600;
	text-decoration: none;
}
