/*
Theme Name: ACEPIS
Theme URI: https://acepis.org
Author: ACEPIS
Description: Native WordPress theme for the Africa Centre for People, Institutions and Society. Replaces the Oxygen Builder stack while preserving the existing layout, brand system, sliders and custom post types.
Version: 4.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: acepis
Tags: nonprofit, think-tank, custom-menu, featured-images, translation-ready
*/

/* -------------------------------------------------------------------------
   Design tokens
   Values carried over from the Oxygen global settings so the rebuilt theme
   matches the existing site: brand colours, type scale, container width and
   breakpoints are identical.
   ---------------------------------------------------------------------- */

:root {
	/*
	 * The site has one light design. Declaring the scheme stops Chrome's
	 * auto-dark-mode from force-inverting the brand colours on devices set to
	 * a dark system theme.
	 */
	color-scheme: light;

	/* Brand palette (Oxygen "Global Colors" set) */
	--acepis-green: #91c740;   /* color(4) - primary, links */
	--acepis-orange: #f48020;  /* color(3) - accent, link hover */
	--acepis-dark: #2b2a27;    /* color(1) - dark sections */
	--acepis-black: #000000;   /* color(2) */
	--acepis-grey: #7f7e87;    /* color(6) - muted */
	--acepis-white: #ffffff;   /* color(5) */

	/* Derived neutrals */
	--acepis-text: #404040;
	--acepis-muted: #6b6b6b;
	--acepis-border: #e3e3e3;
	--acepis-surface: #f5f5f5;
	--acepis-surface-alt: #f2f4f6;

	/* Typography */
	--font-body: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	--font-display: "Source Sans Pro", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

	/*
	 * Fluid type on a single ratio. The old site mixed fixed sizes that did not
	 * relate to one another; this keeps every step proportional and stops
	 * headings colliding with body copy at middling widths.
	 */
	--fs-body: clamp(15px, 0.28vw + 14.1px, 16.5px);
	--fs-small: clamp(13px, 0.18vw + 12.4px, 14px);
	--fs-h1: clamp(28px, 1.7vw + 21.6px, 42px);
	--fs-h2: clamp(23px, 1.1vw + 18.8px, 32px);
	--fs-h3: clamp(19px, 0.7vw + 16.3px, 25px);
	--fs-h4: clamp(17px, 0.4vw + 15.5px, 20px);
	--fs-h5: clamp(16px, 0.25vw + 15px, 18px);
	--fs-h6: clamp(15px, 0.15vw + 14.4px, 16px);

	--lh-body: 1.6;
	--lh-heading: 1.25;

	/*
	 * Layout.
	 *
	 * One container width for everything. The header and footer previously ran
	 * at 1500px while heroes and content were capped at 1120px, so every page
	 * body sat ~180px further in than the logo above it — a visible step and a
	 * lot of dead margin on wide screens.
	 *
	 * Prose keeps a readable measure through `--measure` instead, applied only
	 * where text runs full width with no sidebar beside it.
	 */
	--container: 1500px;
	--container-wide: 1500px;
	--measure: 78ch;
	--gutter: 20px;
	--section-y: 75px;
	--radius: 3px;

	--header-h: 96px;
	/* Only the rail's handle sits over the page; the rest is tucked away. */
	--rail-width: 16px;

	--shadow-card: 0 2px 10px rgba(0, 0, 0, .08);
	--shadow-card-hover: 0 8px 24px rgba(0, 0, 0, .14);
	--transition: .25s ease;
}

/* -------------------------------------------------------------------------
   Reset / base
   ---------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--acepis-white);
	color: var(--acepis-text);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	font-weight: 400;
	line-height: var(--lh-body);
	overflow-x: hidden;
}

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

a {
	color: var(--acepis-green);
	text-decoration: none;
	transition: color var(--transition);
}

a:hover,
a:focus { color: var(--acepis-orange); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	line-height: var(--lh-heading);
	color: var(--acepis-dark);
	margin: 0 0 .6em;
}

h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 700; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 600; }
h5 { font-size: var(--fs-h5); font-weight: 600; }
h6 { font-size: var(--fs-h6); font-weight: 600; }

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

ul, ol { padding-left: 1.3em; }

blockquote {
	margin: 1.5em 0;
	padding: .2em 0 .2em 1.2em;
	border-left: 3px solid var(--acepis-green);
	color: var(--acepis-muted);
	font-style: italic;
}

code, pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: var(--acepis-surface);
	border-radius: var(--radius);
}

code { padding: .15em .4em; font-size: .9em; }
pre { padding: 1em; overflow-x: auto; }

hr { border: 0; border-top: 1px solid var(--acepis-border); margin: 2em 0; }

table { border-collapse: collapse; width: 100%; margin-bottom: 1.5em; }
th, td { border: 1px solid var(--acepis-border); padding: .6em .8em; text-align: left; }
th { background: var(--acepis-surface); font-weight: 600; }

:focus-visible {
	outline: 2px solid var(--acepis-orange);
	outline-offset: 2px;
}

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

.skip-link {
	position: absolute;
	top: -100px;
	left: 10px;
	z-index: 9999;
	background: var(--acepis-dark);
	color: var(--acepis-white);
	padding: 10px 16px;
	border-radius: var(--radius);
}

.skip-link:focus { top: 10px; color: var(--acepis-white); }

/* -------------------------------------------------------------------------
   Layout helpers
   ---------------------------------------------------------------------- */

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

.container--wide { max-width: var(--container-wide); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) / 2); }
.section--surface { background: var(--acepis-surface); }
.section--dark { background: var(--acepis-dark); color: rgba(255, 255, 255, .85); }
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--acepis-white); }

/* -------------------------------------------------------------------------
   Brand accent rule
   A short green-to-orange bar that marks every major heading — section titles,
   page titles and headings inside content — so headings read as one family.
   ---------------------------------------------------------------------- */

.acepis-rule,
.section__title::before,
.page-hero__title::before,
.site-footer__title::before,
.entry-content h2::before,
.entry-content h1::before {
	content: "";
	display: block;
	width: 64px;
	height: 4px;
	margin-bottom: 14px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--acepis-green) 0 55%, var(--acepis-orange) 55% 100%);
}

/* Centred headings get a centred rule. */
.section__head .section__title::before { margin-inline: auto; }

/*
 * Headings that already carry their own underline — sidebar widgets, the
 * contact panels and the hero's separate rule element — are left alone so the
 * mark is not doubled.
 */
.widget__title::before,
.contact-form__title::before,
.contact-details__title::before,
.hero__title::before,
.card__title::before,
.album__title::before,
.leaving__title::before,
.widget-posts__title::before { content: none; }

/* Inside running copy the rule is lighter, so it marks sections without
   shouting over the text. */
.entry-content h2::before,
.entry-content h1::before { width: 48px; height: 3px; margin-bottom: 11px; }

.section__head { margin-bottom: 42px; text-align: center; }
.section__title { margin-bottom: .25em; }

.section__eyebrow {
	display: block;
	color: var(--acepis-orange);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	margin-bottom: .5em;
}

