/* ------------------------------------------------------------------ *
 * Basuto Insights — the hub stylesheet. Design A, "teal journal".
 *
 * The canonical design for the article hub: owned by this plugin, loaded by
 * `includes/class-templates.php` on the hub page only, and paired with
 * `templates/insights-hub.html`.
 *
 * Every selector below is prefixed with `main.bi-r2.gp-hub`, the element the
 * hub template carries and nothing else does. This file is the hub's exact
 * counterpart to `article-editorial.css`, and it exists for the same reason:
 * `insights.css` and `insights-repair.css` also load on single posts and on any
 * service page carrying the further-reading pilot, so a hub redesign written
 * into either of them would move pages that are not being redesigned. Both of
 * those files are left BYTE-IDENTICAL by this release.
 *
 * `main.bi-r2.gp-hub` is an element plus three classes, so it outranks the
 * `.bi-r2 …` rules in the repair file. Where the repair file uses `!important`
 * — it does for `.ed-grid`'s column count at two breakpoints — the rule here
 * repeats `!important` and wins on specificity.
 * ------------------------------------------------------------------ */

main.bi-r2.gp-hub {
	/* ---- Design A's palette, declared in full and under its own names ----
	 *
	 * Identical to the block at the top of `article-editorial.css`, and for the
	 * same reason: `insights-repair.css` redefines `--bi-hairline` as warm sand
	 * `#E8E2D3` on `.bi-r2`, and it loads after `insights.css`, so a descendant
	 * reading `var(--bi-hairline)` gets sand rather than Design A's mint
	 * `#B8E0DA`. The lead plate IS that mint, so borrowing the shared name
	 * rendered the single most prominent element on the hub in the wrong
	 * colour. Both shared stylesheets stay byte-identical; the hub declares
	 * what it draws.
	 *
	 * Values are the approved mockup's `assets/base.css`. The four with theme
	 * presets keep reading them so the brand drives the brand colours.
	 */
	--gp-teal-deep: var(--wp--preset--color--gold, #0E5C5C);
	--gp-teal: var(--wp--preset--color--teal-hover, #237676);
	--gp-ink: var(--wp--preset--color--charcoal, #1F2421);
	--gp-terracotta: var(--wp--preset--color--terracotta, #A04E2C);

	--gp-mint: #B8E0DA;
	--gp-mint-pale: #E8F2EF;
	--gp-muted: #5A615C;
	--gp-rule: #DCE8E5;
	--gp-on-teal: #D5EBE7;
	--gp-on-teal-dim: #9FD3CB;
	--gp-ink-warm: #33403C;
	--gp-ink-on-mint: #2F4F4C;   /* A's meta line inside the mint plate */
	--gp-teal-press: #0A4747;    /* A's pressed/hover teal */
	--gp-field-edge: #9CBFB9;    /* A's search field border */
	--gp-placeholder: #7C8A86;   /* A's search placeholder */
	--gp-mint-rule: rgba(184, 224, 218, 0.34);

	--gp-serif: var(--wp--preset--font-family--heading, Merriweather, Georgia, serif);

	/* Approved Design A's container: 1280px with a 32px gutter, widening to
	   40px where the opening's text column aligns to it. The site's own
	   contentSize is 900px and the theme caps every child of a `constrained`
	   group at it, which rendered the lead plate and the secondary story as
	   ~660px panels floating in a 1440px page — not the approved layout.
	   The section groups in `insights-hub.html` therefore use layout `default`
	   and these two values own the width instead. */
	--gp-container: 1280px;
	--gp-gutter: 40px;

	/* ---- The real header contract ----------------------------------------
	 *
	 * MEASURED on hosted staging at 320/390/768/1024/1440 across three
	 * pages, by `tests/measure-header.mjs`; the numbers are in
	 * `tests/header-contract.json`. Not assumed, and not taken from a native
	 * fixture — the previous round's fixture used a simplified header, which is
	 * precisely why this collision shipped.
	 *
	 *   the announcement bar is fixed at top: 0 and is 42px tall
	 *   `.site-header-sticky` is fixed at top: 42px
	 *   together they occupy 0–137px, and never retract on scroll
	 *   between roughly 980px and 1280px the navigation wraps to a second row
	 *   and the pair occupies 0–177px instead
	 *
	 * The site reserves space for them with `.wp-site-blocks { padding-top:
	 * 95px !important }` — the sticky header's height, with the announcement bar
	 * above it NOT counted. So every page on the site under-reserves by 42px,
	 * and by 82px in the band where the menu wraps. It only SHOWS where a page's
	 * own top padding is smaller than the shortfall, which on the hub is the
	 * phone: the H1 was measured at y=135 under a header whose bottom edge is at
	 * y=137.
	 *
	 * That rule is in the theme's global styles. This release does not edit it —
	 * it is shared by every page on the site and correcting it there is a
	 * site-wide change with its own impact test. What the hub can legitimately
	 * do is reserve the shortfall itself, which is what `--gp-header-gap` is for.
	 *
	 * Note what that does and does not buy. `--gp-header-reserved` is a HARDCODED
	 * 95px recording the measured global reservation on 12 October 2026; nothing
	 * here reads the live value. So if somebody corrects `.wp-site-blocks` to
	 * reserve the full 137px, this file does NOT adjust itself — the gap it adds
	 * would then be 42px of unnecessary space until this constant is updated to
	 * match. Applying it through `max()` against the design padding bounds the
	 * damage to that, rather than compounding it, but it is not self-correcting
	 * and should not be described as if it were. Whoever changes the global
	 * reservation must change this number in the same release.
	 */
	--gp-header-bottom: 137px;
	--gp-header-reserved: 95px;
	--gp-header-air: 40px;
	--gp-header-gap: calc(var(--gp-header-bottom) - var(--gp-header-reserved) + var(--gp-header-air));

	background-color: #fff;
}

/* The band where the navigation wraps to two rows. Measured: 137px at 960 and
   at 1366, 177px at every width sampled between 980 and 1280. */
@media (min-width: 961px) and (max-width: 1365px) {
	main.bi-r2.gp-hub {
		--gp-header-bottom: 177px;
	}
}

/* Belt to the template's `default` layouts.
 *
 * If a section is ever re-saved as `constrained` in the Site Editor, core
 * emits `.wp-container-… > :where(:not(.alignfull)…) { max-width:
 * var(--wp--style--global--content-size) }` — one class plus a zero-specificity
 * `:where()`. These selectors are an element plus three classes, so the
 * approved width survives that without the shared stylesheets being touched and
 * without the template having to stay exactly as shipped to look right. */
/* Two groups, because they want opposite things and an earlier revision gave
   both `max-width: none` — which defeated core's cap and this stylesheet's own
   container at the same time, so the lead plate and the search row ran to the
   full 1440px viewport instead of sitting on the approved 1280px measure. */
main.bi-r2.gp-hub > .full-bleed-section,
main.bi-r2.gp-hub .gp-hero > .gp-hero-inner {
	max-width: none;
}

main.bi-r2.gp-hub .spread > .gp-lead-wrap,
main.bi-r2.gp-hub .latest-hub > .gp-inner,
main.bi-r2.gp-hub .cta-band > .gp-inner {
	max-width: var(--gp-container);
}

/* The shared inner container: everything below the opening sits on it. */
main.bi-r2.gp-hub .gp-inner {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--gp-container);
	margin-inline: auto;
	padding-inline: var(--gp-gutter);
}

/* ---- 1. The opening: teal field, text beside the hub page's own image ----
 *
 * The image is resolved by `Basuto_Insights_Bindings::hub_hero()`: the hub
 * page's own featured image if an editor has set one, otherwise the LEAD
 * article's. It is deliberately not a hardcoded asset URL. The lead's image is
 * safe to use here because Design A's lead plate is text only, so nothing is
 * duplicated — and it is necessary because the staging hub page carries no
 * featured image, so a page-only hero would have shipped an empty right column.
 *
 * With no image from either source `Basuto_Insights_Render::hero()` removes the
 * figure's whole group, and the `:not(:has(…))` rules below collapse the
 * opening to one full-width column — a deliberate layout, not a hole.
 */

main.bi-r2.gp-hub .gp-hero {
	padding: 0;
	margin-top: 0;
	background-color: var(--gp-teal-deep);
	color: #fff;
}

main.bi-r2.gp-hub .gp-hero-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
	gap: 0;
	align-items: stretch;

	/* The opening is a masthead, not a landing page. At 1440 it measured 849px
	   tall — more than a laptop viewport — so a reader arriving at an article
	   index saw no article until they scrolled. Capped here, and the image
	   covers whatever height the text column asks for. */
	min-height: clamp(300px, 30vw, 430px);
}

main.bi-r2.gp-hub .gp-hero-text {
	/* `max()`, not addition: the first value is the design's own padding and the
	   second is the clearance the real fixed header needs. Whichever is larger
	   wins, so correcting the site-wide reservation later cannot produce a
	   double gap here. See the header contract note at the top of this file. */
	padding-top: max(56px, var(--gp-header-gap));
	padding-right: 56px;
	padding-bottom: 60px;
	padding-left: max(var(--gp-gutter), calc((100vw - var(--gp-container)) / 2 + var(--gp-gutter)));
	align-self: center;
}

main.bi-r2.gp-hub .gp-hero-inner:not(:has(.gp-hero-fig img)),
main.bi-r2.gp-hub .gp-hero-inner:not(:has(.gp-hero-fig)) {
	grid-template-columns: minmax(0, 1fr);
}

main.bi-r2.gp-hub .gp-hero-inner:not(:has(.gp-hero-fig img)) .gp-hero-text,
main.bi-r2.gp-hub .gp-hero-inner:not(:has(.gp-hero-fig)) .gp-hero-text {
	padding-right: max(var(--gp-gutter), calc((100vw - var(--gp-container)) / 2 + var(--gp-gutter)));
	padding-bottom: 60px;
}

main.bi-r2.gp-hub .gp-hero-fig {
	position: relative;
	overflow: hidden;
}

main.bi-r2.gp-hub .gp-hero-fig .gp-hero-media {
	height: 100%;
	margin: 0;
}

main.bi-r2.gp-hub .gp-hero-fig .gp-hero-media img {
	display: block;
	width: 100%;
	height: 100%;

	/* Was `min-height: 560px`, which is what made the opening 849px tall: the
	   image set the row height and the text column stretched to match it. The
	   grid's own `min-height` now sets the floor and the picture fills it. */
	min-height: 0;
	object-fit: cover;

	/* Faces sit in the upper third of the delivered editorial set, so the crop
	   is anchored above centre. The hosted capture cropped a clinician's head at
	   390px with the old 46%. */
	object-position: 50% 38%;
	border-radius: 0;
}

/* The hub masthead is decorative above the fold and the article grid below it
   is what the reader came for, so the opening image is not render-blocking. */
main.bi-r2.gp-hub .gp-hero-fig .gp-hero-media img[loading="lazy"] {
	background-color: var(--gp-mint-pale);
}

/* `insights-repair.css` gives the hub H1 a 4px terracotta left border and 15px
   of padding — the accent rule the older image-led hub used. Approved Design A
   has no accent on the title: the whole opening is a teal field and a rule
   against it reads as damage. Reset here rather than edited out of the shared
   file, which also styles the article H1 and the hub this release replaces. */
main.bi-r2.gp-hub .hub-title {
	margin: 0;
	padding-left: 0;
	border-left: 0;
	font-family: var(--gp-serif);
	font-weight: 300;
	font-size: clamp(44px, 5.4vw, 78px);
	line-height: 1.02;
	letter-spacing: -0.015em;
	color: #fff;
}

main.bi-r2.gp-hub .hub-intro {
	margin: 22px 0 0;
	max-width: 26em;
	font-size: 19px;
	line-height: 1.62;
	color: var(--gp-on-teal);
}

/* ---- 1b. "Straight to a section" ----
 *
 * Three links into the lead article's own sections, resolved by
 * `Basuto_Insights_Render::jump_links()` from the same lead the spread renders
 * and the same heading map the article's contents list is built from. The whole
 * group — label included — is dropped when there is no lead or it has fewer
 * than two sections, so this never renders as a heading above nothing.
 */

main.bi-r2.gp-hub .gp-jump {
	margin: 40px 0 0;
	max-width: 30em;
}

main.bi-r2.gp-hub .gp-jump-label {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--gp-on-teal-dim);
}

main.bi-r2.gp-hub .gp-jump-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--gp-mint-rule);
}

