/* =========================================================
   PIDE Smart Search — Apple-style overlay
   Brand colors: green #138041, yellow #F2D127

   NOTE ON SPECIFICITY: this plugin's markup gets injected into
   arbitrary WordPress themes and page builders (Elementor, JetEngine,
   Crocoblock, etc.) that often carry their own global resets for
   ul/li/button/a. Rules here are deliberately scoped under the
   #pide-search-overlay ID (and the trigger/Elementor button classes
   get their own resets) so this survives that bleed-through instead
   of silently losing the specificity war.
   ========================================================= */

:root {
	--pide-green: #138041;
	--pide-green-light: #1aa457;
	--pide-green-deep: #0b4a26;
	--pide-gold: #F2D127;
	--pide-yellow: #F2D127; /* kept as alias — used throughout for the gold accent */
	--pide-bg: #0a0c10;
	--pide-panel: #14171c;
	--pide-text: #f5f6f4;
	--pide-muted: #98989d;
	--pide-border: rgba(255, 255, 255, 0.14);
	/* Neutral dark navy/black tint over the blurred site behind — matches
	   the Apple-style reference rather than tinting green. */
	--pide-overlay-tint: rgba(8, 11, 15, 0.74);
}

/* ---------- shared resets against theme bleed-through ---------- */
#pide-search-overlay,
#pide-search-overlay *,
.pide-search-trigger,
.pide-search-trigger *,
.pide-el-search-wrap,
.pide-el-search-wrap * {
	box-sizing: border-box;
}

#pide-search-overlay ul,
#pide-search-overlay li {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

#pide-search-overlay button,
#pide-search-overlay input {
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
	background-image: none;
}

/* ---------- trigger icon (in the menu) ---------- */
.pide-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50% !important;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
	vertical-align: middle;
	-webkit-appearance: none;
	appearance: none;
}

.pide-search-trigger:hover,
.pide-search-trigger:focus {
	background-color: rgba(19, 128, 65, 0.12) !important;
	color: var(--pide-green);
	outline: none;
}

.menu-item.pide-search-trigger-item {
	display: inline-flex;
	align-items: center;
}

/* ---------- Elementor widget button ---------- */
.pide-el-search-wrap {
	display: flex;
}

.pide-el-search-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 6px;
	cursor: pointer;
	color: #ffffff;
	transition: color .2s ease;
	line-height: 1;
}

.pide-el-search-btn svg {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.pide-el-search-label {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

/* ---------- overlay shell ---------- */
#pide-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: var(--pide-overlay-tint);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow-y: auto;
	padding-bottom: 60px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
}

/* Faint logo watermark. Rendered as a soft white silhouette (regardless
   of the source file's own color) via filter, at very low opacity, and
   pinned behind the search content with a negative z-index so it never
   competes with anything readable. */
#pide-search-overlay .pide-search-watermark {
	position: absolute;
	right: 5%;
	bottom: 4%;
	width: 260px;
	max-width: 42vw;
	height: auto;
	opacity: 0.06;
	filter: brightness(0) invert(1);
	pointer-events: none;
	z-index: -1;
}

#pide-search-overlay.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

body.pide-search-lock {
	overflow: hidden;
}

/* ---------- search field ---------- */
#pide-search-overlay .pide-search-overlay__bar {
	width: 100%;
	max-width: 900px;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 64px 24px 22px;
}

#pide-search-overlay .pide-search-overlay__field {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	padding: 14px 20px;
	color: var(--pide-muted);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

#pide-search-overlay .pide-search-overlay__field:focus-within {
	background: rgba(255, 255, 255, 0.09);
	border-color: var(--pide-gold);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(242, 209, 39, 0.16);
}

#pide-search-overlay .pide-search-overlay__field svg {
	flex-shrink: 0;
	color: var(--pide-muted);
}

#pide-search-overlay .pide-search-overlay__input {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: var(--pide-text);
	font-size: 22px;
	font-weight: 400;
	line-height: 1.3;
	min-width: 0;
}

#pide-search-overlay .pide-search-overlay__input::placeholder {
	color: var(--pide-muted);
}

#pide-search-overlay .pide-search-overlay__clear {
	display: none;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.08);
	color: var(--pide-muted);
	cursor: pointer;
	flex-shrink: 0;
}

#pide-search-overlay .pide-search-overlay__clear.is-visible {
	display: flex;
}

#pide-search-overlay .pide-search-overlay__clear:hover {
	background: rgba(255, 255, 255, 0.16);
	color: var(--pide-text);
}

#pide-search-overlay .pide-search-overlay__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: var(--pide-muted);
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color .2s ease, color .2s ease;
}

#pide-search-overlay .pide-search-overlay__close:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--pide-text);
}

/* ---------- autocomplete suggestions dropdown ---------- */
#pide-search-overlay .pide-search-suggestions {
	width: 100%;
	max-width: 900px;
	padding: 0 24px;
}