.grid { display: grid; gap: 28px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

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

.btn,
.wp-block-button__link,
input[type="submit"],
button.submit {
	display: inline-block;
	background: var(--acepis-green);
	border: 1px solid var(--acepis-green);
	color: var(--acepis-white);
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .03em;
	padding: 11px 22px;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover,
.btn:focus,
input[type="submit"]:hover {
	background: var(--acepis-orange);
	border-color: var(--acepis-orange);
	color: var(--acepis-white);
}

.btn--ghost {
	background: transparent;
	color: var(--acepis-green);
}

.btn--ghost:hover { background: var(--acepis-green); color: var(--acepis-white); }

/* -------------------------------------------------------------------------
   Forms
   ---------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="password"],
textarea,
select {
	width: 100%;
	font-family: inherit;
	font-size: inherit;
	color: var(--acepis-text);
	background: var(--acepis-white);
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	padding: 10px 12px;
	transition: border-color var(--transition);
}

input:focus,
textarea:focus,
select:focus { border-color: var(--acepis-green); outline: none; }

/* -------------------------------------------------------------------------
   Header
   ---------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: var(--acepis-black);
}

/* Row 1 — logo, contact details, utility links */
.site-header__top { background: var(--acepis-black); }

.site-header__top-inner {
	display: flex;
	align-items: center;
	column-gap: 40px;
	row-gap: 12px;
	min-height: 96px;
}

.site-branding { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-right: auto; }
.site-branding img,
.site-branding .custom-logo { max-height: 70px; width: auto; height: auto; }
.site-branding .custom-logo-link { display: block; line-height: 0; }

.site-branding__text {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 20px;
	color: var(--acepis-white);
}

.site-header__contact {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
}

/* Hairline dividers between the contact items rather than wide gaps. */
.contact-item {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 2px 22px;
	color: rgba(255, 255, 255, .9);
	font-size: 13px;
	line-height: 1.3;
	border-left: 1px solid rgba(255, 255, 255, .13);
}

.contact-item:first-child { border-left: 0; padding-left: 0; }

.contact-item:hover { color: var(--acepis-white); }

.contact-item__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgba(145, 199, 64, .14);
	color: var(--acepis-green);
	font-size: 16px;
	line-height: 1;
	transition: background var(--transition), color var(--transition);
}

.contact-item:hover .contact-item__icon {
	background: var(--acepis-orange);
	color: var(--acepis-white);
}

.contact-item__text { display: flex; flex-direction: column; gap: 1px; }

.contact-item__label {
	color: var(--acepis-orange);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.contact-item__value { font-weight: 500; white-space: nowrap; }

.site-header__links {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding-left: 22px;
	border-left: 1px solid rgba(255, 255, 255, .13);
	text-align: right;
	font-size: 12.5px;
}

.site-header__links a {
	color: rgba(255, 255, 255, .75);
	white-space: nowrap;
	font-weight: 500;
}

.site-header__links a:hover { color: var(--acepis-orange); }

/* Row 2 — navigation and slogan */
.site-header__nav-inner {
	display: flex;
	align-items: center;
	gap: 24px;
}

.main-nav { flex: 1; min-width: 0; }

/*
 * Slogan banner. The angled leading edge (clip-path) echoes the ribbon the old
 * site used — a plain rectangle reads as just another box and loses the point
 * of setting the strapline apart.
 */
.site-slogan {
	position: relative;
	margin: 0;
	padding: 10px 18px 10px 34px;
	flex-shrink: 0;
	max-width: 310px;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: linear-gradient(135deg, #f8942f 0%, var(--acepis-orange) 55%, #e06f12 100%);
	color: var(--acepis-white);
	font-family: var(--font-display);
	font-size: 11.5px;
	line-height: 1.5;
	text-align: right;
	clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%);
	transition: filter var(--transition);
}

.site-slogan:hover { filter: brightness(1.07); }

.site-slogan__line { display: block; }

.site-slogan__line--lead {
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .02em;
	margin-bottom: 1px;
}

/* Thin accent rule under the lead clause. */
.site-slogan__line--lead::after {
	content: "";
	display: block;
	width: 34px;
	height: 2px;
	margin: 4px 0 4px auto;
	background: rgba(255, 255, 255, .55);
	border-radius: 2px;
}

.site-slogan__line:not(.site-slogan__line--lead) { opacity: .95; }

/* Row 2 — primary navigation. The green rule separates it from row 1. */
.site-header__nav-row {
	background: var(--acepis-dark);
	min-height: 60px;
	display: flex;
	align-items: center;
	border-top: 2px solid var(--acepis-green);
	box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .07);
}

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

.main-nav { width: 100%; }

.main-nav__list {
	display: flex;
	align-items: center;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-nav__list li { position: relative; }

.main-nav__list a {
	display: block;
	font-family: var(--font-display);
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .92);
	padding: 12px 14px;
	border-radius: var(--radius);
	white-space: nowrap;
}

.main-nav__list a:hover,
.main-nav__list a:focus { color: var(--acepis-orange); }

.main-nav__list > li.current-menu-item > a,
.main-nav__list > li.current-menu-ancestor > a,
.main-nav__list > li.current_page_item > a { color: var(--acepis-green); }

/*
 * A single underline serves both hover and the active item — the previous
 * active-state rule added a second one, so current pages showed two.
 * The line is a green-to-orange gradient that wipes in from the left.
 */
.main-nav__list > li > a { position: relative; }

.main-nav__list > li > a::before {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 6px;
	height: 2px;
	background: linear-gradient(90deg, var(--acepis-green) 0%, var(--acepis-green) 55%, var(--acepis-orange) 55%, var(--acepis-orange) 100%);
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.main-nav__list > li:hover > a::before,
.main-nav__list > li:focus-within > a::before,
.main-nav__list > li.current-menu-item > a::before,
.main-nav__list > li.current-menu-ancestor > a::before { transform: scaleX(1); }

/* Caret on items that have children (desktop only). */
.main-nav__list > li.menu-item-has-children > a { padding-right: 28px; }

.main-nav__list > li.menu-item-has-children > a::after {
	content: "";
	position: absolute;
	right: 12px;
	top: 50%;
	width: 6px;
	height: 6px;
	margin-top: -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	opacity: .75;
	transition: transform .28s ease, opacity .28s ease;
}

.main-nav__list > li.menu-item-has-children:hover > a::after,
.main-nav__list > li.menu-item-has-children:focus-within > a::after {
	transform: rotate(-135deg);
	margin-top: -1px;
	opacity: 1;
}

/* The toggle button is a touch affordance; the caret covers desktop. */
.main-nav .submenu-toggle { display: none; }

/* Dropdown panel */
.main-nav .sub-menu {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	min-width: 290px;
	background: #211f1d;
	border: 1px solid rgba(255, 255, 255, .1);
	border-top: 2px solid var(--acepis-green);
	border-radius: var(--radius);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
	list-style: none;
	margin: 0;
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px) scale(.985);
	transform-origin: top left;
	transition:
		opacity .22s cubic-bezier(.4, 0, .2, 1),
		transform .22s cubic-bezier(.4, 0, .2, 1),
		visibility .22s;
	z-index: 600;
}

/*
 * Invisible bridge across the 10px gap, so moving the pointer from the parent
 * down into the panel does not close it.
 */
.main-nav .sub-menu::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 0;
	right: 0;
	height: 12px;
}

.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.main-nav .sub-menu li { position: relative; }

.main-nav .sub-menu a {
	position: relative;
	text-transform: none;
	font-size: 13.5px;
	font-weight: 500;
	letter-spacing: 0;
	white-space: normal;
	padding: 10px 14px 10px 16px;
	line-height: 1.4;
	color: rgba(255, 255, 255, .82);
	border-radius: var(--radius);
	transition: color .2s ease, background .2s ease, padding-left .2s ease;
}

/* Accent bar slides in from the left on hover. */
.main-nav .sub-menu a::before {
	content: "";
	position: absolute;
	left: 6px;
	top: 50%;
	width: 3px;
	height: 0;
	background: var(--acepis-orange);
	border-radius: 2px;
	transform: translateY(-50%);
	transition: height .22s ease;
}