main.bi-r2.gp-hub .gp-jump-list li {
	margin: 0;
	border-bottom: 1px solid var(--gp-mint-rule);
}

main.bi-r2.gp-hub .gp-jump-list a {
	display: block;
	min-height: 44px;
	padding: 13px 0;
	font-family: var(--gp-serif);
	font-weight: 300;
	font-size: 20px;
	line-height: 1.3;
	color: var(--gp-mint);
	text-decoration: none;
}

main.bi-r2.gp-hub .gp-jump-list a:hover {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 4px;
}

main.bi-r2.gp-hub .gp-jump-list a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* ---- 2. The lead story: a mint plate in ordinary flow ----
 *
 * ── Why the overlap is gone ─────────────────────────────────────────────────
 *
 * Up to 1.5.0-rc.1 the plate was pulled up over the teal field with
 * `margin-top: -112px` from 1024 up. On the real site the top 112px of it —
 * the kicker and the first line of the headline — was invisible, so the hub's
 * primary entry point could not be read. Codex found it on the hosted render
 * and `boxes.json` records it: `.gp-lead-wrap` laid out at y=832 under a hero
 * whose box ends at y=944.
 *
 * It was never a stacking-order problem, which matters because `z-index: 2`
 * was the obvious fix and would not have worked. The theme's global stylesheet
 * carries:
 *
 *     .full-bleed-section {
 *         position: relative !important;
 *         transform: translateX(-50%) !important;
 *         overflow: hidden !important;
 *     }
 *
 * `.spread` is a `.full-bleed-section`, so the plate's negative margin pushed
 * it outside its own parent's padding box and `overflow: hidden` CLIPPED it.
 * No z-index on the clipped element can defeat its ancestor's overflow, and the
 * `transform` makes each section its own stacking context besides.
 *
 * The brief asks for ordinary flow in preference to resolving the stacking, and
 * that is also the correct answer here: the composition now works without
 * depending on a global rule this release must not edit, and it cannot break
 * again if that rule changes. The plate sits under the opening, full width of
 * the container, which is what the approved design draws once the overlap is
 * taken away.
 */

