/*
 * Spacing scale.
 *
 * Declared here rather than as theme.json spacingSizes: core regenerates its
 * default seven-step scale whenever spacingScale is present, and those slugs
 * override identically-named custom ones. Every value below is deliberate.
 */
:root {
	/* Reading measure: ~68 characters at the body size. */
	--sewl-measure: 44rem;

	--sewl-space-2xs: 0.375rem;
	--sewl-space-xs:  0.5rem;
	--sewl-space-s:   0.75rem;
	--sewl-space-m:   1.125rem;
	--sewl-space-l:   1.75rem;
	--sewl-space-xl:  2.5rem;
	--sewl-space-2xl: 3.5rem;

	/*
	 * How far a panel (the at-a-glance box, a figure frame) extends past the
	 * reading column on each side. A panel pads itself by the same amount, so
	 * its contents land back on the text grid: the frame bleeds, the diagram
	 * inside it does not.
	 */
	--sewl-bleed: var(--sewl-space-l);
}

/*
 * Styles that theme.json cannot express: the section-page layout, the sticky
 * navigation map, and figure behaviour. Everything tokenised lives in theme.json.
 */

/* ---------- Section page: prose column + sticky navigation map ---------- */

.sewl-section {
	display: grid;
	--sewl-rail: 14.5rem;
	grid-template-columns: var(--sewl-rail) minmax(0, 1fr);
	gap: var(--sewl-space-l);
	align-items: start;
	background: linear-gradient(
		to right,
		var(--wp--preset--color--rail) 0,
		var(--wp--preset--color--rail) var(--sewl-rail),
		transparent var(--sewl-rail)
	);
}

/* Grid and flex children default to min-content width, which lets long words
   and wide children push the page wider than the viewport. */
.sewl-section > * {
	min-inline-size: 0;
}

.sewl-section__nav {
	position: sticky;
	top: var(--sewl-space-m);
	padding-block: var(--sewl-space-l) var(--sewl-space-m);
	padding-inline: var(--sewl-space-m) var(--sewl-space-s);
	font-family: var(--wp--preset--font-family--sans);
	line-height: 1.35;
}

/* The section name leads; the entries are subordinate to it. */
.sewl-section__nav-label {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--navy);
}

/* A short accent rule reads as an underline to the label rather than as a
   divider across the whole rail. */
.sewl-section__nav-label::after {
	content: "";
	display: block;
	inline-size: 2.25rem;
	block-size: 3px;
	margin-block-start: var(--sewl-space-2xs);
	background: var(--wp--preset--color--nav-active);
}

/*
 * A continuous track binds the entries into one list and gives the current
 * item something to register against — clearer than ruling between every row.
 */
.sewl-section__nav ol {
	list-style: none;
	counter-reset: sewl-nav;
	margin: var(--sewl-space-m) 0 0;
	padding: 0;
	border-inline-start: 2px solid color-mix( in srgb, var(--wp--preset--color--rule) 60%, transparent );
}

.sewl-section__nav li {
	counter-increment: sewl-nav;
}

.sewl-section__nav a {
	display: grid;
	grid-template-columns: 1.5rem 1fr;
	gap: 0.35rem;
	align-items: baseline;
	padding: 0.6rem 0.75rem;
	margin-inline-start: -2px;
	border-inline-start: 2px solid transparent;
	font-size: 0.875rem;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	overflow-wrap: break-word;
	transition: color 120ms ease, background-color 120ms ease;
}

/* Numbering gives the map an order the headings alone do not convey. */
.sewl-section__nav a::before {
	content: counter( sewl-nav );
	font-size: 0.75rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--blue);
	opacity: 0.5;
}

.sewl-section__nav a:hover,
.sewl-section__nav a:focus-visible {
	color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--tint-blue);
	border-inline-start-color: color-mix( in srgb, var(--wp--preset--color--blue) 45%, transparent );
}

.sewl-section__nav a:hover::before,
.sewl-section__nav a:focus-visible::before {
	opacity: 1;
}

.sewl-section__nav a[aria-current="true"] {
	border-inline-start-color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--tint-blue);
	color: var(--wp--preset--color--navy);
	font-weight: 600;
}

.sewl-section__nav a[aria-current="true"]::before {
	color: var(--wp--preset--color--navy);
	opacity: 1;
}

/* Anchor targets clear the sticky header. */
.sewl-section :is(h2, h3)[id] {
	scroll-margin-top: var(--sewl-space-m);
}

