/**
 * Sidebar Lab. Pairs with functions/sidebar-lab.php.
 *
 * Every rule is scoped under a body.sbl-* class. Since 2026-10-10 (reskin
 * to prod, #1190) this sheet is enqueued on every host and the settled
 * defaults ship: sbl-on, sbl-count-paren, sbl-hang-peek, sbl-width-wide,
 * sbl-ground-white, sbl-side-right. The other axes' rules (search popup,
 * follow, stick, tree, paper, other hang/ground/peek values, the switcher
 * panel and study page) only match classes that demo hosts emit.
 *
 * Checked 2026-10-10: the default look depends on no rule in
 * css/reskin-2026-demo.css — it reads only --color-accent (reskin-2026.css,
 * navy via body.reskin-navy) and --font-display / --fw-display
 * (reskin-tokens.css). Nothing was graduated from the demo sheet.
 *
 * Contents
 *   1. Tokens + shared rail bits
 *   2. Counts            body.sbl-count-*
 *   3. Search / filter   body.sbl-search-*
 *   4. Follow module     body.sbl-follow-*
 *   5. Hang              body.sbl-hang-*
 *   6. Sticky            body.sbl-stick-*
 *   7. Tree depth        body.sbl-tree-*
 *   8. The switcher window and the study page
 */

/* ── 1. Tokens ──────────────────────────────────────────────────────── */

body.sbl-on:not(.search) {
	--sbl-accent: var(--color-accent, #dc0009);
	--sbl-ink: #1f2328;
	--sbl-muted: var(--c-neutral-600, #5c636d);
	--sbl-line: #d9dee3;
	--sbl-tint: rgba(220, 0, 9, .07);
	--sbl-ground: #f4f5f6;
	--sbl-radius: 8px;
	/* Sticky offsets: the theme header is not fixed on inner pages, so a
	   small top gap is all that is needed to keep a stuck rail off the
	   viewport edge. */
	--sbl-stick-top: 24px;
}

/* ── 2. Counts ──────────────────────────────────────────────────────── */

body.sbl-on:not(.search) .sbl-count {
	font-variant-numeric: tabular-nums;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: var(--sbl-muted);
	white-space: nowrap;
}

/* The one count treatment (Kalman, 2026-09-01): "Climate Change (16)", on
   every term that has posts. The right-aligned column, tint pill, density
   bar and the 5+ suppression variant are all deleted — along with the
   padding-right that kept the first three clear of the accordion chevron,
   since the number now rides inside the link text and nothing collides. */
body.sbl-count-paren:not(.search) .sbl-count {
	margin-left: .4em;
	/* .85em of a 14px link was 11.9px, under the reskin's 13px floor (#1346). */
	font-size: max(.85em, 13px);
}
body.sbl-count-paren:not(.search) .sbl-count::before { content: "("; }
body.sbl-count-paren:not(.search) .sbl-count::after  { content: ")"; }

/* ── 3b. Search popup (?sbsearch=popup) ─────────────────────────────── */

/* ── The grey the card exposes ──────────────────────────────────────── */

/* The resource rail's accordion rows carry background:#f3f3f3 (global.css
   .card-header). On the shipped page that grey sits on the page's own grey
   ground and disappears; inside a white hang card it reads as dirt — grey
   blocks on white,
which is exactly what Kalman flagged. Inside a card the
   rows get the card's own ground and a hairline rule instead,
so the
   structure still reads without the fill. */
body.sbl-hang-peek:not(.search) #sidebar .card-header,
body.sbl-hang-peek:not(.search) #sidebar .panel-heading {
	background: transparent !important;
	border-bottom: 1px solid var(--sbl-line) !important;
}

/* ── Rail width ─────────────────────────────────────────────────────── */

/* Long category names ("Public Works, Energy and Utilities") wrap to three
   lines in 255px and run under the accordion chevron pinned at right:0.
   Widening the column is the fix; the extra right padding stops the
   collision at any width. Both columns are set so the row still adds to
   100% — Bootstrap's own col-md-3/col-md-9 pair is what is being overridden.
   :has() finds the rail column, same lab-only caveat as ?sbside=. */
/* flex-basis, not width. The columns carry `flex: 0 0 25%` from the grid,
   and once ?sbside makes the row a flex container that basis is what sizes
   them — a `width` override computes but changes nothing. Measured: the
   column stayed at 285px with width:33.333% applied and matching. */
@media (min-width: 992px) {body.sbl-width-wide:not(.search) .container > .row:has(> :nth-child(2):last-child) > [class*="col-"]:has(#sidebar-left, #sidebar),
body.sbl-width-wide:not(.search) .container > .row:has(> :nth-child(2):last-child) > [class*="col-"]:has(#sidebar) {
		flex: 0 0 33.333%;
		max-width: 33.333%;
		width: 33.333%;
	}
	body.sbl-width-wide:not(.search) .container > .row:has(> :nth-child(2):last-child):has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-md-9"],
	body.sbl-width-wide:not(.search) .container > .row:has(> :nth-child(2):last-child):has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-sm-8"] {
		flex: 0 0 66.667%;
		max-width: 66.667%;
		width: 66.667%;
	}
	
}/* The accordion chevron is a float inside the row's own <a>,
so a long
   category name wraps AROUND it and the last line runs underneath —
   "Municipal Services" collided with its chevron at every width tested.
   Padding cannot fix a float; making the row a flex line and pushing the
   icon to the end can,
and it holds at 285px,
380px and 433px. */
body.sbl-on:not(.search) #sidebar .card-header > a {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}
body.sbl-on:not(.search) #sidebar .card-header > a > i {
	float: none;
	margin-left: auto;
	flex-shrink: 0;
	line-height: inherit;
}
body.sbl-on:not(.search) #sidebar-left .menu-item-has-children > a { padding-right: 34px; /* 26px let "TRANSPORTATION" run into the chevron (#1346) */ }

