/* ==========================================================================
   LCA Live Modal Search
   NOTE: the parent theme sets html{font-size:62.5%} (1rem = 10px), so this
   component uses explicit px sizing to stay immune to that. Rebrand via the
   --lca-search-* custom properties.
   ========================================================================== */

.lca-search-modal,
.lca-search-toggle {
	--lca-search-accent: #0b2a4a;        /* LCA navy */
	--lca-search-accent-2: #c8102e;      /* LCA red */
	--lca-search-bg: #ffffff;
	--lca-search-fg: #1a2230;
	--lca-search-muted: #5b6573;
	--lca-search-border: #e6eaf0;
	--lca-search-hover: #f5f8fc;
	--lca-search-overlay: rgba(9, 20, 34, 0.6);
	--lca-search-radius: 18px;
	--lca-search-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Trigger button (icon) ---------------------------------------------- */
.lca-search-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	margin: 0;
	font-family: var(--lca-search-font);
	line-height: 1;
	color: var(--lca-search-accent);
	background: transparent;
	border: 1.5px solid var(--lca-search-border);
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.lca-search-toggle:hover,
.lca-search-toggle:focus-visible {
	color: var(--lca-search-accent-2);
	background: var(--lca-search-hover);
	border-color: var(--lca-search-accent-2);
	outline: none;
}
.lca-search-toggle:active { transform: scale(0.96); }
.lca-search-toggle__icon { flex: 0 0 auto; display: block; width: 20px; height: 20px; }
.lca-search-toggle__label {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
}
@media (max-width: 768px) {
	.lca-search-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
	.lca-search-toggle { padding: 9px; }
}

/* ---- Lock page scroll when open ----------------------------------------- */
html.lca-search-open { overflow: hidden; }

/* ---- Modal -------------------------------------------------------------- */
.lca-search-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	font-family: var(--lca-search-font);
	font-size: 16px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}
.lca-search-modal[hidden] { display: none; }
.lca-search-modal *,
.lca-search-modal *::before,
.lca-search-modal *::after { box-sizing: border-box; }

.lca-search-modal__overlay {
	position: absolute;
	inset: 0;
	background: var(--lca-search-overlay);
	opacity: 0;
	transition: opacity 0.22s ease;
	backdrop-filter: blur(3px);
}
.lca-search-modal.is-open .lca-search-modal__overlay { opacity: 1; }

.lca-search-modal__panel {
	position: relative;
	width: min(720px, calc(100% - 32px));
	margin-top: clamp(16px, 9vh, 120px);
	background: var(--lca-search-bg);
	color: var(--lca-search-fg);
	border-radius: var(--lca-search-radius);
	box-shadow: 0 30px 70px -15px rgba(9, 20, 34, 0.5);
	overflow: hidden;
	transform: translateY(-16px) scale(0.98);
	opacity: 0;
	transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.24s ease;
}
.lca-search-modal.is-open .lca-search-modal__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

/* ---- Search input row --------------------------------------------------- */
.lca-search-modal__form {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px 22px;
	background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
	border-bottom: 1px solid var(--lca-search-border);
}
.lca-search-modal__icon { flex: 0 0 auto; width: 26px; height: 26px; color: var(--lca-search-accent); }
.lca-search-modal.is-loading .lca-search-modal__icon { animation: lca-pulse 1s ease-in-out infinite; }
@keyframes lca-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* High-specificity overrides: the parent theme styles `input` and
   `input:focus` (border + padding + width) which would otherwise paint a
   box/outline around this field. Kill it in every state. */
.lca-search-modal .lca-search-modal__form input.lca-search-modal__input,
.lca-search-modal .lca-search-modal__form input.lca-search-modal__input:focus,
.lca-search-modal .lca-search-modal__form input.lca-search-modal__input:focus-visible,
.lca-search-modal .lca-search-modal__form input.lca-search-modal__input:active,
.lca-search-modal .lca-search-modal__form input.lca-search-modal__input:hover {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	height: auto;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
	font-family: var(--lca-search-font);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--lca-search-fg);
	padding: 4px 0;
	margin: 0;
}
.lca-search-modal__input::placeholder { color: var(--lca-search-muted); opacity: 1; font-weight: 400; }

