/**
 * Search results / 404 page — mirrors the Laravel global-search inline results.
 *
 * Result row layout = Laravel's global-search-row:
 *   [ type-icon  title ]                              [ thumb ]
 *   [ highlighted preview excerpt          ]         [ 1/4   ]
 *   [ breadcrumb ……………………………………… date ]  (dashed top)
 *
 * Used by search.php and 404.php (assets enqueued on is_search()/is_404()).
 * Self-contained; accents use Brentwood red (#c8272c).
 */

.bw-searchpage {
	max-width: 1040px;
	margin: 0 auto;
	padding: 2.5rem 1rem 4.5rem;
}

/* The filtered search page lives inside Kadence's boxed content card
   (.content-container.site-container > .content-bg > .entry-content-wrap), so
   width and inner padding come from the customizer — don't re-constrain here. */
.bw-searchpage--filtered {
	max-width: none;
	margin: 0;
	padding: 2.5rem 2rem 3.5rem;
}
@media (max-width: 600px) {
	.bw-searchpage--filtered {
		padding: 1.75rem 1.1rem 2.5rem;
	}
}

/* Match the boxed Page look on the search results page. Kadence's Additional
   CSS scopes the gradient + card shadow to body.page .content-bg; the search
   body has no .page class, so re-assert them here with the same palette
   variables (so they still track the customizer colours). */