.main-nav .sub-menu a:hover,
.main-nav .sub-menu a:focus-visible {
	background: rgba(255, 255, 255, .06);
	color: var(--acepis-white);
	padding-left: 20px;
}

.main-nav .sub-menu a:hover::before,
.main-nav .sub-menu a:focus-visible::before { height: 18px; }

.main-nav .sub-menu .current-menu-item > a { color: var(--acepis-green); }

/* Third level opens to the side. */
.main-nav .sub-menu .sub-menu {
	top: -9px;
	left: calc(100% + 6px);
	transform: translateX(-8px) scale(.985);
	transform-origin: top left;
}

.main-nav .sub-menu li:hover > .sub-menu,
.main-nav .sub-menu li:focus-within > .sub-menu { transform: translateX(0) scale(1); }

.main-nav .sub-menu .sub-menu::before {
	top: 0;
	left: -10px;
	right: auto;
	width: 10px;
	height: 100%;
}

/* Keep the panel on screen for the last items in the bar. */
.main-nav__list > li:nth-last-child(-n+2) > .sub-menu { left: auto; right: 0; transform-origin: top right; }

/* Menu toggle (mobile) */
.menu-toggle {
	display: none;
	background: transparent;
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	padding: 9px 11px;
	cursor: pointer;
	line-height: 0;
}

.menu-toggle__bar {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--acepis-dark);
	border-radius: 2px;
	transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle__bar + .menu-toggle__bar { margin-top: 5px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------------------------------------------------------------
   Hero / slider
   ---------------------------------------------------------------------- */

/* Native hero carousel (replaces Slider Revolution) */
/*
 * The photo slides are 4724x1299 (roughly 3.64:1). Height is set from that
 * ratio so the whole frame is visible — cropping with `cover` cut the edges
 * off the services diagram, and a taller box made that worse, not better.
 */
.hero {
	position: relative;
	background: var(--acepis-black);
	overflow: hidden;
	min-height: 520px;
	height: clamp(520px, 30vw, 600px);
}

.hero__track { position: relative; height: 100%; min-height: 520px; }

.hero__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .7s ease, visibility .7s ease;
}

.hero__slide.is-active { opacity: 1; visibility: visible; z-index: 2; }

/*
 * Photo slides.
 *
 * The artwork is 3.64:1 and shown with `contain` so nothing is cropped, which
 * leaves bands above and below. Rather than flat black, those are filled with
 * the slide's own photo, blown up and blurred — the bands then read as part of
 * the design instead of a gap, and it works at any viewport width.
 */
.hero__slide--photo { background: var(--acepis-black); }

.hero__slide--photo::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--hero-bg);
	background-size: cover;
	background-position: center;
	filter: blur(26px) saturate(1.15) brightness(.55);
	transform: scale(1.12);   /* hides the soft edges the blur creates */
	pointer-events: none;
}

/* Brand wash over the blur, tying the photo slides to the pillars slide. */
.hero__slide--photo::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(760px 420px at 12% -10%, rgba(145, 199, 64, .20), transparent 68%),
		radial-gradient(820px 460px at 92% 110%, rgba(244, 128, 32, .18), transparent 68%);
	pointer-events: none;
}

.hero__photo {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
}

/*
 * Pillars slide.
 *
 * Flat black read as "unfinished". This layers the brand pair over a dark
 * base: two soft colour washes, a fine diagonal weave, and a dot grid — all
 * at low opacity so the icons and labels stay the loudest thing on screen.
 */
.hero__slide--pillars {
	/*
	 * No `position: relative` here — .hero__slide is already absolutely
	 * positioned with inset:0, and overriding that collapsed the slide to its
	 * content height, leaving a black band under the pattern.
	 */
	background:
		/* colour washes, green from the top left, orange from the bottom right */
		radial-gradient(760px 420px at 12% -10%, rgba(145, 199, 64, .22), transparent 68%),
		radial-gradient(820px 460px at 92% 110%, rgba(244, 128, 32, .20), transparent 68%),
		radial-gradient(600px 300px at 65% 15%, rgba(145, 199, 64, .08), transparent 70%),
		/* base */
		linear-gradient(145deg, #15140f 0%, #221f18 45%, #141310 100%);
	padding-block: 48px;
	overflow: hidden;
}

/* Diagonal weave, matching the slogan banner's angle. */
.hero__slide--pillars::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		repeating-linear-gradient(115deg, rgba(145, 199, 64, .07) 0 1px, transparent 1px 38px),
		repeating-linear-gradient(65deg,  rgba(244, 128, 32, .06) 0 1px, transparent 1px 52px);
	pointer-events: none;
}

/* Dot grid, fading out towards the bottom so the dots never fight the text. */
.hero__slide--pillars::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.2px);
	background-size: 26px 26px;
	-webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), transparent 72%);
	mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), transparent 72%);
	pointer-events: none;
}

/* Keep the content above both pattern layers. */
.hero__slide--pillars > .container { position: relative; z-index: 1; }

/* The cards sit on the pattern, so give them a touch of their own surface. */
.hero__slide--pillars .pillars__link {
	background: rgba(0, 0, 0, .28);
	backdrop-filter: blur(2px);
}

.hero__title {
	color: var(--acepis-white);
	text-align: center;
	text-transform: uppercase;
	letter-spacing: .06em;
	margin-bottom: 10px;
}

.hero__rule {
	width: 90px;
	height: 3px;
	margin: 0 auto 36px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--acepis-green) 0 55%, var(--acepis-orange) 55% 100%);
}

.pillars {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 18px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.pillars__item { opacity: 0; transform: translateY(14px); }

/*
 * The end state is declared outright, not left to the animation. Returning to
 * this slide does not reliably restart a CSS animation, which left the pillars
 * invisible the second time round.
 */
.hero__slide--pillars.is-active .pillars__item {
	opacity: 1;
	transform: none;
	animation: acepis-rise .55s cubic-bezier(.4, 0, .2, 1) both;
	animation-delay: calc(var(--i) * .09s);
}

@media (prefers-reduced-motion: reduce) {
	.hero__slide--pillars.is-active .pillars__item { animation: none; }
}

@keyframes acepis-rise {
	to { opacity: 1; transform: translateY(0); }
}

.pillars__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 20px 10px;
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: var(--radius);
	text-align: center;
	height: 100%;
	transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

a.pillars__link:hover,
a.pillars__link:focus-visible {
	border-color: var(--acepis-green);
	background: rgba(145, 199, 64, .08);
	transform: translateY(-4px);
}

.pillars__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .05);
	border: 1px solid rgba(255, 255, 255, .12);
	transition: background var(--transition), border-color var(--transition);
}

a.pillars__link:hover .pillars__icon { background: rgba(145, 199, 64, .16); border-color: var(--acepis-green); }

.pillars__icon img { width: 44px; height: 44px; object-fit: contain; }

.pillars__label {
	color: var(--acepis-white);
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	text-transform: uppercase;
	letter-spacing: .03em;
}

/* Controls */
.hero__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 44px;
	height: 44px;
	background: rgba(0, 0, 0, .4);
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 50%;
	color: var(--acepis-white);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background var(--transition), border-color var(--transition);
}

.hero__nav:hover { background: var(--acepis-orange); border-color: var(--acepis-orange); }
.hero__nav--prev { left: 18px; }

/*
 * The sticky rail is fixed to the right edge, so the next arrow is inset past
 * it rather than sitting underneath.
 */
