/* ==========================================================================
   Junction Enterprise — theme layer
   Everything here builds on the tokens defined in theme.json.
   To rebrand: change the `accent` colours in theme.json. Nothing here
   hard-codes the accent.
   ========================================================================== */

:root {
	--je-line: var(--wp--preset--color--line, #dcdcdf);
	--je-ease: var(--wp--custom--transition, 180ms cubic-bezier(0.2, 0, 0, 1));
	--je-radius: var(--wp--custom--radius--lg, 30px);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   Focus — visible, on brand, never removed
   -------------------------------------------------------------------------- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.je-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--wp--preset--color--base);
	border-bottom: 1px solid transparent;
	transition: border-color var(--je-ease), background-color var(--je-ease);
}
.je-header.is-scrolled { border-bottom-color: var(--je-line); }

/* The frosted-glass effect is deliberately scoped to widths where the overlay
   menu is never used. `backdrop-filter` makes an element a containing block for
   position:fixed descendants, so wherever it applies the navigation overlay is
   trapped inside the header bar instead of covering the viewport.
   This breakpoint must therefore stay above the one that switches the menu to
   the overlay (1321px) — do not lower it independently. */
@media (min-width: 1322px) {
	.je-header {
		background-color: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent);
		-webkit-backdrop-filter: saturate(180%) blur(14px);
		backdrop-filter: saturate(180%) blur(14px);
	}
}
/* Belt and braces: never blur while a modal menu is open, whichever element
   WordPress flags. */
html.has-modal-open .je-header,
body.has-modal-open .je-header {
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	background-color: var(--wp--preset--color--base);
}

.je-header .wp-block-site-title a { letter-spacing: -0.03em; }
.je-brand-mark {
	display: inline-flex;
	align-items: baseline;
	gap: 0.42em;
	text-decoration: none;
	line-height: 1;
}
.je-brand-mark .je-brand-word { font-weight: 650; letter-spacing: -0.03em; color: var(--wp--preset--color--contrast); }
.je-brand-mark .je-brand-sub {
	font-size: 0.6em;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	font-weight: 500;
}

/* --------------------------------------------------------------------------
   Navigation — inline (desktop)
   -------------------------------------------------------------------------- */
.je-header .wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 0.4em;
	position: relative;
	color: var(--wp--preset--color--ink-mid);
	transition: color var(--je-ease);
}
.je-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.je-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--contrast);
}

/* Active-page underline — inline menu only, never in the overlay. */
@media (min-width: 600px) {
	.je-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after,
	.je-header .wp-block-navigation .current-menu-ancestor > .wp-block-navigation-item__content::after {
		content: "";
		position: absolute;
		left: 0; right: 0; bottom: -0.15em;
		height: 2px;
		background: var(--wp--preset--color--accent);
		border-radius: 2px;
	}
}

/* Dropdown panels — inline menu only. */
@media (min-width: 600px) {
	.je-header .wp-block-navigation__submenu-container {
		border: 1px solid var(--je-line) !important;
		border-radius: var(--wp--custom--radius--md, 16px);
		box-shadow: var(--wp--preset--shadow--lift);
		padding: 0.4rem;
		min-width: 16rem;
		background: var(--wp--preset--color--base) !important;
	}
	.je-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		border-radius: 6px;
		padding: 0.55rem 0.75rem !important;
		width: 100%;
	}
	.je-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
		background: var(--wp--preset--color--base-soft);
	}
}

/* --------------------------------------------------------------------------
   Navigation — mobile overlay
   -------------------------------------------------------------------------- */

/* Hamburger: a proper 44px tap target. */
.je-header .wp-block-navigation__responsive-container-open {
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: -10px;
	border-radius: var(--wp--custom--radius--md, 16px);
	color: var(--wp--preset--color--contrast);
	transition: background-color var(--je-ease);
}
.je-header .wp-block-navigation__responsive-container-open:hover { background: var(--wp--preset--color--base-soft); }
.je-header .wp-block-navigation__responsive-container-open svg { width: 26px; height: 26px; }

