/* Flint Blog Search — everything scoped under .flint-blog-search */

.flint-blog-search {
	position: relative;
	max-width: 560px;
	margin: 0 auto;
	font-family: 'Lato', sans-serif;
}

.flint-blog-search form {
	margin: 0;
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.flint-blog-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	padding: 12px 18px;
	border: 1px solid #d4d4d4;
	border-radius: 8px;
	font-size: 16px;
	line-height: 1.4;
	background: #fff;
	box-sizing: border-box;
}

.flint-bs-scope {
	flex: 0 1 auto;
	/* The longest preset ("Stroke Rehabilitation Methods") measures 201px in Lato and
	   would sit exactly on a 45% cap — 55% leaves room for a font fallback or a longer
	   category name. The select is content-sized, so this only lifts the ceiling. */
	max-width: 55%;
	/* Astra hides the native control and paints its own arrow at calc(100% - 10px);
	   the 34px right padding is what keeps long labels from running under it. */
	padding: 12px 34px 12px 14px;
	border: 1px solid #d4d4d4;
	border-radius: 8px;
	background-color: #fff;
	font-size: 15px;
	line-height: 1.4;
	color: #333;
	box-sizing: border-box;
}

.flint-blog-search input[type="search"]:focus,
.flint-bs-scope:focus {
	outline: none;
	border-color: var(--ast-global-color-0, #0170b9);
	box-shadow: 0 0 0 2px rgba(1, 112, 185, 0.15);
}

.flint-bs-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 99999;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 420px;
	overflow-y: auto;
}

.flint-bs-item {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px 14px;
	text-decoration: none;
	color: inherit;
}

.flint-bs-item:hover,
.flint-bs-item.is-active {
	background: #f2f8fc;
}

.flint-bs-item img {
	width: 56px;
	height: 42px;
	object-fit: cover;
	border-radius: 4px;
	flex: 0 0 auto;
}

.flint-bs-item-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.flint-bs-item-title {
	font-size: 15px;
	font-weight: 700;
	color: #333;
}

.flint-bs-item-date {
	font-size: 12px;
	color: #888;
}

.flint-bs-state {
	padding: 14px;
	font-size: 14px;
	color: #666;
	text-align: center;
}

.flint-bs-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.flint-bs-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #e2e2e2;
	border-top-color: var(--ast-global-color-0, #0170b9);
	border-radius: 50%;
	animation: flint-bs-spin 0.7s linear infinite;
}

@keyframes flint-bs-spin {
	to { transform: rotate(360deg); }
}

/* Visually hidden by default — the spinner carries the meaning for sighted users. */
.flint-bs-loading-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* A frozen spinner says nothing, so show the words instead. */
@media (prefers-reduced-motion: reduce) {
	.flint-bs-spinner {
		display: none;
	}

	.flint-bs-loading-text {
		position: static;
		width: auto;
		height: auto;
		margin: 0;
		overflow: visible;
		clip: auto;
	}
}

.flint-bs-note {
	padding: 10px 14px;
	font-size: 13px;
	text-align: left;
	color: #8a6d3b;
	background: #fcf8e3;
	border-bottom: 1px solid #f5e79e;
}

@media (max-width: 640px) {
	.flint-blog-search form {
		flex-wrap: wrap;
	}

	/* Scope first in the DOM, so it stacks above the input. */
	.flint-bs-scope {
		flex: 1 1 100%;
		max-width: 100%;
	}

	.flint-bs-results {
		max-height: 60vh;
	}
}