.hero__nav--next { right: calc(var(--rail-width, 55px) + 18px); }

/* Dots clear the rail too when the viewport is short enough for them to meet. */
.hero__dots { padding-right: var(--rail-width, 55px); }

.hero__dots {
	position: absolute;
	bottom: 16px;
	left: 0;
	right: 0;
	z-index: 5;
	display: flex;
	justify-content: center;
	gap: 9px;
}

.hero__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	background: rgba(255, 255, 255, .35);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background var(--transition), width var(--transition);
}

.hero__dot.is-active { background: var(--acepis-green); width: 26px; }

@media (max-width: 992px) {
	.hero, .hero__track { min-height: 420px; height: auto; }
	.hero { height: clamp(420px, 44vw, 520px); }
	.pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 768px) {
	/* The rail moves to the bottom edge, so the arrows regain the full width. */
	.hero__nav--next { right: 18px; }
	.hero__dots { padding-right: 0; bottom: 64px; }
}

@media (max-width: 600px) {
	.hero, .hero__track { min-height: 360px; }
	.pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pillars__icon { width: 60px; height: 60px; }
	.pillars__icon img { width: 34px; height: 34px; }
	.pillars__label { font-size: 11.5px; }
	.hero__nav { width: 36px; height: 36px; font-size: 19px; }
}

/*
 * The hero sat on the same flat dark as the nav row, so the two merged into one
 * slab. A deeper gradient plus a faint brand motif separates them without
 * needing a per-page image.
 */
.page-hero {
	background:
		radial-gradient(1200px 300px at 18% -40%, rgba(145, 199, 64, .16), transparent 70%),
		radial-gradient(900px 260px at 88% 120%, rgba(244, 128, 32, .14), transparent 70%),
		linear-gradient(160deg, #26251f 0%, #35332c 55%, #1f1e1a 100%);
	color: var(--acepis-white);
	padding-block: 60px;
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid rgba(255, 255, 255, .07);
}

/* Diagonal hairlines, echoing the slogan banner's angle. */
.page-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: repeating-linear-gradient(
		115deg,
		rgba(255, 255, 255, .035) 0 1px,
		transparent 1px 34px
	);
	pointer-events: none;
}

.page-hero--image { background-size: cover; background-position: center; }

.page-hero--image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(43, 42, 39, .62), rgba(43, 42, 39, .82));
}

.page-hero .container { position: relative; }
.page-hero__title { color: var(--acepis-white); margin-bottom: .2em; }
.page-hero__subtitle {
	color: rgba(255, 255, 255, .78);
	max-width: 78ch;
	margin: 0;
	font-size: var(--fs-h6);
	line-height: 1.5;
	/* Keep the strapline to a single idea; long lines wrap at most twice. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Breadcrumbs */
.breadcrumbs { font-size: 13px; color: rgba(255, 255, 255, .7); margin-bottom: 10px; }
.breadcrumbs a { color: rgba(255, 255, 255, .85); }
.breadcrumbs a:hover { color: var(--acepis-orange); }
.breadcrumbs .sep { padding-inline: 7px; opacity: .6; }

/* -------------------------------------------------------------------------
   Entry content
   ---------------------------------------------------------------------- */

.entry-content > *:first-child { margin-top: 0; }

.entry-content img { border-radius: var(--radius); }

.entry-content h2,
.entry-content h3,
.entry-content h4 { margin-top: 1.6em; }

/*
 * Article images were inserted at small crops against a narrow column. They
 * are now upgraded server-side; these rules stop the old float classes from
 * squeezing them back down.
 */
.entry-content img { height: auto; }

.entry-content .alignleft,
.entry-content .alignright,
.entry-content .alignnone,
.entry-content .aligncenter {
	float: none;
	display: block;
	margin-inline: auto;
	max-width: 100%;
}

.entry-content > img,
.entry-content p > img { width: 100%; }

/* Figures and captions */
.entry-content figure,
.entry-content .wp-caption {
	width: auto !important;   /* overrides the editor's inline pixel width */
	max-width: 100%;
	margin: 34px 0;
	position: relative;
}

.entry-content figure img,
.entry-content .wp-caption img {
	width: 100%;
	border-radius: var(--radius);
	display: block;
}

.entry-content figcaption,
.entry-content .wp-caption-text {
	position: relative;
	margin: 0;
	padding: 12px 16px 12px 18px;
	background: var(--acepis-surface);
	border-left: 3px solid var(--acepis-orange);
	border-radius: 0 var(--radius) var(--radius) 0;
	font-family: var(--font-display);
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--acepis-muted);
}

/* Small accent rule above the caption, picking up the brand pair. */
.entry-content figure::after,
.entry-content .wp-caption::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 0;
}

.entry-content figcaption a,
.entry-content .wp-caption-text a { color: var(--acepis-green); }

/* Pull-quote style images sitting beside text on wide screens only. */
@media (min-width: 992px) {
	.entry-content .alignleft.is-small { float: left; margin: 6px 28px 18px 0; max-width: 42%; }
	.entry-content .alignright.is-small { float: right; margin: 6px 0 18px 28px; max-width: 42%; }
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 13px;
	color: var(--acepis-muted);
	margin-bottom: 20px;
}

.entry-meta a { color: var(--acepis-muted); }
.entry-meta a:hover { color: var(--acepis-green); }

.entry-thumb { margin-bottom: 28px; }
.entry-thumb img { width: 100%; border-radius: var(--radius); }

/*
 * Layout with sidebar.
 *
 * `align-items: start` matters: without it the grid stretches each column to
 * the row height, which leaves a sticky sidebar nothing to travel within, so
 * it never actually sticks.
 */
.content-area {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.has-sidebar .content-area { grid-template-columns: minmax(0, 1fr) 320px; }

/* Page layout with the contextual section sidebar */
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
.page-layout--aside { grid-template-columns: minmax(0, 1fr) 290px; align-items: start; }

/*
 * The container is now full width so nothing is inset from the header, but a
 * single column of prose at that width runs past 130 characters a line. Cap
 * the running text only — headings, figures, grids, tables and embeds still
 * use the whole column.
 */
.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote,
.entry-content .oxy-bridge__block > p,
.entry-content .oxy-bridge__block > ul,
.entry-content .oxy-bridge__block > ol,
.page-hero__subtitle { max-width: var(--measure); }

/* The homepage intro is a deliberate two-column block; it sets its own width. */
.home .entry-content .oxy-bridge__columns p { max-width: none; }

.page-aside__list { list-style: none; margin: 0; padding: 0; }

.page-aside__list li { border-bottom: 1px solid var(--acepis-border); }
.page-aside__list li:last-child { border-bottom: 0; }

.page-aside__list a {
	display: block;
	padding: 11px 14px 11px 0;
	color: var(--acepis-dark);
	font-size: 14.5px;
	line-height: 1.4;
	border-left: 2px solid transparent;
	padding-left: 12px;
	transition: border-color var(--transition), color var(--transition), padding-left var(--transition);
}

.page-aside__list a:hover {
	border-left-color: var(--acepis-orange);
	color: var(--acepis-green);
	padding-left: 16px;
}

.page-aside__list a.is-current {
	border-left-color: var(--acepis-green);
	color: var(--acepis-green);
	font-weight: 600;
}

@media (max-width: 992px) {
	.page-layout--aside { grid-template-columns: minmax(0, 1fr); gap: 34px; }
	.page-aside { position: static; }
}

/* -------------------------------------------------------------------------
   Cards
   ---------------------------------------------------------------------- */

.card {
	display: flex;
	flex-direction: column;
	background: var(--acepis-white);
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	overflow: hidden;
	height: 100%;
	transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }

.card__media { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--acepis-surface); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.04); }

