/* ==========================================================================
   Live Search Panel
   All colours and sizes are CSS custom properties so the Elementor widget,
   shortcode and theme CSS can restyle them without fighting specificity.
   ========================================================================== */

.lsp {
	--lsp-accent: #2547d0;
	--lsp-accent-soft: color-mix(in srgb, var(--lsp-accent) 11%, transparent);
	--lsp-focus: var(--lsp-accent);
	--lsp-text: #172033;
	--lsp-title-color: var(--lsp-text);
	--lsp-muted: #5b6475;
	--lsp-border: #e2e5ea;
	--lsp-hover: #f3f5f9;
	--lsp-sidebar-bg: #f8f9fb;
	--lsp-input-bg: #ffffff;
	--lsp-input-height: 52px;
	--lsp-radius: 12px;
	--lsp-panel-bg: #ffffff;
	--lsp-panel-width: 980px;
	--lsp-panel-max-height: 72vh;
	--lsp-panel-radius: 16px;
	--lsp-mark-bg: color-mix(in srgb, var(--lsp-accent) 16%, transparent);
	--lsp-thumb-size: 64px;
	--lsp-columns: 1;
	--lsp-backdrop: rgba(14, 20, 34, 0.55);

	position: relative;
	width: 100%;
	color: var(--lsp-text);
	font-family: inherit;
	line-height: 1.4;
	text-align: left;
}

.lsp *,
.lsp *::before,
.lsp *::after {
	box-sizing: border-box;
}

.lsp [hidden] {
	display: none !important;
}

.lsp .lsp-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Neutralise aggressive theme button styles. */
.lsp button {
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.2;
	min-height: 0;
	min-width: 0;
	margin: 0;
	box-shadow: none;
	text-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.lsp button:focus-visible,
.lsp a:focus-visible {
	outline: 2px solid var(--lsp-focus);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Search form
   -------------------------------------------------------------------------- */

.lsp .lsp-form {
	display: flex;
	align-items: stretch;
	gap: 8px;
	margin: 0;
	padding: 0;
	width: 100%;
}

.lsp .lsp-field {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	height: var(--lsp-input-height);
	background: var(--lsp-input-bg);
	border: 1px solid var(--lsp-border);
	border-radius: var(--lsp-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lsp .lsp-field:focus-within {
	border-color: var(--lsp-focus);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--lsp-focus) 16%, transparent);
}

.lsp .lsp-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 46px;
	height: 100%;
	color: var(--lsp-muted);
	pointer-events: none;
}

.lsp .lsp-input,
.lsp input.lsp-input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0 8px 0 0;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--lsp-text);
	font-family: inherit;
	font-size: 16px; /* 16px stops iOS zooming on focus. */
	line-height: 1.2;
	-webkit-appearance: none;
	appearance: none;
}

.lsp .lsp-input::placeholder {
	color: var(--lsp-muted);
	opacity: 0.85;
}

.lsp .lsp-input::-webkit-search-cancel-button,
.lsp .lsp-input::-webkit-search-decoration {
	-webkit-appearance: none;
	display: none;
}

.lsp .lsp-clear {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 32px;
	height: 32px;
	margin-right: 8px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--lsp-muted);
	cursor: pointer;
}

.lsp .lsp-clear:hover {
	background: var(--lsp-hover);
	color: var(--lsp-text);
}

.lsp .lsp-spinner {
	flex: none;
	width: 18px;
	height: 18px;
	margin-right: 6px;
	border: 2px solid var(--lsp-border);
	border-top-color: var(--lsp-accent);
	border-radius: 50%;
	animation: lsp-spin 0.7s linear infinite;
}

.lsp .lsp-submit {
	flex: none;
	height: var(--lsp-input-height);
	padding: 0 24px;
	border: 0;
	border-radius: var(--lsp-radius);
	background: var(--lsp-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, filter 0.15s ease;
}

.lsp .lsp-submit:hover {
	background: var(--lsp-accent);
	color: #fff;
	filter: brightness(1.08);
}

/* --------------------------------------------------------------------------
   Results panel (shared)
   -------------------------------------------------------------------------- */

.lsp .lsp-panel {
	background: var(--lsp-panel-bg);
	color: var(--lsp-text);
}

.lsp .lsp-panel-inner {
	display: flex;
	max-height: var(--lsp-panel-max-height);
	min-height: 0;
}

.lsp .lsp-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
}

/* Tabs: vertical sidebar on wide panels, scrolling row on narrow ones. */
.lsp .lsp-tabs {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: none;
	width: 216px;
	padding: 14px 10px;
	background: var(--lsp-sidebar-bg);
	border-right: 1px solid var(--lsp-border);
	overflow-y: auto;
}

.lsp .lsp-tab {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	padding: 9px 10px 9px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--lsp-text);
	font-size: 14px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.lsp .lsp-tab:hover {
	background: var(--lsp-hover);
	color: var(--lsp-text);
}

.lsp .lsp-tab.is-active {
	background: var(--lsp-accent-soft);
	color: var(--lsp-accent);
	font-weight: 600;
}

