/**
 * News Element — Search block. Structure only; colours, sizes and
 * borders come from the block's controls.
 */

.ne-search {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.ne-search-form {
	position: relative;
	display: flex;
	align-items: center;
	width: 240px;
	max-width: 100%;
	margin: 0;
}

.ne-search-input {
	box-sizing: border-box;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 44px 0 16px;
	border: 1px solid #dddddd;
	border-radius: 30px;
	background: #ffffff;
	color: #111111;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	outline: none;
	transition: border-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ne-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.ne-search-submit,
.ne-search-open {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.ne-search-submit {
	position: absolute;
	top: 50%;
	right: 4px;
	transform: translateY(-50%);
}

.ne-search svg {
	display: block;
	flex: 0 0 auto;
}

/* Icon mode: the form is a dropdown under the icon. */
.ne-search--icon .ne-search-form {
	position: absolute;
	top: calc(100% + 10px);
	z-index: 1003;
	width: 280px;
	max-width: calc(100vw - 32px);
	padding: 0;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
	border-radius: 30px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.ne-search--drop-right .ne-search-form {
	right: 0;
}

.ne-search--drop-left .ne-search-form {
	left: 0;
}

.ne-search--icon.is-open .ne-search-form {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.ne-search-input,
	.ne-search-submit,
	.ne-search-open,
	.ne-search--icon .ne-search-form {
		transition: none;
	}
}

/* --------------------------------------------------------------------------
 * Live results popup (js/search.js builds it once, at the end of <body>).
 * Colours and fonts follow the Global Kit; the accent comes from the block's
 * Results popup > Accent color control (--ne-sp-accent).
 * ----------------------------------------------------------------------- */

html.ne-sp-lock {
	overflow: hidden;
}

.ne-sp {
	--sp-accent: var(--ne-sp-accent, var(--ne-color-primary, #c8102e));
	/* Kits name their presets differently from site to site (ink / dark / black,
	   title-sm / tp-title-sm / title-s, meta / meta-s …), so every token walks a
	   chain of the usual names. Never the Kit's "secondary": on several sites it
	   is a bright accent (Journal's is yellow), not a text colour. */
	--sp-ink: var(--ne-color-ink, var(--ne-color-black, var(--ne-color-dark, #111418)));
	--sp-muted: var(--ne-color-muted, var(--ne-color-grey, #5b6270));
	--sp-line: var(--ne-color-rule, var(--ne-color-border, #e4e6ea));
	--sp-soft: var(--ne-color-surface, var(--ne-color-light-bg, #f6f7f9));
	--sp-bg: var(--ne-color-white, #ffffff);
	--sp-ui-font: var(--ne-typo-meta-font-family, var(--ne-typo-label-font-family, var(--ne-typo-text-font-family, inherit)));
	--sp-title-font: var(--ne-typo-title-sm-font-family, var(--ne-typo-tp-title-sm-font-family, var(--ne-typo-title-s-font-family, var(--ne-typo-title-font-family, var(--sp-ui-font)))));
	--sp-title-weight: var(--ne-typo-title-sm-font-weight, var(--ne-typo-tp-title-sm-font-weight, var(--ne-typo-title-s-font-weight, 700)));
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 88px 16px 16px;
	font-family: var(--sp-ui-font);
	color: var(--sp-ink);
	line-height: 1.4;
}

.ne-sp[hidden] {
	display: none;
}

.ne-sp-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 20, 24, 0.5);
	opacity: 0;
	transition: opacity 0.18s ease;
}

.ne-sp-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 720px;
	max-width: 100%;
	max-height: calc(100vh - 104px);
	max-height: calc(100dvh - 104px);
	overflow: hidden;
	border-radius: 16px;
	background: var(--sp-bg);
	color: var(--sp-ink); /* Re-read here so the Search block's popup Text color reaches inherited text. */
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	opacity: 0;
	transform: translateY(-8px) scale(0.985);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.ne-sp.is-open .ne-sp-backdrop,
.ne-sp.is-open .ne-sp-dialog {
	opacity: 1;
	transform: none;
}

.ne-sp button {
	font: inherit;
	color: inherit;
}

.ne-sp svg {
	display: block;
	flex: 0 0 auto;
}

/* Head: icon, field, clear, Esc */
.ne-sp-head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 12px;
	height: 64px;
	padding: 0 16px 0 20px;
	border-bottom: 1px solid var(--sp-line);
}

.ne-sp-icon {
	display: flex;
	color: var(--sp-accent);
}

.ne-sp .ne-sp-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--sp-ink);
	font: 500 19px/1.2 var(--sp-ui-font);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.ne-sp .ne-sp-input::placeholder {
	color: #7a808c;
	opacity: 1;
}

.ne-sp .ne-sp-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.ne-sp-status {
	flex: 0 0 auto;
	font-size: 13px;
	color: var(--sp-muted);
}

.ne-sp-status:empty {
	display: none;
}

.ne-sp .ne-sp-clear,
.ne-sp .ne-sp-close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--sp-muted);
	cursor: pointer;
}

.ne-sp .ne-sp-clear[hidden] {
	display: none;
}

.ne-sp .ne-sp-clear:hover,
.ne-sp .ne-sp-close:hover {
	color: var(--sp-ink);
}

.ne-sp-kbd,
.ne-sp kbd {
	display: inline-block;
	padding: 2px 6px;
	border: 1px solid #d5d8de;
	border-radius: 5px;
	background: var(--sp-bg);
	font: 600 12px/1.3 var(--sp-ui-font);
	color: var(--sp-muted);
}

.ne-sp-cancel {
	display: none;
	font-weight: 600;
	font-size: 15px;
	color: var(--sp-accent);
}

/* Tabs */
.ne-sp-tabs {
	display: flex;
	flex: 0 0 auto;
	gap: 4px;
	padding: 6px 16px 0;
	border-bottom: 1px solid var(--sp-line);
	overflow-x: auto;
	scrollbar-width: none;
}

.ne-sp-tabs[hidden] {
	display: none;
}

.ne-sp .ne-sp-tab {
	flex: 0 0 auto;
	height: 42px;
	margin: 0 0 -1px;
	padding: 0 12px;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: transparent;
	font-weight: 600;
	font-size: 14px;
	color: var(--sp-muted);
	cursor: pointer;
}

.ne-sp .ne-sp-tab span {
	font-weight: 500;
	color: var(--sp-muted);
}

.ne-sp .ne-sp-tab:hover,
.ne-sp .ne-sp-tab.is-current {
	color: var(--sp-ink);
}

.ne-sp .ne-sp-tab.is-current {
	border-bottom-color: var(--sp-accent);
}

.ne-sp .ne-sp-tab:disabled {
	opacity: 0.55;
	cursor: default;
}

/* Body */
.ne-sp-body {
	flex: 1 1 auto;
	min-height: 120px;
	max-height: 440px;
	padding: 8px 8px 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ne-sp-sec {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 4px 4px;
}

.ne-sp-h {
	padding: 6px 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--sp-muted);
}

.ne-sp a {
	color: var(--sp-ink);
	text-decoration: none;
}

.ne-sp mark {
	padding: 0 1px;
	border-radius: 3px;
	background: #ffe58a;
	color: inherit;
}

.ne-sp-opt {
	outline: none;
}

.ne-sp-opt.is-active,
.ne-sp-opt:focus-visible {
	background: #f1f3f6;
}

/* Article row */
.ne-sp-art {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 8px;
	border-radius: 10px;
}

.ne-sp-thumb {
	flex: 0 0 auto;
	width: 72px;
	height: 54px;
	overflow: hidden;
	border-radius: 8px;
	background: #eef0f3;
}

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

.ne-sp-art-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ne-sp-art-title {
	display: -webkit-box;
	overflow: hidden;
	font-family: var(--sp-title-font);
	font-size: 17px;
	font-weight: var(--sp-title-weight);
	line-height: 1.3;
	color: var(--sp-ink);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ne-sp-meta {
	overflow: hidden;
	font-size: 13px;
	color: var(--sp-muted);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ne-sp-cat {
	font-weight: 600;
	color: var(--sp-accent);
}

.ne-sp-enter {
	display: none;
	color: var(--sp-muted);
}

.ne-sp-art.is-active .ne-sp-enter {
	display: flex;
}

/* Recent searches */
.ne-sp .ne-sp-recent {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	font-weight: 500;
	font-size: 15px;
	text-align: left;
	color: var(--sp-ink);
	cursor: pointer;
}

.ne-sp .ne-sp-recent svg {
	color: var(--sp-muted);
}

.ne-sp .ne-sp-recent.is-active {
	background: #f1f3f6;
}

/* Chips: trending, topics, sections */
.ne-sp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 2px 8px 4px;
}

.ne-sp .ne-sp-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #d5d8de;
	border-radius: 999px;
	background: var(--sp-bg);
	font-weight: 500;
	font-size: 14px;
	color: var(--sp-ink);
	cursor: pointer;
}

.ne-sp .ne-sp-chip span {
	color: var(--sp-muted);
}

.ne-sp .ne-sp-chip:hover,
.ne-sp .ne-sp-chip.is-active {
	border-color: var(--sp-ink);
	background: var(--sp-bg);
}

/* Authors */
.ne-sp-author {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 10px;
}

.ne-sp-avatar {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 50%;
	background: #eef0f3;
	font-weight: 700;
	font-size: 14px;
	color: #3a404b;
}

.ne-sp-avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ne-sp-author-name {
	font-weight: 600;
	font-size: 15px;
}

/* See all */
.ne-sp-all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 48px;
	margin: 12px 4px 0;
	padding: 0 14px;
	border-radius: 10px;
	background: var(--sp-soft);
	font-weight: 600;
	font-size: 15px;
}

.ne-sp .ne-sp-all.is-active {
	background: #eceef2;
}

/* Hints, no results, loading */
.ne-sp-hint {
	padding: 40px 24px;
	text-align: center;
	font-size: 15px;
	color: var(--sp-muted);
}

.ne-sp-none {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 48px 24px 32px;
	text-align: center;
}

.ne-sp-none p {
	margin: 0;
	font-size: 15px;
	color: var(--sp-muted);
}

.ne-sp-none .ne-sp-none-title {
	font-family: var(--sp-title-font);
	font-size: 22px;
	font-weight: var(--sp-title-weight);
	color: var(--sp-ink);
}

.ne-sp-none .ne-sp-h {
	padding-top: 14px;
}

.ne-sp-none .ne-sp-chips {
	justify-content: center;
}

.ne-sp-skel {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 8px;
}

.ne-sp-skel-img {
	flex: 0 0 auto;
	width: 72px;
	height: 54px;
	border-radius: 8px;
	background: #eef0f3;
}

.ne-sp:not(.has-thumbs) .ne-sp-skel-img {
	display: none;
}

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

.ne-sp-skel-lines span {
	width: 80%;
	height: 14px;
	border-radius: 6px;
	background: #eef0f3;
	animation: ne-sp-pulse 1.2s ease-in-out infinite;
}

.ne-sp-skel-lines span + span {
	width: 40%;
	height: 10px;
	background: #f3f4f6;
}

@keyframes ne-sp-pulse {
	50% {
		opacity: 0.5;
	}
}

/* Phone: a full-screen sheet with Cancel instead of Esc. */
@media (max-width: 640px) {
	.ne-sp {
		padding: 0;
	}

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

	.ne-sp-head {
		height: auto;
		gap: 8px;
		padding: 12px 8px 12px 16px;
	}

	.ne-sp .ne-sp-input {
		font-size: 17px;
	}

	.ne-sp-body {
		max-height: none;
	}

	.ne-sp-kbd {
		display: none;
	}

	.ne-sp-cancel {
		display: inline;
		padding: 0 8px;
	}

	.ne-sp-thumb {
		order: 2;
		width: 72px;
		height: 72px;
	}

	.ne-sp-art-title {
		font-size: 17px;
	}

	.ne-sp-meta {
		white-space: normal;
	}

	.ne-sp-art.is-active .ne-sp-enter {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ne-sp-backdrop,
	.ne-sp-dialog {
		transition: none;
	}

	.ne-sp-skel-lines span {
		animation: none;
	}
}