/* Placeholder for entries with no image */
.card__media--empty { background: linear-gradient(135deg, #2b2a27 0%, #3a3833 100%); }

.card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.card__placeholder-mark {
	font-family: var(--font-display);
	font-size: 40px;
	font-weight: 700;
	line-height: 1;
	color: var(--acepis-green);
}

.card__placeholder-label {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .5);
}

.card__body { display: flex; flex-direction: column; gap: 9px; padding: 18px; flex: 1; }

/*
 * Titles and excerpts vary a lot in length. Clamping both to a fixed number of
 * lines keeps every card in a row the same shape, so the "Read More" buttons
 * line up instead of drifting.
 */
.card__title {
	font-size: 17px;
	font-weight: 600;
	margin: 0;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: calc(3 * 1.35em);
}

.card__title a { color: var(--acepis-dark); }
.card__title a:hover { color: var(--acepis-green); }

.card__meta { font-size: 12px; color: var(--acepis-muted); }

.card__excerpt {
	font-size: 14px;
	color: var(--acepis-muted);
	margin: 0;
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: calc(4 * 1.55em);
}

.card__footer { margin-top: auto; padding-top: 10px; }

/* Team cards carry a short role, not a 3-line headline. */
.card--team .card__title { -webkit-line-clamp: 2; min-height: calc(2 * 1.35em); }
.card--team .card__excerpt { -webkit-line-clamp: 3; min-height: calc(3 * 1.55em); }

.card--team .card__media { aspect-ratio: 1 / 1; border-radius: 50%; width: 160px; margin: 18px auto 0; }
.card--team { text-align: center; }

/* Pillars (What we do) */
.pillar { text-align: center; padding: 26px 18px; }
.pillar__icon { width: 72px; height: 72px; margin: 0 auto 16px; object-fit: contain; }
.pillar__title { font-size: 16px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4em; }
.pillar__text { font-size: 14px; color: var(--acepis-muted); }

/* -------------------------------------------------------------------------
   Sidebar / widgets
   ---------------------------------------------------------------------- */

.widget { margin-bottom: 32px; }

.widget__title {
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--acepis-green);
	margin-bottom: 16px;
}

.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--acepis-border); font-size: 14px; }
.widget li:last-child { border-bottom: 0; }

/* Latest-articles list */
.widget-posts__item { display: flex; gap: 12px; padding: 12px 0; align-items: flex-start; }

.widget-posts__media {
	flex: 0 0 72px;
	width: 72px;
	height: 56px;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--acepis-surface);
}

.widget-posts__media img { width: 100%; height: 100%; object-fit: cover; }

.widget-posts__title {
	display: block;
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--acepis-dark);
}

.widget-posts__title:hover { color: var(--acepis-green); }

.widget-posts__date { display: block; margin-top: 4px; font-size: 12px; color: var(--acepis-muted); }

/* Topic chips */
.topic-cloud { display: flex; flex-wrap: wrap; gap: 7px; }

.topic-cloud__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 1px solid var(--acepis-border);
	border-radius: 999px;
	font-size: 13px;
	color: var(--acepis-dark);
	transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.topic-cloud__item span { font-size: 11px; font-weight: 600; color: var(--acepis-muted); }

.topic-cloud__item:hover {
	background: var(--acepis-green);
	border-color: var(--acepis-green);
	color: var(--acepis-white);
}

.topic-cloud__item:hover span { color: rgba(255, 255, 255, .85); }

/*
 * Sticky sidebars. `top` clears the sticky header (96px top row + 60px nav),
 * and max-height plus scrolling keeps a sidebar taller than the viewport
 * usable rather than pinning only its first screenful.
 */
.sidebar,
.page-aside {
	position: sticky;
	top: 168px;
	align-self: start;
	max-height: calc(100vh - 188px);
	overflow-y: auto;
	scrollbar-width: thin;
}

/* Hide the scrollbar until the pointer is over the sidebar. */
.sidebar::-webkit-scrollbar,
.page-aside::-webkit-scrollbar { width: 6px; }

.sidebar::-webkit-scrollbar-thumb,
.page-aside::-webkit-scrollbar-thumb { background: var(--acepis-border); border-radius: 3px; }

@media (max-width: 992px) {
	.sidebar,
	.page-aside {
		position: static;
		max-height: none;
		overflow: visible;
	}
}

/* -------------------------------------------------------------------------
   Pagination
   ---------------------------------------------------------------------- */

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 48px; flex-wrap: wrap; }

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	color: var(--acepis-dark);
	font-size: 14px;
}

.pagination .page-numbers:hover { border-color: var(--acepis-green); color: var(--acepis-green); }
.pagination .page-numbers.current { background: var(--acepis-green); border-color: var(--acepis-green); color: var(--acepis-white); }

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

.site-footer { background: var(--acepis-black); color: rgba(255, 255, 255, .72); padding-top: 50px; font-size: 14px; }

.site-footer__lead {
	color: rgba(255, 255, 255, .82);
	font-size: 15px;
	line-height: 1.6;
	max-width: 46ch;
}

.site-footer a { color: rgba(255, 255, 255, .72); }
.site-footer a:hover { color: var(--acepis-orange); }

.site-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: 36px;
	padding-bottom: 44px;
}

.site-footer__title {
	color: var(--acepis-white);
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: .06em;
	margin-bottom: 16px;
}

/* Slightly shorter rule here, to suit the smaller column headings. */
.site-footer__title::before { width: 46px; height: 3px; margin-bottom: 11px; }

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 5px 0; }

/* Strapline, centred above the contact row. */
.site-footer__tagline {
	margin: 0;
	padding: 24px 0 2px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	color: rgba(255, 255, 255, .6);
	font-family: var(--font-display);
	font-style: italic;
	font-size: 14px;
	text-align: center;
}

/* The strapline already provides the divider above the contact row. */
.site-footer__tagline + .site-footer__connect { border-top: 0; padding-top: 14px; }

.site-footer__logo { max-height: 72px; margin-bottom: 14px; }

.site-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, .12);
	padding-block: 18px;
	display: flex;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 13px;
	text-align: center;
	color: rgba(255, 255, 255, .55);
}

/*
 * Contact details and social icons on one centred row, between the link
 * columns and the copyright line.
 */
/* Three stacked rows: strapline, contact details, social icons. */
.site-footer__connect {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding: 18px 0 24px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	text-align: center;
}

.footer-contact {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-contact li {
	padding: 2px 20px;
	border-left: 1px solid rgba(255, 255, 255, .16);
	font-size: var(--fs-small);
	line-height: 1.4;
}

.footer-contact li:first-child { border-left: 0; }

.footer-contact a { color: rgba(255, 255, 255, .82); }
.footer-contact a:hover { color: var(--acepis-orange); }

.social-links { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }

/*
 * Icons carry their own brand colour at rest, and glow in that colour on hover,
 * rather than all turning the same orange.
 */
.social-links a {
	--brand: var(--acepis-green);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 50%;
	color: var(--brand);
	transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.social-links a:hover,
.social-links a:focus-visible {
	background: var(--brand);
	border-color: var(--brand);
	color: var(--acepis-white);
	transform: translateY(-3px);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 28%, transparent),
	            0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent);
}