@media (width < 60rem) {
	.sewl-section {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--sewl-space-s);
		background: none;
	}

	.sewl-section__nav {
		position: static;
		padding: 0;
		background: var(--wp--preset--color--rail);
		border: 1px solid var(--wp--preset--color--rule);
	}

	.sewl-section__nav-label::after {
		display: none;
	}

	.sewl-section__nav-disclosure > summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--sewl-space-s);
		min-block-size: 2.75rem;
		padding: 0 var(--sewl-space-s);
		cursor: pointer;
	}

	.sewl-section__nav-label {
		font-size: 0.6875rem;
	}

	.sewl-section__nav-hint {
		white-space: nowrap;
	}

	/* The list owns its own spacing once open; a closed panel is just the row. */
	.sewl-section__nav-disclosure > ol {
		margin-block-start: 0;
		padding-block: var(--sewl-space-2xs);
		padding-inline-start: var(--sewl-space-s);
		border-block-start: 1px solid var(--wp--preset--color--rule);
	}

	.sewl-section__nav-hint::after {
		content: " \25BE";
	}

	.sewl-section__nav-disclosure[open] .sewl-section__nav-hint::after {
		content: " \25B4";
	}

	.sewl-section__nav ol {
		margin: 0;
		padding: var(--sewl-space-2xs) var(--sewl-space-s) var(--sewl-space-s);
	}

	.sewl-section__nav a {
		/* A comfortable tap target; the numbered grid is kept from the base
		   rule so the list reads the same as it does on a wide screen. */
		min-block-size: 2.75rem;
		align-content: center;
		padding-block: 0.35rem;
		padding-inline: 0.75rem;
	}
}

/* ---------- Prose rhythm ---------- */

/*
 * Grid margins do not collapse, so stacked block margins would double up. The
 * baseline gap lives on the grid; headings and panels add to it deliberately.
 */
.sewl-prose {
	row-gap: var(--sewl-space-s);
}

.sewl-prose > * {
	margin-block: 0;
}

.sewl-prose > h2 {
	margin-block-start: var(--sewl-space-l);
	padding-block-end: var(--sewl-space-2xs);
	border-block-end: 1px solid var(--wp--preset--color--rule);
}

.sewl-prose > h3 {
	margin-block-start: var(--sewl-space-s);
}

/* A heading straight after a heading keeps only the baseline gap. */
.sewl-prose > :is(h2, h3) + :is(h2, h3) {
	margin-block-start: 0;
}

.sewl-prose > :first-child {
	margin-block-start: 0;
}

/* ---------- Panels: full column width, contents on the text grid ---------- */

/*
 * A three-track grid: prose sits in the centre `text` track at a readable
 * measure, panels span the whole `full` width. Grid placement rather than
 * negative margins, because the constrained layout sets margin-inline: auto on
 * every child and that fights a bleed.
 */
.sewl-section__body,
.sewl-prose {
	display: grid;
	grid-template-columns:
		[full-start] minmax( 0, 1fr )
		[text-start] min( var(--sewl-measure), 100% ) [text-end]
		minmax( 0, 1fr ) [full-end];
}

.sewl-section__body > *,
.sewl-prose > * {
	grid-column: text;
	max-inline-size: none;
}

/* The page title and standfirst share the reading column; the content area
   spans the full width so its own panels can. */
.sewl-section__body > .sewl-prose {
	grid-column: full;
}

.sewl-section__body {
	row-gap: var(--sewl-space-2xs);
}

.sewl-section__body > .sewl-prose {
	margin-block-start: var(--sewl-space-l);
}

.sewl-prose > :is(.sewl-figure, .sewl-glance) {
	grid-column: full;
	margin-block: var(--sewl-space-l);
}

/* The shorthand above would otherwise reinstate a top margin on a panel that
   opens the page, doubling the gap under the standfirst. */
.sewl-prose > :is(.sewl-figure, .sewl-glance):first-child {
	margin-block-start: 0;
}

/*
 * Panels pad themselves by the distance from the full edge to the text edge,
 * so their contents land back on the text grid.
 */
.sewl-glance,
.sewl-figure__frame {
	padding-block: var(--sewl-space-l);
	padding-inline: max( var(--sewl-space-s), calc( ( 100% - var(--sewl-measure) ) / 2 ) );
}

/* Panels are constrained groups; their children would otherwise be re-centred
   at the global content size and land 16px inside the text column. */
