/* ============================================================
   Studio Visuali — Search  |  search.css  |  v1.2.0
   ============================================================ */

/* The strip below the header starts collapsed — the nav's magnifying-glass
   button (#vs-search-toggle, added by class-header-migrator.php) toggles
   the .is-open class via search.js. Height/opacity (not display) so the
   open/close has a transition instead of an abrupt jump. */
#vs-strip {
	position: relative;
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}

#vs-strip.is-open {
	max-height: 160px;
	opacity: 1;
	padding-top: 16px !important;
	padding-bottom: 16px !important;
}

/* Once the open transition has finished, stop clipping so the AJAX results
   dropdown (which is taller than the strip) can spill below it, and lift the
   strip's stacking context above the page content underneath the header.
   Added/removed by search.js so the collapse animation still clips cleanly. */
#vs-strip.is-open.is-expanded {
	overflow: visible;
	max-height: none;
	z-index: 1000;
}

#vs-search-toggle {
	cursor: pointer;
}

.vs-root {
	--vs-field-bg: #ffffff;
	--vs-field-border: #d1d5db;
	--vs-btn-bg: #4338ca;
	--vs-btn-color: #ffffff;
	--vs-radius: 8px;
	--vs-field-font-size: 14px;
	--vs-btn-font-size: 14px;

	position: relative;
	max-width: var(--vs-max-width, 720px);
	margin: 0 auto;
}

.vs-bar {
	display: flex;
	gap: 8px;
}

.vs-root select.vs-cat {
	flex: 0 0 auto;
	max-width: 160px;
	background: var(--vs-field-bg) !important;
	border: 1px solid var(--vs-field-border) !important;
	border-radius: var(--vs-radius) !important;
	padding: 10px 12px;
	font-size: var(--vs-field-font-size);
}

.vs-root input.vs-input {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--vs-field-bg) !important;
	border: 1px solid var(--vs-field-border) !important;
	border-radius: var(--vs-radius) !important;
	padding: 10px 16px;
	font-size: var(--vs-field-font-size);
}

.vs-root input.vs-input:focus,
.vs-root select.vs-cat:focus {
	outline: none;
	border-color: var(--vs-btn-bg) !important;
}

.vs-root button.vs-submit {
	flex: 0 0 auto;
	background: var(--vs-btn-bg) !important;
	color: var(--vs-btn-color) !important;
	border: none !important;
	padding: 10px 22px;
	border-radius: var(--vs-radius) !important;
	font-size: var(--vs-btn-font-size);
	font-weight: 600;
	cursor: pointer;
}

.vs-dropdown {
	position: absolute;
	z-index: 10000;
	top: calc(100% + 6px);
	right: 0;
	left: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 420px;
	overflow-y: auto;
	padding: 6px;
}

.vs-dropdown[hidden] {
	display: none;
}

.vs-dd-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 6px;
	text-decoration: none !important;
	color: inherit;
}

.vs-dd-item:hover {
	background: #f5f5ff;
}

.vs-dd-thumb {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 6px;
	overflow: hidden;
	background: #eef2ff;
}

.vs-dd-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vs-dd-text {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.vs-dd-badge {
	font-size: 11px;
	color: #4338ca;
	font-weight: 600;
}

.vs-dd-title {
	font-size: 14px;
	color: #111827;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vs-dd-more {
	display: block;
	text-align: center;
	padding: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #4338ca;
	text-decoration: none !important;
}

.vs-dd-empty,
.vs-dd-loading {
	padding: 16px;
	text-align: center;
	font-size: 13px;
	color: #6b7280;
}

/* Results page */

.vsr-root {
	--vsr-item-bg: #ffffff;
	--vsr-badge-bg: #eef2ff;
	--vsr-badge-color: #4338ca;
}

.vsr-form {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
	max-width: 720px;
}

.vsr-form input,
.vsr-form select {
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
}

.vsr-form input {
	flex: 1 1 auto;
	min-width: 0;
}

.vsr-form button {
	background: #4338ca;
	color: #fff;
	border: none;
	padding: 10px 22px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
}

.vsr-count {
	font-size: 14px;
	color: #6b7280;
	margin-bottom: 12px;
}

.vsr-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.vsr-item {
	display: flex;
	align-items: center;
	gap: 14px;
	background: var(--vsr-item-bg);
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 14px 18px;
	text-decoration: none !important;
	color: inherit;
	transition: box-shadow 0.15s ease;
}

.vsr-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.vsr-thumb {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--vsr-badge-bg);
}

.vsr-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vsr-text {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.vsr-badge {
	display: inline-flex;
	align-self: flex-start;
	background: var(--vsr-badge-bg);
	color: var(--vsr-badge-color);
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 999px;
}

.vsr-badge-sep {
	opacity: 0.6;
}

.vsr-title {
	font-size: 15px;
	color: #111827;
}

.vsr-empty {
	padding: 32px;
	text-align: center;
	color: #6b7280;
	border: 1px dashed #d1d5db;
	border-radius: 10px;
}
