/**
 * Styles for the Elementor widgets.
 *
 * Every colour that a site designer is likely to change is driven by an
 * Elementor control, so the values here are only defaults. Layout is written
 * mobile-first and degrades to a single column without media-query overrides
 * from the widget.
 */

.spark-hero,
.spark-featured,
.spark-results {
	--spark-hero-radius: 10px;
	box-sizing: border-box;
}

.spark-hero *,
.spark-featured *,
.spark-results * { box-sizing: border-box; }

/* ---------- Hero search ---------- */

.spark-hero {
	background: var(--spark-surface, #fff);
	border-radius: 12px;
	padding: 1.75rem;
}


.spark-hero__heading {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 1rem;
}

/*
 * Flexbox rather than grid: the number of fields is chosen per widget, and
 * `repeat(auto-fit, ...)` cannot be combined with a flexible track, which
 * invalidates the whole grid-template-columns declaration.
 */
.spark-hero__form {
	align-items: stretch;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.spark-hero__field {
	display: flex;
	flex: 1 1 100%;
	min-width: 0;
	position: relative;
}

@media (min-width: 720px) {
	.spark-hero__field { flex: 1 1 116px; }

	/* The location box carries the longest placeholder — "City, Zip Code,
	   MLS# or Area" — so it is given enough basis to show it in full rather
	   than truncating mid-word. */
	.spark-hero__field--keyword { flex: 2.6 1 272px; }
}

/* Tablet: one row cannot hold every field, and letting them wrap freely left
   a single select stranded beside the button. The location box takes the
   first row; the filters and the button share the second. */
@media (min-width: 720px) and (max-width: 1099px) {
	.spark-hero__field { flex: 1 1 110px; }

	.spark-hero__field--keyword { flex: 1 1 100%; }
}

/* Selects need less room than the free-text price fields. */
@media (min-width: 1100px) {
	.spark-hero__field:has( .spark-hero__input--select ) { flex: 0 1 132px; }
}

/*
 * Phone layout. Declared after the desktop rules: these share the same
 * specificity as the base `.spark-hero__field` declaration, so source order
 * decides, and placing them earlier silently loses.
 */
@media (max-width: 719px) {
	.spark-hero { padding: 1.25rem; }

	.spark-hero__form { gap: 0.6rem; }

	/* Two per row keeps the bar compact without cramping the location and
	   price fields, which stay full width. */
	.spark-hero__field { flex: 1 1 calc(50% - 0.3rem); }

	.spark-hero__field--keyword { flex: 1 1 100%; }

	.spark-hero__control { min-height: 50px; }

	.spark-hero__submit {
		flex: 1 1 100%;
		min-height: 50px;
	}

	.spark-hero__heading { margin-bottom: 0.8rem; }
}

/*
 * The control is the bordered box; the input inside it is fully reset.
 *
 * Themes and Elementor kits style bare `input` selectors with enough
 * specificity to beat a single class — Hello Elementor's kit sets
 * `padding: 8px 16px` here — which previously pushed the placeholder text
 * underneath the location icon. Making the box a flex row with the icon and
 * the input as siblings removes the overlap by construction, and the resets
 * below are specific enough to win without resorting to !important.
 */
.spark-hero__control {
	align-items: center;
	background: var(--spark-surface, #fff);
	border: 1px solid var(--spark-border, #e4e7ec);
	border-radius: var(--spark-hero-radius);
	display: flex;
	gap: 0.6rem;
	min-height: 58px;
	padding: 0 1rem;
	position: relative;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
}

.spark-hero .spark-hero__control .spark-hero__input {
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--spark-text, #12232e);
	flex: 1 1 auto;
	font: inherit;
	height: auto;
	line-height: 1.4;
	margin: 0;
	min-width: 0;
	outline: 0;
	padding: 0.7rem 0;
	width: 100%;
}

.spark-hero .spark-hero__control .spark-hero__input::placeholder {
	color: #8a93a2;
	opacity: 1;
}

/* Native search affordances would sit on top of the custom layout. */
.spark-hero__input[type="search"]::-webkit-search-decoration,
.spark-hero__input[type="search"]::-webkit-search-cancel-button {
	appearance: none;
}

/* The focus ring belongs on the box, not the borderless input. */
.spark-hero__control:focus-within {
	border-color: var(--spark-accent, #17a67f);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--spark-accent, #17a67f) 18%, transparent);
}

.spark-hero__pin {
	align-items: center;
	color: var(--spark-accent-text, #0e7a5c);
	display: flex;
	flex: 0 0 auto;
	justify-content: center;
}

/* Selects keep room for the chevron drawn on the wrapper. */
.spark-hero__control--select { padding-right: 0.75rem; }

.spark-hero .spark-hero__control .spark-hero__input--select {
	cursor: pointer;
	padding-right: 1.4rem;
}

.spark-hero__chevron {
	border-bottom: 2px solid #8a93a2;
	border-right: 2px solid #8a93a2;
	flex: 0 0 auto;
	height: 8px;
	pointer-events: none;
	position: absolute;
	right: 1rem;
	top: calc(50% - 6px);
	transform: rotate(45deg);
	width: 8px;
}

.spark-hero__submit {
	align-items: center;
	flex: 1 1 100%;
	background: var(--spark-accent, #17a67f);
	border: 1px solid var(--spark-accent, #17a67f);
	border-radius: var(--spark-hero-radius);
	color: #fff;
	cursor: pointer;
	display: flex;
	font: inherit;
	font-weight: 700;
	gap: 0.5rem;
	justify-content: center;
	min-height: 58px;
	min-width: 62px;
	padding: 0.7rem 1.25rem;
	transition: filter 0.15s ease;
}

@media (min-width: 720px) {
	.spark-hero__submit { flex: 0 0 auto; }
}

.spark-hero__submit:hover { filter: brightness(0.93); }

.spark-hero__submit:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Featured section ---------- */

.spark-featured__header {
	align-items: flex-start;
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	justify-content: space-between;
	margin-bottom: 2.25rem;
}

.spark-featured__headings { min-width: 0; }

.spark-featured__eyebrow {
	color: var(--spark-accent-text, #0e7a5c);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	margin: 0 0 0.6rem;
	text-transform: uppercase;
}

.spark-featured__title {
	font-size: clamp(2rem, 5vw, 3.5rem);
	line-height: 1.1;
	margin: 0 0 1rem;
}

.spark-featured__rule {
	background: var(--spark-accent, #17a67f);
	display: block;
	height: 2px;
	width: 68px;
}

.spark-featured__more {
	align-items: center;
	background: #0f4d4a;
	border: 1px solid #0f4d4a;
	border-radius: 4px;
	color: #fff;
	display: inline-flex;
	flex-shrink: 0;
	font-size: 0.875rem;
	font-weight: 700;
	gap: 0.65rem;
	letter-spacing: 0.06em;
	padding: 1.1rem 2rem;
	text-decoration: none;
	text-transform: uppercase;
	transition: filter 0.15s ease;
}

.spark-featured__more:hover,
.spark-featured__more:focus {
	color: #fff;
	filter: brightness(1.15);
}

.spark-featured__grid {
	display: grid;
	gap: 2rem;
	grid-template-columns: 1fr;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 640px) {
	.spark-featured__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
	.spark-featured__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/*
 * Explicit column counts for callers that ask for one — the shortcodes take a
 * `columns` attribute, and Elementor's own column control writes an inline
 * grid-template-columns that overrides these.
 */
@media (min-width: 640px) {
	.spark-featured__grid--1 { grid-template-columns: minmax(0, 1fr); }
	.spark-featured__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
	.spark-featured__grid--1 { grid-template-columns: minmax(0, 1fr); }
	.spark-featured__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.spark-featured__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.spark-featured__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.spark-featured__item {
	list-style: none;
	margin: 0;
}

/* ---------- Listing card ---------- */

.spark-listing-card {
	background: var(--spark-surface, #fff);
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(16, 28, 44, 0.08), 0 8px 24px rgba(16, 28, 44, 0.06);
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.spark-listing-card:hover {
	box-shadow: 0 4px 10px rgba(16, 28, 44, 0.12), 0 18px 40px rgba(16, 28, 44, 0.12);
	transform: translateY(-3px);
}

.spark-listing-card__media {
	aspect-ratio: 4 / 3;
	background: var(--spark-surface-alt, #f7f9fa);
	overflow: hidden;
	position: relative;
}

.spark-listing-card__media-link {
	display: block;
	height: 100%;
	width: 100%;
}

/*
 * Every photo fills the same 4:3 frame, whatever shape it was shot in.
 * Two classes deep on purpose: Elementor's `.elementor img { height: auto }`
 * outranks a single class, which let photos keep their own height and left a
 * strip of background under landscape shots.
 */
.spark-listing-card .spark-listing-card__image {
	display: block;
	height: 100%;
	inset: 0;
	max-width: none;
	object-fit: cover;
	object-position: center;
	position: absolute;
	width: 100%;
}

.spark-listing-card__badge {
	background: #0f4d4a;
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	inset-inline-start: 0;
	letter-spacing: 0.08em;
	padding: 0.5rem 0.9rem;
	position: absolute;
	text-transform: uppercase;
	top: 1rem;
}

.spark-listing-card__badge--open {
	background: var(--spark-accent, #17a67f);
	inset-inline-start: auto;
	inset-inline-end: 0;
}

.spark-listing-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.5rem 1.6rem 1.35rem;
}

.spark-listing-card__price {
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 1rem;
}

.spark-listing-card__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.4rem;
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
}

.spark-listing-card__stat {
	align-items: center;
	color: var(--spark-text, #12232e);
	display: flex;
	font-size: 0.9375rem;
	gap: 0.45rem;
	list-style: none;
	margin: 0;
}

.spark-listing-card__stat-icon {
	color: var(--spark-muted, #5b6472);
	flex-shrink: 0;
}

.spark-listing-card__footer {
	align-items: flex-end;
	border-top: 1px solid var(--spark-border, #e4e7ec);
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 1.25rem;
}

.spark-listing-card__address {
	color: var(--spark-text, #12232e);
	font-size: 0.95rem;
	line-height: 1.45;
	margin: 0;
	max-width: 62%;
	min-width: 0;
}

.spark-listing-card__locality { display: block; }

.spark-listing-card__cta {
	align-items: center;
	color: var(--spark-accent-text, #0e7a5c);
	display: inline-flex;
	flex-shrink: 0;
	font-size: 0.8125rem;
	font-weight: 700;
	gap: 0.5rem;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
}

.spark-listing-card__cta:hover,
.spark-listing-card__cta:focus { text-decoration: underline; }

.spark-listing-card__cta-icon { transition: transform 0.15s ease; }

.spark-listing-card:hover .spark-listing-card__cta-icon { transform: translateX(3px); }

.spark-listing-card__attribution {
	color: var(--spark-muted, #5b6472);
	font-size: 0.6875rem;
	line-height: 1.5;
	margin: 0.9rem 0 0;
}

.spark-listing-card__required,
.spark-listing-card__idx-logo-text {
	color: var(--spark-muted, #5b6472);
	font-size: 0.6875rem;
	line-height: 1.5;
	margin: 0.35rem 0 0;
}

.spark-listing-card__idx-logo {
	display: block;
	height: auto;
	margin-top: 0.5rem;
	max-height: 28px;
	max-width: 110px;
	object-fit: contain;
}

/* ---------- Results page ---------- */

/* ---------- Results page header and active filters ---------- */

.spark-results__header { margin-bottom: 1.6rem; }

.spark-results__heading {
	font-size: clamp(1.8rem, 4vw, 2.75rem);
	letter-spacing: -0.02em;
	line-height: 1.12;
	margin: 0 0 0.6rem;
}

.spark-results__intro {
	color: var(--spark-muted, #5b6472);
	font-size: 1.02rem;
	line-height: 1.65;
	margin: 0;
	max-width: 62ch;
}

/* Active refinements, each individually removable. */
.spark-results__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 1.4rem;
	padding: 0;
}

.spark-results__chip {
	align-items: center;
	background: var(--spark-surface-alt, #f7f9fa);
	border: 1px solid var(--spark-border, #e4e7ec);
	border-radius: 999px;
	display: inline-flex;
	font-size: 0.85rem;
	font-weight: 600;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0.35rem 0.4rem 0.35rem 0.9rem;
}

.spark-results__chip-clear {
	align-items: center;
	border-radius: 50%;
	color: var(--spark-muted, #5b6472);
	display: inline-flex;
	font-size: 1.05rem;
	height: 22px;
	justify-content: center;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
	width: 22px;
}

.spark-results__chip-clear:hover,
.spark-results__chip-clear:focus-visible {
	background: var(--spark-accent, #17a67f);
	color: #fff;
}

.spark-results__bar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	margin-bottom: 1.5rem;
}

.spark-results .flexmls-spark__count { margin: 0; }

/* Links to the other community pages, below the results. */
.spark-results__areas {
	border-top: 1px solid var(--spark-border, #e4e7ec);
	margin-top: 2.5rem;
	padding-top: 1.75rem;
}

.spark-results__areas-title {
	font-size: 1.25rem;
	line-height: 1.3;
	margin: 0 0 1rem;
}

.spark-results__areas-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.spark-results__areas-list li { list-style: none; margin: 0; }

.flexmls-spark .spark-results__area {
	background: var(--spark-surface, #fff);
	border: 1px solid var(--spark-border, #e4e7ec);
	border-radius: 999px;
	color: var(--spark-text, #12232e);
	display: inline-flex;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.55rem 1.1rem;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.flexmls-spark .spark-results__area--all { color: var(--spark-accent-text, #0e7a5c); }

.flexmls-spark .spark-results__area:hover,
.flexmls-spark .spark-results__area:focus-visible {
	background: var(--spark-accent-text, #0e7a5c);
	border-color: var(--spark-accent-text, #0e7a5c);
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.flexmls-spark .spark-results__area { transition: none; }
}

/* The Elementor editor canvas has no theme container. */
.elementor-editor-active .spark-hero,
.elementor-editor-active .spark-featured { max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
	.spark-listing-card,
	.spark-listing-card__cta-icon,
	.spark-hero__submit {
		transition: none;
	}

	.spark-listing-card:hover { transform: none; }
}

/* ---------- Asynchronous results ----------
 *
 * The region dims and locks while a request is in flight. Content is never
 * removed first: the previous results stay readable so the page does not
 * collapse and reflow on every keystroke of a filter change.
 */

.spark-results {
	position: relative;
	transition: opacity 0.15s ease;
}

/* Focus lands on the region after paging only to keep the visitor's place. */
.spark-results:focus {
	outline: none;
}

.spark-results.is-loading {
	opacity: 0.55;
	pointer-events: none;
}

.spark-results.is-loading::after {
	animation: spark-spin 0.7s linear infinite;
	border: 2px solid var(--spark-border, #e4e7ec);
	border-radius: 50%;
	border-top-color: var(--spark-accent, #17a67f);
	content: "";
	height: 30px;
	inset-inline-start: calc(50% - 15px);
	position: absolute;
	top: 90px;
	width: 30px;
	z-index: 2;
}

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

@media (prefers-reduced-motion: reduce) {
	.spark-results.is-loading::after { animation-duration: 2.4s; }
	.spark-results { transition: none; }
}

/* ---------- Community index ---------- */

.spark-communities__header { margin-bottom: 1.8rem; }

.spark-communities__title {
	font-size: clamp(1.8rem, 4vw, 2.75rem);
	letter-spacing: -0.02em;
	line-height: 1.12;
	margin: 0 0 0.6rem;
}

.spark-communities__intro {
	color: var(--spark-muted, #5b6472);
	font-size: 1.02rem;
	line-height: 1.65;
	margin: 0;
	max-width: 62ch;
}

.spark-communities__grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 640px) {
	.spark-communities__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
	.spark-communities__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.spark-communities__item { list-style: none; margin: 0; }

.flexmls-spark .spark-communities__card {
	align-items: center;
	background: var(--spark-surface, #fff);
	border: 1px solid var(--spark-border, #e4e7ec);
	border-radius: 8px;
	color: var(--spark-text, #12232e);
	display: flex;
	gap: 0.75rem;
	min-height: 84px;
	padding: 1.1rem 1.3rem;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.flexmls-spark .spark-communities__card:hover,
.flexmls-spark .spark-communities__card:focus-visible {
	border-color: var(--spark-accent-text, #0e7a5c);
	box-shadow: 0 6px 20px rgba(16, 28, 44, 0.08);
	transform: translateY(-2px);
}

.spark-communities__name {
	font-size: 1.1rem;
	font-weight: 700;
}

.spark-communities__count {
	color: var(--spark-muted, #5b6472);
	font-size: 0.85rem;
	margin-inline-start: auto;
}

.spark-communities__cta {
	color: var(--spark-accent-text, #0e7a5c);
	display: inline-flex;
	flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
	.flexmls-spark .spark-communities__card { transition: none; }
	.flexmls-spark .spark-communities__card:hover { transform: none; }
}