main.bi-r2.gp-hub .spread {
	padding: 0;
	background: transparent;
}

/* `insights.css` styles `.spread-lead` as the left half of the OLD two-column
   spread: `border-right: 1px solid var(--bi-hairline); padding-right: 32px`.
   This wrapper still carries that class — the Hub's own query and render code
   keys off it — so the rule drew a thin vertical line down the right-hand side
   of the whole lead wrapper, from the bottom of the teal field to the bottom of
   the plate. Approved Design A has no such divider: the lead is a plate on
   white, not a column beside another column. Reset at the owning scoped
   selector; `insights.css` is not edited, because the old hub and the service
   pilot still read it. */
main.bi-r2.gp-hub .gp-lead-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--gp-container);
	margin-inline: auto;

	/* Ordinary flow. No negative margin and no z-index: see the note above. */
	margin-top: 0;
	padding-inline: var(--gp-gutter);
	padding-block: 44px 0;
	border-right: 0;
	border-bottom: 0;
}

/* From 1024 up the plate and its section links sit side by side.
 *
 * Without the overlap the plate is a 760px panel on a 1280px measure, and
 * stacking the links under it left a tall column of white to its right and
 * pushed the topic row further down — the opposite of the "browse sooner"
 * this release is for. Beside it, the two things that belong to the lead story
 * read as one block and the page is around 180px shorter. */