/* ── 5. Hang into the title area ────────────────────────────────────── */

@media (min-width: 992px) {/* The rail's column and the #page_head band are siblings two levels up,
so lifting the column is enough — nothing needs to move inside the
	   band. z-index keeps the card above the band's gradient.
	 *
	 * Scoped to "any .container row that holds a rail",
NOT to #page2-cont:
	 * single-advocacy.php (and the other singles) wrap their row in a bare
	 * .container with no id,
so an #page2-cont selector silently skipped
	 * every single-post page. The :has() carries the same ship-it-as-markup
	 * caveat as ?sbside=.
	 *
	 * The offset is a variable so all six variants share one selector list
	 * instead of repeating it per variant. Each value is 50px — the measured
	 * band-to-rail gap — plus however far into the band that variant juts. */
	body[class*="sbl-hang-"]:not(.search) .container > .row:has(> :nth-child(2):last-child) > [class*="col-"]:has(#sidebar-left, #sidebar),
body[class*="sbl-hang-"]:not(.search) .container > .row:has(> :nth-child(2):last-child) > [class*="col-"]:has(#sidebar) {
		position: relative;
		z-index: 3;
		margin-top: calc(-1 * var(--sbl-hang, 0px));
	}body[class*="sbl-hang-"]:not(.search) .container:has(> .row > [class*="col-"] #sidebar),
body[class*="sbl-hang-"]:not(.search) .container:has(> .row > [class*="col-"] #sidebar-left) {
		position: relative;
		z-index: 2;
	}
	/* The offset is the natural band-to-rail gap PLUS how far into the band
	   that variant should jut. The gap is not constant: archives leave 50px
	   under the band, singles leave 0 — so a single flat -100px put the card
	   100px into the band there instead of 50, twice as deep as everywhere
	   else. Measured, both with the hang off. */
	body[class*="sbl-hang-"]:not(.search)       { --sbl-gap: 50px; }
	body[class*="sbl-hang-"].single:not(.search){ --sbl-gap: 0px; }
	/* Resource singles keep #page2-cont's 50px under the band, unlike the
	   other singles, so with gap 0 the rail stopped 17px BELOW the band
	   (#1346). 32px lands it at the same depth as the other singles. */
	body[class*="sbl-hang-"].single-resource:not(.search) { --sbl-gap: 32px; }

	/* Scaled to two thirds of the first pass across every variant (Kalman,
	   2026-09-01: "maybe about 2/3 as much overlap ... and maybe
	   everywhere"). peek 50 -> 33 is the one that matters; the rest keep
	   their spacing relative to it. */

	body.sbl-hang-peek:not(.search)  { --sbl-jut: 33px; }

	body[class*="sbl-hang-"]:not(.search) { --sbl-hang: calc(var(--sbl-gap) + var(--sbl-jut)); }
	/* /webinars/ prints a full-width intro between the band and the row that
	   holds the rail, so lifting the rail put it over the intro's last line
	   (#1346). No hang there: the rail starts level with the list. */
	body.page-template-webinars[class*="sbl-hang-"]:not(.search) { --sbl-hang: 0px; }/* The rail's h2 carries a 30px top margin from global.css; every hang
	   value zeroes it so the measurement below is the real gap. */
	body[class*="sbl-hang-"]:not(.search) #sidebar-left > li:first-child > h2.widgettitle,
body[class*="sbl-hang-"]:not(.search) #sidebar > li:first-child > h2.widgettitle {
		margin-top: 0 !important;
	}
	
	/* peek — the smallest version that still reads as deliberate: a white
	   card whose top 44px sits inside the band,
nothing else changed. The
	   heading stays on white where its type was designed,
so no inversion
	   and no scrim are needed — the only thing in the band is the card's
	   own corner. This is the "juts a little" option; card and over are the
	   same move committed to harder. */
	/* Measured,
not guessed: the band's bottom edge is 50px above the rail
	   column's top on a 1440px advocacy archive. So -50px is exactly flush
	   and every jut is 50 + however far in you want it. -100 = 50px in. */
	body.sbl-hang-peek:not(.search) #sidebar-left,
body.sbl-hang-peek:not(.search) #sidebar {
		background: #fff;
		/* Closed on all four sides. It started open at the bottom so the card
		   would "run off" down the page, which reads fine under the 49-item
		   advocacy tree and reads as TRUNCATED under the resource rail's six
		   rows — the last hairline landed exactly on the card's edge.
		   Left corners square by default (Kalman, 2026-09-01): the left edge
		   faces the content column, and squaring it stops the card reading as
		   a sticker floating on the band. ?sbpeek=rounded restores the curve. */
		border-radius: 0 var(--sbl-radius) var(--sbl-radius) 0;
		padding: 26px 18px 22px !important;
		box-shadow: 0 6px 24px rgba(0, 0, 0, .10), 0 -2px 18px rgba(0, 0, 0, .16);
	}
	/* The heading's 4px red rule is a border-left on the h2,
so inside a
	   card it floats one padding-width in from the edge instead of sitting
	   ON the edge (Kalman,
2026-09-01). Pull the h2 out by the card's own
	   horizontal padding and add that same amount back as padding-left,
so
	   the rule lands flush on the card edge while the heading text stays
	   aligned with the menu items below it. --sbl-card-pad is set per
	   variant so the two numbers can never drift apart. */
	body.sbl-hang-peek:not(.search) #sidebar-left,
body.sbl-hang-peek:not(.search) #sidebar { --sbl-card-pad: 18px; --sbl-card-pad-top: 26px; }body.sbl-hang-peek:not(.search) #sidebar-left > li:first-child > h2.widgettitle,
body.sbl-hang-peek:not(.search) #sidebar > li:first-child > h2.widgettitle {
		margin-left: calc(-1 * var(--sbl-card-pad)) !important;
		margin-right: calc(-1 * var(--sbl-card-pad)) !important;
		padding-left: calc(13px + var(--sbl-card-pad)) !important;
		/* Left side gets the compensation; the right gets none, because
		   nothing sits in that gutter and the title needs the measure.
		   "Advocacy Topics" is 192px of Fraunces 24 and had 193px — it
		   wrapped anyway once the 4px rule was counted. Zeroing the right
		   padding gives it 32px of headroom and puts it on one line. */
		padding-right: 0 !important;
	}

}