.lsp .lsp-tab-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lsp .lsp-tab-count {
	flex: none;
	min-width: 26px;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--lsp-panel-bg);
	border: 1px solid var(--lsp-border);
	color: var(--lsp-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.lsp .lsp-tab.is-active .lsp-tab-count {
	border-color: transparent;
	background: var(--lsp-accent);
	color: #fff;
}

.lsp .lsp-status {
	flex: none;
	padding: 14px 22px 6px;
	color: var(--lsp-muted);
	font-size: 13px;
}

/* Results list */
.lsp .lsp-results {
	display: grid;
	grid-template-columns: repeat(var(--lsp-columns), minmax(0, 1fr));
	align-content: start;
	gap: 2px 8px;
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 4px 12px 12px;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
	transition: opacity 0.15s ease;
}

.lsp.is-loading .lsp-results {
	opacity: 0.55;
}

.lsp .lsp-results > li {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
}

.lsp .lsp-results > li::before,
.lsp .lsp-results > li::marker {
	content: none;
}

.lsp .lsp-link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 12px;
	border-radius: 10px;
	color: inherit;
	text-decoration: none !important;
	box-shadow: none;
	transition: background-color 0.12s ease;
}

.lsp .lsp-item.is-active .lsp-link,
.lsp .lsp-link:hover {
	background: var(--lsp-hover);
	color: inherit;
}

.lsp .lsp-thumb {
	flex: none;
	width: var(--lsp-thumb-size);
	height: var(--lsp-thumb-size);
	border-radius: 8px;
	overflow: hidden;
	background: var(--lsp-hover);
}

.lsp .lsp-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

.lsp .lsp-thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--lsp-accent-soft);
	color: var(--lsp-accent);
	font-size: calc(var(--lsp-thumb-size) * 0.36);
	font-weight: 700;
}

.lsp .lsp-content {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1 1 auto;
	min-width: 0;
}

.lsp .lsp-meta {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 12px;
	line-height: 1.3;
}

.lsp .lsp-badge {
	color: var(--lsp-accent);
	font-weight: 600;
}

.lsp .lsp-date {
	color: var(--lsp-muted);
}

.lsp .lsp-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--lsp-title-color);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
}

.lsp .lsp-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--lsp-muted);
	font-size: 14px;
	line-height: 1.5;
}

.lsp mark {
	padding: 0;
	border-radius: 2px;
	background: var(--lsp-mark-bg);
	color: inherit;
	font-weight: inherit;
}

.lsp .lsp-go {
	display: flex;
	flex: none;
	color: var(--lsp-accent);
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.lsp .lsp-item.is-active .lsp-go,
.lsp .lsp-link:hover .lsp-go {
	opacity: 1;
	transform: none;
}

/* Empty, idle and skeleton states */
.lsp .lsp-results > .lsp-empty,
.lsp .lsp-results > .lsp-idle {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	grid-column: 1 / -1;
	padding: 48px 24px;
	color: var(--lsp-muted);
	font-size: 14px;
	text-align: center;
}

.lsp .lsp-empty strong {
	color: var(--lsp-text);
	font-size: 16px;
}

.lsp .lsp-results > .lsp-skel {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 12px;
}

.lsp .lsp-skel-thumb,
.lsp .lsp-skel-lines span {
	display: block;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--lsp-hover) 0%, var(--lsp-border) 50%, var(--lsp-hover) 100%);
	background-size: 200% 100%;
	animation: lsp-shimmer 1.2s ease-in-out infinite;
}

.lsp .lsp-skel-thumb {
	flex: none;
	width: var(--lsp-thumb-size);
	height: var(--lsp-thumb-size);
	border-radius: 8px;
}

.lsp .lsp-skel-lines {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.lsp .lsp-skel-lines span { height: 10px; width: 22%; }
.lsp .lsp-skel-lines span:nth-child(2) { height: 14px; width: 62%; }
.lsp .lsp-skel-lines span:nth-child(3) { width: 85%; }

/* Footer */
.lsp .lsp-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex: none;
	padding: 10px 22px;
	border-top: 1px solid var(--lsp-border);
	font-size: 13px;
}

.lsp .lsp-hints {
	display: flex;
	gap: 16px;
	color: var(--lsp-muted);
}

.lsp .lsp-hints kbd,
.lsp .lsp-kbd,
.lsp .lsp-close {
	display: inline-block;
	min-width: 20px;
	margin-right: 2px;
	padding: 1px 5px;
	border: 1px solid var(--lsp-border);
	border-bottom-width: 2px;
	border-radius: 5px;
	background: var(--lsp-panel-bg);
	color: var(--lsp-muted);
	font-family: inherit;
	font-size: 11px;
	line-height: 1.5;
	text-align: center;
	box-shadow: none;
}

.lsp .lsp-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-left: auto;
}