/* The open overlay. */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: 0;
	background-color: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
	max-width: none;
	width: 100%;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	margin: 0;
	padding: 0;
}

/* Close button, placed where the hamburger was. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	position: absolute;
	top: 0.85rem;
	right: calc(var(--wp--preset--spacing--30) - 10px);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--wp--custom--radius--md, 16px);
	color: var(--wp--preset--color--contrast);
	transition: background-color var(--je-ease);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close:hover {
	background: var(--wp--preset--color--base-soft);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close svg { width: 24px; height: 24px; }

/* Overlay contents. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding: 4.25rem var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
	align-items: stretch;
	width: 100%;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	width: 100%;
	gap: 0 !important;
	align-items: stretch;
	flex-direction: column;
}

/* Every nested list is reset to zero, so indentation is set once, by us,
   and never compounds as the menu gets deeper. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	position: static !important;
	display: block !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	inset: auto !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
	gap: 0 !important;
}

/* Shared link reset inside the overlay. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	display: block;
	width: 100%;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	line-height: 1.3;
	transition: color var(--je-ease), background-color var(--je-ease);
}

/* ---- Level 1: the main sections ---- */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	border-top: 1px solid var(--je-line);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item:last-child {
	border-bottom: 1px solid var(--je-line);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0.95rem 0 !important;
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: -0.024em;
	color: var(--wp--preset--color--contrast);
}
/* A section that opens into sub-items keeps its own label tight to them. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item.has-child > .wp-block-navigation-item__content {
	padding-bottom: 0.55rem !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container {
	padding-bottom: 0.9rem !important;
}

/* ---- Level 2: solution groups ---- */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0.65rem 0 0.3rem !important;
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--contrast);
}

/* ---- Level 3: the individual services, on a hairline rail ---- */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
	border-left: 1px solid var(--je-line) !important;
	padding: 0.1rem 0 0.35rem 0.9rem !important;
	margin: 0 0 0.35rem 1px !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0.42rem 0 !important;
	font-size: 0.9375rem;
	font-weight: 400;
	letter-spacing: 0;
	color: var(--wp--preset--color--ink-mid);
}

/* ---- States ---- */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent);
}
.wp-block-navigation__responsive-container.is-menu-open .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent);
}
/* A tinted bar reads as intentional where a full outline box does not — and
   WordPress moves focus here automatically when the menu opens. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
	outline: none;
	border-radius: 6px;
	background: var(--wp--preset--color--accent-soft);
	box-shadow: inset 3px 0 0 var(--wp--preset--color--accent);
	padding-left: 0.75rem !important;
	color: var(--wp--preset--color--contrast);
}

/* Submenus are already expanded in the overlay, so the toggle chevron is noise. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon { display: none !important; }

/* --------------------------------------------------------------------------
   Header at small widths
   -------------------------------------------------------------------------- */
/* Switch to the overlay navigation before the inline links begin to crowd
   the header. WordPress defaults this at 600px; this site needs 1321px. */
@media (max-width: 1321px) {
	.je-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none !important;
	}
	.je-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
}
@media (max-width: 781px) {
	.je-header > .wp-block-group { flex-wrap: nowrap; }
}
@media (max-width: 599px) {
	.je-header .wp-block-site-title { font-size: 1rem; }
	.je-header .wp-block-buttons { display: none; }
}

/* --------------------------------------------------------------------------
   Typography helpers (block styles)
   -------------------------------------------------------------------------- */
.is-style-je-eyebrow {
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 600;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	margin-bottom: 0.9rem;
	display: flex;
	align-items: center;
	gap: 0.7em;
	line-height: 1.2;
}
.is-style-je-eyebrow::before {
	content: "";
	width: 1.6em;
	height: 2px;
	background: var(--wp--preset--color--accent);
	flex: none;
}
.has-contrast-background-color .is-style-je-eyebrow,
.je-dark .is-style-je-eyebrow { color: rgba(255,255,255,0.62); }