/* The theme gives the rail's first widget padding-top:35px, which made
   sense when the rail started on the open page and is dead space once the
   card supplies its own 26px — 61px above the title on /news/. The card's
   padding is the spacing; the widget's is not needed. */
@media (min-width: 992px) {body[class*="sbl-hang-"]:not(.search) #sidebar-left > li:first-child,
body[class*="sbl-hang-"]:not(.search) #sidebar > li:first-child {
		padding-top: 0 !important;
		margin-top: 0 !important;
	}
}

/* Secondary widgets in the rail (Recent posts, and anything else a rail
   picks up) ship at Playfair 36/50 with a 17px inset rule, while the rail's
   lead title is 21/25 with its rule flush to the card edge. Two headings
   competing, and two rules that do not line up. Everything after the first
   widget is brought onto the lead title's treatment. */
@media (min-width: 992px) {
	body[class*="sbl-hang-"]:not(.search) #sidebar-left li.widget > h2.widgettitle,
	body[class*="sbl-hang-"]:not(.search) #sidebar li.widget > h2.widgettitle,
	body[class*="sbl-hang-"]:not(.search) #sidebar-left > li > h2.widgettitle,
	body[class*="sbl-hang-"]:not(.search) #sidebar > li > h2.widgettitle {
		font-size: 21px !important;
		line-height: 25px !important;
		margin-left: calc(-1 * var(--sbl-card-pad)) !important;
		margin-right: calc(-1 * var(--sbl-card-pad)) !important;
		padding-left: calc(13px + var(--sbl-card-pad)) !important;
		padding-right: 0 !important;
	}
	/* Only the lead title loses its top margin — the ones below it need the
	   separation from the list above. */
	body[class*="sbl-hang-"]:not(.search) #sidebar-left > li:not(:first-child) > h2.widgettitle,
	body[class*="sbl-hang-"]:not(.search) #sidebar > li:not(:first-child) > h2.widgettitle {
		margin-top: 26px !important;
	}
}