.social-links .social--facebook  a { --brand: #1877f2; }
.social-links .social--twitter   a { --brand: #ffffff; }
.social-links .social--linkedin  a { --brand: #0a66c2; }
.social-links .social--youtube   a { --brand: #ff0000; }
.social-links .social--instagram a { --brand: #e1306c; }

/* X's mark is white; invert the text colour so it stays readable when filled. */
.social-links .social--twitter a:hover,
.social-links .social--twitter a:focus-visible { color: #000; }

.social-links svg { display: block; }

/* On the dark contact panel the icons sit on the same dark surface. */
.social-links--dark { justify-content: flex-start; }

/* -------------------------------------------------------------------------
   Filter bar (publications by genre)
   ---------------------------------------------------------------------- */

.filter-bar-wrap { padding-bottom: 0; }

.filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-bottom: 26px;
	border-bottom: 1px solid var(--acepis-border);
}

.filter-bar__item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 15px;
	border: 1px solid var(--acepis-border);
	border-radius: 999px;
	color: var(--acepis-dark);
	font-size: 13.5px;
	font-weight: 500;
	transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.filter-bar__item:hover { border-color: var(--acepis-green); color: var(--acepis-green); }

.filter-bar__item.is-active {
	background: var(--acepis-green);
	border-color: var(--acepis-green);
	color: var(--acepis-white);
}

.filter-bar__count {
	font-size: 11px;
	font-weight: 600;
	opacity: .65;
}

.filter-bar__item.is-active .filter-bar__count { opacity: .85; }

/* -------------------------------------------------------------------------
   Fact strip (publication details above the body copy)
   ---------------------------------------------------------------------- */

.fact-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0 0 26px;
	padding: 16px 0;
	border-top: 2px solid var(--acepis-green);
	border-bottom: 1px solid var(--acepis-border);
}

.fact-strip__item { padding: 0 22px; border-left: 1px solid var(--acepis-border); }
.fact-strip__item:first-child { border-left: 0; padding-left: 0; }

.fact-strip dt {
	color: var(--acepis-orange);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	margin-bottom: 3px;
}

.fact-strip dd { margin: 0; font-size: 14.5px; font-weight: 500; color: var(--acepis-dark); }

@media (max-width: 480px) {
	.fact-strip__item { padding: 6px 0; border-left: 0; width: 100%; }
}

/* -------------------------------------------------------------------------
   Contact page
   ---------------------------------------------------------------------- */

.contact-layout {
	display: grid;
	grid-template-columns: 350px minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.contact-details {
	background: var(--acepis-dark);
	color: rgba(255, 255, 255, .85);
	border-radius: var(--radius);
	padding: 30px 28px;
}

.contact-details__title {
	color: var(--acepis-white);
	font-size: 19px;
	margin-bottom: 22px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--acepis-green);
}

.contact-list { list-style: none; margin: 0; padding: 0; }

.contact-list li {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 11px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
	font-size: 14px;
	line-height: 1.5;
}

.contact-list li:last-child { border-bottom: 0; }

.contact-list__label {
	color: var(--acepis-orange);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.contact-list a { color: var(--acepis-white); }
.contact-list a:hover { color: var(--acepis-orange); }

.social-links--dark { margin-top: 22px; }

.contact-form__title {
	font-size: 19px;
	margin-bottom: 22px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--acepis-green);
}

/* Normalise the form plugin's markup so fields line up with the theme. */
.contact-form .wpforms-container { margin: 0; }

.contact-form .wpforms-field { padding: 0 0 18px; }

.contact-form .wpforms-field-label {
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 600;
	color: var(--acepis-dark);
	margin-bottom: 6px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form input[type="url"],
.contact-form textarea,
.contact-form select {
	max-width: 100%;
	font-size: 15px;
	padding: 11px 13px;
}

.contact-form textarea { min-height: 160px; resize: vertical; }

.contact-form .wpforms-submit {
	background: var(--acepis-green);
	border: 1px solid var(--acepis-green);
	color: var(--acepis-white);
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: .03em;
	padding: 12px 26px;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background var(--transition), border-color var(--transition);
}

.contact-form .wpforms-submit:hover { background: var(--acepis-orange); border-color: var(--acepis-orange); }

.contact-map { line-height: 0; }

.contact-map iframe {
	display: block;
	width: 100%;
	height: 420px;
	border: 0;
	filter: grayscale(.25);
}

@media (max-width: 992px) {
	.contact-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.contact-map iframe { height: 320px; }
}

/* -------------------------------------------------------------------------
   Gallery
   Replaces the Maika Gallery plugin's album view.
   ---------------------------------------------------------------------- */

.gallery__count {
	color: var(--acepis-muted);
	font-size: 14px;
	margin-bottom: 26px;
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 26px;
}

.album__trigger {
	display: block;
	width: 100%;
	padding: 0;
	background: var(--acepis-white);
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	overflow: hidden;
	text-align: left;
	cursor: pointer;
	transition: box-shadow var(--transition), transform var(--transition);
}

.album__trigger:hover,
.album__trigger:focus-visible {
	box-shadow: var(--shadow-card-hover);
	transform: translateY(-3px);
}

.album__media {
	position: relative;
	display: block;
	aspect-ratio: 375 / 275; /* matches the old Maika album ratio */
	background: var(--acepis-surface);
	overflow: hidden;
}

.album__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .45s ease;
}

.album__trigger:hover .album__media img { transform: scale(1.05); }

.album__count {
	position: absolute;
	right: 10px;
	bottom: 10px;
	background: rgba(0, 0, 0, .72);
	color: var(--acepis-white);
	font-size: 12px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
}

.album__body { display: block; padding: 15px 16px 18px; }

.album__title {
	display: block;
	font-family: var(--font-display);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--acepis-dark);
}

.album__caption {
	display: block;
	margin-top: 5px;
	font-size: 13px;
	color: var(--acepis-muted);
}

/* Lightbox */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 60px 16px 40px;
	background: rgba(12, 12, 12, .94);
}

.lightbox[hidden] { display: none; }

.lightbox__bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	color: rgba(255, 255, 255, .9);
	font-size: 14px;
}

.lightbox__title {
	flex: 1;
	font-family: var(--font-display);
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lightbox__counter { color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }

.lightbox__close {
	background: transparent;
	border: 0;
	color: var(--acepis-white);
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.lightbox__close:hover { color: var(--acepis-orange); }

.lightbox__figure {
	margin: 0;
	max-width: min(1200px, 100%);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.lightbox__image {
	max-width: 100%;
	max-height: calc(100vh - 150px);
	object-fit: contain;
	border-radius: var(--radius);
}

.lightbox__caption {
	color: rgba(255, 255, 255, .7);
	font-size: 13px;
	text-align: center;
	max-width: 70ch;
}

.lightbox__nav {
	flex-shrink: 0;
	width: 46px;
	height: 46px;
	background: rgba(255, 255, 255, .1);
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 50%;
	color: var(--acepis-white);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background var(--transition);
}

.lightbox__nav:hover { background: var(--acepis-orange); border-color: var(--acepis-orange); }

@media (max-width: 992px) {
	.gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}

@media (max-width: 768px) {
	.lightbox { padding: 54px 8px 30px; gap: 4px; }
	.lightbox__nav { width: 38px; height: 38px; font-size: 21px; }
	.lightbox__image { max-height: calc(100vh - 130px); }
}

@media (max-width: 480px) {
	.gallery-grid { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------------------------
   Homepage intro ("Welcome to ACEPIS")
   The converted Oxygen markup is a bare two-column block; these rules give it
   a proper editorial layout instead of a heading floating beside a paragraph.
   ---------------------------------------------------------------------- */

/*
 * The intro: photograph on the left, heading and copy stacked on the right.
 * The converted Oxygen markup is its own two-column grid, so it is flattened
 * to a single column and the outer grid does the layout instead.
 */
.intro__grid {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: 56px;
	align-items: center;
}

.intro__grid--text-only { grid-template-columns: minmax(0, 1fr); }

.intro__media {
	position: relative;
	margin: 0;
	border-radius: var(--radius);
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--acepis-surface);
}

.intro__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Brand corner accent, so the image reads as designed rather than dropped in. */
.intro__media::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 96px;
	height: 6px;
	background: linear-gradient(90deg, var(--acepis-green) 0 55%, var(--acepis-orange) 55% 100%);
}

.intro__body .entry-content > * { margin-left: 0; }

.home .entry-content .oxy-bridge__columns {
	grid-template-columns: minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.home .entry-content .oxy-bridge__headline {
	position: relative;
	margin: 0;
	padding-top: 18px;
	font-size: var(--fs-h2);
	line-height: 1.15;
}

/* Brand rule above the heading. */
.home .entry-content .oxy-bridge__headline::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 64px;
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--acepis-green) 0 55%, var(--acepis-orange) 55% 100%);
}

.home .entry-content .oxy-bridge__columns p {
	font-size: clamp(16px, .4vw + 15px, 18px);
	line-height: 1.75;
	color: var(--acepis-text);
}

.home .entry-content .oxy-bridge__columns p:first-letter {
	/* A restrained lead-in rather than a full drop cap. */
	font-weight: 600;
}

.intro-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

@media (max-width: 860px) {
	.intro__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.intro__media { aspect-ratio: 16 / 9; }
	.home .entry-content .oxy-bridge__headline { padding-top: 16px; }
}

/* -------------------------------------------------------------------------
   Leaving-site interstitial
   ---------------------------------------------------------------------- */

.leaving {
	position: fixed;
	inset: 0;
	z-index: 9500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(12, 12, 12, .72);
	backdrop-filter: blur(3px);
}

.leaving[hidden] { display: none; }

.leaving__box {
	position: relative;
	width: 100%;
	max-width: 460px;
	background: var(--acepis-white);
	border-radius: var(--radius);
	border-top: 4px solid var(--acepis-orange);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
	padding: 30px 28px 26px;
	text-align: center;
}

.leaving__close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: 0;
	font-size: 24px;
	line-height: 1;
	color: var(--acepis-muted);
	cursor: pointer;
}

.leaving__close:hover { color: var(--acepis-orange); }

.leaving__title { font-size: var(--fs-h4); margin-bottom: 10px; }

.leaving__lead { color: var(--acepis-muted); font-size: 14.5px; margin-bottom: 14px; }

.leaving__dest {
	background: var(--acepis-surface);
	border-radius: var(--radius);
	padding: 12px 14px;
	margin-bottom: 22px;
	word-break: break-all;
}

.leaving__host {
	display: block;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 15px;
	color: var(--acepis-dark);
	margin-bottom: 3px;
}

.leaving__url { display: block; font-size: 12px; color: var(--acepis-muted); }

.leaving__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Where we work map
   ---------------------------------------------------------------------- */

.world-map {
	width: 100%;
	height: 540px;
	background: var(--acepis-surface);
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	overflow: hidden;
}

.country-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
	gap: 8px 20px;
	list-style: none;
	margin: 28px 0 0;
	padding: 0;
}

