/* Stage B V07 — shared compact filter chrome (What's On, HertsJobs, HertsOffers, HertsVolunteers). */

.hp-compact-filters {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: var( --hp-space-6, 24px );
}

/* Win cleanly over each module's earlier board-specific grid rule. */
.hp-jobs-board__filters.hp-compact-filters,
.hp-hertsoffers-board__filters.hp-compact-filters,
.hp-events-filter.hp-compact-filters {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	grid-template-columns: none;
	align-items: stretch;
	margin: 0 0 var( --hp-space-6, 24px );
	padding: 0;
	background: transparent;
	border-radius: 0;
}

.hp-compact-filters__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 9px;
	padding: 9px;
	border: 1px solid color-mix(in srgb, var( --hp-color-primary-500, #7c3aed ) 18%, transparent);
	border-radius: 16px;
	background: linear-gradient(135deg, var( --hp-color-surface, #fff ), var( --hp-color-primary-100, #f5f0ff ));
	box-shadow: 0 10px 28px rgba(55, 31, 86, .07);
}

.hp-compact-filters__row .hp-field,
.hp-compact-filters__row .hp-jobs-board__filter,
.hp-compact-filters__row .hp-hertsoffers-board__filter {
	margin: 0;
}

.hp-compact-filters__row label {
	display: block;
	margin: 0 0 4px;
	color: var( --hp-color-primary-900, #2e1065 );
	font-size: .74rem;
	font-weight: 750;
	line-height: 1.25;
}

.hp-compact-filters__row :where( input, select ) {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid rgba(124, 58, 237, .2);
	border-radius: 12px;
	background: #fff;
	color: var( --hp-color-ink, #17131f );
	font: inherit;
}

.hp-compact-filters__row :where( input, select ):focus-visible {
	border-color: var( --hp-color-primary-500, #7c3aed );
	outline: 3px solid var( --hp-color-primary-200, #c4b5fd );
	outline-offset: 1px;
}

.hp-compact-filters__quick {
	flex: 1 1 220px;
	min-width: 0;
}

.hp-compact-filters__search {
	flex: 0 0 auto;
	min-height: 44px;
	border-radius: 12px;
}

.hp-compact-filters__toggle,
button.hp-compact-filters__toggle {
	flex: 0 0 auto;
	display: none;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	min-height: 44px;
	border: 1px solid var( --hp-color-primary-200, #c4b5fd );
	border-radius: var( --hp-radius-md, 8px );
	background: var( --hp-color-surface, #fff );
	color: var( --hp-color-primary-700, #6d28d9 );
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.hp-compact-filters__toggle::before,
button.hp-compact-filters__toggle::before {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h10M18 7h2M4 17h2M10 17h10M14 4v6M6 14v6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h10M18 7h2M4 17h2M10 17h10M14 4v6M6 14v6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.hp-compact-filters__toggle:hover,
.hp-compact-filters__toggle:focus-visible,
button.hp-compact-filters__toggle:hover,
button.hp-compact-filters__toggle:focus-visible {
	border-color: var( --hp-color-primary-500, #7c3aed );
	background: var( --hp-color-primary-100, #f5f0ff );
	color: var( --hp-color-primary-700, #6d28d9 );
}

.hp-compact-filters__toggle[ aria-expanded="true" ],
button.hp-compact-filters__toggle[ aria-expanded="true" ] {
	background: var( --hp-color-primary-500, #7c3aed );
	border-color: var( --hp-color-primary-500, #7c3aed );
	color: #fff;
}

.hp-compact-filters__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var( --hp-color-primary-500, #7c3aed );
	color: #fff;
	font-size: 0.75rem;
	line-height: 20px;
}

.hp-compact-filters__toggle[ aria-expanded="true" ] .hp-compact-filters__count {
	background: rgba( 255, 255, 255, 0.25 );
}

.hp-compact-filters__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hp-compact-filters__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	min-height: 32px;
	border-radius: 999px;
	background: var( --hp-color-surface-muted, #f1f3f4 );
	color: var( --hp-color-text, #1a1d21 );
	font-size: 0.875rem;
	text-decoration: none;
	line-height: 1;
}

.hp-compact-filters__chip:hover,
.hp-compact-filters__chip:focus-visible {
	background: var( --hp-color-border, #d8dce1 );
}

.hp-compact-filters__chip span[ aria-hidden ] {
	font-size: 1rem;
}

/*
 * Owner correction (2026-08-19): this panel's own diagonal gradient-card
 * (white -> pale lavender, bordered, with a soft shadow) sat directly
 * below the masthead on HertsJobs (where it renders open by default at
 * desktop widths, not behind the "Filters" toggle) -- two adjacent
 * pale-lavender rounded boxes with a visible border/shadow between them
 * read as two separate blocks, the same underlying problem fixed on
 * Local Updates' .hp-feed-filter in this same wave. Shared by What's On,
 * HertsJobs, HertsOffers and HertsVolunteers, so this one change covers
 * all four rather than a per-page patch.
 */
.hp-compact-filters__panel {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	padding-block: 2px;
}

.hp-compact-filters__panel[ hidden ] {
	display: none;
}

.hp-compact-filters__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	grid-column: 1 / -1;
}

.hp-compact-filters__clear-all {
	font-size: 0.9rem;
}

@media ( max-width: 699px ) {
	/* Owner correction (2026-08-20): part of the same measured mobile-density
	   pass as page-surfaces.css's masthead/results-summary trim -- this
	   panel's own margin-bottom (24px on every screen size) was one more
	   real, low-risk whitespace contributor on HertsJobs before the first
	   result card. */
	.hp-compact-filters {
		margin-bottom: 16px;
	}

	.hp-compact-filters.is-enhanced .hp-compact-filters__toggle {
		display: inline-flex;
	}

	.hp-compact-filters__row .hp-compact-filters__search {
		flex: 1 1 auto;
	}

	.hp-compact-filters__panel {
		gap: 10px;
		padding: 12px;
		border-color: var( --hp-color-primary-200, #c4b5fd );
		border-radius: 18px;
	}

	.hp-compact-filters__panel .hp-field,
	.hp-compact-filters__panel .hp-jobs-board__filter,
	.hp-compact-filters__panel .hp-hertsoffers-board__filter {
		margin: 0 !important;
		padding: 0 !important;
	}

	.hp-compact-filters__panel label {
		display: block;
		margin: 0 0 5px !important;
		color: var( --hp-color-primary-900, #2e1065 );
		font-size: 0.78rem !important;
		font-weight: 750;
		line-height: 1.25;
	}

	.hp-compact-filters__panel :where( input, select ) {
		box-sizing: border-box;
		width: 100%;
		min-height: 46px !important;
		height: 46px;
		margin: 0 !important;
		padding: 9px 12px !important;
		border: 1px solid rgba( 124, 58, 237, 0.2 ) !important;
		border-radius: 12px !important;
		background-color: #fff;
		font-size: 0.95rem !important;
	}

	.hp-compact-filters__actions {
		justify-content: space-between;
		gap: 10px;
		margin-top: 2px;
		padding-top: 10px;
		border-top: 1px solid rgba( 124, 58, 237, 0.12 );
	}

	.hp-compact-filters__actions .hp-btn--primary {
		flex: 1 1 auto;
		min-height: 46px;
		border-radius: 12px;
	}

	.hp-compact-filters__clear-all {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 44px;
		min-height: 44px;
		padding-inline: 8px;
	}

	/* Wave 6 mobile touch-target audit (2026-08-20): base .hp-compact-filters__chip
	   is 32px, shared with desktop -- bumped only here (mobile-only) rather than
	   in the base rule, so the desktop chip stays its intended compact size. */
	.hp-compact-filters__chip {
		min-height: 44px;
	}
}

@media ( min-width: 700px ) {
	.hp-compact-filters__panel {
		grid-template-columns: repeat( 3, 1fr );
		align-items: end;
	}
}

@media ( min-width: 1000px ) {
	.hp-compact-filters__panel {
		grid-template-columns: repeat( 4, 1fr ) auto;
	}
}

/*
 * Dark theme (owner-reported, 2026-09-11, /search/?q=heartbeat).
 *
 * The label rules above set a fixed deep purple (--hp-color-primary-900,
 * #2e1065) and the field rules a fixed white background, neither of which had
 * any dark-theme counterpart. Measured on /search/ in dark mode: labels came
 * out #2e1065 on the #2a1b39 filter row -- a contrast ratio of 1.05:1, which
 * is why "Search", "Type" and "Town" were effectively invisible. The fields
 * were inconsistent too: the text inputs kept the hardcoded white while the
 * select picked up the global dark input rule, giving bright white boxes
 * beside a dark dropdown.
 *
 * This lives in the shared file deliberately: What's On, HertsJobs,
 * HertsOffers, HertsVolunteers and Search all use this same chrome, so all of
 * them carried the same latent defect. Colours reuse the palette already
 * established in site-experience.css (#22172e surface, #efe5fa field text,
 * #654975 border, #b4a1c4 placeholder) so the treatment matches the accepted
 * dark direction rather than introducing a second one.
 */
.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) label {
	color: #dbc5ee;
}

/*
 * The `.hp-field` variant is needed, not redundant: the Partner Hub plugin's
 * own public.css sets `.hp-field input[type="search"] { background: var(--hp-white) }`
 * at specificity 0-2-1, which outranked a `:where()`-based dark rule and left
 * the text inputs white while the select -- which that rule does not match --
 * correctly went dark. That mismatch is the "white boxes beside a dark
 * dropdown" the owner reported.
 */
.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) :is( input, select ),
.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) .hp-field :is( input, select ) {
	background: #22172e;
	background-color: #22172e;
	border-color: #654975;
	color: #efe5fa;
}

.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) :is( input, select )::placeholder,
.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) .hp-field :is( input, select )::placeholder {
	color: #b4a1c4;
	opacity: 1;
}

/* A selected option must stay readable in the open native dropdown too. */
.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) select option {
	background: #22172e;
	color: #efe5fa;
}

.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) :is( input, select ):focus-visible,
.hp-experience-dark :is( .hp-compact-filters__row, .hp-compact-filters__panel ) .hp-field :is( input, select ):focus-visible {
	border-color: #c4a3e8;
	outline: 3px solid #7c3aed;
	outline-offset: 1px;
}

/*
 * Field guidance shown under an input. Kept visible only while the field is
 * empty is a template concern; this is just its readable presentation in both
 * themes, matching .hp-section__note.
 */
.hp-compact-filters__hint {
	display: block;
	margin: 4px 0 0;
	color: var( --hp-color-muted, #5c5470 );
	font-size: 0.72rem;
	line-height: 1.35;
}

.hp-experience-dark .hp-compact-filters__hint {
	color: #c3b2d4;
}

/*
 * Site-page suggestions on /search/. This search covers published content and
 * never site pages, so a query like "heartbeat" legitimately matches nothing;
 * these are offered as clearly-labelled destinations, visually distinct from
 * result cards so they can never be mistaken for one. Theme-aware on purpose:
 * the first version reused .hp-community-box and rendered as a white card with
 * an unreadable heading in dark mode.
 */
.hp-search__pages {
	margin: 0 0 var( --hp-space-6, 24px );
	padding: 16px 18px;
	border: 1px solid color-mix( in srgb, var( --hp-color-primary-500, #7c3aed ) 22%, transparent );
	border-left: 4px solid var( --hp-color-primary-500, #7c3aed );
	border-radius: 14px;
	background: var( --hp-color-primary-50, #f7f3ff );
}

.hp-search__pages-title {
	margin: 0 0 2px;
	color: var( --hp-color-primary-900, #2e1065 );
	font-size: 1rem;
	line-height: 1.3;
}

.hp-search__pages-list {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 8px;
}

.hp-search__pages-link {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	min-height: 44px;
	padding: 8px 10px;
	border-radius: 10px;
	background: var( --hp-color-surface, #fff );
	color: inherit;
	text-decoration: none;
}

.hp-search__pages-link strong {
	color: var( --hp-color-primary-700, #6d28d9 );
	text-decoration: underline;
}

.hp-search__pages-link span {
	color: var( --hp-color-muted, #5c5470 );
	font-size: 0.9rem;
}

.hp-search__pages-link:hover,
.hp-search__pages-link:focus-visible {
	background: var( --hp-color-primary-100, #f5f0ff );
}

.hp-experience-dark .hp-search__pages {
	border-color: #5d4478;
	border-left-color: #a78bfa;
	background: #2a1b39;
}

.hp-experience-dark .hp-search__pages-title {
	color: #f3e9ff;
}

.hp-experience-dark .hp-search__pages-link {
	background: #22172e;
}

.hp-experience-dark .hp-search__pages-link strong {
	color: #d7b8ff;
}

.hp-experience-dark .hp-search__pages-link span {
	color: #c3b2d4;
}

.hp-experience-dark .hp-search__pages-link:hover,
.hp-experience-dark .hp-search__pages-link:focus-visible {
	background: #33234a;
}

/* L01.1 (2026-09-12): the filter disclosure uses the brand purple directly,
   which measured 2.43:1 against the dark canvas. It was already corrected for
   Directorist archives in directorist.css, but that stylesheet is not
   enqueued on /offers/ or /hertsoffers/, which use this shared component. */
.hp-experience-dark .hp-compact-filters__toggle {
	color: #d6b4ff;
	border-color: #8b5cf6;
}

.hp-experience-dark .hp-compact-filters__toggle:hover {
	background: rgba( 255, 255, 255, .07 );
}
