/*
 * Hero heading rewritten with the visitor's query. Deliberately low-specificity
 * and free of !important, so an Elementor Heading widget's own typography and
 * colour settings still win. This is the fallback for an unstyled heading.
 */
.lobf-search-heading {
	color: #fff;
	font-size: clamp(1.9rem, 5vw, 3.5rem);
	font-weight: 700;
	line-height: 1.15;
	margin: 0;
	overflow-wrap: break-word;
	/* Keeps white legible where the hero image lightens behind it. */
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.lobf-search {
	--lobf-green: #1e3d32;
	--lobf-green-soft: #2f5a4a;
	--lobf-gold: #b08d3f;
	--lobf-border: #d9dfdb;
	--lobf-bg: #ffffff;
	--lobf-muted: #5d6b65;
	/* Space between the input and the Search button. Tune here. */
	--lobf-search-gap: 18px;
	/* Shared height, so the input and button cannot drift out of alignment. */
	--lobf-control-height: 46px;
	/* Set these to Astra's orange (#d2703f / #b85c2e) if you prefer the theme accent. */
	--lobf-button: #1e3d32;
	--lobf-button-hover: #2f5a4a;

	position: relative;
	max-width: 34rem;
	width: 100%;
}

.lobf-search__form {
	display: flex;
	align-items: stretch;
	gap: var(--lobf-search-gap, 18px);
}

/*
 * Deep selector on purpose. The theme styles buttons with enough specificity to
 * beat a single class, which is why this rendered in Astra's orange rather than
 * the intended green. Set --lobf-button to recolour it.
 */
.lobf-search form.lobf-search__form button.lobf-search__submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	height: var(--lobf-control-height, 46px);
	min-height: 0;
	padding: 0 1.25rem;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: none;
	color: #fff;
	background: var(--lobf-button, var(--lobf-green));
	border: 0;
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(30, 61, 50, 0.16);
	cursor: pointer;
	transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.lobf-search form.lobf-search__form button.lobf-search__submit:hover {
	background: var(--lobf-button-hover, var(--lobf-green-soft));
	box-shadow: 0 4px 10px rgba(30, 61, 50, 0.22);
	transform: translateY(-1px);
}

.lobf-search form.lobf-search__form button.lobf-search__submit:active {
	box-shadow: 0 1px 2px rgba(30, 61, 50, 0.2);
	transform: translateY(0);
}

.lobf-search form.lobf-search__form button.lobf-search__submit:focus-visible {
	outline: 2px solid var(--lobf-gold);
	outline-offset: 2px;
}

.lobf-search__submit-icon {
	flex: 0 0 auto;
	opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
	.lobf-search form.lobf-search__form button.lobf-search__submit {
		transition: none;
	}

	.lobf-search form.lobf-search__form button.lobf-search__submit:hover {
		transform: none;
	}
}

/* min-width:0 so the input can shrink inside a narrow sidebar instead of
   pushing the button out of the container. */
.lobf-search__form .lobf-search__input {
	flex: 1 1 auto;
	min-width: 0;
}

.lobf-search__all > a {
	display: block;
	padding: 0.7rem 1rem;
	font-weight: 600;
	font-size: 0.875rem;
	text-decoration: none;
	color: var(--lobf-green);
	background: #f2f6f4;
}

.lobf-search__all.is-active > a {
	box-shadow: inset 3px 0 0 var(--lobf-gold);
}

.lobf-results {
	--lobf-green: #1e3d32;
	--lobf-gold: #b08d3f;
	--lobf-border: #d9dfdb;
	--lobf-muted: #5d6b65;
}

/* Styled to match a section heading, since this doubles as the results title
   when no .lobf-results-heading element is present to fill instead. */
.lobf-results__status {
	margin: 0 0 1.75rem;
	padding-bottom: 0.6rem;
	font-size: clamp(1.4rem, 2.6vw, 2rem);
	font-weight: 600;
	line-height: 1.25;
	color: var(--lobf-green);
	border-bottom: 3px solid var(--lobf-green);
	display: inline-block;
}

/* minmax(0, 1fr) rather than plain 1fr, so a long unbroken title cannot force a
   track wider than its share and push the last column out of the container. */
.lobf-results__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2.25rem 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.lobf-results__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.lobf-results__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

.lobf-card > a {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* A fixed ratio reserves the space before the image arrives, so lazy loading
   cannot shift the layout. */
.lobf-card__media {
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f1f4f2;
}

/*
 * Absolutely positioned with inset:0 rather than height:100%. Astra and
 * Elementor both ship `img { height: auto }`, which wins over a plain
 * height:100% and leaves the image short of the box with background showing
 * beneath it. With top and bottom both pinned, auto height still fills.
 * The extra selector depth is there to out-specify those theme rules.
 */
.lobf-results__list .lobf-card__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.lobf-card__date {
	display: block;
	margin-top: 0.8rem;
	font-size: 0.8125rem;
	color: #7b8a93;
}

.lobf-card__title {
	display: block;
	margin-top: 0.3rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: #1c1c1c;
}

.lobf-card > a:hover .lobf-card__title {
	text-decoration: underline;
}

.lobf-card__title mark {
	background: rgba(176, 141, 63, 0.22);
	color: inherit;
}

/* Spinner for the one genuinely async wait: the initial index download. */
.lobf-spinner {
	display: inline-block;
	width: 0.9em;
	height: 0.9em;
	margin-right: 0.45em;
	vertical-align: -0.1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: lobf-spin 0.7s linear infinite;
}

@keyframes lobf-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Shimmer while a card's image is still downloading. */
.lobf-card__media--loading {
	background-image: linear-gradient(90deg, #f1f4f2 25%, #e6ebe8 37%, #f1f4f2 63%);
	background-size: 400% 100%;
	animation: lobf-shimmer 1.4s ease-in-out infinite;
}

@keyframes lobf-shimmer {
	from {
		background-position: 100% 0;
	}
	to {
		background-position: 0 0;
	}
}

.lobf-card--new {
	animation: lobf-fade 0.35s ease-out both;
}

@keyframes lobf-fade {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lobf-spinner,
	.lobf-card__media--loading,
	.lobf-card--new {
		animation: none;
	}
}

/* The hidden attribute is only display:none in the UA stylesheet, so any theme
   rule setting display on a button beats it. Restate it at author level. */
.lobf-results__more[hidden] {
	display: none;
}

.lobf-results__more[disabled] {
	opacity: 0.6;
	cursor: default;
}

.lobf-results__more {
	margin-top: 1.25rem;
	padding: 0.7rem 1.4rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--lobf-green);
	background: transparent;
	border: 1px solid var(--lobf-green);
	border-radius: 4px;
	cursor: pointer;
}

.lobf-results__more:hover {
	color: #fff;
	background: var(--lobf-green);
}

/* End-of-results marker, shown in the button's place once nothing remains. */
.lobf-results__end {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	margin: 2.5rem 0 0;
	padding-top: 1.75rem;
	border-top: 1px solid var(--lobf-border);
	text-align: center;
	color: var(--lobf-muted);
}

.lobf-results__end[hidden] {
	display: none;
}

.lobf-results__end-icon {
	color: var(--lobf-green);
	opacity: 0.55;
}

.lobf-results__end-text {
	font-size: 0.9375rem;
}

.lobf-results__end-cta {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--lobf-green);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Height pinned to the same token as the button, rather than left to fall out
   of font metrics and padding, which is what left the two misaligned. */
.lobf-search .lobf-search__input {
	width: 100%;
	height: var(--lobf-control-height, 46px);
	min-height: 0;
	padding: 0 1rem;
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: var(--lobf-green);
	background: var(--lobf-bg);
	border: 1px solid var(--lobf-border);
	border-radius: 6px;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.lobf-search .lobf-search__input::placeholder {
	color: var(--lobf-muted);
	opacity: 0.75;
}

.lobf-search .lobf-search__input:hover {
	border-color: #bcc7c1;
}

.lobf-search .lobf-search__input:focus {
	outline: none;
	border-color: var(--lobf-green-soft);
	box-shadow: 0 0 0 3px rgba(176, 141, 63, 0.25);
}

.lobf-search__results {
	position: absolute;
	z-index: 60;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 26rem;
	overflow-y: auto;
	background: var(--lobf-bg);
	border: 1px solid var(--lobf-border);
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(30, 61, 50, 0.14);
}

.lobf-search__results[hidden] {
	display: none;
}

.lobf-search__result {
	margin: 0;
	border-bottom: 1px solid var(--lobf-border);
}

.lobf-search__result:last-child {
	border-bottom: 0;
}

.lobf-search__result > a {
	display: block;
	padding: 0.7rem 1rem;
	text-decoration: none;
	color: var(--lobf-green);
}

.lobf-search__result:hover > a,
.lobf-search__result.is-active > a {
	background: #f2f6f4;
}

.lobf-search__result.is-active > a {
	box-shadow: inset 3px 0 0 var(--lobf-gold);
}

.lobf-search__title {
	display: block;
	font-weight: 600;
	line-height: 1.35;
}

.lobf-search__title mark {
	background: rgba(176, 141, 63, 0.22);
	color: inherit;
	padding: 0 1px;
}

.lobf-search__meta {
	display: block;
	margin-top: 0.15rem;
	font-size: 0.8125rem;
	color: var(--lobf-muted);
}

.lobf-search__empty {
	padding: 0.9rem 1rem;
	font-size: 0.9375rem;
	color: var(--lobf-muted);
}

.lobf-search__empty a {
	color: var(--lobf-green);
	font-weight: 600;
}

@media (max-width: 600px) {
	.lobf-search__results {
		max-height: 18rem;
	}
}