.is-style-je-lead {
	font-size: var(--wp--preset--font-size--large) !important;
	line-height: 1.5;
	letter-spacing: -0.017em;
	color: var(--wp--preset--color--ink-mid);
}
.je-dark .is-style-je-lead,
.has-contrast-background-color .is-style-je-lead { color: rgba(255,255,255,0.78); }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.is-style-je-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--je-line);
	border-radius: var(--je-radius);
	padding: clamp(1.5rem, 3vw, 2.25rem);
	transition: border-color var(--je-ease), box-shadow var(--je-ease), transform var(--je-ease);
	height: 100%;
}
.is-style-je-card:hover { border-color: color-mix(in srgb, var(--wp--preset--color--accent) 45%, var(--je-line)); box-shadow: var(--wp--preset--shadow--soft); }
.je-dark .is-style-je-card,
.has-contrast-background-color .is-style-je-card {
	background: rgba(255,255,255,0.035);
	border-color: rgba(255,255,255,0.12);
}
.je-dark .is-style-je-card:hover { border-color: rgba(255,255,255,0.3); }

.is-style-je-bordered {
	border: 1px solid var(--je-line);
	border-radius: var(--je-radius);
	padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* A card that is one big link */
.je-linkcard { position: relative; }
.je-linkcard a.je-stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.je-linkcard .je-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	color: var(--wp--preset--color--accent);
}
.je-linkcard .je-arrow::after {
	content: "\2192";
	transition: transform var(--je-ease);
	display: inline-block;
}
.je-linkcard:hover .je-arrow::after { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Divided columns
   -------------------------------------------------------------------------- */
.is-style-je-divided > .wp-block-column + .wp-block-column {
	border-left: 1px solid var(--je-line);
	padding-left: clamp(1.25rem, 3vw, 2.5rem);
}
@media (max-width: 781px) {
	.is-style-je-divided > .wp-block-column + .wp-block-column {
		border-left: 0;
		border-top: 1px solid var(--je-line);
		padding-left: 0;
		padding-top: 1.5rem;
	}
}
.je-dark .is-style-je-divided > .wp-block-column + .wp-block-column { border-color: rgba(255,255,255,0.14); }

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */
ul.is-style-je-tags {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
ul.is-style-je-tags li {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.2;
	padding: 0.5em 0.85em;
	border: 1px solid var(--je-line);
	border-radius: var(--wp--custom--radius--pill, 999px);
	color: var(--wp--preset--color--ink-mid);
	background: var(--wp--preset--color--base);
	transition: border-color var(--je-ease), color var(--je-ease);
}
ul.is-style-je-tags li:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); }
.je-dark ul.is-style-je-tags li { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.14); color: rgba(255,255,255,0.8); }

ul.is-style-je-check { list-style: none; padding: 0; margin: 0; }
ul.is-style-je-check li {
	position: relative;
	padding-left: 1.85em;
	margin-bottom: 0.65em;
	color: var(--wp--preset--color--ink-mid);
}
ul.is-style-je-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 0.85em;
	height: 0.45em;
	border-left: 2px solid var(--wp--preset--color--accent);
	border-bottom: 2px solid var(--wp--preset--color--accent);
	transform: rotate(-45deg);
}
.je-dark ul.is-style-je-check li { color: rgba(255,255,255,0.78); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.wp-block-button__link { transition: background-color var(--je-ease), color var(--je-ease), border-color var(--je-ease), transform var(--je-ease); }
.wp-block-button__link:hover { transform: translateY(-1px); }

.is-style-je-ghost .wp-block-button__link {
	background: transparent !important;
	color: var(--wp--preset--color--contrast) !important;
	border: 1px solid var(--je-line);
}
.is-style-je-ghost .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--contrast);
	background: transparent !important;
	color: var(--wp--preset--color--contrast) !important;
}
.je-dark .is-style-je-ghost .wp-block-button__link,
.has-contrast-background-color .is-style-je-ghost .wp-block-button__link {
	color: #fff !important;
	border-color: rgba(255,255,255,0.28);
}
.je-dark .is-style-je-ghost .wp-block-button__link:hover { border-color: #fff; color: #fff !important; }

/* Buttons sitting on dark sections */
.je-dark .wp-block-button:not(.is-style-je-ghost) .wp-block-button__link {
	background-color: #fff;
	color: var(--wp--preset--color--contrast);
}
.je-dark .wp-block-button:not(.is-style-je-ghost) .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--accent);
	color: #fff;
}

