/* The search palette (public/js/search.js). Colours follow TT1's dark mode
   (html.is-dark-theme), the same switch the rest of the site uses. */
.tx-search-root {
	--sx-bg: #fffdfa;
	--sx-ink: #28303d;
	--sx-muted: #6e6e73;
	--sx-line: rgba(40, 48, 61, .12);
	--sx-hover: rgba(40, 48, 61, .07);
	--sx-accent: #5b6cff;
	position: fixed;
	inset: 0;
	z-index: 100000;
	font-family: var(--global--font-secondary, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
}
html.is-dark-theme .tx-search-root {
	--sx-bg: #1f1f22;
	--sx-ink: #f0f0f0;
	--sx-muted: #a1a1a8;
	--sx-line: rgba(255, 255, 255, .12);
	--sx-hover: rgba(255, 255, 255, .08);
	--sx-accent: #8ea0ff;
}
.tx-search-root[hidden] { display: none; }
html.tx-search-open { overflow: hidden; }
.tx-search-backdrop { position: absolute; inset: 0; background: rgba(20, 20, 24, .38); backdrop-filter: blur(2px); }
.tx-search-box {
	position: relative;
	width: min(640px, calc(100vw - 32px));
	max-height: min(70vh, 640px);
	margin: 12vh auto 0;
	display: flex;
	flex-direction: column;
	background: var(--sx-bg);
	color: var(--sx-ink);
	border-radius: 14px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .28), 0 0 0 1px var(--sx-line);
	overflow: hidden;
}
.tx-search-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--sx-line); }
.tx-search-bar svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--sx-muted); stroke-width: 2; stroke-linecap: round; }
.tx-search-root .tx-search-bar input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	padding: 4px 0;
	background: transparent;
	color: var(--sx-ink);
	font: inherit;
	font-size: 18px;
	box-shadow: none;
}
.tx-search-root .tx-search-bar input::-webkit-search-cancel-button { display: none; }
.tx-search-root .tx-search-close {
	line-height: 1.6;
	flex: none;
	border: 1px solid var(--sx-line);
	background: transparent;
	color: var(--sx-muted);
	border-radius: 6px;
	padding: 2px 7px;
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}
.tx-search-list { overflow-y: auto; padding: 6px 8px 10px; overscroll-behavior: contain; }
.tx-search-group { padding: 12px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sx-muted); }
.tx-search-root .tx-search-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border-radius: 8px;
	color: var(--sx-ink);
	text-decoration: none;
}
.tx-search-root .tx-search-item[aria-selected="true"] { background: var(--sx-hover); box-shadow: inset 3px 0 0 var(--sx-accent); }
.tx-search-item img { width: 44px; height: 33px; object-fit: cover; border-radius: 4px; flex: none; }
.tx-search-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tx-search-title { font-size: 15px; font-weight: 500; line-height: 1.3; }
.tx-search-sub { font-size: 13px; line-height: 1.35; color: var(--sx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-search-date { flex: none; font-size: 12px; color: var(--sx-muted); }
.tx-search-hint { margin: 0; padding: 18px 10px; font-size: 14px; color: var(--sx-muted); }
.tx-search-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--sx-line); font-size: 12px; color: var(--sx-muted); }
.tx-search-foot kbd { font: inherit; font-size: 11px; border: 1px solid var(--sx-line); border-radius: 4px; padding: 0 4px; margin-right: 2px; }

/* Phones: a full-screen sheet. */
@media (max-width: 600px) {
	.tx-search-box { width: 100vw; max-height: none; height: 100%; margin: 0; border-radius: 0; }
	.tx-search-foot { display: none; }
	.tx-search-root .tx-search-bar input { font-size: 17px; }
}