body.search-results .bw-search-entry.content-bg {
	background: linear-gradient(
		180deg,
		var(--global-palette9, #ffffff) 0%,
		var(--global-palette7, #dcf2fa) 83%,
		var(--global-palette9, #ffffff) 100%
	);
	box-shadow:
		0 10px 15px -3px rgb(0 0 0 / 0.1),
		0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* ---- Two-column layout: sidebar | results ---- */
.bw-searchpage__layout {
	display: flex;
	align-items: flex-start;
	gap: 2.25rem;
}
.bw-searchpage__content {
	flex: 1 1 auto;
	min-width: 0;
}
.bw-searchpage__for {
	margin: 1rem 0 0;
	color: #6b7280;
	font-size: .95rem;
}
.bw-searchpage__for strong {
	color: #1a1a1a;
}

@media (max-width: 860px) {
	.bw-searchpage__layout {
		flex-direction: column;
		gap: 1.5rem;
		/* Reset the desktop `align-items: flex-start` for the stacked layout.
		   In column direction flex-start sizes children to their content width,
		   so the results column would collapse onto its widest child (the
		   nowrap breadcrumb) and overflow the viewport (then get clipped by
		   #wrapper's overflow-x). Stretch makes both columns fill the width. */
		align-items: stretch;
	}
}

/* ---- Sidebar filter (Laravel global-search sidebar) ---- */
.bw-facets {
	flex: 0 0 13.5rem;
	width: 13.5rem;
}
@media (max-width: 860px) {
	.bw-facets {
		flex-basis: auto;
		width: 100%;
	}
}
.bw-facets__form {
	margin: 0;
}
.bw-facets__count {
	margin: 0 0 1.1rem;
	text-align: center;
	line-height: 1.15;
}
.bw-facets__count-num {
	font-size: 1.05rem;
	font-weight: 300;
	color: var(--global-palette1, #3182CE);
}
.bw-facets__count-label {
	font-size: 1.05rem;
	font-weight: 300;
	color: var(--global-palette1, #3182CE);
}
.bw-facets__list {
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
}
.bw-facets__item {
	margin: 0;
}

/* Custom round checkbox + label. */
.bw-facet {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .42rem 0;
	cursor: pointer;
	user-select: none;
}
.bw-facet__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.bw-facet__box {
	flex: 0 0 auto;
	position: relative;
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid #c9ccd1;
	border-radius: 50%;
	background: #fff;
	transition: background-color .15s ease, border-color .15s ease;
}
.bw-facet__box::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 46%;
	width: .34rem;
	height: .62rem;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: translate(-50%, -55%) rotate(45deg);
	opacity: 0;
	transition: opacity .15s ease;
}
.bw-facet__input:checked + .bw-facet__box {
	background: #2b2f36;
	border-color: #2b2f36;
}
.bw-facet__input:checked + .bw-facet__box::after {
	opacity: 1;
}
.bw-facet__input:focus-visible + .bw-facet__box {
	box-shadow: 0 0 0 3px rgba(200, 39, 44, .25);
	border-color: #c8272c;
}
.bw-facet__label {
	font-size: 1rem;
	color: #374151;
	line-height: 1.2;
}
.bw-facet:hover .bw-facet__label {
	color: #1a1a1a;
}

/* ---- Per Page stepper ---- */
.bw-facets__perpage {
	display: flex;
	align-items: center;
	gap: .55rem;
	flex-wrap: wrap;
	padding-top: .35rem;
}
.bw-facets__perpage-label {
	font-size: .92rem;
	color: #6b7280;
}
.bw-stepper {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
}
.bw-stepper__input {
	width: 3rem;
	text-align: center;
	border: 1px solid #d6d9de;
	border-radius: .35rem;
	padding: .3rem .25rem;
	font-size: .95rem;
	color: #1a1a1a;
	background: #fff;
	-moz-appearance: textfield;
	appearance: textfield;
}
.bw-stepper__input::-webkit-outer-spin-button,
.bw-stepper__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.bw-stepper__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.85rem;
	height: 1.85rem;
	padding: 0;
	border: 1px solid #d6d9de;
	border-radius: .35rem;
	background: #fff;
	color: #374151;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.bw-stepper__btn:hover,
.bw-stepper__btn:focus-visible {
	border-color: #c8272c;
	color: #c8272c;
}

/* No-JS fallback Apply button — hidden once the JS enhancement is active. */
.bw-facets__apply {
	margin-top: 1.1rem;
	width: 100%;
	padding: .55rem .75rem;
	border: 0;
	border-radius: .35rem;
	background: #c8272c;
	color: #fff;
	font-size: .95rem;
	font-weight: 600;
	cursor: pointer;
}
.bw-facets__apply:hover,
.bw-facets__apply:focus-visible {
	background: #a81f24;
}
.bw-facets__form.is-enhanced .bw-facets__apply {
	display: none;
}

.bw-searchpage__head {
	margin-bottom: 1.25rem;
}
.bw-searchpage__title {
	font-size: 2rem;
	line-height: 1.2;
	margin: 0 0 1.1rem;
	color: #1a1a1a;
}
.bw-searchpage__count {
	margin: 1rem 0 0;
	color: #6b7280;
	font-size: .95rem;
}

/* ---- Inline always-open search bar (same look as the header dropdown) ---- */
.bw-searchform {
	display: flex;
	align-items: stretch;
	max-width: 42rem;
}
.bw-searchform__field {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	min-width: 0;
}
.bw-searchform__lead {
	position: absolute;
	left: .95rem;
	top: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	color: #d1d5db;
	pointer-events: none;
}
.bw-searchform__lead svg {
	width: 1.4rem;
	height: 1.4rem;
	fill: currentColor;
}
.bw-searchform__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	border: 1px solid #e3e3e3;
	border-right: 0;
	border-radius: .4rem 0 0 .4rem;
	padding: .72rem .8rem .72rem 3rem;
	font-size: 1.05rem;
	line-height: 1.4;
	color: #374151;
	outline: none;
	background: #fff;
	-webkit-appearance: none;
	appearance: none;
}
.bw-searchform__input::placeholder {
	color: #9ca3af;
	font-style: italic;
	opacity: 1;
}
.bw-searchform__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.bw-searchform__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	padding: 0 1rem;
	border: 1px solid #e3e3e3;
	border-left: 0;
	border-radius: 0 .4rem .4rem 0;
	background: #fff;
	cursor: pointer;
	color: #9ca3af;
	transition: color .15s ease;
}
.bw-searchform__submit:hover,
.bw-searchform__submit:focus-visible {
	color: #c8272c;
}
.bw-searchform__submit svg {
	width: 1.3rem;
	height: 1.3rem;
	fill: currentColor;
}
.bw-searchform:focus-within .bw-searchform__input,
.bw-searchform:focus-within .bw-searchform__submit {
	border-color: #c8272c;
}

/* On the results page the bar keeps only the submit-button icon — hide the
   left lead magnifying glass and reclaim its reserved left padding so the
   typed text isn't indented. (The 404 page, .bw-searchpage--404, keeps it.) */
.bw-searchpage--filtered .bw-searchform__lead {
	display: none;
}
.bw-searchpage--filtered .bw-searchform__input {
	padding-left: .9rem;
}

/* ---- Results ---- */
.bw-search-results {
	margin-top: 1.25rem;
}
.bw-search-result {
	border-bottom: 2px solid #ececec;
}
.bw-search-result__row {
	display: flex;
	align-items: stretch;
	gap: 0;
}
.bw-search-result__main {
	flex: 1 1 auto;
	min-width: 0;
	padding: 1rem 1.1rem;
}
.bw-search-result__icon {
	display: inline-block;
	opacity: .5;
	margin-right: .4rem;
	color: #1a1a1a;
}
.bw-search-result__icon svg {
	width: 18px;
	height: 18px;
	vertical-align: -3px;
	fill: currentColor;
}
.bw-search-result__title {
	font-size: 1.3rem;
	line-height: 1.3;
	font-weight: 300;
	color: var(--global-palette-highlight);
	text-decoration: none;
}
.bw-search-result__title:hover,
.bw-search-result__title:focus-visible {
	color: #c8272c;
}
.bw-search-result__preview {
	margin: .45rem 0 .55rem;
	color: #4b5563;
	font-size: .97rem;
	line-height: 1.55;
}
.bw-search-result__preview strong {
	color: #1a1a1a;
	font-weight: 700;
}
.bw-search-result__meta {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	font-size: .8rem;
	color: #6b7280;
	border-top: 1px dashed #d1d5db;
	padding-top: .4rem;
	margin-top: .25rem;
}
.bw-search-result__crumb {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.bw-search-result__date {
	flex: 0 0 auto;
}
.bw-search-result__photo {
	flex: 0 0 25%;
	width: 25%;
	position: relative;       /* image fills this; column height = text height */
	overflow: hidden;
	min-height: 96px;
}
.bw-search-result__photo a {
	position: absolute;
	inset: 0;
	display: block;
}
.bw-search-result__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
@media (max-width: 767px) {
	/* Mobile: show the result thumbnail as a full-width banner ABOVE the text
	   (desktop shows it as a right-hand 25% column). The row stacks vertically
	   and the photo is pulled to the top with order:-1. */
	.bw-search-result__row {
		flex-direction: column;
	}
	.bw-search-result__photo {
		display: block;
		order: -1;
		flex: none;
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
		min-height: 0;
		margin-bottom: .75rem;
	}
}

/* ---- Empty state ---- */
.bw-search-empty {
	color: #4b5563;
	font-size: 1.05rem;
	padding: 1.75rem 0;
}

/* ---- Pagination ---- */
.bw-searchpage__pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: .35rem;
	margin-top: 2.25rem;
}
.bw-searchpage__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.3rem;
	height: 2.3rem;
	padding: 0 .65rem;
	border: 1px solid #e3e3e3;
	border-radius: .35rem;
	color: #374151;
	text-decoration: none;
	font-size: .95rem;
	line-height: 1;
}
.bw-searchpage__pagination a.page-numbers:hover,
.bw-searchpage__pagination a.page-numbers:focus-visible {
	border-color: #c8272c;
	color: #c8272c;
}
.bw-searchpage__pagination .page-numbers.current {
	background: #c8272c;
	border-color: #c8272c;
	color: #fff;
}
.bw-searchpage__pagination .page-numbers.dots {
	border-color: transparent;
}

/* ---- 404 ---- */
.bw-searchpage--404 .bw-searchpage__head {
	margin-bottom: 0;
}