.country-list li {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 14.5px;
	color: var(--acepis-text);
}

.country-list__dot {
	width: 9px;
	height: 9px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--acepis-green);
}

@media (max-width: 768px) {
	.world-map { height: 380px; }
}

/* -------------------------------------------------------------------------
   Sticky side rail (translate + social)
   ---------------------------------------------------------------------- */

/*
 * The rail stays tucked off the right edge, leaving only a slim handle, and
 * slides out on hover, keyboard focus or a tap. Parked permanently over the
 * page it covered content and fought everything beside it.
 */
.sticky-rail {
	position: fixed;
	top: 50%;
	right: 0;
	z-index: 800;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px 8px;
	background: rgba(43, 42, 39, .92);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, .12);
	border-right: 0;
	border-radius: var(--radius) 0 0 var(--radius);
	box-shadow: -4px 0 18px rgba(0, 0, 0, .25);

	/* Hidden but for the handle. */
	transform: translate(calc(100% - 14px), -50%);
	transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}

.sticky-rail:hover,
.sticky-rail:focus-within,
.sticky-rail.is-open { transform: translate(0, -50%); }

/* Slim grab handle on the left edge of the rail. */
.sticky-rail__handle {
	position: absolute;
	top: 50%;
	left: -14px;
	transform: translateY(-50%);
	width: 14px;
	height: 56px;
	padding: 0;
	background: var(--acepis-orange);
	border: 0;
	border-radius: var(--radius) 0 0 var(--radius);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--transition);
}

.sticky-rail__handle:hover { background: var(--acepis-green); }

/* Three dots, drawn with a repeating gradient. */
.sticky-rail__handle-dots {
	width: 3px;
	height: 18px;
	background-image: radial-gradient(circle, rgba(255, 255, 255, .95) 1.2px, transparent 1.4px);
	background-size: 3px 6px;
	background-repeat: repeat-y;
}

/* While tucked away, the buttons must not be reachable by stray clicks. */
.sticky-rail:not(:hover):not(:focus-within):not(.is-open) .sticky-rail__btn { pointer-events: none; }

.sticky-rail__social { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .14); }

.sticky-rail__btn {
	--brand: var(--acepis-green);
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 50%;
	color: var(--brand);
	cursor: pointer;
	transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.sticky-rail__btn:hover,
.sticky-rail__btn:focus-visible {
	background: var(--brand);
	border-color: var(--brand);
	color: var(--acepis-white);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 26%, transparent);
}