@media (min-width: 1024px) {
	main.bi-r2.gp-hub .gp-lead-wrap {
		display: grid;
		grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
		gap: 0 56px;
		align-items: start;
	}

	main.bi-r2.gp-hub .gp-lead-wrap .wp-block-query {
		min-width: 0;
	}

	main.bi-r2.gp-hub .gp-jump--after {
		margin-top: 6px;
	}
}

main.bi-r2.gp-hub .gp-lead-wrap .gp-lead-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

main.bi-r2.gp-hub .gp-lead {
	box-sizing: border-box;
	max-width: 760px;
	margin: 0;
	padding: 40px 46px 42px;
	border: 0;
	border-radius: 0;
	background: var(--gp-mint);
	color: var(--gp-ink);
}

main.bi-r2.gp-hub .gp-lead .kicker {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .gp-lead .lead-title {
	margin: 0;
	font-family: var(--gp-serif);
	font-weight: 300;
	font-size: clamp(28px, 3.2vw, 41px);
	line-height: 1.12;
	letter-spacing: -0.01em;
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .gp-lead .lead-title a {
	color: inherit;
	text-decoration: none;
}

main.bi-r2.gp-hub .gp-lead .lead-title a:hover {
	text-decoration: underline;
	text-underline-offset: 5px;
}

main.bi-r2.gp-hub .gp-lead .lead-standfirst {
	margin: 16px 0 0;
	max-width: 44em;
	font-size: 17.5px;
	line-height: 1.6;
}

main.bi-r2.gp-hub .gp-lead .lead-go {
	margin: 20px 0 0;
	font-size: 14.5px;
	font-weight: 600;
}

main.bi-r2.gp-hub .gp-lead .lead-go a,
main.bi-r2.gp-hub .gp-lead a.lead-go {
	color: var(--gp-teal-deep);
	text-underline-offset: 3px;
}

/* ---- 2b. Story meta, shared by the lead, the two features and the list ---- */

main.bi-r2.gp-hub .story-meta {
	gap: 6px 18px;
	margin: 20px 0 0;
	align-items: center;
	font-size: 14px;
	color: var(--gp-ink-on-mint);
}

main.bi-r2.gp-hub .story-meta p,
main.bi-r2.gp-hub .story-meta .wp-block-post-date {
	margin: 0;
	font-size: inherit;
	color: inherit;
}

/* Each of the three can be absent for a given post: a post with no measurable
   body has no read time, and a post with no credited author has no byline.
   An empty paragraph would still take a flex gap. */
main.bi-r2.gp-hub .story-meta p:empty {
	display: none;
}

main.bi-r2.gp-hub .story-byline a {
	color: inherit;
	text-underline-offset: 3px;
}

/* ---- 3. The secondary story ----
 *
 * ONE story, laid out wide and horizontal: image on the left, text beside it,
 * as `.a-second` does in the approved `hub-a.html`. Up to 1.4.0-rc.1 this slot
 * held TWO side-by-side supporting cards, which is the older image-led hub —
 * independent review caught the old composition surviving under the new
 * styling.
 *
 * The count is not set here and not in the template either. It is
 * `Basuto_Insights_Queries::SECONDARY_SLOTS`, because `supporting_vars()`
 * derives `posts_per_page` from the resolved spread and `grid_vars()` derives
 * the grid's exclusions from the same place — so a number typed into the
 * template would be overridden and the grid below would still be short.
 */

main.bi-r2.gp-hub .gp-second-wrap {
	margin-top: 0;
	padding-block: 56px 60px;
	border-bottom: 1px solid var(--gp-rule);
}

main.bi-r2.gp-hub .gp-second-grid {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
}

main.bi-r2.gp-hub .gp-second {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 52px;
	align-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

main.bi-r2.gp-hub .gp-second-media {
	margin: 0;
}

main.bi-r2.gp-hub .gp-second-media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 0;
	max-height: none;
}

/* The one story in this slot may have no featured image; the text then takes
   the full width rather than sitting in a 1fr column beside a gap. */
main.bi-r2.gp-hub .gp-second:not(:has(.gp-second-media img)) {
	grid-template-columns: minmax(0, 1fr);
}

main.bi-r2.gp-hub .gp-second-body .kicker {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: none;
	color: var(--gp-teal);
}

main.bi-r2.gp-hub .gp-second-title {
	margin: 10px 0 0;
	font-family: var(--gp-serif);
	font-weight: 300;
	font-size: clamp(25px, 2.5vw, 33px);
	line-height: 1.16;
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .gp-second-title a {
	color: inherit;
	text-decoration: none;
}

main.bi-r2.gp-hub .gp-second-title a:hover {
	text-decoration: underline;
	text-underline-offset: 5px;
}

main.bi-r2.gp-hub .gp-second-excerpt {
	margin: 14px 0 0;
	max-width: 38em;
	font-size: 17px;
	line-height: 1.6;
	color: var(--gp-ink-warm);
}

main.bi-r2.gp-hub .gp-second .story-meta {
	margin-top: 14px;
	font-size: 13.5px;
	color: var(--gp-muted);
}

/* ---- 4. Tools: search, result count, topics ---- */

/* The section carries no padding in the template; `.gp-inner` owns the gutter
   and these own the vertical rhythm. */
main.bi-r2.gp-hub .latest-hub {
	padding: 0;
	background-color: #fff;
}

main.bi-r2.gp-hub .gp-tools {
	gap: 20px 32px;
	align-items: flex-end;
	justify-content: space-between;

	/* 72px when this was the first thing in the section; the topic row is above
	   it now and owns the opening space. */
	padding-top: 30px;
	padding-bottom: 10px;
	margin: 0;
	border-bottom: 1px solid var(--gp-rule);
}

main.bi-r2.gp-hub .gp-tools-title {
	margin: 0 0 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .latest-tools {
	min-width: 0;
}

main.bi-r2.gp-hub .latest-tools .wp-block-search__inside-wrapper {
	gap: 0;
	border: 0;
}

main.bi-r2.gp-hub .latest-tools .wp-block-search__input {
	width: min(420px, 70vw);
	padding: 13px 15px;
	font-size: 16px;
	color: var(--gp-ink);
	background: #fff;
	border: 1px solid var(--gp-field-edge);
	border-right: 0;
	border-radius: 0;
}

main.bi-r2.gp-hub .latest-tools .wp-block-search__input::placeholder {
	color: var(--gp-placeholder);
}

main.bi-r2.gp-hub .latest-tools .wp-block-search__button {
	min-height: 48px;
	margin: 0;
	padding: 13px 20px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--gp-teal-deep);
	border: 1px solid var(--gp-teal-deep);
	border-radius: 0;
	cursor: pointer;
}

main.bi-r2.gp-hub .latest-tools .wp-block-search__button:hover {
	background: var(--gp-teal-press);
	border-color: var(--gp-teal-press);
}

/* The reset link, bound to the archive source. It renders empty when no filter
   is active, and an empty inline-flex box would still draw its border. */
main.bi-r2.gp-hub .reset-wrap {
	margin: 10px 0 0;
	font-size: 14.5px;
}

main.bi-r2.gp-hub .reset-wrap:empty {
	display: none;
}

main.bi-r2.gp-hub .reset-wrap a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--gp-teal-deep);
	text-underline-offset: 3px;
}

main.bi-r2.gp-hub .latest-meta {
	gap: 4px 16px;
	margin: 0;
	padding-bottom: 4px;
}

main.bi-r2.gp-hub .latest-meta .result-count,
main.bi-r2.gp-hub .latest-meta .filter-summary {
	margin: 0;
	font-size: 14.5px;
	color: var(--gp-muted);
}

main.bi-r2.gp-hub .latest-meta p:empty {
	display: none;
}

/* Topic navigation. Kept, and restyled as a quiet row of text links rather
   than removed: the practice has eleven real topic categories and
   `Basuto_Insights_Render::topics()` points them at the hub's own `?topic=`
   views, which the article's topic chip also links to. The approved mockup drew
   no topic row because its six-article fixture shared one category — a property
   of the fixture, not a decision about the live taxonomy. */
/* Moved ABOVE the search row by this release. The hosted review found the stack
   "hero → lead → search → secondary" delayed browsing: a reader who wanted a
   subject rather than a specific phrase had to pass the opening, the lead story
   and a search field before being offered one. Topics are now the first thing
   after the lead plate, and the search row follows for people who know what
   they are looking for. */
main.bi-r2.gp-hub .topicnav {
	padding: 54px 0 0;
	margin: 0;
	background: transparent;
}

main.bi-r2.gp-hub .gp-browse-title {
	margin: 0 0 10px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .topicnav-scroll {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
}

main.bi-r2.gp-hub .topicnav-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0;

	/* `padding: 0` alone left a ~12px indent: core's list styles set
	   `padding-inline-start` separately and the logical property wins over the
	   physical shorthand's `padding-left` in LTR. Both are zeroed. */
	padding: 0;
	padding-inline-start: 0;
	list-style: none;
}

main.bi-r2.gp-hub .topicnav-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

main.bi-r2.gp-hub .topicnav-list li::marker {
	content: '';
}

main.bi-r2.gp-hub .topicnav-list a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: 14.5px;
	color: var(--gp-muted);
	text-decoration: none;
}