#pide-search-overlay .pide-search-suggestions:not(:empty) {
	margin-bottom: 6px;
}

#pide-search-overlay .pide-search-suggestions button {
	width: 100%;
	text-align: left;
	background: transparent;
	border: none;
	color: var(--pide-text);
	font-size: 15px;
	padding: 10px 14px;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
}

#pide-search-overlay .pide-search-suggestions button:hover,
#pide-search-overlay .pide-search-suggestions button.is-active {
	background: rgba(242, 209, 39, 0.08);
}

/* Apple never color-codes the matched term — titles stay plain white/grey
   throughout. Keep that here too: no color shift, just inherit. */
#pide-search-overlay mark {
	background: transparent;
	color: inherit;
	font-weight: inherit;
	padding: 0;
}

/* ---------- body / panel ---------- */
#pide-search-overlay .pide-search-overlay__body {
	width: 100%;
	max-width: 900px;
	padding: 0 24px;
	display: flex;
	flex-direction: column;
}

#pide-search-overlay .pide-search-panel__label {
	display: flex;
	align-items: center;
	gap: 8px;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: .08em;
	color: var(--pide-muted);
	margin: 22px 0 8px;
	font-weight: 700;
}

#pide-search-overlay .pide-search-panel__label::before {
	content: '';
	display: inline-block;
	width: 12px;
	height: 2px;
	background: var(--pide-gold);
	flex-shrink: 0;
}

#pide-search-overlay .pide-search-results__group:first-child .pide-search-panel__label {
	margin-top: 10px;
}

#pide-search-overlay .pide-search-panel__list a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 8px;
	margin: 0 -8px;
	border-radius: 10px;
	color: var(--pide-text);
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	transition: background-color .15s ease;
}

#pide-search-overlay .pide-search-panel__list a svg {
	color: var(--pide-muted);
	flex-shrink: 0;
}

#pide-search-overlay .pide-search-panel__list a span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#pide-search-overlay .pide-search-panel__list a:hover {
	background: rgba(255, 255, 255, 0.05);
}

/* ---------- tagline ---------- */
#pide-search-overlay .pide-search-tagline {
	width: 100%;
	max-width: 900px;
	text-align: center;
	color: var(--pide-muted);
	font-size: 17px;
	margin: 16px 0 0;
	padding: 0 24px;
}

/* ---------- "Top Result" label + rule ---------- */
#pide-search-overlay .pide-search-toplabel {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 24px 0 10px;
}

#pide-search-overlay .pide-search-toplabel span:first-child {
	font-size: 12px;
	letter-spacing: .1em;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.68);
	text-transform: uppercase;
	white-space: nowrap;
}

#pide-search-overlay .pide-search-toplabel__rule {
	flex: 1;
	height: 1px;
	background: rgba(255, 255, 255, 0.14);
}

/* ---------- hero (Top Result) card ---------- */
#pide-search-overlay .pide-search-hero {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.05);
	text-decoration: none;
	transition: border-color .2s ease, background-color .2s ease;
}

#pide-search-overlay .pide-search-hero:hover {
	border-color: rgba(255, 255, 255, 0.28);
	background: rgba(255, 255, 255, 0.08);
}

#pide-search-overlay .pide-search-hero__thumb {
	width: 96px;
	height: 72px;
	border-radius: 8px;
	flex-shrink: 0;
	background-size: cover;
	background-position: center;
}

/* Headshots are portrait — a plain center crop on this wide/short box
   chops off the top of the head. Bias toward the top of the photo. */
#pide-search-overlay .pide-search-hero__thumb--person {
	background-position: center 15%;
}

#pide-search-overlay .pide-search-hero__thumb--icon {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--pide-green-light), var(--pide-green-deep));
	color: var(--pide-gold);
}

#pide-search-overlay .pide-search-hero__thumb--icon svg {
	width: 26px;
	height: 26px;
}

#pide-search-overlay .pide-search-hero__body {
	flex: 1;
	min-width: 0;
}

#pide-search-overlay .pide-search-hero__title {
	font-size: 19px;
	font-weight: 600;
	color: #ffffff;
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

#pide-search-overlay .pide-search-hero__excerpt {
	font-size: 14.5px;
	color: var(--pide-muted);
	margin-top: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#pide-search-overlay .pide-search-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .05em;
	color: rgba(255, 255, 255, 0.55);
	text-transform: uppercase;
}

#pide-search-overlay .pide-search-hero__badge svg {
	width: 11px;
	height: 11px;
	flex-shrink: 0;
}

#pide-search-overlay .pide-search-hero__arrow {
	display: flex;
	align-items: center;
	color: rgba(255, 255, 255, 0.5);
	flex-shrink: 0;
}

#pide-search-overlay .pide-search-hero__arrow svg {
	width: 16px;
	height: 16px;
}

/* ---------- flat ranked list below the hero ---------- */
#pide-search-overlay .pide-search-list {
	margin-top: 6px;
}

