/**
 * Active filters row above the Articles / Resources results (inc/active-filters.php):
 * chips, then "Clear all" right after the last one (wrapping when the line is full). The row is an Elementor flexbox holding the
 * Search & Filter "Active filters" and "Clear all" controls.
 */

.e-flexbox-base:has(> .elementor-widget-search-filter-field .search-filter-field--control-type-selection) {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 8px 16px;
	/* Closer to the heading rule above and the first result below (the column adds 20px). */
	margin: -6px 0 -10px;
	padding: 0;
}

/* Nothing selected: the plugin hides the chips; hide "Clear all" (the whole row) too. */
.e-flexbox-base:has(> .elementor-widget-search-filter-field .search-filter-field--control-type-selection.search-filter-field--hidden) {
	display: none;
}

.e-flexbox-base:has(> .elementor-widget-search-filter-field .search-filter-field--control-type-selection) > .elementor-widget-search-filter-field {
	flex: 0 1 auto;
	width: auto;
	min-width: 0;
}

.search-filter-field--control-type-selection .search-filter-input-button-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
}

.search-filter-field--control-type-selection .search-filter-input-button {
	margin: 0;
	max-width: 100%;
	white-space: normal;
	text-align: left;
}

/* ---------- Sort By / Rows per page: same type as the sidebar filter options ----------
   The open list is rendered in a popover at the end of the page (outside the field), so it
   is styled through the popover: this applies to every Search & Filter dropdown. */

.search-filter-component-popover .search-filter-component-combobox-base__listbox-list {
	padding: 4px 0;
	border: 1px solid var(--Grey-text, #5B6472);
	background: #FFFFFF;
}

.search-filter-component-popover .search-filter-component-combobox-base__listbox-option {
	padding: 8px 12px;
	background: transparent;
	font-family: var(--Primary, "Ubuntu"), sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--Dark-blue, #172849);
}

/* Hover / keyboard highlight: the light grey used across the site, not gold. */
.search-filter-component-popover .search-filter-component-combobox-base__listbox-option:hover,
.search-filter-component-popover .search-filter-component-combobox-base__listbox-option--active {
	background: var(--grey-bg, #F5F6F8);
	color: var(--Dark-blue, #172849);
}

/* The current choice: bold navy with a small navy bar, like a ticked filter. */
.search-filter-component-popover .search-filter-component-combobox-base__listbox-option[aria-selected="true"] {
	box-shadow: inset 3px 0 0 var(--Dark-blue, #172849);
	background: var(--grey-bg, #F5F6F8);
	font-weight: 500;
	color: var(--Dark-blue, #172849);
}

/* The closed box: sidebar label type (16px light), navy text. */
.search-filter-field--control-type-sort .search-filter-component-combobox-base,
.search-filter-field--control-type-per_page .search-filter-component-combobox-base {
	font-family: var(--Primary, "Ubuntu"), sans-serif;
	font-size: 16px;
	font-weight: 300;
	color: var(--Dark-blue, #172849);
}
