/* CM Search - styled for koi.fan */

.cm-search-bar {
	position: relative;
	width: 100%;
	max-width: 600px;
}

.cm-search-bar__form {
	display: flex;
	align-items: center;
	background: var(--kf-surface, #1a1a24);
	border: 1px solid var(--kf-border, rgba(255,255,255,0.1));
	border-radius: 10px;
	overflow: hidden;
	transition: border-color 0.15s;
}

.cm-search-bar__form:focus-within {
	border-color: var(--kf-rose, #d4617b);
}

.cm-search-bar__input {
	flex: 1;
	border: none;
	outline: none;
	padding: 14px 16px;
	font-size: 1rem;
	background: transparent;
	color: var(--kf-text, #f0ece8);
}

.cm-search-bar__input::placeholder {
	color: var(--kf-muted, #888);
}

.cm-search-bar__submit {
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	color: var(--kf-muted, #888);
	transition: color 0.15s;
}

.cm-search-bar__submit:hover {
	color: var(--kf-rose, #d4617b);
}

/* Suggestions dropdown */

.cm-search-suggestions {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--kf-surface, #1a1a24);
	border: 1px solid var(--kf-border, rgba(255,255,255,0.1));
	border-radius: 10px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.4);
	z-index: 1000;
	max-height: 360px;
	overflow-y: auto;
}

.cm-search-suggestions[hidden] {
	display: none;
}

.cm-search-suggestions__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	cursor: pointer;
	color: var(--kf-text, #f0ece8);
	transition: background 0.1s;
}

.cm-search-suggestions__item:hover,
.cm-search-suggestions__item[aria-selected="true"] {
	background: rgba(255,255,255,0.06);
}

.cm-search-suggestions__thumb {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.cm-search-suggestions__meta {
	display: flex;
	flex-direction: column;
}

.cm-search-suggestions__title {
	font-weight: 600;
	font-size: 0.9rem;
}

.cm-search-suggestions__type {
	font-size: 0.72rem;
	color: var(--kf-muted, #888);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-top: 2px;
}

/* Taxonomy / category filter pills */

.cm-search-taxonomy {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.cm-search-facet {
	display: inline-flex;
	align-items: center;
	padding: 6px 16px;
	border-radius: 999px;
	border: 1px solid var(--kf-border, rgba(255,255,255,0.12));
	background: transparent;
	color: var(--kf-muted, #888);
	font-size: 0.85rem;
	font-family: inherit;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.cm-search-facet:hover {
	border-color: var(--kf-rose, #d4617b);
	color: var(--kf-text, #f0ece8);
}

.cm-search-facet.is-active {
	background: var(--kf-rose, #d4617b);
	border-color: var(--kf-rose, #d4617b);
	color: #fff;
}

/* Search results page */

.cm-search-results {
	max-width: 1100px;
	margin: 0 auto;
	padding: 32px var(--kf-gutter, 24px) 80px;
}

.cm-search-results__heading {
	font-family: 'Playfair Display', serif;
	font-size: 1.5rem;
	margin-bottom: 28px;
	color: var(--kf-text, #f0ece8);
}

.cm-search-results__error,
.cm-search-results__none {
	color: var(--kf-muted, #888);
	font-size: 1rem;
}

.cm-search-results__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.cm-search-results__item {
	background: var(--kf-surface, #1a1a24);
	border: 1px solid var(--kf-border, rgba(255,255,255,0.08));
	border-radius: 10px;
	overflow: hidden;
	transition: border-color 0.15s, transform 0.15s;
}

.cm-search-results__item:hover {
	border-color: var(--kf-rose, #d4617b);
	transform: translateY(-2px);
}

.cm-search-results__link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.cm-search-results__thumb {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}

.cm-search-results__title {
	padding: 10px 14px 4px;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--kf-text, #f0ece8);
}

.cm-search-results__excerpt {
	padding: 0 14px 14px;
	font-size: 0.8rem;
	color: var(--kf-muted, #888);
	line-height: 1.4;
}

.cm-search-pagination {
	margin-top: 40px;
	display: flex;
	gap: 12px;
	justify-content: center;
}

.cm-search-pagination a {
	padding: 9px 20px;
	border: 1px solid var(--kf-border, rgba(255,255,255,0.12));
	border-radius: 8px;
	text-decoration: none;
	font-size: 0.875rem;
	color: var(--kf-text, #f0ece8);
	transition: border-color 0.15s, background 0.15s;
}

.cm-search-pagination a:hover {
	border-color: var(--kf-rose, #d4617b);
	background: rgba(212,97,123,0.08);
}