/* --------------------------------------------------------------------------
   Dark sections
   -------------------------------------------------------------------------- */
.je-dark { color: rgba(255,255,255,0.82); }
.je-dark :is(h1,h2,h3,h4,h5) { color: #fff; }
.je-dark h6 { color: rgba(255,255,255,0.55); }
.je-dark a { color: #fff; }
.je-dark a:hover { color: var(--wp--preset--color--accent-soft); }
.je-dark hr.wp-block-separator { border-color: rgba(255,255,255,0.14); color: rgba(255,255,255,0.14); }

/* --------------------------------------------------------------------------
   Numbered steps (Our Approach)
   -------------------------------------------------------------------------- */
.je-step { position: relative; }
.je-step .je-step-num {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--accent);
	display: block;
	margin-bottom: 0.9rem;
}
.je-step::before {
	content: "";
	display: block;
	height: 1px;
	background: var(--je-line);
	margin-bottom: 1.25rem;
}
.je-dark .je-step::before { background: rgba(255,255,255,0.16); }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */
.je-stat .je-stat-value {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1;
	display: block;
}
.je-stat .je-stat-label {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--ink-soft);
	display: block;
	margin-top: 0.5rem;
}
.je-dark .je-stat .je-stat-label { color: rgba(255,255,255,0.6); }

/* --------------------------------------------------------------------------
   Hairline separator
   -------------------------------------------------------------------------- */
hr.is-style-je-hairline {
	border: 0;
	border-top: 1px solid var(--je-line);
	height: 0;
	margin-block: 0;
	max-width: none;
	width: 100%;
	opacity: 1;
}

/* --------------------------------------------------------------------------
   Enquiry form
   -------------------------------------------------------------------------- */
/* Form controls must include their padding and border in the declared width.
   Without this, `width: 100%` plus 1rem of side padding and a 1px border makes
   every field 34px wider than its container — the fields overhang their grid
   cells and the page scrolls sideways on a phone. Scoped to the form so core
   block layouts are untouched. */
.je-form,
.je-form *,
.je-form *::before,
.je-form *::after { box-sizing: border-box; }

.je-form { display: grid; gap: 1.15rem; }
.je-form .je-grid-2 { display: grid; gap: 1.15rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 600px) { .je-form .je-grid-2 { grid-template-columns: 1fr; } }

.je-field { display: grid; gap: 0.4rem; }
.je-field label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--ink-mid);
}
.je-field .je-req { color: var(--wp--preset--color--accent); }
.je-field input[type="text"],
.je-field input[type="email"],
.je-field input[type="tel"],
.je-field select,
.je-field textarea {
	width: 100%;
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base);
	border: 1px solid var(--je-line);
	border-radius: var(--wp--custom--radius--md, 16px);
	padding: 0.85rem 1rem;
	transition: border-color var(--je-ease), box-shadow var(--je-ease);
}
.je-field textarea { min-height: 9rem; resize: vertical; }
.je-field :is(input,select,textarea):focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--accent) 18%, transparent);
}

.je-checks {
	border: 0;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.6rem;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}
.je-checks legend {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--ink-mid);
	margin-bottom: 0.75rem;
	padding: 0;
	grid-column: 1 / -1;
}
.je-check {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	border: 1px solid var(--je-line);
	border-radius: var(--wp--custom--radius--md, 16px);
	padding: 0.7rem 0.9rem;
	cursor: pointer;
	font-size: var(--wp--preset--font-size--small);
	transition: border-color var(--je-ease), background-color var(--je-ease);
}
.je-check:hover { border-color: var(--wp--preset--color--ink-soft); }
.je-check input { accent-color: var(--wp--preset--color--accent); width: 1.05em; height: 1.05em; flex: none; }
.je-check:has(input:checked) {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent-soft);
}