.sewl-glance > * {
	max-inline-size: none;
	margin-inline: 0;
}

/* Label and caption are prose, so they align to the text column. */
.sewl-figure__label,
.sewl-figure__caption,
.sewl-figure__details {
	padding-inline: max( var(--sewl-space-s), calc( ( 100% - var(--sewl-measure) ) / 2 ) );
}

/* ---------- Banner ---------- */

/*
 * The supplied BANNER artwork, used as-is on every page at Yorghos's request.
 * Its wording is baked into the raster, so the alt text carries the same
 * information for screen readers and search engines.
 */

.sewl-banner {
	padding-block: 0;
	background: #FFFFFF;
}

.sewl-banner__link {
	display: block;
}

.sewl-banner__image {
	display: block;
	inline-size: 100%;
	block-size: auto;
}

/* ---------- Primary navigation ---------- */

.sewl-nav {
	--sewl-nav-pad: 0.85rem;
	--sewl-nav-gap: 0.75rem;
	padding-block: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-size: clamp( 0.75rem, 0.62rem + 0.35vw, 0.9375rem );
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.sewl-nav .wp-block-navigation-item .wp-block-navigation-item__content {
	padding: var(--sewl-nav-pad) var(--sewl-nav-gap);
	white-space: nowrap;
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

.sewl-nav .wp-block-navigation-item .wp-block-navigation-item__content:hover,
.sewl-nav .wp-block-navigation-item .wp-block-navigation-item__content:focus-visible {
	background: color-mix( in srgb, var(--wp--preset--color--nav-active) 35%, transparent );
}

/*
 * Origins & Leadership and Collaborate sit apart from the scientific sections.
 * The mockup's red (#E8232A) reaches only 3.12:1 on this navy, and no fully
 * saturated red clears 4.5:1 against it, so the bar uses a lighter coral
 * (4.99:1). The original red stays in the palette for use on light grounds.
 */
.sewl-nav .wp-block-navigation-item.is-aside .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent-red-on-dark);
	text-transform: none;
	font-weight: 600;
}

.sewl-nav .wp-block-navigation-item.is-aside:first-of-type {
	margin-inline-start: auto;
}

/* ---------- Section page furniture ---------- */

.sewl-section__nav-label {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--navy);
}

.sewl-section__nav-hint {
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
}

/* The disclosure affordance is only meaningful where the map collapses. */
@media (width >= 60rem) {
	.sewl-section__nav-hint {
		display: none;
	}
}

.sewl-section__nav-disclosure > summary {
	list-style: none;
	cursor: default;
}

.sewl-section__nav-disclosure > summary::-webkit-details-marker {
	display: none;
}

.sewl-section__nav a[aria-current="true"] {
	background: var(--wp--preset--color--tint-blue);
}

/* Page subtitle, set from the page excerpt. */
.sewl-subtitle {
	margin-block-start: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	font-style: italic;
	color: var(--wp--preset--color--blue);
}

/* ---------- At a glance panel ---------- */

.sewl-glance {
	background: var(--wp--preset--color--panel);
}

.sewl-glance__label {
	margin-block: 0 var(--sewl-space-s);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.2;
	color: var(--wp--preset--color--navy);
}

/* A short accent rule ties the panel to the section colour. */
.sewl-glance__label::after {
	content: "";
	display: block;
	inline-size: 2.5rem;
	block-size: 3px;
	margin-block-start: var(--sewl-space-2xs);
	background: var(--wp--preset--color--nav-active);
}

.sewl-glance > p:last-child {
	margin-block-end: 0;
}

/* ---------- Figures ---------- */

.sewl-figure {
	margin-block: var(--sewl-space-xl);
}

.sewl-figure__label {
	margin: 0 0 var(--sewl-space-2xs);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--navy);
}

.sewl-figure__number::after {
	content: " · ";
	color: var(--wp--preset--color--rule);
}

/* The frame is the control: clicking anywhere on a figure opens it. */
.sewl-figure__frame {
	position: relative;
	display: block;
	inline-size: 100%;
	border: 0;
	background: var(--wp--preset--color--panel);
	cursor: zoom-in;
	font: inherit;
	text-align: inherit;
}

.sewl-figure__zoom {
	position: absolute;
	inset-block-end: var(--sewl-space-xs);
	inset-inline-end: var(--sewl-space-xs);
	padding: 0.3rem 0.6rem;
	background: var(--wp--preset--color--nav);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.85;
}

