/**
 * Query Filter Block — Frontend styles.
 *
 * @package QueryFilterBlock
 * @since   1.0.0
 */

/* Controls row */
.qfb-controls {
	display: flex;
	gap: 1rem;
	align-items: center;
	margin-bottom: 1.5rem;
}

@media ( max-width: 600px ) {
	.qfb-controls {
		flex-direction: column;
	}
}

.qfb-control {
	flex: 1;
	min-width: 0;
}

/* Search */
.qfb-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.qfb-search {
	width: 100%;
	padding: 0.75rem 2.5rem 0.75rem 1rem;
	font-size: 1rem;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	background: #fff;
	transition: border-color 0.2s ease;
	font-family: inherit;
	box-sizing: border-box;
}

.qfb-search:focus {
	outline: none;
	border-color: var( --wp--preset--color--purple-light, #7c3aed );
}

.qfb-search::placeholder {
	color: #999;
}

.qfb-search-clear {
	position: absolute;
	right: 0.75rem;
	top: 50%;
	transform: translateY( -50% );
	background: none;
	border: none;
	font-size: 1.25rem;
	color: #999;
	cursor: pointer;
	line-height: 1;
	padding: 0.25rem;
}

.qfb-search-clear:hover {
	color: #333;
}

/* Category / taxonomy dropdown (custom listbox) */
.qfb-category-wrap {
	position: relative;
}

.qfb-category-toggle {
	width: 100%;
	padding: 0.75rem 2.5rem 0.75rem 1rem;
	font-size: 1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	color: inherit;
	transition: border-color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	line-height: 1.5;
}

.qfb-category-toggle:focus {
	outline: none;
	border-color: var( --wp--preset--color--purple-light, #7c3aed );
}

.qfb-chevron {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	transition: transform 0.2s ease;
	color: #999;
}

.qfb-category-toggle[aria-expanded="true"] .qfb-chevron {
	transform: rotate( 180deg );
}

.qfb-category-listbox {
	position: absolute;
	top: calc( 100% + 4px );
	left: 0;
	right: 0;
	max-height: 400px;
	overflow-y: auto;
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	list-style: none;
	margin: 0;
	padding: 0.5rem 0;
	z-index: 100;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.08 );
}

.qfb-category-listbox[hidden] {
	display: none;
}

.qfb-category-listbox li {
	padding: 0.875rem 1rem;
	font-size: 1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
	color: inherit;
	transition: background-color 0.15s ease;
	outline: none;
}

.qfb-category-listbox li:hover,
.qfb-category-listbox li:focus {
	background: #f5f5f5;
}

.qfb-category-listbox li[aria-selected="true"] {
	color: var( --wp--preset--color--purple, #6763B3 );
}

/* Loading state */
.wp-block-post-template {
	transition: opacity 0.2s ease;
}

/* No results */
.qfb-no-results {
	text-align: center;
	padding: 3rem 1rem;
	font-size: 1.125rem;
	color: #666;
}

/* Pagination */
.qfb-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	padding: 2rem 0;
	flex-wrap: wrap;
}

.qfb-page-btn {
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 0.5rem 1rem;
	font-size: 0.9375rem;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s ease;
	color: #333;
}

.qfb-page-btn:hover {
	border-color: var( --wp--preset--color--purple-light, #7c3aed );
	color: var( --wp--preset--color--purple-light, #7c3aed );
}

.qfb-page-btn.qfb-page-current {
	background: var( --wp--preset--color--purple-light, #7c3aed );
	border-color: var( --wp--preset--color--purple-light, #7c3aed );
	color: #fff;
	pointer-events: none;
}
