/* Webbler search panel – shared by the Search widget ("Big panel") and the
 * Search Results widget. Colors etc. come from CSS variables set by the
 * widgets' style controls. */

.wsp {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--wsp-bg, #ffffff);
	color: var(--wsp-text, #101921);
	text-align: left;
}

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

.wsp__body {
	display: grid;
	grid-template-columns: var(--wsp-side, 270px) minmax(0, 1fr);
	min-height: 0;
}

/* ---------- Sidebar ---------- */
.wsp__side {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 20px 18px;
	border-right: 1px solid var(--wsp-line, #e4e9e8);
	background: var(--wsp-side-bg, transparent);
}

.wsp__group + .wsp__group {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var(--wsp-line, #e4e9e8);
}

.wsp__label {
	margin: 0 0 10px;
	color: var(--wsp-muted, #6b7378);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wsp .wsp__rows {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wsp .wsp__rows > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wsp .wsp__rows > li::before,
.wsp .wsp__rows > li::marker {
	content: none;
}

.wsp .wsp__row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	border: 0;
	border-radius: var(--wel-r-sm, 10px);
	background: transparent;
	color: var(--wsp-text, #101921);
	font: inherit;
	font-size: 15px;
	line-height: 1.35;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.wsp .wsp__row:hover,
.wsp .wsp__row.is-active,
.wsp .wsp__row:focus-visible {
	background: var(--wsp-hover, #f0faf9);
	color: var(--wsp-text, #101921);
	text-decoration: none;
}

.wsp .wsp__row:focus-visible {
	outline: 2px solid var(--wsp-accent, #163e35);
	outline-offset: -2px;
}

.wsp__row-icon {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--wsp-muted, #6b7378);
	font-size: 18px;
}

.wsp__row-text {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wsp__row-end {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--wsp-muted, #6b7378);
	font-size: 18px;
	transition: transform 200ms var(--wsp-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.wsp__row:hover .wsp__row-end,
.wsp__row.is-active .wsp__row-end {
	transform: translateX(3px);
}

.wsp__tips {
	margin: 0;
	color: var(--wsp-muted, #6b7378);
	font-size: 14px;
	line-height: 1.6;
}

/* ---------- Main ---------- */
.wsp__main {
	min-width: 0;
	padding: 20px 24px 24px;
}

.wsp__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.wsp__head .wsp__label {
	margin: 0;
}

.wsp__count {
	color: var(--wsp-muted, #6b7378);
	font-size: 13px;
	white-space: nowrap;
}

.wsp__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.wsp .wsp__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 8px 14px;
	border: 1px solid var(--wsp-line, #e4e9e8);
	border-radius: 100px;
	background: transparent;
	color: var(--wsp-text, #101921);
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.wsp .wsp__chip:hover {
	border-color: var(--wsp-accent, #163e35);
	color: var(--wsp-text, #101921);
	text-decoration: none;
}

.wsp .wsp__chip.is-active {
	border-color: var(--wsp-accent, #163e35);
	background: var(--wsp-accent, #163e35);
	color: var(--wsp-accent-text, #ffffff);
}

.wsp .wsp__chip:focus-visible {
	outline: 2px solid var(--wsp-accent, #163e35);
	outline-offset: 2px;
}

.wsp__chip-n {
	opacity: 0.6;
	font-size: 0.9em;
}

.wsp__grid {
	display: grid;
	grid-template-columns: repeat(var(--wsp-cols, 3), minmax(0, 1fr));
	gap: 16px;
}

.wsp__grid:empty {
	display: none;
}

.wsp .wsp__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 10px;
	border: 1px solid var(--wsp-line, #e4e9e8);
	border-radius: var(--wsp-r, var(--wel-r-md, 16px));
	background: var(--wsp-card-bg, #ffffff);
	color: var(--wsp-text, #101921);
	text-decoration: none;
	transition: border-color 200ms ease, transform 250ms var(--wsp-ease, cubic-bezier(0.22, 0.61, 0.36, 1)), box-shadow 250ms ease;
}

.wsp .wsp__card:hover,
.wsp .wsp__card.is-active {
	border-color: var(--wsp-card-hover, #6bcbc2);
	color: var(--wsp-text, #101921);
	text-decoration: none;
}

.wsp .wsp__card:focus-visible {
	outline: 2px solid var(--wsp-accent, #163e35);
	outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
	.wsp .wsp__card:hover {
		transform: translateY(-2px);
	}
}

.wsp__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: var(--wsp-ratio, 16 / 10);
	overflow: hidden;
	border-radius: calc(var(--wsp-r, var(--wel-r-md, 16px)) * 0.6);
	background: var(--wsp-media-bg, #eef4f3);
	color: var(--wsp-muted, #6b7378);
	font-size: 32px;
}

.wsp__media img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	transition: transform 400ms var(--wsp-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.wsp__card:hover .wsp__media img {
	transform: scale(1.04);
}

.wsp__media--empty svg {
	opacity: 0.55;
}

.wsp__card-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 4px 4px;
}

.wsp__type {
	color: var(--wsp-muted, #6b7378);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.wsp__title {
	color: var(--wsp-text, #101921);
	font-size: 18px;
	line-height: 1.3;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.wsp__text {
	color: var(--wsp-muted, #6b7378);
	font-size: 14px;
	line-height: 1.5;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.wsp mark {
	padding: 0 1px;
	border-radius: 3px;
	background: var(--wsp-mark, rgba(255, 198, 0, 0.45));
	color: inherit;
}

.wsp__empty {
	margin: 0;
	padding: 40px 12px;
	color: var(--wsp-muted, #6b7378);
	font-size: 16px;
	text-align: center;
}

.wsp__empty strong {
	color: var(--wsp-text, #101921);
}

/* Loading a filter */
.wsp.is-filtering .wsp__grid {
	opacity: 0.45;
	transition: opacity 150ms ease;
}

/* ---------- Footer ---------- */
.wsp__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 24px;
	border-top: 1px solid var(--wsp-line, #e4e9e8);
	background: var(--wsp-foot-bg, #fafbfb);
}

.wsp__note {
	color: var(--wsp-muted, #6b7378);
	font-size: 13px;
	line-height: 1.4;
}

.wsp .wsp__all {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	padding: 12px 18px;
	border-radius: var(--wel-r-pill, 100px);
	background: var(--wsp-accent, #163e35);
	color: var(--wsp-accent-text, #ffffff);
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 150ms ease;
}

.wsp .wsp__all:hover,
.wsp .wsp__all.is-active {
	color: var(--wsp-accent-text, #ffffff);
	text-decoration: none;
	opacity: 0.88;
}

.wsp .wsp__all:focus-visible {
	outline: 2px solid var(--wsp-accent, #163e35);
	outline-offset: 3px;
}

.wsp__all svg {
	font-size: 18px;
	transition: transform 200ms var(--wsp-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.wsp__all:hover svg,
.wsp__all.is-active svg {
	transform: translateX(3px);
}

/* ---------- Sidebar position ---------- */
.wsp-side-right .wsp__body,
.wsp--side-right .wsp__body {
	grid-template-columns: minmax(0, 1fr) var(--wsp-side, 270px);
}

.wsp-side-right .wsp__side,
.wsp--side-right .wsp__side {
	order: 2;
	border-right: 0;
	border-left: 1px solid var(--wsp-line, #e4e9e8);
}

.wsp-side-none .wsp__body,
.wsp--no-side .wsp__body {
	grid-template-columns: minmax(0, 1fr);
}

.wsp-side-none .wsp__side,
.wsp--no-side .wsp__side {
	display: none;
}

/* ---------- Results page variant ---------- */
.wsp--page {
	overflow: hidden;
	border: 1px solid var(--wsp-line, #e4e9e8);
	border-radius: var(--wel-r-lg, 24px);
}

.wsp--flat {
	border: 0;
	border-radius: 0;
}

.wsp--page .wsp__side {
	padding: 28px 22px;
}

.wsp--page .wsp__main {
	padding: 28px 32px 32px;
}

.wsp__pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 28px;
}

.wsp .wsp__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--wsp-line, #e4e9e8);
	border-radius: 100px;
	color: var(--wsp-text, #101921);
	font-size: 15px;
	text-decoration: none;
}

.wsp .wsp__page:hover {
	border-color: var(--wsp-accent, #163e35);
	color: var(--wsp-text, #101921);
	text-decoration: none;
}

.wsp .wsp__page.is-current {
	border-color: var(--wsp-accent, #163e35);
	background: var(--wsp-accent, #163e35);
	color: var(--wsp-accent-text, #ffffff);
}

.wsp__page--gap {
	color: var(--wsp-muted, #6b7378);
}

/* ---------- Narrow screens: stack ---------- */
@media (max-width: 767px) {
	.wsp__body,
	.wsp-side-right .wsp__body,
	.wsp--side-right .wsp__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.wsp__side,
	.wsp-side-right .wsp__side,
	.wsp--side-right .wsp__side {
		order: 0;
		padding: 16px;
		border-right: 0;
		border-left: 0;
		border-bottom: 1px solid var(--wsp-line, #e4e9e8);
	}

	.wsp--side-below .wsp__side {
		order: 2;
		border-bottom: 0;
		border-top: 1px solid var(--wsp-line, #e4e9e8);
	}

	.wsp__group--tips {
		display: none;
	}

	.wsp--page .wsp__group--tips {
		display: block;
	}

	.wsp__main,
	.wsp--page .wsp__main {
		padding: 16px;
	}

	.wsp--page .wsp__side {
		padding: 16px;
	}

	.wsp__foot {
		padding: 12px 16px;
	}

	.wsp__note {
		display: none;
	}

	/* In the dropdown, cards become compact rows to save space */
	.wsp--drop .wsp__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.wsp--drop .wsp__card {
		flex-direction: row;
		align-items: center;
		gap: 12px;
		padding: 8px;
	}

	.wsp--drop .wsp__media {
		flex-shrink: 0;
		width: 64px;
		aspect-ratio: 1 / 1;
		font-size: 22px;
	}

	.wsp--drop .wsp__card-body {
		padding: 0;
		min-width: 0;
	}

	.wsp--drop .wsp__title {
		font-size: 16px;
		-webkit-line-clamp: 2;
	}

	.wsp--drop .wsp__text {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wsp *,
	.wsp *::before {
		transition: none !important;
	}
}

/* ---------- Search Results widget: heading + search box ---------- */
.wsr__heading {
	margin: 0 0 20px;
	color: #163e35;
	font-size: 40px;
	font-weight: 400;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.wsr__form {
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	max-width: 640px;
	margin: 0 0 32px;
	padding: 6px 6px 6px 18px;
	border: 1.5px solid #163e35;
	border-radius: var(--wel-r-pill, 100px);
	background: #ffffff;
}

.wsr__form:focus-within {
	box-shadow: 0 0 0 3px rgba(107, 203, 194, 0.35);
}

.wsr__form-icon {
	display: inline-flex;
	flex-shrink: 0;
	color: #163e35;
	font-size: 20px;
}

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

.wsr .wsr__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: #101921;
	font: inherit;
	font-size: 17px;
	outline: none;
}

.wsr .wsr__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.wsr .wsr__submit {
	flex-shrink: 0;
	height: 44px;
	margin: 0;
	padding: 0 22px;
	border: 0;
	border-radius: var(--wel-r-pill, 100px);
	background: var(--wsp-accent, #163e35);
	color: var(--wsp-accent-text, #ffffff);
	font: inherit;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: opacity 150ms ease;
}

.wsr .wsr__submit:hover {
	opacity: 0.88;
}

.wsr .wsr__submit:focus-visible {
	outline: 2px solid var(--wsp-accent, #163e35);
	outline-offset: 2px;
}
