/*
 * Our Impact — structural frontend CSS.
 *
 * Layout scaffolding only. No color, font, or spacing declarations that
 * belong to the theme. The active theme provides all color tokens, typography,
 * and button styles. Plugin CSS only sets structural rules (grids, flex,
 * sticky positioning, the card stripe, and layout containers).
 *
 * Brief-type color stripe: keyed to .impact-type--{slug} classes.
 * Themes can remap these via the ffa_impact_brief_type_color filter or by
 * overriding the CSS custom properties below.
 */

/* ── Color tokens for brief-type stripes (theme can override) ───────────── */
:root {
	--impact-color-research-briefs:          #004c97;
	--impact-color-program-insights-briefs:  #2a7d4f;
	--impact-color-organization-briefs:      #c8a227;

	/* The archive's reading measure.
	 *
	 * Narrower than the single's, and deliberately so — the two pages need
	 * DIFFERENT container widths to look the same width, because their insides
	 * differ. The single's hero spends ~270px of its box on the Study at a
	 * Glance column, so a 1600px container yields a ~1280px text column. The
	 * archive hero has no such column, so the same 1600px container ran its
	 * title and copy the full width, and it read far wider than the single even
	 * though the numbers matched. Matching the containers is what made them look
	 * mismatched.
	 *
	 * A token rather than a literal so this is one number to tune, and a theme
	 * that declares content-size still wins.
	 *
	 * Only INNER wrappers use it; the bands stay full width so their backgrounds
	 * reach the window edge. */
	--impact-measure: var(--wp--style--global--content-size, 1400px);
}

/* ── Archive wrapper ─────────────────────────────────────────────────────── */
.impact-archive {
	width: 100%;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.impact-hero {
	padding: 48px 24px;
}

.impact-hero__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	margin-top: 24px;
}

.impact-stat {
	display: flex;
	flex-direction: column;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.impact-filter-bar {
	position: sticky;
	top: 0;
	z-index: 100;
	padding: 12px 24px;
}

.impact-filter-bar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.impact-filter-bar__search {
	flex: 1 1 200px;
	min-width: 160px;
}

.impact-filter-bar__select {
	flex: 0 1 180px;
}

.impact-filter-bar__count {
	margin-left: auto;
	white-space: nowrap;
}

.impact-filter-bar__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 8px;
}

.impact-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	border-radius: 9999px;
	font-size: 0.8em;
	cursor: pointer;
}