main.bi-r2.gp-hub .topicnav-list a:hover,
main.bi-r2.gp-hub .topicnav-list .current-topic a {
	color: var(--gp-teal-deep);
	text-decoration: underline;
	text-underline-offset: 4px;
}

main.bi-r2.gp-hub .next-step {
	margin: 18px 0 0;
	font-size: 16px;
	max-width: 52em;
	color: var(--gp-muted);
}

main.bi-r2.gp-hub .next-step:empty {
	display: none;
}

main.bi-r2.gp-hub .next-step a {
	color: var(--gp-teal-deep);
}

/* ---- 5. The library: a two-column list with square thumbnails ---- */

main.bi-r2.gp-hub .ed-grid-wrap {
	margin-top: 0;
}

main.bi-r2.gp-hub .gp-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 0 56px;
	margin: 0;
	padding: 0 0 16px;
	list-style: none;
}

/* The second card in the first row started 20px below the first one.
 *
 * `wp:post-template` in `templates/insights-hub.html` carries no `layout`
 * attribute, so WordPress renders this list as FLOW — `is-layout-flow
 * wp-block-post-template-is-layout-flow`, and no `wp-container-core-…` class,
 * because a flow container with the theme's own block gap needs no per-instance
 * rule. Global styles then supply the spacing for every flow container on the
 * page:
 *
 *     :root :where(.is-layout-flow) > :first-child { margin-block-start: 0 }
 *     :root :where(.is-layout-flow) > *            { margin-block-start: 20px }
 *
 * `:first-child` is a pseudo-class, so the first rule is (0,2,0) and the second
 * (0,1,0): the FIRST `<li>` keeps 0 and every later `<li>` takes 20px, whatever
 * the order of the two declarations.
 *
 * The rule above then replaces that flow with CSS grid. The display changes;
 * the margins WordPress already put on the children do not. In a grid they stop
 * being "space between stacked siblings" and become a 20px offset inside each
 * item's own grid area — so cards 2, 3 and 4 sit 20px low and card 1 does not.
 * In a two-column grid that is visible exactly once, between the two cards of
 * row one; cards 3 and 4 share the same offset and so look level with each
 * other while the whole second row hangs 20px below its row line.
 *
 * Measured on staging at 1440 (codex/alignment-baseline.json): row-one card
 * one `.gp-item` top 1703.98, so its thumbnail sits at 1737.98 after the card's
 * 34px padding, and the `<li>` carries no margin. Every later `<li>` carries
 * 20px, which is where row one's second card goes. Confirmed after the fix on
 * the saved staging page at 320, 390, 768, 1342 and 1440 in
 * codex/alignment-check.json.
 *
 * So: drop the flow margins on the children this stylesheet has re-laid-out as
 * grid items. It is the same correction `.gp-item-media { margin: 0 }` below
 * already makes for the thumbnail inside each card, applied at the level that
 * was missed. Row rhythm is the row's own `padding: 34px 0` and hairline, which
 * is why `gap`'s row value is 0 — the 20px was never part of it.
 *
 * (0,3,2) against the global rules' (0,2,0), so no `!important` is needed, and
 * the selector reaches only this grid: the article page's "More reading" list
 * declares `layout: grid` and so is rendered `is-layout-grid`, which carries no
 * margin rules and is not affected either way. Single-item lists — the lead and
 * the supporting story — are unaffected because their one `<li>` is
 * `:first-child`. */