.lsp .lsp-more {
	padding: 7px 14px;
	border: 1px solid var(--lsp-border);
	border-radius: 8px;
	background: var(--lsp-panel-bg);
	color: var(--lsp-text);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.lsp .lsp-more:hover {
	background: var(--lsp-hover);
	color: var(--lsp-text);
}

.lsp .lsp-all,
.lsp .lsp-all:hover {
	color: var(--lsp-accent);
	font-weight: 600;
	text-decoration: none;
}

.lsp .lsp-all:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Layout: dropdown (large panel under the search bar)
   -------------------------------------------------------------------------- */

.lsp--dropdown .lsp-panel {
	position: absolute;
	top: calc(100% + 10px);
	left: var(--lsp-shift, 0px);
	z-index: 99999;
	width: min(max(100%, var(--lsp-panel-width)), calc(100vw - 24px));
	border: 1px solid var(--lsp-border);
	border-radius: var(--lsp-panel-radius);
	box-shadow: 0 28px 64px -16px rgba(16, 24, 40, 0.28), 0 6px 16px -4px rgba(16, 24, 40, 0.08);
	overflow: hidden;
	transform-origin: top left;
	animation: lsp-pop 0.16s ease-out;
}

/* --------------------------------------------------------------------------
   Layout: overlay (button opens a full-screen search)
   -------------------------------------------------------------------------- */

.lsp .lsp-trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	height: var(--lsp-input-height);
	padding: 0 12px 0 14px;
	border: 1px solid var(--lsp-border);
	border-radius: var(--lsp-radius);
	background: var(--lsp-input-bg);
	color: var(--lsp-muted);
	font-size: 15px;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.lsp .lsp-trigger:hover {
	border-color: color-mix(in srgb, var(--lsp-accent) 45%, var(--lsp-border));
	background: var(--lsp-input-bg);
	color: var(--lsp-muted);
}

.lsp .lsp-trigger-text {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lsp .lsp-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 7vh 20px 20px;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.lsp .lsp-modal.is-visible {
	opacity: 1;
}

.lsp .lsp-backdrop {
	position: absolute;
	inset: 0;
	background: var(--lsp-backdrop);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.lsp .lsp-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1120px, 100%);
	max-height: 86vh;
	border-radius: var(--lsp-panel-radius);
	background: var(--lsp-panel-bg);
	box-shadow: 0 40px 100px -20px rgba(10, 15, 30, 0.45);
	overflow: hidden;
	transform: translateY(-10px) scale(0.985);
	transition: transform 0.2s ease;
}

.lsp .lsp-modal.is-visible .lsp-dialog {
	transform: none;
}

.lsp--overlay .lsp-form {
	align-items: center;
	padding: 14px 18px;
	border-bottom: 1px solid var(--lsp-border);
}

.lsp--overlay .lsp-field {
	--lsp-input-height: 56px;
	border: 0;
	background: transparent;
}

.lsp--overlay .lsp-field:focus-within {
	box-shadow: none;
}

.lsp--overlay .lsp-input,
.lsp--overlay input.lsp-input[type="search"] {
	font-size: 20px;
}

.lsp--overlay .lsp-close {
	flex: none;
	padding: 4px 9px;
	font-size: 12px;
	cursor: pointer;
}

.lsp--overlay .lsp-panel {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
}

.lsp--overlay .lsp-panel-inner {
	flex: 1 1 auto;
	max-height: none;
	min-height: min(420px, 60vh);
}

html.lsp-lock {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
	.lsp {
		--lsp-thumb-size: 48px;
		--lsp-columns: 1 !important;
	}

	.lsp .lsp-panel-inner {
		flex-direction: column;
	}

	.lsp .lsp-tabs {
		flex-direction: row;
		width: auto;
		padding: 10px 12px;
		border-right: 0;
		border-bottom: 1px solid var(--lsp-border);
		overflow-x: auto;
		overflow-y: hidden;
		scrollbar-width: none;
	}

	.lsp .lsp-tabs::-webkit-scrollbar {
		display: none;
	}

	.lsp .lsp-tab {
		flex: none;
		width: auto;
	}

	.lsp .lsp-status {
		padding: 12px 16px 4px;
	}

	.lsp .lsp-results {
		padding: 4px 6px 10px;
	}

	.lsp .lsp-link {
		gap: 12px;
		padding: 10px;
	}

	.lsp .lsp-title {
		font-size: 15px;
	}

	.lsp .lsp-go {
		display: none;
	}

	.lsp .lsp-footer {
		padding: 10px 16px;
	}

	.lsp .lsp-submit {
		padding: 0 16px;
	}

	.lsp .lsp-modal {
		padding: 0;
	}

	.lsp .lsp-dialog {
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}

	.lsp--overlay .lsp-form {
		padding: 8px 12px;
	}

	.lsp--overlay .lsp-input,
	.lsp--overlay input.lsp-input[type="search"] {
		font-size: 17px;
	}
}

@media (hover: none) {
	.lsp .lsp-hints,
	.lsp .lsp-kbd {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lsp *,
	.lsp *::before,
	.lsp *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

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

@keyframes lsp-pop {
	from { opacity: 0; transform: translateY(-6px) scale(0.99); }
	to { opacity: 1; transform: none; }
}

@keyframes lsp-shimmer {
	from { background-position: 100% 0; }
	to { background-position: -100% 0; }
}