.sticky-rail .social--twitter  { --brand: #ffffff; }
.sticky-rail .social--facebook { --brand: #1877f2; }
.sticky-rail .social--linkedin { --brand: #0a66c2; }
.sticky-rail .social--twitter:hover { color: #000; }

/* Label that slides out on hover */
.sticky-rail__tip {
	position: absolute;
	right: calc(100% + 10px);
	white-space: nowrap;
	background: var(--acepis-dark);
	color: var(--acepis-white);
	font-size: 12px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: var(--radius);
	opacity: 0;
	visibility: hidden;
	transform: translateX(6px);
	transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
	pointer-events: none;
}

.sticky-rail__btn:hover .sticky-rail__tip,
.sticky-rail__btn:focus-visible .sticky-rail__tip {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

/* Compact: the panel holds a short row of flags, not a form. */
.sticky-rail__panel {
	position: absolute;
	right: calc(100% + 10px);
	top: 0;
	width: max-content;
	min-width: 150px;
	max-width: 230px;
	padding: 9px 10px 8px;
	background: var(--acepis-white);
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
	color: var(--acepis-text);
}

.sticky-rail__panel[hidden] { display: none; }

.sticky-rail__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-family: var(--font-display);
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--acepis-muted);
	margin-bottom: 7px;
}

.sticky-rail__close {
	background: none;
	border: 0;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	color: var(--acepis-muted);
	padding: 0;
}

.sticky-rail__close:hover { color: var(--acepis-orange); }

.sticky-rail__note { margin: 7px 0 0; font-size: 9.5px; line-height: 1.3; color: var(--acepis-muted); }

/*
 * Google's widget brings its own chrome. Style the <select> it renders and
 * hide only the branding line — hiding every span (as this previously did)
 * blanked the control and made it look broken.
 */
.sticky-rail__panel .goog-te-combo {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-size: 14px;
	color: var(--acepis-text);
	background: var(--acepis-white);
}

/* The gadget wrapper carries Google's branding text; collapse it but keep it
   laid out, or the <select> inside ends up zero-width. */
.sticky-rail__panel .goog-te-gadget {
	display: block;
	width: 100%;
	font-size: 0;
	line-height: 0;
	color: transparent;
}

.sticky-rail__panel .goog-te-gadget > span { display: none; }
.sticky-rail__panel .goog-logo-link { display: none !important; }

/* Restore a real size on the control itself. */
.sticky-rail__panel .goog-te-combo {
	display: block;
	font-size: 14px !important;
	line-height: 1.4 !important;
	margin: 0 !important;
}

/*
 * GTranslate, set to the "flags" look: a wrapping row of small flag links.
 * Keep it tight — this sits in a narrow panel, not a page column.
 */
.acepis-gt .gtranslate_wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	align-items: center;
	max-width: 200px;
}

.acepis-gt a {
	display: inline-flex;
	line-height: 0;
	border-radius: 2px;
	opacity: .85;
	transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}

.acepis-gt a:hover,
.acepis-gt a:focus-visible {
	opacity: 1;
	transform: translateY(-1px);
	box-shadow: 0 0 0 2px var(--acepis-green);
}

.acepis-gt img { display: block; width: 16px; height: auto; }

/* Any other look the plugin may be set to still has to stay inside the panel. */
.acepis-gt select {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid var(--acepis-border);
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-size: 13px;
	color: var(--acepis-text);
	background: var(--acepis-white);
}

.acepis-gt .gt_float_switcher { position: static !important; box-shadow: none !important; font-size: 12px; }

body > .skiptranslate { display: none !important; }
body { top: 0 !important; }

@media (max-width: 768px) {
	/* On a phone the rail docks to the bottom edge and tucks downward. */
	.sticky-rail {
		top: auto;
		bottom: 0;
		right: 0;
		left: 0;
		flex-direction: row;
		justify-content: center;
		border-radius: 0;
		border-right: 1px solid rgba(255, 255, 255, .12);
		border-bottom: 0;
		transform: translateY(calc(100% - 14px));
	}

	.sticky-rail:hover,
	.sticky-rail:focus-within,
	.sticky-rail.is-open { transform: translateY(0); }

	.sticky-rail__handle {
		top: -14px;
		left: 50%;
		transform: translateX(-50%);
		width: 56px;
		height: 14px;
		border-radius: var(--radius) var(--radius) 0 0;
	}

	.sticky-rail__handle-dots { width: 18px; height: 3px; background-size: 6px 3px; background-repeat: repeat-x; }

	.sticky-rail__social { flex-direction: row; padding-top: 0; padding-left: 8px; border-top: 0; border-left: 1px solid rgba(255, 255, 255, .14); }
	.sticky-rail__tip { display: none; }
	.sticky-rail__panel { right: 10px; left: 10px; width: auto; max-width: none; top: auto; bottom: calc(100% + 12px); }
}

/* -------------------------------------------------------------------------
   Oxygen bridge output
   Content converted from the legacy Oxygen shortcode tree keeps a light
   structural wrapper so converted pages read correctly before each page is
   rebuilt by hand.
   ---------------------------------------------------------------------- */

.oxy-bridge__section + .oxy-bridge__section { margin-top: 48px; }

.oxy-bridge__columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 32px;
	align-items: start;
}

.oxy-bridge__block > *:last-child { margin-bottom: 0; }

.oxy-bridge img { border-radius: var(--radius); }

/* Legacy WPBakery wrappers that survive inside converted rich text */
.oxy-bridge .wpb_text_column + .wpb_text_column { margin-top: 1.2em; }

/* -------------------------------------------------------------------------
   Responsive
   Breakpoints match the Oxygen settings: 992 / 768 / 480
   ---------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.main-nav__list a { padding: 12px 9px; font-size: 13px; }
}

@media (max-width: 992px) {
	:root { --section-y: 56px; --fs-h1: 30px; --fs-h2: 26px; --fs-h3: 21px; }

	.menu-toggle { display: block; order: 3; }
	.menu-toggle__bar { background: var(--acepis-white); }

	.site-header__top-inner { flex-wrap: wrap; gap: 14px; min-height: 72px; }
	.site-header__contact { order: 4; width: 100%; gap: 18px; margin-left: 0; }
	.site-header__links { order: 2; flex-direction: row; gap: 14px; margin-left: auto; }

	/* The nav row collapses into a drawer opened by the toggle. */
	.site-header__nav-row { min-height: 0; padding: 0; display: block; }

	.main-nav {
		display: none;
		max-height: calc(100vh - 150px);
		overflow-y: auto;
	}

	.main-nav.is-open { display: block; }

	.main-nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0; }

	.main-nav__list > li { border-bottom: 1px solid rgba(255, 255, 255, .12); }
	.main-nav__list > li:last-child { border-bottom: 0; }

	.main-nav__list a { padding: 13px 4px; font-size: 14px; }

	.main-nav .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: transparent;
		border: 0;
		box-shadow: none;
		padding: 0 0 8px 16px;
		display: none;
		min-width: 0;
	}

	.main-nav .sub-menu a { color: rgba(255, 255, 255, .8); }
	.main-nav .sub-menu a:hover { background: transparent; color: var(--acepis-orange); }

	.main-nav li.is-open > .sub-menu { display: block; }

	/* Touch devices use the toggle button instead of hover + caret. */
	.main-nav .submenu-toggle {
		display: block;
		position: absolute;
		top: 3px;
		right: 0;
		width: 44px;
		height: 44px;
		background: transparent;
		border: 0;
		cursor: pointer;
		font-size: 17px;
		color: var(--acepis-white);
		line-height: 1;
		transition: transform .25s ease;
	}

	.main-nav__list > li > a::before,
	.main-nav__list > li.menu-item-has-children > a::after { display: none; }

	.main-nav__list > li.menu-item-has-children > a { padding-right: 46px; }

	.main-nav .sub-menu::before,
	.main-nav .sub-menu a::before { display: none; }

	.main-nav .sub-menu a { padding: 10px 4px; }
	.main-nav .sub-menu a:hover { padding-left: 4px; }

	.submenu-toggle[aria-expanded="true"] { transform: rotate(180deg); }

	.has-sidebar .content-area { grid-template-columns: minmax(0, 1fr); }

	.site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
	:root { --header-h: 76px; }

	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.site-topbar__contact { gap: 12px; font-size: 12px; }
	.site-branding img { max-height: 48px; }
}

@media (max-width: 768px) {
	/* Let the contact details wrap onto their own line before the icons. */
	.site-footer__connect { gap: 14px 18px; }
	.footer-contact li { padding: 2px 12px; }
}

@media (max-width: 480px) {
	:root { --section-y: 44px; --gutter: 16px; }

	.grid--2,
	.grid--3,
	.grid--4 { grid-template-columns: minmax(0, 1fr); }

	.site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.site-footer__bottom { flex-direction: column; }

	.footer-contact { flex-direction: column; gap: 6px; }
	.footer-contact li { border-left: 0; padding: 0; }
}

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

/* Print */
@media print {
	.site-header,
	.site-footer,
	.site-topbar,
	.menu-toggle,
	.pagination { display: none !important; }

	body { color: #000; font-size: 12pt; }
}