#pide-search-overlay .pide-search-list li {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#pide-search-overlay .pide-search-list li:last-child {
	border-bottom: none;
}

#pide-search-overlay .pide-search-list a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 13px 8px;
	margin: 0 -8px;
	border-radius: 10px;
	text-decoration: none;
	transition: background-color .15s ease;
}

#pide-search-overlay .pide-search-list a:hover {
	background: rgba(255, 255, 255, 0.05);
}

#pide-search-overlay .pide-search-list__icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: rgba(255, 255, 255, 0.75);
	transition: color .15s ease;
}

#pide-search-overlay .pide-search-list__icon svg {
	width: 16px;
	height: 16px;
}

#pide-search-overlay .pide-search-list__thumb {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background-size: cover;
	background-position: center;
	background-color: rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
	display: block;
}

#pide-search-overlay .pide-search-list__thumb--person {
	background-position: center 15%;
}

#pide-search-overlay .pide-search-list__text {
	flex: 1;
	min-width: 0;
}

#pide-search-overlay .pide-search-list__title {
	display: block;
	font-size: 16px;
	font-weight: 500;
	color: #ffffff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color .15s ease;
}

#pide-search-overlay .pide-search-list__type {
	display: block;
	font-size: 11px;
	letter-spacing: .05em;
	color: rgba(255, 255, 255, 0.5);
	text-transform: uppercase;
	margin-top: 2px;
}

#pide-search-overlay .pide-search-list__arrow {
	display: flex;
	align-items: center;
	color: rgba(255, 255, 255, 0.4);
	flex-shrink: 0;
	margin-left: auto;
}

#pide-search-overlay .pide-search-list__arrow svg {
	width: 14px;
	height: 14px;
}

/* ---------- state messages ---------- */
#pide-search-overlay .pide-search-message {
	color: var(--pide-muted);
	font-size: 14px;
	padding: 16px 4px;
}

#pide-search-overlay .pide-search-didyoumean {
	font-size: 14px;
	color: var(--pide-muted);
	padding: 4px 4px 16px;
}

#pide-search-overlay .pide-search-didyoumean button {
	background: none;
	border: none;
	color: var(--pide-yellow);
	font-weight: 700;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

#pide-search-overlay .pide-search-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--pide-muted);
	font-size: 14px;
	padding: 16px 4px;
}

#pide-search-overlay .pide-search-spinner {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.18);
	border-top-color: var(--pide-green-light);
	animation: pide-spin 0.7s linear infinite;
}

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

/* ---------- responsive ---------- */
@media (max-width: 640px) {
	#pide-search-overlay {
		align-items: stretch;
		padding-bottom: 24px;
	}

	#pide-search-overlay .pide-search-overlay__bar {
		position: sticky;
		top: 0;
		z-index: 2;
		background: var(--pide-bg);
		padding: calc(16px + env(safe-area-inset-top, 0px)) 14px 12px;
		gap: 10px;
	}

	#pide-search-overlay .pide-search-overlay__field {
		padding: 11px 14px;
		border-radius: 12px;
	}

	#pide-search-overlay .pide-search-overlay__input {
		font-size: 17px;
	}

	#pide-search-overlay .pide-search-overlay__close {
		width: 36px;
		height: 36px;
	}

	#pide-search-overlay .pide-search-overlay__body,
	#pide-search-overlay .pide-search-suggestions {
		padding: 0 14px;
	}

	#pide-search-overlay .pide-search-panel__list a {
		padding: 13px 4px;
		font-size: 15px;
	}

	#pide-search-overlay .pide-search-tagline {
		font-size: 13px;
		margin-top: 12px;
		padding: 0 14px;
	}

	#pide-search-overlay .pide-search-hero {
		gap: 12px;
		padding: 11px;
	}

	#pide-search-overlay .pide-search-hero__thumb {
		width: 64px;
		height: 64px;
	}

	#pide-search-overlay .pide-search-hero__title {
		font-size: 15.5px;
	}

	#pide-search-overlay .pide-search-hero__excerpt {
		display: none; /* keep the mobile card compact */
	}

	#pide-search-overlay .pide-search-list a {
		padding: 12px 4px;
		gap: 12px;
	}

	#pide-search-overlay .pide-search-list__icon {
		width: 32px;
		height: 32px;
	}

	#pide-search-overlay .pide-search-list__thumb {
		width: 40px;
		height: 40px;
	}

	#pide-search-overlay .pide-search-suggestions button {
		padding: 11px 12px;
		font-size: 14.5px;
	}

	/* Full-width tap target for the trigger icon inside mobile nav menus */
	.menu-item.pide-search-trigger-item {
		width: 100%;
	}

	.pide-search-trigger {
		width: 40px;
		height: 40px;
	}
}

@media (max-width: 400px) {
	#pide-search-overlay .pide-search-overlay__close {
		width: 32px;
		height: 32px;
	}
}