/* The recent-entries list ships circle bullets and underlined links; the
   categories list above it has neither. Match them. */
body.sbl-on:not(.search) #sidebar .widget_recent_entries ul,
body.sbl-on:not(.search) #sidebar-left .widget_recent_entries ul {
	list-style: none;
	padding-left: 0;
	margin: 0;
}
body.sbl-on:not(.search) #sidebar .widget_recent_entries li,
body.sbl-on:not(.search) #sidebar-left .widget_recent_entries li {
	list-style: none;
	padding: 8px 0;
	border-bottom: 1px solid var(--sbl-line);
}
body.sbl-on:not(.search) #sidebar .widget_recent_entries li:last-child,
body.sbl-on:not(.search) #sidebar-left .widget_recent_entries li:last-child {
	border-bottom: 0;
}
body.sbl-on:not(.search) #sidebar .widget_recent_entries a,
body.sbl-on:not(.search) #sidebar-left .widget_recent_entries a {
	text-decoration: none;
	color: var(--sbl-ink);
	font-weight: 500;
	line-height: 1.4;
	display: block;
}
body.sbl-on:not(.search) #sidebar .widget_recent_entries a:hover,
body.sbl-on:not(.search) #sidebar-left .widget_recent_entries a:hover {
	color: var(--sbl-rule, #dc0009);
}
/* Core renders the date as a sibling <span> after the link, so it needs to
   be pushed onto its own line under the headline. Quiet and small — it is
   there to date the item, not to compete with it. */
body.sbl-on:not(.search) #sidebar .widget_recent_entries .post-date,
body.sbl-on:not(.search) #sidebar-left .widget_recent_entries .post-date {
	display: block;
	margin-top: 3px;
	font: 400 var(--fs-100)/1.3 var(--font-body, 'Lexend', sans-serif);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--sbl-muted);
}

/* ── The content column as paper (?sbpaper=) ────────────────────────── */

/* ── Page ground (?sbground=) ────────────────────────────────────────── */

/* Kalman, 2026-10-02, looking at the reskin on d2mma: "the body of the pages
   in grey ends up looking like it is upside down a bit ... the single post
   was looking ok because the body is on a white background ... maybe we
   have to experiment with the page backgrounds being white by default ...
   unless there is a white thing on top ... and maybe we experiment with the
   sidebar having some grey in it".

   ?sbpaper= answers the same complaint by keeping the grey and giving the
   article its own white sheet. These go the other way: the page is white
   (the p1vlct pattern), and the grey moves INTO the rail, so the rail is
   the thing set apart and the reading column is plain paper. The homepage
   keeps its own bands. */
body[class*="sbl-ground-"]:not(.home):not(.search) {
	background: #fff;
}

/* white — the lab default since 2026-10-02 (Kalman, after comparing all
   four: "I like white background and then we just have to do more with
   thin outlines"). The rail stays the white peek card, edged with a
   hairline instead of a shadow. ?sbground=off restores the grey page. */
body.sbl-ground-white:not(.search) #sidebar-left,
body.sbl-ground-white:not(.search) #sidebar {
	box-shadow: none;
	border: 1px solid var(--sbl-line);
}

/* ...except where the content is already white boxes. There the grey is
   what makes them read, and with white cards in the column the rail stops
   overwhelming it (Kalman, 2026-10-02: "lets make the background of some
   pages grey still...when there is other white content on it the sidebar
   doesnt overwhelm it so much"). Single posts (white article sheet) and
   any page listing resource cards (/resources/ and its categories). Add a
   page type here when it gets white cards of its own. */
body.sbl-ground-white:not(.search):not(.home):is(.single-post, :has(.single_resources_wrapper)) {
	background: #f3f3f3;
}

