/* BK Пошук — стилі. Колір акценту можна змінити змінною --bk-accent */
.bk-search {
	--bk-accent: #2ea3f2;
	--bk-border: #d9dde3;
	--bk-text: #333;
	--bk-muted: #6b7280;
	--bk-bg: #fff;
	--bk-hover: #f4f9fe;
	--bk-mark: #fff2a8;
	position: relative;
	width: var(--bk-w, 100%);
	max-width: 100%;
	color: var(--bk-text);
	box-sizing: border-box;
}
/* Вирівнювання панелі, коли вона вужча за контейнер */
.bk-search--align-left { margin-left: 0; margin-right: auto; }
.bk-search--align-center { margin-left: auto; margin-right: auto; }
.bk-search--align-right { margin-left: auto; margin-right: 0; }
.bk-search .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.bk-search__form {
	position: relative;
	display: flex;
	margin: 0;
}
.bk-search__input[type="search"] {
	flex: 1;
	width: 100%;
	height: var(--bk-h, auto);
	box-sizing: border-box;
	padding: 0 48px 0 16px;
	border: 1px solid var(--bk-border);
	border-radius: 6px;
	background: var(--bk-bg);
	font-size: 16px;
	line-height: 1.4;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.bk-search__input:focus {
	outline: none;
	border-color: var(--bk-accent);
	box-shadow: 0 0 0 3px rgba(46, 163, 242, .18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bk-accent) 20%, transparent);
}
.bk-search__btn {
	position: absolute;
	top: 0; right: 0; bottom: 0;
	width: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bk-muted);
	cursor: pointer;
}
.bk-search__btn:hover { color: var(--bk-accent); }

.bk-search__results {
	/* Колір і змінні дублюються: список живе в <body>, поза .bk-search */
	--bk-accent: #2ea3f2;
	--bk-border: #d9dde3;
	--bk-text: #333;
	--bk-muted: #6b7280;
	--bk-bg: #fff;
	--bk-hover: #f4f9fe;
	--bk-mark: #fff2a8;
	color: var(--bk-text);
	box-sizing: border-box;
	position: absolute;
	z-index: 2147483647;
	top: 0;
	left: 0;
	max-height: 70vh;
	overflow-y: auto;
	background: var(--bk-bg);
	border: 1px solid var(--bk-border);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}
.bk-search__results[hidden] { display: none; }

.bk-search__item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 10px 14px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid var(--bk-border);
}
.bk-search__item:hover,
.bk-search__item.is-active { background: var(--bk-hover); }
.bk-search__thumb {
	flex: 0 0 56px;
	width: 56px; height: 56px;
	object-fit: cover;
	border-radius: 4px;
	background: #eef0f3;
}
.bk-search__body { min-width: 0; }
.bk-search__title {
	display: block;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
}
.bk-search__meta {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--bk-muted);
}
.bk-search__excerpt {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--bk-muted);
}
.bk-search__results mark,
.bk-results mark {
	background: var(--bk-mark);
	color: inherit;
	padding: 0 1px;
	border-radius: 2px;
}
.bk-search__status {
	padding: 14px;
	font-size: 14px;
	color: var(--bk-muted);
}
.bk-search__all {
	display: block;
	padding: 12px 14px;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
	color: var(--bk-accent);
	text-decoration: none;
}
.bk-search__all:hover { background: var(--bk-hover); }

/* Мобільні: власні ширина та висота */
@media (max-width: 767px) {
	.bk-search { width: var(--bk-w-m, var(--bk-w, 100%)); }
	.bk-search__input[type="search"] { height: var(--bk-h-m, var(--bk-h, auto)); }
}

@media (max-width: 480px) {
	.bk-search__thumb { flex-basis: 44px; width: 44px; height: 44px; }
}

/* ---------- Сторінка результатів [bk_search_results] ---------- */
.bk-results {
	--bk-accent: #2ea3f2;
	--bk-border: #d9dde3;
	--bk-text: #333;
	--bk-muted: #6b7280;
	--bk-hover: #f4f9fe;
	--bk-mark: #fff2a8;
	max-width: 900px;
	margin: 0 auto;
	color: var(--bk-text);
}
.bk-results .bk-search { margin-bottom: 18px; }
.bk-results__status { margin: 0 0 18px; color: var(--bk-muted); }
.bk-results__item {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	padding: 16px 0;
	border-top: 1px solid var(--bk-border);
}
.bk-results__thumb { flex: 0 0 150px; width: 150px; }
.bk-results__thumb img {
	display: block;
	width: 150px;
	height: 100px;
	object-fit: cover;
	border-radius: 4px;
	background: #eef0f3;
}
.bk-results__body { min-width: 0; flex: 1; }
.bk-results__title { margin: 0 0 4px; padding: 0; font-size: 20px; line-height: 1.3; }
.bk-results__title a { text-decoration: none; }
.bk-results__title a:hover { color: var(--bk-accent); }
.bk-results__meta { margin-bottom: 6px; font-size: 13px; color: var(--bk-muted); }
.bk-results__excerpt { margin: 0; font-size: 15px; line-height: 1.5; }
.bk-results__pages { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.bk-results__pages .page-numbers {
	min-width: 38px;
	padding: 7px 10px;
	text-align: center;
	border: 1px solid var(--bk-border);
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
}
.bk-results__pages .page-numbers.current { background: var(--bk-accent); border-color: var(--bk-accent); color: #fff; }

@media (max-width: 600px) {
	.bk-results__item { flex-direction: column; gap: 10px; }
	.bk-results__thumb, .bk-results__thumb img { width: 100%; flex-basis: auto; height: auto; max-height: 200px; }
}