.sewl-figure__frame:hover .sewl-figure__zoom,
.sewl-figure__frame:focus-visible .sewl-figure__zoom {
	opacity: 1;
	background: var(--wp--preset--color--nav-active);
}

/* The figure intro sentence sits above the figure it introduces. */
.sewl-figure-intro {
	font-style: italic;
	color: var(--wp--preset--color--muted);
}

.sewl-figure__image {
	display: block;
	inline-size: 100%;
	block-size: auto;
}

.sewl-figure__caption {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sewl-space-2xs) var(--sewl-space-s);
	align-items: baseline;
	justify-content: space-between;
	margin-block-start: var(--sewl-space-s);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.sewl-figure__caption-text {
	flex: 1 1 18rem;
	min-inline-size: 0;
}

.sewl-figure__open {
	flex: 0 0 auto;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-weight: 600;
	color: var(--wp--preset--color--blue);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.sewl-figure__open:hover,
.sewl-figure__open:focus-visible {
	color: var(--wp--preset--color--navy);
}

.sewl-figure__details {
	margin-block-start: var(--sewl-space-s);
	font-size: var(--wp--preset--font-size--small);
}

.sewl-figure__details summary {
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 600;
	color: var(--wp--preset--color--blue);
	cursor: pointer;
}

/* ---------- Detailed figure viewer ---------- */

.sewl-viewer {
	inline-size: min( 96vw, 100rem );
	max-inline-size: none;
	max-block-size: 94vh;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.sewl-viewer::backdrop {
	background: rgb( 8 18 36 / 0.78 );
}

.sewl-viewer__bar {
	display: flex;
	gap: var(--sewl-space-s);
	align-items: center;
	justify-content: space-between;
	padding: var(--sewl-space-s);
	background: var(--wp--preset--color--nav);
	color: var(--wp--preset--color--base);
}

.sewl-viewer__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sewl-viewer__actions {
	display: flex;
	gap: var(--sewl-space-s);
	align-items: center;
}

.sewl-viewer__size,
.sewl-viewer__close {
	border: 1px solid rgb( 255 255 255 / 0.35 );
	background: none;
	color: inherit;
	font: inherit;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	padding: 0.3rem 0.7rem;
	cursor: pointer;
}

.sewl-viewer__close {
	font-size: 1.1rem;
	line-height: 1;
	padding: 0.2rem 0.55rem;
}

.sewl-viewer__size:hover,
.sewl-viewer__close:hover {
	background: rgb( 255 255 255 / 0.15 );
}

.sewl-viewer__canvas {
	overflow: auto;
	max-block-size: calc( 94vh - 4rem );
	background: var(--wp--preset--color--panel);
}

.sewl-viewer__canvas img {
	display: block;
	margin-inline: auto;
	inline-size: auto;
	max-inline-size: 100%;
	block-size: auto;
	max-block-size: calc( 94vh - 4rem );
}

/* Actual size: the image sits at its native pixels and the canvas pans. */
.sewl-viewer.is-actual-size .sewl-viewer__canvas img {
	max-inline-size: none;
	max-block-size: none;
}

/* ---------- Pathway chain ---------- */

.sewl-chain {
	gap: 0.4rem 0.3rem;
	align-items: stretch;
	margin-block: var(--sewl-space-m);
}

.sewl-chain__step {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0.45rem 0.75rem;
	background: var(--wp--preset--color--tint-blue);
	border-inline-start: 3px solid var(--wp--preset--color--blue);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--wp--preset--color--navy);
}

.sewl-chain__step:not(:last-child)::after {
	content: "\2192";
	margin-inline-start: 0.6rem;
	color: var(--wp--preset--color--blue);
	font-weight: 400;
}

/* ---------- Onward links ---------- */

.sewl-cta {
	gap: var(--sewl-space-s) var(--sewl-space-m);
	margin-block-start: var(--sewl-space-l);
	padding-block-start: var(--sewl-space-m);
	border-block-start: 1px solid var(--wp--preset--color--rule);
}

.sewl-cta__item {
	margin: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 700;
}

.sewl-cta__item a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1rem;
	border: 2px solid var(--wp--preset--color--blue);
	background: var(--wp--preset--color--tint-blue);
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--medium);
	text-decoration: none;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.sewl-cta__item a:hover,
.sewl-cta__item a:focus-visible {
	background: var(--wp--preset--color--nav-active);
	border-color: var(--wp--preset--color--nav-active);
	color: var(--wp--preset--color--base);
}