.impact-filter-chip__remove {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

/* ── Two-column archive body ─────────────────────────────────────────────── */
.impact-archive__body {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	padding: 24px;
}

/* ── Sidebar taxonomy navigator ──────────────────────────────────────────── */
.impact-sidebar {
	width: 220px;
	flex-shrink: 0;
	position: sticky;
	top: 56px;
	max-height: calc(100vh - 80px);
	overflow-y: auto;
}

.impact-sidebar__section {
	margin-bottom: 24px;
}

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

.impact-sidebar__btn {
	display: flex;
	justify-content: space-between;
	width: 100%;
	background: none;
	border: none;
	text-align: left;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 3px;
}

.impact-sidebar__btn.is-active,
.impact-sidebar__btn:hover {
	background: rgba(0, 0, 0, 0.06);
}

/* ── Main card area ──────────────────────────────────────────────────────── */
.impact-archive__main {
	flex: 1;
	min-width: 0;
}

/* A real grid as of 1.19.0, and the element has carried the name since 1.16.0
   in anticipation of it.

   auto-fill rather than a fixed column count, because this sits beside a
   sidebar: the main column is not the viewport, and hard-coding three would
   overflow on a laptop and waste a wide screen. The track floor is what decides
   when a column drops, so the grid reflows on its own and needs no breakpoint. */
.impact-card-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 16px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.impact-card {
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
}

/* A bar across the top rather than down the side. In a column flex container
   the cross axis is horizontal, so `align-self: stretch` spans the card's width
   and the size has to be given as a HEIGHT — keeping `width: 4px` here would
   leave a 4px-wide stripe of zero height, i.e. nothing at all.

   6px, not the 4px it carried as a vertical rule. Down the side of a card the
   bar ran the full height, so 4px was plenty of colour to read; across the top
   it is a short line above a photograph and 4px reads as a hairline rather than
   as the brief-type indicator it is. A token because it is the sort of number
   that gets adjusted by eye. */
.impact-card__stripe {
	height: var( --impact-stripe-height, 6px );
	flex-shrink: 0;
	align-self: stretch;
}

.impact-type--research-briefs          .impact-card__stripe { background: var( --impact-color-research-briefs ); }
.impact-type--program-insights-briefs  .impact-card__stripe { background: var( --impact-color-program-insights-briefs ); }
.impact-type--organization-briefs      .impact-card__stripe { background: var( --impact-color-organization-briefs ); }

/* ── Card cover ──────────────────────────────────────────────────────────
 * A 16:9 band across the top of the card, at every width.
 *
 * THE SLOT MATCHES THE REGISTERED SIZE, and that is the whole design. Every
 * earlier treatment cropped twice — `ffa-card` is a hard 16:9 crop of the
 * original, and a slot of any other shape then crops that again. Measured
 * against a 3:2 original, which is what the PhotoShelter library mostly holds:
 *
 *   1.16.4  200px column, filling height, serving ffa-card      0.385 survives
 *   1.17.0  200px column, filling height, serving ffa-portrait  0.527
 *   1.19.0  16:9 band, serving ffa-card                         0.842
 *
 * The tall column was never a design decision. It is what "fill the height of a
 * text-driven card" produces at 200px wide, and 1.16.3 / 1.16.4 / 1.17.0 were
 * three attempts to source or crop photography to fit an accident. Matching the
 * slot to the size the importer already generates costs nothing and ends it.
 *
 * The density argument that defended the row was also wrong: a taller card three
 * across beats a short card one across. Measured at 1280px — 3.4 cards per
 * screen before, 5.1 after.
 *
 * A brief with no cover renders no `__media` at all and the body takes the whole
 * card — deliberate, because on a fresh import most briefs have none and a wall
 * of grey boxes reads as broken. */
.impact-card__media {
	width: 100%;
	aspect-ratio: 16 / 9;
	flex: none;
	overflow: hidden;
	position: relative;
}

/* ⚠️ THE COVER IS TAKEN OUT OF FLOW, and that line is still load-bearing.
   An in-flow `height: 100%` resolves against a parent of indefinite height,
   falls back to `auto`, and the image's INTRINSIC height becomes the card's
   height — so the cover sizes the card instead of filling its box. It survived
   the layout change because it is what lets `aspect-ratio` on the box above
   decide the shape: an aspect-ratio on the image itself would be overridden by
   the intrinsic size and quietly do nothing. */
.impact-card__image {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* A column flex container so the footer can be pinned to the bottom.
 *
 * Cards in a grid row are all the height of the tallest, and a short brief left
 * its Read Brief button floating wherever its text happened to stop — three
 * different heights across one row. The excerpt takes the slack instead, so the
 * buttons and tags line up straight across.
 *
 * ⚠️ Flex items are blockified, which is why the stat pill needs `align-self`
 * below: it is an inline-block, and as a stretched flex item it becomes a
 * full-width bar rather than a pill. */
.impact-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	padding: 16px 20px;
}

.impact-card__header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.impact-card__title {
	margin: 0 0 8px;
}

.impact-card__stat-pill {
	display: inline-block;
	/* Hug the text. Without this the blockified flex item stretches the pill
	   across the whole card. */
	align-self: flex-start;
	padding: 2px 10px;
	border-radius: 9999px;
	font-size: 0.8em;
	margin-bottom: 8px;
}

/* Takes the slack in a stretched card, so the space lands in the description
   rather than as a gap under the buttons. */
.impact-card__excerpt {
	flex: 1 1 auto;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 12px;
}

/* Stacked, not a space-between row. As a row, the tags took the left edge and
 * `space-between` threw the actions to the right — so the "Read Brief" button
 * landed in a different horizontal position on every card, governed by how many
 * tags that brief happened to carry. Stacking puts the button under the excerpt
 * at one left edge the eye can read straight down.
 *
 * `margin-top: auto` pins the whole footer to the bottom of the card. It is
 * belt and braces alongside the excerpt's `flex: 1` — where there IS an excerpt
 * the excerpt has already eaten the free space and this resolves to zero, but a
 * brief with no excerpt has nothing to grow, and without this its buttons would
 * float halfway up a stretched card. */
.impact-card__footer {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

.impact-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.impact-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-start;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.impact-pagination {
	margin-top: 32px;
	text-align: center;
}

/* ── Featured briefs shortcode ───────────────────────────────────────────── */
.impact-featured-briefs {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.impact-featured-briefs .impact-card {
	flex: 1 1 280px;
}

/* ── Single brief ────────────────────────────────────────────────────────── */
.impact-breadcrumb {
	padding: 12px 24px;
}

.impact-single__hero {
	padding: 40px 24px;
}

.impact-single__hero-inner {
	display: flex;
	align-items: flex-start;
	gap: 32px;
	flex-wrap: wrap;
}

.impact-single__hero-main {
	flex: 1 1 400px;
}

.impact-single__pills {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.impact-single__byline {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin: 8px 0;
}

.impact-single__glance {
	flex: 0 1 240px;
	padding: 20px;
	border-radius: 4px;
}

.impact-single__glance-list {
	margin: 0;
}

.impact-single__glance-list dt {
	font-weight: 700;
	margin-top: 12px;
}

.impact-single__glance-list dd {
	margin: 0;
}

/* ── Single two-column body ──────────────────────────────────────────────── */
.impact-single__body {
	display: flex;
	align-items: flex-start;
	gap: 32px;
	padding: 32px 24px;
}

.impact-single__main {
	flex: 1;
	min-width: 0;
}

/* Scoped to the fallback two-column row ON PURPOSE. The block template puts the
   sidebar in a core wp:column, which already owns its width — a fixed width here
   would fight the column and break its responsive behaviour. Stickiness is fine
   in both, so it stays unscoped below. */
.impact-single__body > .impact-single__sidebar {
	/* 260px wrapped a typical brief title over three lines and stacked the topic
	   pills one per row. 320px fits the longest live title in two. */
	width: 320px;
	flex-shrink: 0;
}

.impact-single__sidebar {
	position: sticky;
	top: 24px;
}

.impact-sidebar-card {
	margin-bottom: 24px;
	padding: 16px;
}

/* ── Key points box ──────────────────────────────────────────────────────── */
.impact-key-points {
	padding: 20px 24px;
	border-radius: 4px;
	margin-bottom: 28px;
}

.impact-key-points__list {
	padding-left: 20px;
}

/* ── Quote blocks ────────────────────────────────────────────────────────── */
.impact-blockquote {
	padding: 16px 24px;
	margin: 24px 0;
	border-left: 4px solid currentColor;
}

.impact-blockquote cite {
	display: block;
	margin-top: 8px;
	font-style: normal;
}

/* ── Tag cloud ───────────────────────────────────────────────────────────── */
.impact-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* ── Related briefs list ─────────────────────────────────────────────────── */
.impact-related-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.impact-related-item {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

/* ⚠️ box-sizing is load-bearing here, not tidiness. `.impact-btn` carries
 * `padding: 0.7rem 1.3rem`, so `width: 100%` under the default content-box
 * resolves to 100% PLUS ~2.6rem of padding — the Download PDF pill rendered
 * about 42px wider than the sidebar card containing it and broke out of its
 * border. It only looks correct on a theme that happens to set border-box
 * globally, which is why it survived: the bug is invisible until the plugin
 * meets a theme that does not. */
.impact-btn--block {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

/* Belt and braces for every other pill: a long label in a narrow column should
 * wrap or clip inside its container, never spill out of it. */
.impact-btn {
	max-width: 100%;
	box-sizing: border-box;
}

.impact-no-results {
	padding: 32px;
	text-align: center;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media ( max-width: 768px ) {
	.impact-sidebar,
	.impact-single__glance {
		display: none;
	}

	.impact-archive__body,
	.impact-single__body {
		flex-direction: column;
	}

	.impact-single__body > .impact-single__sidebar {
		width: 100%;
	}

	.impact-single__sidebar {
		position: static;
	}
}

/* =========================================================================
 * Single-brief presentation — reclaimed from ffa-horizon.
 *
 * These rules lived in the THEME, which breaks its own boundary: a shared
 * neutral base theme must not style surfaces belonging to a plugin only one
 * site runs. brand.ffa.org consumes ffa-horizon and does NOT run Our Impact, so
 * it was being shipped 25 rule blocks it can never use.
 *
 * They also could not follow the plugin anywhere else. The legacy ffa.org runs
 * Avada, where none of this existed — the brief rendered structurally correct
 * and visually unfinished.
 *
 * Colours keep the theme preset AND carry a hex fallback, so one stylesheet
 * serves both: on a block theme the preset resolves and the brand stays the
 * single source of truth exactly as before; on a classic theme the hex applies.
 * No conditional loading and no second code path.
 *
 * Deliberately NOT reclaimed, because they are genuinely shared and belong to
 * the theme: the Anton uppercase rule (h1, .has-display-font-family, and other
 * plugins' titles) and the ElasticPress search-highlight rule.
 * ====================================================================== */
/* ⚠️ `.impact-single__hero` is deliberately NOT in this list, and its measure
 * has NOT changed — it moved.
 *
 * The section used to carry the max-width, and that is why the brief's coloured
 * band stopped short of the window on a classic theme: constraining the section
 * constrains its background with it. The same 1600px now sits on
 * `.impact-single__hero-inner`, which the markup has always had, so the text
 * measure a reader sees is exactly what it was — only the band behind it is
 * free to reach the edge.
 *
 * The block-theme rules further down had already worked this out and full-bleed
 * the hero there, so before this the two render paths disagreed about the same
 * element: the block site got an edge-to-edge band and ffa.org got a floating
 * one. */
.impact-single__body,
.impact-breadcrumb,
.impact-single__hero-inner {
	max-width: var(--wp--style--global--wide-size, 1600px);
	margin-inline: auto;
}

/* ----------------------------------------------------------------------
 * Block-theme layout reconciliation.
 *
 * Since 1.6.0 the single brief is a block template: the breadcrumb and hero
 * are shortcodes, but the BODY is a core wp:columns block. So the two get
 * their horizontal frame from completely different places, and the left edges
 * cannot line up. Two separate causes, both real:
 *
 *   measure  the rule above pins the hero to WIDE size (1600px), while the
 *            columns block has no alignment and so takes the constrained
 *            layout's CONTENT size (1400px). The layout rule that would have
 *            constrained the hero is `:where(.is-layout-constrained) > *`,
 *            and `:where()` has zero specificity, so ours wins silently.
 *   inset    `.impact-single__hero` adds `padding: 40px 24px` on top of the
 *            wrapper's global padding; the columns block adds none.
 *
 * The two push OPPOSITE ways, which is the part worth keeping: the padding
 * moves the hero text right, the wider measure moves it left, and which one
 * you see depends on the viewport. Fixing only the padding — the obvious
 * reading — leaves the measure gap standing and makes the visible offset
 * BIGGER, not smaller. Both have to go together.
 *
 * Scoped to a wrapper that supplies both, so the classic-theme path is
 * untouched: on Avada there is no constrained layout and no global padding,
 * the fallback PHP template renders `.impact-single__body`, and the 24px is
 * still the only thing keeping the brief off the window edge.
 * ---------------------------------------------------------------------- */
/* The breadcrumb carries no background, so simply dropping its own inset puts it
 * on the layout's frame and it is done. */
.has-global-padding.is-layout-constrained > .impact-breadcrumb {
	max-width: var(--wp--style--global--content-size, 1400px);
	padding-inline: 0;
}

/* ⚠️ The hero is a coloured BAND, and 1.10.0 zeroed its horizontal padding the
 * same way as the breadcrumb. Alignment was then correct and the result still
 * wrong: the band's own text sat flush against its left and right edges, which
 * is what Larry reported on the block site. The measurement that verified the
 * fix — left edges agreeing at five viewports — was true and did not describe
 * the thing that was broken.
 *
 * Padding it back in reopens the misalignment, because the band is capped at
 * content-size, so its text would start 24px inside the frame the body sits on.
 * Full-bleed resolves both at once: the band spans the viewport by cancelling
 * the wrapper's global padding, then re-applies that padding so nothing touches
 * the screen edge, and the INNER element takes the content-size cap so the hero
 * text lands exactly on the body's left edge.
 *
 * Falls back safely: with --wp--style--root--padding-* undefined the negative
 * margins compute to 0 and the hero simply stays contained with 24px of inset,
 * which is the pre-1.10.0 behaviour rather than a broken one.
 *
 * ⚠️ The !important on the two margins is LOAD-BEARING (1.12.2) — do not tidy it
 * away. Core's constrained-layout rule is
 *
 *   .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull))
 *       { margin-left: auto !important; margin-right: auto !important }
 *
 * and !important beats any non-important declaration whatever its specificity.
 * Through 1.12.1 the negative margins here were silently outranked while the
 * padding half applied (nothing declares padding !important), so the band was
 * inset AND the hero text sat 24px right of the body's left edge — a worse
 * result than either half alone. Measured over CDP at 1024/1280/1440/1600/1920:
 * without !important the rule changed the geometry by literally zero pixels;
 * with it, band spans 0..viewport and the h1/body left edges agree at every
 * width. This is the same core !important that centred the archive search bar,
 * so treat any own-margin rule inside a constrained layout as fighting it.
 *
 * Physical longhands throughout, not the -inline shorthands: core declares the
 * physical properties, so matching it keeps the cascade comparison plain — and
 * the values are physical root-padding vars, which a logical shorthand would
 * flip under RTL while the negative margins cancelling them would not. */
.has-global-padding.is-layout-constrained > .impact-single__hero {
	max-width: none;
	margin-left: calc( -1 * var( --wp--style--root--padding-left, 0px ) ) !important;
	margin-right: calc( -1 * var( --wp--style--root--padding-right, 0px ) ) !important;
	padding-left: var( --wp--style--root--padding-left, 24px );
	padding-right: var( --wp--style--root--padding-right, 24px );
}

.has-global-padding.is-layout-constrained > .impact-single__hero > .impact-single__hero-inner {
	max-width: var(--impact-measure);
	margin-inline: auto;
}

.impact-breadcrumb {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--wp--preset--color--ink, #23303D) 55%, transparent);
}
.impact-breadcrumb a {
	color: var(--wp--preset--color--steel, #177E93);
	text-decoration: none;
}
.impact-single__hero {
	background: var(--wp--preset--color--corduroy, #16274A);
	border-top: 4px solid var(--wp--preset--color--ffa-yellow, #F2CE1B);
	color: #fff;
}
.impact-single__pills .impact-type-pill,
.impact-single__pills .impact-series-pill {
	font-size: 0.7rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0.28rem 0.7rem;
	border-radius: 999px;
}
.impact-single__pills .impact-type-pill {
	background: var(--wp--preset--color--ffa-yellow, #F2CE1B);
	color: var(--wp--preset--color--corduroy, #16274A);
}
.impact-single__pills .impact-series-pill {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
}
.impact-single__title {
	font-family: var(--wp--preset--font-family--display);
	letter-spacing: 0;
	line-height: 1.04;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	margin: 0.15em 0 0.1em;
	color: #fff;
}
.impact-single__byline,
.impact-single__method {
	color: #d9e2ef;
	font-size: 0.92rem;
}
.impact-single__byline a {
	color: var(--wp--preset--color--ffa-yellow, #F2CE1B);
}
.impact-single__glance {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
}
.impact-single__glance-title {
	font-size: 0.78rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--ffa-yellow, #F2CE1B);
	margin: 0 0 0.6rem;
}
.impact-single__glance-list dt {
	color: #fff;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.impact-single__glance-list dd {
	color: #d9e2ef;
	font-size: 0.95rem;
}
.impact-key-points {
	background: var(--wp--preset--color--surface, #FFFFFF);
	border-left: 4px solid var(--wp--preset--color--ffa-blue, #004C97);
	color: var(--wp--preset--color--ink, #23303D);
}
.impact-key-points__title,
.impact-footnotes__title {
	font-family: var(--wp--preset--font-family--display);
	text-transform: uppercase;
	font-weight: 400;
	font-synthesis-weight: none;
	color: var(--wp--preset--color--ffa-blue, #004C97);
	font-size: 1.3rem;
}
.impact-single__content {
	font-size: 1.05rem;
	line-height: 1.7;
	color: var(--wp--preset--color--ink, #23303D);
}
.impact-single__content :where(h2, h3) {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	color: var(--wp--preset--color--ffa-blue, #004C97);
}
.impact-sidebar-card {
	background: var(--wp--preset--color--surface, #FFFFFF);
	border: 1px solid var(--wp--preset--color--line, #DCE6F2);
	border-radius: 6px;
	color: var(--wp--preset--color--ink, #23303D);
}
.impact-sidebar-card__title {
	font-size: 0.8rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--ffa-blue, #004C97);
	margin: 0 0 0.6rem;
}
.impact-study-details dt {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--wp--preset--color--ink, #23303D) 55%, transparent);
	margin-top: 0.6rem;
}
.impact-study-details dd {
	margin: 0;
}
.impact-study-details a,
.impact-related-item a {
	color: var(--wp--preset--color--ffa-blue, #004C97);
	text-decoration: none;
}
.impact-btn,
.impact-btn--primary {
	display: inline-block;
	background: var(--wp--preset--color--steel, #177E93);
	color: #fff;
	border-radius: 999px;
	padding: 0.7rem 1.3rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.85rem;
	text-decoration: none;
}
.impact-tag {
	font-size: 0.72rem;
	font-weight: 700;
	background: color-mix(in srgb, var(--wp--preset--color--steel, #177E93) 12%, transparent);
	color: var(--wp--preset--color--steel, #177E93);
	border-radius: 999px;
	padding: 0.2rem 0.6rem;
	text-decoration: none;
}

/* =========================================================================
 * Archive brand layer — reclaimed for classic themes (1.12.0).
 *
 * The single-brief surfaces were reclaimed from ffa-horizon in 1.9.0; the
 * ARCHIVE half never was, and nothing supplied it. On the legacy ffa.org that
 * shows as a page with correct structure and no finish: browser-default selects
 * and search box, unstyled facet lists, and — worst — no measure at all, so the
 * whole archive runs edge to edge on a wide monitor and the "37 briefs" count
 * falls off the right edge.
 *
 * Safe to apply unconditionally: the BLOCK archive template is built from core
 * and ElasticPress blocks and emits no .impact-* markup whatsoever, so every
 * rule below can only ever match the classic/fallback PHP template. Checked
 * rather than assumed — templates/blocks/archive-ffa-report.html contains
 * wp:query / wp:post-template / wp:elasticpress-facet and nothing of ours.
 *
 * Colours carry the theme preset AND a hex fallback, the same contract the
 * single-brief layer uses, so one stylesheet serves a block theme and a classic
 * one with no conditional loading.
 * ====================================================================== */
.impact-archive__body,
.impact-filter-bar__inner,
.impact-filter-bar__chips,
.impact-hero__inner {
	max-width: var(--impact-measure);
	margin-inline: auto;
}

/* ----------------------------------------------------------------------
 * The single brief's band reaches the window edge on a classic theme.
 *
 * Measured on ffa.org, and the two pages are not set up the same way:
 *
 *   archive  <main class="clearfix width-100" style="padding:0">
 *              inside <div class="fusion-row" style="max-width:100%">
 *   single   <main class="clearfix">
 *              inside <div class="fusion-row">          ← constrained by Avada
 *
 * So the archive band already reaches the edge and the single's does not, and
 * no rule removing OUR max-width can change that: the constraint is the theme's
 * page container, set per page in Fusion's options.
 *
 * ⚠️ The first attempt at this moved the BAND with `margin-inline: calc(50% -
 * 50vw)` and put `overflow-x: clip` on `.impact-single` to absorb the overflow.
 * That clipped the hero's own text off the left of the screen, because
 * `.impact-single` is itself inside the constrained container — so the clip
 * boundary was tighter than the thing being clipped, and it cut the content
 * instead of containing it. Never put the clip on an element the escape has to
 * escape from.
 *
 * So the content does not move at all now; only the PAINT extends. The hero
 * keeps its place and its measure — which is what was wanted, since the single's
 * content width was already right — and a pseudo-element draws the band behind
 * it, out to the viewport on both sides. Nothing can be clipped, because nothing
 * is displaced.
 *
 * `calc(50% - 50vw)` is self-cancelling: where the container is already full
 * width it computes to zero. The archive is left alone regardless — it works,
 * and the rule that "works" is the one not to touch.
 *
 * Classic path only. The block template composes the partials without an
 * `.impact-single` wrapper and has its own root-padding reconciliation below.
 * ---------------------------------------------------------------------- */
.impact-single > .impact-single__hero {
	position: relative;
	background: none;
	border-top: 0;
}

.impact-single > .impact-single__hero::before {
	content: "";
	position: absolute;
	inset: 0;
	left: calc( 50% - 50vw );
	width: 100vw;
	background: var(--wp--preset--color--corduroy, #16274A);
	border-top: 4px solid var(--wp--preset--color--ffa-yellow, #F2CE1B);
	/* 0 rather than -1: a negative index can drop the band behind the page
	   background in a stacking context the plugin does not control. */
	z-index: 0;
}

.impact-single > .impact-single__hero > * {
	position: relative;
	z-index: 1;
}

/* The archive header, wearing the single brief’s clothes (1.14.0).
 *
 * `.impact-hero` deliberately takes NO max-width: the measure moved to
 * `.impact-hero__inner` so the band paints edge to edge while its text keeps the
 * same measure as the cards below. The section used to carry the max-width
 * itself, which constrained the BACKGROUND along with the words and left the
 * archive header looking unrelated to the single-brief header it sits above.
 *
 * Same three declarations as `.impact-single__hero` — corduroy ground, yellow
 * top rule, white text — because "similar to the individual impact pages" is
 * best served by being literally the same values rather than a near miss.
 *
 * No negative-margin full-bleed trick here, and none is needed: this markup is
 * only ever emitted by the classic PHP template, whose container on ffa.org is
 * `main.width-100` inside `.fusion-row[max-width:100%]` — both already full
 * width, measured. The block archive template emits no .impact-* markup at all,
 * so these rules cannot reach it. */
.impact-hero {
	background: var(--wp--preset--color--corduroy, #16274A);
	border-top: 4px solid var(--wp--preset--color--ffa-yellow, #F2CE1B);
	color: #fff;
}

.impact-hero__eyebrow {
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ffa-yellow, #F2CE1B);
	margin: 0 0 0.5rem;
}

.impact-hero__title {
	margin: 0 0 0.75rem;
	color: #fff;
}

.impact-hero__subhead {
	margin: 0;
	max-width: 60ch;
	color: color-mix(in srgb, #fff 85%, transparent);
}

.impact-hero .impact-stat__value {
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.1;
	color: var(--wp--preset--color--ffa-yellow, #F2CE1B);
}

.impact-hero .impact-stat__label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: color-mix(in srgb, #fff 75%, transparent);
}

.impact-filter-bar {
	background: var(--wp--preset--color--surface, #FFFFFF);
	border-bottom: 1px solid var(--wp--preset--color--line, #DCE6F2);
}

/* ⚠️ These two classes sit ON the input and the select, not on a wrapper around
 * them — see templates/archive-ffa-report.php. The rules here were written as
 * `.impact-filter-bar__search input[type="search"]`, a descendant selector
 * looking for a child that has never existed, so they matched NOTHING and the
 * search box and every dropdown rendered browser-default. That is the whole of
 * "the archive search bar is not styled", and it silently took the selects with
 * it. The layout rules above always worked, because those DO target the element
 * directly, which is why the controls were the right size and the wrong skin. */
input.impact-filter-bar__search,
select.impact-filter-bar__select {
	width: 100%;
	font-family: inherit;
	font-size: 0.95rem;
	padding: 0.55rem 0.75rem;
	border: 1.5px solid var(--wp--preset--color--line, #DCE6F2);
	border-radius: 8px;
	background: var(--wp--preset--color--surface, #FFFFFF);
	color: var(--wp--preset--color--ink, #23303D);
}

input.impact-filter-bar__search:focus,
select.impact-filter-bar__select:focus {
	outline: none;
	border-color: var(--wp--preset--color--ffa-blue, #004C97);
}

.impact-filter-bar__count {
	font-size: 0.85rem;
	color: color-mix(in srgb, var(--wp--preset--color--ink, #23303D) 60%, transparent);
}

/* Active filter chips (1.23.1).
 *
 * Two defects, and either alone was enough to make them look broken:
 *
 *   - `.impact-filter-bar__chips` was missing from the measure group above, so
 *     on a wide screen the row sat at the bar's left padding while the search,
 *     the dropdowns and the cards were centered: the chips appeared outside the
 *     container the rest of the page lives in.
 *   - The chip had a shape but no skin. Its colour came only from the Designer's
 *     accent token, which is opt-in and set on no site, so it rendered as bare
 *     text next to a bare ✕ and read as a stray link.
 *
 * The skin is a filled FFA Blue pill, the same treatment as a selected facet
 * pill in ffa-patterns. Single-class selectors on purpose: the Designer emits
 * `.impact-filter-chip{background:…}` inline after this file, so a site that
 * DOES set an accent still wins by source order. */
.impact-filter-bar__chips:empty {
	display: none;
}

.impact-filter-chip {
	gap: 0.4rem;
	padding: 0.3rem 0.4rem 0.3rem 0.8rem;
	border: 1px solid var(--wp--preset--color--ffa-blue, #004C97);
	background: var(--wp--preset--color--ffa-blue, #004C97);
	color: #fff;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: default;
}

.impact-filter-chip__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 9999px;
	background: color-mix(in srgb, #fff 20%, transparent);
	color: inherit;
	font-size: 0.7rem;
}

.impact-filter-chip__remove:hover,
.impact-filter-chip__remove:focus-visible {
	background: color-mix(in srgb, #fff 35%, transparent);
}

.impact-filter-chip__remove:focus-visible {
	outline: 2px solid var(--wp--preset--color--ffa-yellow, #F2CE1B);
	outline-offset: 1px;
}

.impact-sidebar__heading {
	font-size: 0.95rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--ffa-blue, #004C97);
	margin: 0 0 0.5rem;
}


/* The BUTTON inside already owns the flex row (display:flex, space-between,
   width:100%), so the item only needs the separator — duplicating the flex here
   would nest one flex container inside another for no reason. */
.impact-sidebar__item {
	font-size: 0.9rem;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--line, #DCE6F2) 60%, transparent);
}

.impact-sidebar__count {
	color: color-mix(in srgb, var(--wp--preset--color--ink, #23303D) 55%, transparent);
	font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------
 * The cards themselves (1.14.4).
 *
 * 1.12.0 reclaimed the archive's frame — filter bar, sidebar, counts — and
 * stopped at the cards. Not one card element had a single brand declaration on
 * a classic theme, so every one of them fell through to Avada: the title
 * inherited the theme's h2 and rendered at very nearly the size of the page
 * <h1>, underlined, because it is a link. That is why the archive still read as
 * a different site from the single brief even after the header was fixed.
 *
 * Values are lifted from the single-brief layer above rather than invented, so
 * "use the styling from the single on the archive" is literally true: the type
 * badge is the hero's type pill, the tag is `.impact-tag`, the title takes the
 * display face and a clamp scaled for a card instead of a page heading.
 * ---------------------------------------------------------------------- */
.impact-card {
	background: var(--wp--preset--color--surface, #FFFFFF);
	border: 1px solid var(--wp--preset--color--line, #DCE6F2);
	border-radius: 6px;
}

.impact-card__title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-synthesis-weight: none;
	letter-spacing: 0;
	line-height: 1.15;
	font-size: clamp(1.15rem, 1.5vw, 1.5rem);
}

/* The underline is the theme's default link decoration, and at this size it
   dominated the card. The stripe and the heading weight carry the affordance. */
.impact-card__title a {
	color: var(--wp--preset--color--ffa-blue, #004C97);
	text-decoration: none;
}

.impact-card__title a:hover,
.impact-card__title a:focus {
	text-decoration: underline;
}

.impact-card__type-badge {
	font-size: 0.68rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0.24rem 0.6rem;
	border-radius: 999px;
	background: var(--wp--preset--color--ffa-yellow, #F2CE1B);
	color: var(--wp--preset--color--corduroy, #16274A);
}

.impact-card__year {
	font-size: 0.78rem;
	font-weight: 700;
	color: color-mix(in srgb, var(--wp--preset--color--ink, #23303D) 55%, transparent);
	font-variant-numeric: tabular-nums;
}

.impact-card__stat-pill {
	font-size: 0.75rem;
	font-weight: 700;
	background: color-mix(in srgb, var(--wp--preset--color--steel, #177E93) 12%, transparent);
	color: var(--wp--preset--color--steel, #177E93);
}

.impact-card__excerpt {
	font-size: 0.95rem;
	line-height: 1.55;
	color: color-mix(in srgb, var(--wp--preset--color--ink, #23303D) 78%, transparent);
}

.impact-card__tag {
	font-size: 0.72rem;
	font-weight: 700;
	background: color-mix(in srgb, var(--wp--preset--color--steel, #177E93) 12%, transparent);
	color: var(--wp--preset--color--steel, #177E93);
	border-radius: 999px;
	padding: 0.2rem 0.6rem;
}