/* Applied automatically on the white default to the page types that are
   collections of items or a single item (Kalman 2026-10-02, agreeing with
   the A/B: "I agree exactly with how you think about it"): list archives
   (news, advocacy, press releases — anything listing .single_news_wrapper),
   the staff directory (Grid Builder cards) and single events. Resource
   listings and single posts take the grey ground from the rule above.
   The /advocacy/ landing lists news rows too but is a mixed page — it
   stays white. Editorial pages (section pages, about text, forms) stay
   white. ?sbground=boxes forces it on any page for comparison. */
/* boxes (Kalman 2026-10-02: "find some page examples and show me white
   background and an alternative ... attractive with a grey background but
   the sidebar doesnt overpower") — the grey alternative to the white page: grey ground, the
   content itself in white boxes, the rail flattened to the same hairline
   card so it sits in the same plane instead of floating above the
   content. Lists become one white card per item; everything else gets
   one white sheet. */
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.home):not(.search) {
	background: #f3f3f3;
}
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search) #sidebar-left,
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search) #sidebar {
	box-shadow: none;
	border: 1px solid var(--sbl-line);
}

/* One sheet for the content column — unless it is a list, where the
   items are the boxes. */
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .container > .row:has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-"]:not(:has(#sidebar-left, #sidebar, .single_news_wrapper, .single_resources_wrapper, .wpgb-card)) {
	background: #fff;
	border: 1px solid var(--sbl-line);
	border-radius: var(--sbl-radius);
	padding: 20px;
	align-self: flex-start;
	margin-bottom: 48px;
}
@media (min-width: 992px) {
	body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .container > .row:has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-"]:not(:has(#sidebar-left, #sidebar, .single_news_wrapper, .single_resources_wrapper, .wpgb-card)) {
		padding: 36px 40px;
	}
}
/* Stacked (under 992px) the sheet is a full-width column whose row pulls it
   out to the screen edges, so the card ran edge to edge on phones while the
   rail card below kept a 15px gutter (#1346). Same gutter here. */
@media (max-width: 991px) {
	body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .container > .row:has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-"]:not(:has(#sidebar-left, #sidebar, .single_news_wrapper, .single_resources_wrapper, .wpgb-card)) {
		flex: 0 0 calc(100% - 30px);
		max-width: calc(100% - 30px);
		margin-left: 15px;
		margin-right: 15px;
	}
}