.sewl-cta__item a span {
	transition: transform 120ms ease;
}

.sewl-cta__item a:hover span {
	transform: translateX( 0.2rem );
}

/* #11 — selective colour: lead sentences of a section carry slightly more
   weight so the eye lands on the scientific claim, not the connective text. */
.sewl-prose > h2 + p {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.45;
	color: var(--wp--preset--color--contrast);
}

/* ---------- Framing question ---------- */

.sewl-question {
	margin-block: var(--sewl-space-l);
	padding-inline-start: var(--sewl-space-m);
	border-inline-start: 4px solid var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-large);
	font-style: italic;
	line-height: 1.3;
	color: var(--wp--preset--color--navy);
}

/* ---------- From / to shift ---------- */

.sewl-shift__heading {
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--medium);
	letter-spacing: 0.01em;
}

/* ---------- Home hero ---------- */

.sewl-hero__title {
	margin-block-end: var(--sewl-space-2xs);
}

.sewl-hero__standfirst {
	margin-block-start: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	font-style: italic;
	color: var(--wp--preset--color--blue);
}

/* ---------- Small screens ---------- */

/*
 * The figures are 1140–1774px diagrams of dense, text-bearing material. At phone
 * width the inline rendering is a locator, not something to read — the viewer is
 * how they are actually read, so the control that opens it is promoted to a
 * full-width button rather than an inline link.
 */
@media (width < 48rem) {
	.sewl-section__body > .sewl-prose {
		margin-block-start: var(--sewl-space-m);
	}

	.sewl-prose > :is(.sewl-figure, .sewl-glance) {
		margin-block: var(--sewl-space-m);
	}

	.sewl-prose > :is(.sewl-figure, .sewl-glance):first-child {
		margin-block-start: 0;
	}

	.sewl-prose > h2 {
		margin-block-start: var(--sewl-space-m);
	}

	.sewl-glance,
	.sewl-figure__frame {
		padding-block: var(--sewl-space-m);
	}

	.sewl-banner {
		padding-block: var(--sewl-space-s);
	}

	.sewl-figure__caption {
		display: grid;
		gap: var(--sewl-space-s);
	}

	.sewl-figure__caption-text {
		flex: none;
	}

	.sewl-figure__open {
		justify-self: stretch;
		min-block-size: 2.75rem;
		padding-inline: var(--sewl-space-s);
		border: 1px solid var(--wp--preset--color--blue);
		background: var(--wp--preset--color--tint-blue);
		text-decoration: none;
		text-align: center;
	}

	.sewl-figure__frame {
		padding: var(--sewl-space-2xs);
	}

	/* Each construct becomes its own row; inline arrows would point sideways. */
	.sewl-chain {
		display: grid;
		gap: 0.3rem;
	}

	.sewl-chain__step:not(:last-child)::after {
		content: none;
	}

	.sewl-chain__step {
		padding-inline-end: 1.75rem;
		position: relative;
	}

	.sewl-chain__step:not(:last-child) {
		background-image: linear-gradient( transparent, transparent );
	}

	.sewl-chain__step:not(:last-child)::before {
		content: "\2193";
		position: absolute;
		inset-inline-end: 0.6rem;
		color: var(--wp--preset--color--blue);
	}

	.sewl-cta {
		display: grid;
		gap: var(--sewl-space-s);
	}

	.sewl-cta__item a {
		display: flex;
		align-items: center;
		min-block-size: 2.75rem;
	}

	.sewl-question {
		padding-inline-start: var(--sewl-space-s);
		font-size: var(--wp--preset--font-size--large);
	}

	.sewl-glance {
		padding: var(--sewl-space-s);
	}

	/* No room for an inset on a phone: panels run to the column edge. */
	.sewl-glance,
	.sewl-figure__frame {
		padding-inline: var(--sewl-space-s);
	}

	.sewl-figure__label,
	.sewl-figure__caption,
	.sewl-figure__details {
		padding-inline: 0;
	}
}

/* The hamburger and its overlay need real tap targets. */
.sewl-nav .wp-block-navigation__responsive-container-open,
.sewl-nav .wp-block-navigation__responsive-container-close {
	min-inline-size: 2.75rem;
	min-block-size: 2.75rem;
	color: var(--wp--preset--color--base);
}

.sewl-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--nav);
	padding: var(--sewl-space-l) var(--sewl-space-m);
}

