/**
 * [oaks_post_filter] - see includes/post-filter.php. Enqueued only where the
 * shortcode renders. Colours are the theme's --bb-color-* tokens from style.css.
 * Selectors are .oaks-post-filter-scoped to outrank the BB skin's
 * input[type=search] and :focus rules (0,1,1 / 0,2,1).
 */

.oaks-post-filter {
	--oaks-pf-height: 45px;
	--oaks-pf-field-width: 240px;
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
}

.oaks-post-filter .oaks-pf-field {
	flex: 1 1 var(--oaks-pf-field-width);
	min-width: 0;
}

.oaks-post-filter .oaks-pf-label {
	display: block;
	margin-bottom: 4px;
	font-weight: 700;
	color: var(--bb-color-oaks-charcoal);
}

.oaks-post-filter .oaks-pf-control {
	position: relative;
}

.oaks-post-filter .oaks-pf-search,
.oaks-post-filter .oaks-pf-category {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: var(--oaks-pf-height);
	margin: 0;
	padding: 0 40px 0 12px;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.25;
	color: var(--bb-color-oaks-charcoal);
	background-color: var(--bb-color-off-white-hover);
	border: 1px solid var(--bb-color-oaks-deep-sea);
	border-radius: 0;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: none;
}

.oaks-post-filter .oaks-pf-search::placeholder {
	color: var(--bb-color-oaks-charcoal);
	opacity: 0.7;
}

.oaks-post-filter .oaks-pf-search::-webkit-search-decoration {
	-webkit-appearance: none;
}

.oaks-post-filter .oaks-pf-search:not(:placeholder-shown) {
	padding-right: 12px;
}

.oaks-post-filter .oaks-pf-icon {
	position: absolute;
	top: 50%;
	right: 13px;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	fill: none;
	stroke: var(--bb-color-oaks-charcoal);
	stroke-width: 2;
	stroke-linecap: round;
	opacity: 0.6;
	pointer-events: none;
}

.oaks-post-filter .oaks-pf-search:not(:placeholder-shown) + .oaks-pf-icon {
	display: none;
}

.oaks-post-filter .oaks-pf-category {
	cursor: pointer;
	text-overflow: ellipsis;
}

.oaks-post-filter .oaks-pf-control-select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 17px;
	width: 7px;
	height: 7px;
	border-right: 2px solid var(--bb-color-oaks-charcoal);
	border-bottom: 2px solid var(--bb-color-oaks-charcoal);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.oaks-post-filter .oaks-pf-search:focus,
.oaks-post-filter .oaks-pf-category:focus {
	color: var(--bb-color-oaks-charcoal);
	background-color: var(--bb-color-off-white-hover);
	border-color: var(--bb-color-oaks-deep-sea);
	box-shadow: none;
}

.oaks-post-filter .oaks-pf-search:focus-visible,
.oaks-post-filter .oaks-pf-category:focus-visible {
	outline: 2px solid var(--bb-color-oaks-deep-sea);
	outline-offset: 2px;
}

.oaks-post-filter .oaks-pf-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.fl-module.oaks-pf-loading {
	opacity: 0.5;
	transition: opacity 0.15s linear;
}

.fl-module.oaks-post-filter-results:focus:not(:focus-visible) {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	.fl-module.oaks-pf-loading {
		transition: none;
	}
}

@media (forced-colors: active) {
	.oaks-post-filter .oaks-pf-icon {
		stroke: CanvasText;
		opacity: 1;
	}
}