.je-hp { position: absolute !important; left: -9999px !important; }

.je-form button[type="submit"] {
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	cursor: pointer;
	border: 0;
	border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--contrast);
	color: #fff;
	padding: 0.95em 2em;
	justify-self: start;
	transition: background-color var(--je-ease), transform var(--je-ease);
}
.je-form button[type="submit"]:hover { background: var(--wp--preset--color--accent); transform: translateY(-1px); }

.je-notice {
	border-radius: var(--wp--custom--radius--md, 16px);
	padding: 1rem 1.15rem;
	font-size: var(--wp--preset--font-size--small);
	border: 1px solid;
}
.je-notice--ok { border-color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--je-line)); background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--contrast); }
.je-notice--err { border-color: #e0b4b4; background: #fdf4f4; color: #7a2020; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
/* The CTA band is the last block in <main>. Keep its dark background joined
   to the dark footer instead of letting the global block gap reveal the page
   background between them. */
.wp-site-blocks > main + .wp-block-template-part {
	position: relative;
	margin-block-start: 0;
}

/* A restrained accent rule makes the hand-off from the CTA to the footer
   intentional while retaining a single, continuous dark background. */
.wp-site-blocks > main + .wp-block-template-part::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	width: min(var(--wp--style--global--wide-size, 1440px), calc(100% - var(--wp--preset--spacing--30) - var(--wp--preset--spacing--30)));
	height: 3px;
	transform: translateX(-50%);
	background: var(--wp--preset--color--accent);
	z-index: 1;
}

.je-footer a { text-decoration: none; }
.je-footer a:hover { text-decoration: underline; }
.je-footer ul { list-style: none; padding: 0; margin: 0; }
.je-footer li { margin-bottom: 0.55em; font-size: var(--wp--preset--font-size--small); }

/* --------------------------------------------------------------------------
   Post / editorial content
   -------------------------------------------------------------------------- */
.je-prose :is(h2,h3) { margin-top: 2.2em; }
.je-prose > * + * { margin-top: 1.1em; }

/* Query loop cards */
.je-posts .wp-block-post {
	border-top: 1px solid var(--je-line);
	padding-top: 1.5rem;
}
.je-posts .wp-block-post-title a { text-decoration: none; }
.je-posts .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.je-screen-reader-text {
	border: 0; clip-path: inset(50%); height: 1px; margin: -1px;
	overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.je-balance { text-wrap: balance; }
.je-measure { max-width: 46ch; }

/* --------------------------------------------------------------------------
   Measure helpers (attribute-backed classes, safe for block validation)
   -------------------------------------------------------------------------- */
.je-measure-wide { max-width: 62ch; }
.je-arrow-row { margin: 1.4rem 0 0; }

/* --------------------------------------------------------------------------
   Overlay heading (injected server-side; see je_navigation_overlay_extras)
   Hidden unless the overlay is actually open, so it never appears inline
   in the desktop header.
   -------------------------------------------------------------------------- */
.je-overlay-brand { display: none; }

.wp-block-navigation__responsive-container.is-menu-open .je-overlay-brand {
	display: flex;
	align-items: center;
	gap: 0.7em;
	padding-bottom: 1.15rem;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	line-height: 1.2;
}
.wp-block-navigation__responsive-container.is-menu-open .je-overlay-brand::before {
	content: "";
	width: 1.6em;
	height: 2px;
	background: var(--wp--preset--color--accent);
	flex: none;
}

/* --------------------------------------------------------------------------
   Back to top
   -------------------------------------------------------------------------- */
.je-to-top {
	position: fixed;
	right: clamp(1rem, 3vw, 2rem);
	bottom: calc(clamp(1rem, 3vw, 2rem) + env(safe-area-inset-bottom, 0px));
	z-index: 90;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--je-line);
	border-radius: var(--wp--custom--radius--pill, 999px);
	/* White on a hairline reads on the light page sections and on the dark
	   footer alike, which a solid dark chip would not. */
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--lift);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity var(--je-ease), transform var(--je-ease), visibility var(--je-ease),
		background-color var(--je-ease), color var(--je-ease), border-color var(--je-ease);
}
.je-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.je-to-top:hover,
.je-to-top:focus-visible {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}
.je-to-top.is-visible:hover { transform: translateY(-2px); }
.je-to-top svg { display: block; }