.sewl-nav .wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item .wp-block-navigation-item__content {
	min-block-size: 2.75rem;
	display: flex;
	align-items: center;
	font-size: 1rem;
}

/* Long unbroken terms in this vocabulary (Working-Life Exposure Systems,
   exposure-generating) must not push the page sideways. */
.sewl-prose :is(p, li, h1, h2, h3, figcaption) {
	overflow-wrap: break-word;
}

/* Nothing in the document scrolls the page sideways. */
.sewl-section-wrap {
	overflow-x: clip;
}

/* On a phone the viewer opens at actual size, since fitting a 1536px diagram to
   375px reproduces the unreadable inline view. Pinch zoom stays available. */
@media (width < 48rem) {
	.sewl-viewer {
		inline-size: 100vw;
		max-block-size: 100vh;
	}

	.sewl-viewer__canvas {
		max-block-size: calc( 100vh - 4rem );
		touch-action: pinch-zoom pan-x pan-y;
	}

	.sewl-viewer__canvas img {
		max-inline-size: none;
		max-block-size: none;
	}

	.sewl-viewer__title {
		font-size: 0.6875rem;
	}
}

/* ---------- Sticky header on small screens ---------- */

.sewl-nav__brand {
	display: none;
}


@media (width < 60rem) {
	.sewl-nav > .wp-block-group__inner-container,
	.sewl-nav {
		display: flex;
		align-items: center;
		gap: var(--sewl-space-s);
	}

	.sewl-nav__brand {
		display: block;
		flex: 1 1 auto;
		min-inline-size: 0;
		margin: 0;
		padding-inline-start: var(--sewl-space-2xs);
		font-family: "Archivo Narrow", "Arial Narrow", var(--wp--preset--font-family--sans);
		font-size: 0.8125rem;
		font-weight: 700;
		letter-spacing: 0.02em;
		line-height: 1.15;
		text-transform: uppercase;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.sewl-nav__brand a {
		color: var(--wp--preset--color--base);
		text-decoration: none;
	}

	.sewl-nav {
		position: sticky;
		inset-block-start: 0;
		z-index: 20;
		box-shadow: 0 1px 0 rgb( 255 255 255 / 0.12 ), 0 6px 14px rgb( 8 18 36 / 0.22 );
	}

	/* The bar covers the top of the viewport, so anchored headings must clear
	   it or a jump lands with the heading hidden underneath. */
	.sewl-section :is(h2, h3)[id] {
		scroll-margin-top: calc( var(--sewl-nav-height, 3rem) + var(--sewl-space-s) );
	}

	/* The open overlay menu must sit above the bar it came from. */
	.sewl-nav .wp-block-navigation__responsive-container.is-menu-open {
		z-index: 21;
	}
}

/* A reader who prefers reduced motion generally also prefers less movement in
   the chrome; the bar stays put rather than tracking the scroll. */
@media (width < 60rem) and (prefers-reduced-motion: reduce) {
	.sewl-nav {
		position: static;
		box-shadow: none;
	}

	.sewl-section :is(h2, h3)[id] {
		scroll-margin-top: var(--sewl-space-s);
	}
}

/* ---------- Interaction and accessibility ---------- */

/* One visible focus treatment everywhere, rather than the browser default
   disappearing against the navy bar. */
:where(a, button, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--nav-active);
	outline-offset: 2px;
	border-radius: 1px;
}

.sewl-nav :is(a, button):focus-visible {
	outline-color: var(--wp--preset--color--base);
	outline-offset: -3px;
}

#sewl-main:focus {
	outline: none;
}

/* The current page in the bar. */
.sewl-nav .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content {
	background: var(--wp--preset--color--nav-active);
	font-weight: 600;
}

.sewl-nav .wp-block-navigation-item.is-aside.current-menu-item .wp-block-navigation-item__content {
	background: var(--wp--preset--color--accent-red-on-dark);
	color: var(--wp--preset--color--nav);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ---------- Print ---------- */

@media print {
	.sewl-nav,
	.sewl-section__nav,
	.sewl-cta,
	.sewl-figure__open,
	.skip-link,
	.sewl-footer {
		display: none !important;
	}

	.sewl-section {
		display: block;
		background: none;
	}

	.sewl-prose {
		font-size: 11pt;
	}

	/* Figures should not be split across a page break. */
	.sewl-figure,
	.sewl-glance {
		break-inside: avoid;
	}

	.sewl-figure__details[open] summary {
		display: none;
	}

	.sewl-figure__details {
		display: block;
	}
}