main.bi-r2.gp-hub .gp-grid > li {
	margin-block: 0;
}

main.bi-r2.gp-hub .gp-item {
	display: grid;
	grid-template-columns: 132px minmax(0, 1fr);
	gap: 22px;
	align-items: start;
	padding: 34px 0;
	margin: 0;
	border: 0;
	border-bottom: 1px solid var(--gp-rule);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

/* The same correction as `.gp-grid > li` above, one level down and for exactly
 * the same reason. `.gp-item` is also rendered `is-layout-flow`, so WordPress
 * puts its block gap on every child of the card too; this stylesheet then makes
 * the card a two-column grid with `align-items: start`. In a grid that margin
 * is not space between stacked siblings, it is a dead offset inside each
 * child's own grid area.
 *
 * The thumbnail never showed it because the rule below already zeroed its
 * margin outright. `.gp-item-body` did not, so every title, excerpt and byline
 * block started 20px below its own thumbnail while `align-items: start` said
 * they should be level — the offset Codex measured on all four cards at
 * 1342/1440 after the `> li` fix (codex/alignment-check.json, `titleOffsets`).
 *
 * `margin-block`, not `margin`: a `<figure>` still needs its UA inline margin
 * removing, which the rule below now does on its own terms. */
main.bi-r2.gp-hub .gp-item > * {
	margin-block: 0;
}

main.bi-r2.gp-hub .gp-item-media {
	margin-inline: 0;
}

main.bi-r2.gp-hub .gp-item-media img {
	display: block;
	width: 132px;
	height: 132px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0;
	max-height: none;
}

/* An article with no featured image would otherwise leave a 132px hole and
   indent its title across it. */
main.bi-r2.gp-hub .gp-item:not(:has(.gp-item-media img)) {
	grid-template-columns: minmax(0, 1fr);
}

/* `insights-repair.css` styles `.ed-card-body` as the lower half of the OLD
   boxed card: `padding: 15px 18px 18px; border-top: 3px solid
   var(--bi-teal-deep)`. These list rows still carry `ed-card-body` — the class
   is part of the archive markup contract — so every grid title sat under a 3px
   teal bar and 18px of card padding. Approved Design A's `.a-item` is a plain
   list row: a thumbnail, text, and one hairline UNDER the row. Reset here; the
   shared file is untouched because the old hub and the article's "More
   reading" cards still read it. */
main.bi-r2.gp-hub .gp-item-body {
	min-width: 0;
	padding: 0;
	border-top: 0;
}

main.bi-r2.gp-hub .gp-item-title {
	margin: 0;
	font-family: var(--gp-serif);
	font-weight: 400;
	font-size: 21px;
	line-height: 1.25;
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .gp-item-title a {
	color: inherit;
	text-decoration: none;
}

main.bi-r2.gp-hub .gp-item-title a:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

main.bi-r2.gp-hub .gp-item-excerpt {
	margin: 9px 0 0;
	font-size: 15.5px;
	line-height: 1.55;
	color: var(--gp-muted);
}

main.bi-r2.gp-hub .gp-item .story-meta {
	margin-top: 12px;
	font-size: 13.5px;
	color: var(--gp-muted);
}

main.bi-r2.gp-hub .empty-state {
	max-width: 40em;
	padding: 48px 0 0;
	font-size: 18px;
	color: var(--gp-ink);
}

main.bi-r2.gp-hub .empty-state p {
	margin: 0 0 10px;
}

main.bi-r2.gp-hub .empty-state a {
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .ed-pagination {
	gap: 10px 16px;
	padding: 42px 0 76px;
	font-size: 15px;
}

main.bi-r2.gp-hub .ed-pagination a,
main.bi-r2.gp-hub .ed-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	color: var(--gp-teal-deep);
}

/* ---- 6. Closing CTA ---- */

main.bi-r2.gp-hub .cta-band {
	padding: 0;
	background-color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .cta-band-inner {
	padding-block: 76px 80px;
}

main.bi-r2.gp-hub .cta-band h2 {
	max-width: 16em;
	margin: 0;
	font-family: var(--gp-serif);
	font-weight: 300;
	font-size: clamp(28px, 3.4vw, 42px);
	line-height: 1.14;
	text-align: left;
}

main.bi-r2.gp-hub .cta-band .cta-band-note {
	max-width: 34em;
	margin: 16px 0 0;
	font-size: 17.5px;
	line-height: 1.6;
	color: var(--gp-on-teal);
}

main.bi-r2.gp-hub .cta-band .wp-block-buttons {
	gap: 14px;
	justify-content: flex-start;
}

main.bi-r2.gp-hub .cta-band .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 16px 26px;
	border-radius: 0;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---- 7. Responsive ---- */

@media (max-width: 1023px) {
	main.bi-r2.gp-hub .gp-hero-inner {
		grid-template-columns: minmax(0, 1fr);

		/* Stacked, the text and the picture each have their own height; a floor
		   on the pair would only add empty teal. */
		min-height: 0;
	}

	main.bi-r2.gp-hub .gp-hero-text {
		/* Same `max()` contract as desktop. 52px was less than the 42px
		   under-reservation plus any air at all, which is why the hosted phone
		   capture put the H1 at y=135 beneath a header ending at y=137. */
		padding-top: max(44px, var(--gp-header-gap));
		padding-right: 24px;
		padding-bottom: 40px;
		padding-left: 24px;
	}

	main.bi-r2.gp-hub .gp-hero-fig .gp-hero-media img {
		min-height: 0;
		height: auto;

		/* 2.1/1 cropped a clinician's head on the hosted phone capture. 2/1 is
		   marginally taller and the crop is anchored higher — see
		   `object-position` above — which keeps faces in frame without
		   reinstating a tall opening.

		   Capped in absolute terms as well as by ratio: at 768 the ratio alone
		   gave a 384px band, and a stacked opening of 655px was most of a
		   tablet viewport before a single article title. */
		aspect-ratio: 2 / 1;
		max-height: 230px;
		object-fit: cover;
	}

	main.bi-r2.gp-hub .gp-lead-wrap {
		padding-block: 32px 0;
	}

	main.bi-r2.gp-hub .gp-lead {
		max-width: none;
		padding: 32px 24px 34px;
	}

	main.bi-r2.gp-hub .gp-jump--after {
		max-width: none;
	}

	main.bi-r2.gp-hub .gp-second {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	main.bi-r2.gp-hub .gp-second-wrap {
		padding-block: 40px 44px;
	}

	main.bi-r2.gp-hub .gp-second-media img {
		aspect-ratio: 2 / 1;
	}

	main.bi-r2.gp-hub .gp-grid {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 0;
	}

	main.bi-r2.gp-hub .spread,
	main.bi-r2.gp-hub .latest-hub,
	main.bi-r2.gp-hub .cta-band {
		padding-left: 24px;
		padding-right: 24px;
	}
}

/* ---- 8. "Straight to a section" ----
 *
 * ONE instance, under the lead story, at every width.
 *
 * 1.5.0-rc.1 carried two instances — one in the teal opening for desktop, one
 * under the lead for phones — and switched between them with `display`. Both
 * are out of the opening now, for two reasons the hosted review raised together:
 *
 *   the opening measured 849px tall and these links were part of why. Removing
 *   them is most of the hero-footprint reduction brief §1 asks for;
 *
 *   the links point into the LEAD ARTICLE's own sections, and nothing in the
 *   opening said so. Directly under the lead plate they read as what they are —
 *   a way into that story — rather than as site navigation that happened to say
 *   "Sample section one".
 *
 * One instance also means one landmark, which is what a screen reader should be
 * offered; the previous arrangement depended on `display: none` keeping the
 * second one out of the accessibility tree.
 *
 * `Basuto_Insights_Render::jump_links()` fills it from the resolved lead and the
 * same heading map the article's contents list is built from, and drops the
 * whole group when there is no lead or it has fewer than two sections. Nothing
 * here is hardcoded. */
main.bi-r2.gp-hub .gp-jump--after {
	display: block;
	margin: 26px 0 0;
	max-width: 760px;
}

/* On white, under the plate, so the list takes its on-white colours rather than
   the mint-on-teal ones the opening used. */
main.bi-r2.gp-hub .gp-jump--after .gp-jump-label {
	color: var(--gp-muted);
}

main.bi-r2.gp-hub .gp-jump--after .gp-jump-list {
	border-top: 1px solid var(--gp-rule);
}

main.bi-r2.gp-hub .gp-jump--after .gp-jump-list li {
	border-bottom: 1px solid var(--gp-rule);
}

main.bi-r2.gp-hub .gp-jump--after .gp-jump-list a {
	padding: 12px 0;
	font-size: 18px;
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .gp-jump--after .gp-jump-list a:hover {
	color: var(--gp-teal-deep);
}

main.bi-r2.gp-hub .gp-jump--after .gp-jump-list a:focus-visible {
	outline-color: var(--gp-teal-deep);
}


@media (max-width: 639px) {
	/* ONE gutter on a phone, not two.
	 *
	 * `insights.css`, the shared file, has owned the phone gutter since 1.0.2:
	 *
	 *     .hub-masthead, .topicnav, .spread, .latest-hub, .article-head,
	 *     .article-shell, .related-reading {
	 *         padding-left: 20px !important; padding-right: 20px !important;
	 *     }
	 *
	 * `!important` at (0,1,0), so nothing in this file outranks it and nothing
	 * in this file should try. This breakpoint's own `padding-left: 20px` on
	 * the same three sections was therefore already dead code.
	 *
	 * What was NOT dead was `.gp-inner` and `.gp-lead-wrap` still taking the
	 * desktop `--gp-gutter: 40px` inside those sections. A phone got 20px from
	 * the shared file and 40px again from the inner container: 60px a side,
	 * measured on staging as `.gp-item` x = 60 at a 320px viewport
	 * (codex/alignment-check.json).
	 *
	 * On a 320px phone that left a 200px content column. The card spends 92px
	 * of it on the thumbnail and 16px on the gap, so titles and excerpts had
	 * 92px to live in: the titles broke mid-word — "Recurrin / g / Headach /
	 * es:" — and the four cards measured 873, 952, 882 and 851px tall
	 * (codex/narrow-card.jpg, codex/hub-candidate-320.png).
	 *
	 * That shared rule only applies at 380px and below, so the gutter has two
	 * owners at two widths and the hub has to agree with each. From 381 to 639
	 * the inner containers own it and 20px is the value; at 380 and below the
	 * shared file owns it and the inner containers must add nothing, which is
	 * the second block at the end of this file.
	 *
	 * Moving `--gp-gutter` rather than zeroing one of the two paddings keeps a
	 * single source: `.gp-inner`, `.gp-lead-wrap` and `.cta-band-inner` all
	 * read it, so they cannot drift apart. */
	main.bi-r2.gp-hub {
		--gp-gutter: 20px;
	}

	main.bi-r2.gp-hub .gp-hero-text {
		padding-top: max(36px, var(--gp-header-gap));
		padding-right: 20px;
		padding-bottom: 32px;
		padding-left: 20px;
	}

	/* The heading and the intro deliberately keep their full size on a phone:
	   `clamp(44px, …)` holds the H1 at 44px and the intro stays at 19px. The
	   phone saving comes from the shorter opening and from the section links
	   sitting under the lead, not from shrinking the two things a reader came
	   for. */

	main.bi-r2.gp-hub .gp-lead-wrap {
		padding-block: 26px 0;
	}

	main.bi-r2.gp-hub .gp-lead {
		padding: 26px 20px 28px;
	}

	main.bi-r2.gp-hub .gp-item {
		grid-template-columns: 92px minmax(0, 1fr);
		gap: 16px;
		padding: 26px 0;
	}

	main.bi-r2.gp-hub .gp-item-media img {
		width: 92px;
		height: 92px;
	}

	main.bi-r2.gp-hub .topicnav {
		padding-top: 40px;
	}

	main.bi-r2.gp-hub .gp-tools {
		padding-top: 24px;
	}

	main.bi-r2.gp-hub .latest-tools .wp-block-search__input {
		width: 100%;
	}

	/* The three sections carried `padding-left: 20px; padding-right: 20px` here.
	 * It never applied: `templates/insights-hub.html` writes `padding-left:0px`
	 * inline on all three, and an inline declaration outranks any author rule
	 * that is not `!important`. Removed rather than given an `!important` it
	 * does not need — the inner containers own the gutter through
	 * `--gp-gutter` above, which is the contract section 4 states. */
}

/* The shared file's phone gutter, and the hub agreeing with it.
 *
 * `insights.css` forces `padding-left/right: 20px !important` on `.spread` and
 * `.latest-hub` at 380 and below — the one declaration that does outrank the
 * template's inline `0px`. Nothing in this file can outrank it and nothing
 * here should try, so inside those two sections the inner container adds
 * nothing and the shared 20px is the whole gutter.
 *
 * Scoped to those two containers rather than done by zeroing `--gp-gutter` for
 * the hub: `.cta-band` is not in the shared file's list and its section keeps
 * the template's inline `0px`, so its inner container is the only thing
 * holding its gutter and must go on reading the variable. */
@media (max-width: 380px) {
	main.bi-r2.gp-hub .latest-hub > .gp-inner,
	main.bi-r2.gp-hub .spread > .gp-lead-wrap {
		padding-inline: 0;
	}

	/* `.topicnav` is in the shared file's list too, but it is not a section —
	 * it is a child of `.gp-inner`, so its 20px lands INSIDE the section's
	 * 20px and the topic row alone started at 40 while the search row, the lead
	 * and every card started at 20. `!important` to meet `!important`, which is
	 * the arrangement the note at the top of this file already describes for
	 * `.ed-grid`'s column count. */
	main.bi-r2.gp-hub .topicnav {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}