/* Never float above an open mobile menu. */
html.has-modal-open .je-to-top,
body.has-modal-open .je-to-top {
	opacity: 0;
	visibility: hidden;
}

/* --------------------------------------------------------------------------
   Card grids
   Rows of cards wrap and centre their last line, so an odd number of cards
   (five "why" cards, for instance) needs no empty spacer columns to look right.
   -------------------------------------------------------------------------- */

/* An empty column is never wanted. It is a desktop-only centring hack that
   leaves a blank gap the moment the columns stack. */
.wp-block-columns > .wp-block-column:empty { display: none; }

/* Existing pages still built from two Columns rows: centre the short row and
   hold the cards to the same width as a full row, rather than letting the
   survivors stretch to fill it. */
@media (min-width: 782px) {
	.wp-block-columns:has(> .wp-block-column:empty) {
		/* Core forces nowrap at this width, hence the !important. */
		flex-wrap: wrap !important;
		justify-content: center;
	}
	.wp-block-columns:has(> .wp-block-column:empty) > .wp-block-column:not(:empty) {
		flex-grow: 0;
		flex-basis: calc((100% - 2 * var(--wp--preset--spacing--30)) / 3);
	}
}

/* The pattern's own markup: a single wrapping row. Three across, then the
   remainder centred underneath, with no spacers involved at any width. */
.je-cardgrid {
	--je-cardgrid-gap: var(--wp--preset--spacing--30);
	gap: var(--je-cardgrid-gap) !important;
	align-items: stretch;
}
.je-cardgrid > * {
	flex: 0 1 calc((100% - 2 * var(--je-cardgrid-gap)) / 3);
	min-width: 15rem;
}
@media (max-width: 1023px) {
	.je-cardgrid > * { flex-basis: calc((100% - var(--je-cardgrid-gap)) / 2); }
}
@media (max-width: 599px) {
	.je-cardgrid > * {
		flex-basis: 100%;
		min-width: 0;
	}
}

/* --------------------------------------------------------------------------
   Image slots
   An empty group that CSS turns into a shaped, rounded image panel. Drop a
   normal Image block inside it and the image fills the slot; until then a
   faint glyph marks it as a place for one.
   -------------------------------------------------------------------------- */
.je-mediaslot {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg, 30px);
	background-color: var(--wp--preset--color--base-soft);
	border: 1px solid var(--je-line);
}
.je-mediaslot--band { aspect-ratio: 21 / 9; }
.je-mediaslot--feature { aspect-ratio: 4 / 3; }

@media (max-width: 781px) {
	.je-mediaslot--band,
	.je-mediaslot--feature { aspect-ratio: 16 / 10; }
}

/* However the image is inserted, it fills the slot. */
.je-mediaslot figure,
.je-mediaslot .wp-block-image {
	margin: 0;
	height: 100%;
}
.je-mediaslot img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

/* Empty state. Disappears the moment an image is added. */
.je-mediaslot:not(:has(img))::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23101014' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='M21 15l-5-5-5 5-2-2-6 6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 42px 42px;
	opacity: 0.2;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Skip link
   First thing in the tab order, invisible until focused.
   -------------------------------------------------------------------------- */
.je-skip-link {
	position: absolute;
	left: 50%;
	top: 0;
	transform: translate(-50%, -150%);
	z-index: 1000;
	padding: 0.85rem 1.4rem;
	border-radius: 0 0 var(--wp--custom--radius--md, 16px) var(--wp--custom--radius--md, 16px);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	transition: transform var(--je-ease);
}
.je-skip-link:focus {
	transform: translate(-50%, 0);
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
#je-main:focus { outline: none; }