.lca-search-modal__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	color: var(--lca-search-muted);
	background: #fff;
	border: 1px solid var(--lca-search-border);
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.lca-search-modal__close:hover,
.lca-search-modal__close:focus-visible {
	color: #fff;
	background: var(--lca-search-accent-2);
	border-color: var(--lca-search-accent-2);
	outline: none;
}
.lca-search-modal__close svg { width: 22px; height: 22px; }

/* ---- Status / results --------------------------------------------------- */
.lca-search-modal__status:not(:empty) {
	padding: 18px 22px;
	color: var(--lca-search-muted);
	font-size: 15px;
}

.lca-search-modal__results {
	list-style: none;
	margin: 0;
	padding: 8px;
	max-height: min(62vh, 540px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #c9d3e0 transparent;
}
.lca-search-modal__results::-webkit-scrollbar { width: 8px; }
.lca-search-modal__results::-webkit-scrollbar-thumb { background: #c9d3e0; border-radius: 99px; }
.lca-search-modal__results::-webkit-scrollbar-track { background: transparent; }

.lca-result { margin: 0; padding: 0; list-style: none; }
.lca-result::before { display: none !important; }
.lca-result__link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 13px 16px;
	text-decoration: none;
	color: inherit;
	border-radius: 12px;
	border: 0;
	transition: background-color 0.13s ease;
}
.lca-result.is-active .lca-result__link,
.lca-result__link:hover,
.lca-result__link:focus-visible {
	background: var(--lca-search-hover);
	outline: none;
}
.lca-result__thumb {
	flex: 0 0 auto;
	width: 54px;
	height: 54px;
	border-radius: 11px;
	background-size: cover;
	background-position: center;
	background-color: #e9eef5;
	box-shadow: inset 0 0 0 1px rgba(9, 20, 34, 0.06);
}
.lca-result__thumb--empty {
	background-image: linear-gradient(135deg, #eaf0f8, #dbe5f1);
	position: relative;
}
.lca-result__thumb--empty::after {
	content: "";
	position: absolute;
	inset: 0;
	background: center / 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230b2a4a' stroke-opacity='0.4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
}
.lca-result__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lca-result__title {
	font-weight: 700;
	font-size: 17px;
	line-height: 1.3;
	color: var(--lca-search-accent);
}
.lca-result__excerpt {
	font-size: 14px;
	line-height: 1.45;
	color: var(--lca-search-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.lca-result__type {
	align-self: flex-start;
	margin-top: 2px;
	padding: 2px 9px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--lca-search-accent-2);
	background: rgba(200, 16, 46, 0.08);
	border-radius: 999px;
}
.lca-result mark {
	background: rgba(200, 16, 46, 0.16);
	color: inherit;
	padding: 0 2px;
	border-radius: 3px;
	font-weight: 700;
}

.lca-search-modal__all {
	display: block;
	padding: 16px 22px;
	text-align: center;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	background: var(--lca-search-accent);
	text-decoration: none;
	transition: background-color 0.15s ease;
}
.lca-search-modal__all:hover,
.lca-search-modal__all:focus-visible { background: var(--lca-search-accent-2); outline: none; color: #fff; }
.lca-search-modal__all[hidden] { display: none; }

@media (max-width: 600px) {
	/* compact floating card — never touches the screen edges */
	.lca-search-modal__panel {
		width: calc(100% - 20px);
		max-width: calc(100% - 20px);
		height: auto;
		margin: 10px auto 0;
		border-radius: 14px;
		overflow-x: hidden;
	}
	.lca-search-modal__form { padding: 12px 14px; gap: 10px; }
	.lca-search-modal__icon { width: 22px; height: 22px; }
	.lca-search-modal__close { width: 38px; height: 38px; }
	.lca-search-modal__close svg { width: 19px; height: 19px; }
	.lca-search-modal__results {
		max-height: calc(100vh - 160px);
		max-height: calc(100dvh - 160px);
	}
	.lca-result__link { gap: 12px; padding: 11px 12px; }
	.lca-result__thumb { width: 44px; height: 44px; }
	.lca-result__title { font-size: 15px; }
	.lca-result__excerpt { font-size: 13px; }
	.lca-search-modal__all { padding: 13px 16px; font-size: 13px; }
	.lca-search-modal .lca-search-modal__form input.lca-search-modal__input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.lca-search-modal__overlay,
	.lca-search-modal__panel { transition: none; }
	.lca-search-modal.is-loading .lca-search-modal__icon { animation: none; }
}