/* The sheet's padding stops the first block's top margin collapsing away
   the way it does on the bare column (audit 2026-10-11): single events
   opened with the empty image wrapper (30px) + the date h3's 60px margin,
   ~125px of blank card. No image -> no wrapper; first block flush. */
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .container > .row:has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-"]:not(:has(#sidebar-left, #sidebar, .single_news_wrapper, .single_resources_wrapper, .wpgb-card)) > .wp-caption:first-child:not(:has(img)) {
	display: none;
}
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .container > .row:has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-"]:not(:has(#sidebar-left, #sidebar, .single_news_wrapper, .single_resources_wrapper, .wpgb-card)) > :first-child,
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .container > .row:has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar) > [class*="col-"]:not(:has(#sidebar-left, #sidebar, .single_news_wrapper, .single_resources_wrapper, .wpgb-card)) > .wp-caption:first-child:not(:has(img)) + * {
	margin-top: 0;
}

/* List items (news, advocacy archives, press releases): a white card
   each, same hairline + hover as the resource cards (?cards=14). */
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .single_news_wrapper {
	background: #fff;
	border: 1px solid #dfe3e7;
	border-radius: 10px;
	padding: 18px;
	margin: 0 0 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .single_news_wrapper:hover,
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home) .single_news_wrapper:focus-within {
	border-color: #9aa2ad;
	box-shadow: 0 0 0 1px #9aa2ad, 0 8px 22px rgba(0, 0, 0, .08);
}

/* Staff directory (WP Grid Builder cards): each person a white card. The
   grid positions the outer <article> absolutely, so the box goes on the
   inner wrapper to leave its measured size alone. Not the job board
   (/municipal-marketplace/job-ads/): its rows are Grid Builder cards too,
   and outlined rows were not wanted there (Kalman 2026-11-27). */
body:is(.sbl-ground-boxes, .sbl-ground-white:is(.single-event, :has(#page2-cont .wpgb-card), :has(#page2-cont .single_news_wrapper):not(.page-template-advocacy-template))):not(.search):not(.home):not(.page-template-job-listings-new) .wpgb-card .wpgb-card-inner {
	background: #fff;
	border: 1px solid #dfe3e7;
	border-radius: 10px;
	overflow: hidden;
}

/* ── 5b. Card edge + accent rule (?sbpeek=) ─────────────────────────── */

/* Variations on the settled peek card. All of them are about two things:
   where the red mark sits, and which corners are cut. Only the card hangs
   have a card to cut, so everything here is scoped to them.

   The rule is a border-left on the h2, which cannot reach past the h2 — so
   "run it to the top" is done by pulling the heading up by the card's top
   padding and adding that padding back inside, the same trick the flush
   left edge uses horizontally. "Run it the whole height" cannot be done
   that way at all and uses a pseudo-element on the card instead. */
@media (min-width: 992px) {body[class*="sbl-hang-"]:not(.search) #sidebar-left,
body[class*="sbl-hang-"]:not(.search) #sidebar {
		position: relative;
		/* The shipped rule is a flat brand red (#dc0009 in global.css), NOT
		   the section accent — which is gold on advocacy. Variants that draw
		   their own rule have to match the h2's border or the same card ends
		   up with two different reds in it. */
		--sbl-rule: #dc0009;
	}

	/* Corner cuts. The left edge faces the content column,
so squaring it
	   reads as the card being anchored to the page rather than floating. */

}

/* ── 6b. Which side the rail sits on (?sbside=right) ─────────────────── */

/* The site is split: advocacy/news/events/author/category put the rail
   after the content in source order (so it floats right), resources/press
   releases/search/listings put it before (so it floats left). The overlap
   only reads on the right, so this previews "all right" without touching
   19 templates.
 *
 * Bootstrap 3 columns are floats, and source order decides which side a
 * float lands on — so the flip has to come from making the row a flex
 * container and reordering. align-items:flex-start keeps the two columns
 * from stretching to equal height, which floats never did.
 *
 * :has() is doing the work of finding "the column that contains a rail",
 * which is what makes this a one-rule preview instead of a per-template
 * selector list. That is fine for a lab (every current browser supports
 * it) but it is NOT how this should ship: shipping it means reordering the
 * two columns in each template's markup, which costs nothing at runtime
 * and needs no :has(). */
@media (min-width: 992px) {/* GATE — every rule below only touches a row with EXACTLY two children.
   :has(> :nth-child(2):last-child) is "has a second child that is also the
   last". Without it,
single-listing.php broke: its row holds the rail,
the
   main column AND a third unclassed div,
which floats ignored and flex
   turned into a 855px third column — 1995px of children in a 1140px row.
   Two-column rows are the only shape any of this was designed against. */
	body.sbl-side-right:not(.search) .container > .row:has(> :nth-child(2):last-child):has(> [class*="col-"] #sidebar-left, > [class*="col-"] #sidebar),
body.sbl-side-right:not(.search) .container > .row:has(> :nth-child(2):last-child):has(> [class*="col-"] #sidebar),
body.sbl-side-right:not(.search) .search-page-container > .row:has(> :nth-child(2):last-child):has(> #filtr) {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
	}body.sbl-side-right:not(.search) .container > .row:has(> :nth-child(2):last-child) > [class*="col-"]:has(#sidebar-left, #sidebar),
body.sbl-side-right:not(.search) .container > .row:has(> :nth-child(2):last-child) > [class*="col-"]:has(#sidebar),
body.sbl-side-right:not(.search) .search-page-container > .row:has(> :nth-child(2):last-child) > #filtr {
		order: 2;
	}
}/* ── 7. Tree depth ──────────────────────────────────────────────────── */

/* Under 992px the rail card (white, padding, radius) switches off but the
   page-ground rules still draw its 1px border, so the rail's text sat flush
   against a bare outline on tablets and phones (audit 2026-10-11). Same
   card as desktop, full width, all corners round. */
@media only screen and (max-width: 991px) {
	body.sbl-on:not(.search) #sidebar-left,
	body.sbl-on:not(.search) #sidebar {
		background: #fff;
		border: 1px solid var(--sbl-line);
		border-radius: var(--sbl-radius, 8px);
		padding: 20px 18px 16px;
		/* 40px below: the card is the last thing before the footer on most
		   pages and sat flush on it (#1346 — global.css's old-sidebar
		   `.table-footer-on-tablet > ul { margin: 0 !important }` was
		   zeroing this and is gone). */
		margin: 24px 0 40px;
		box-sizing: border-box;
		width: auto;
		max-width: 100%;
	}
}
