/**
 * Property Insider front-end styles.
 *
 * Sits on top of the theme's Bootstrap 4 grid and card conventions rather than
 * replacing them: the markup reuses .row, .col-sm-6, .wrapper, .thumbnail and
 * .overlay-link, so the theme's existing hover and aspect-ratio rules apply and
 * these styles only add what is genuinely new.
 *
 * Colours are defined as custom properties so they can be re-pointed at the
 * theme palette in one place.
 */

.cpi-properties {
	--cpi-accent: #0b4a8f;
	--cpi-coming-soon: #0b4a8f;
	--cpi-sold: #444a52;
	--cpi-border: #e3e5e8;
	--cpi-muted: #5c636a;
}

/* ---------------------------------------------------------------- Filters */

.cpi-filters {
	background: #f7f8f9;
	border: 1px solid var(--cpi-border, #e3e5e8);
	border-radius: 3px;
	padding: 18px 20px;
	margin-bottom: 30px;
}

.cpi-filters__row {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-end;
}

.cpi-filters__field {
	display: flex;
	flex-direction: column;
	flex: 1 1 150px;
	margin: 0;
	min-width: 0;
}

.cpi-filters__label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #5c636a;
	margin-bottom: 4px;
}

.cpi-filters__field select {
	width: 100%;
	max-width: 100%;
	padding: 7px 10px;
	border: 1px solid #ccd0d4;
	border-radius: 2px;
	background: #fff;
}

.cpi-filters__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.cpi-button {
	display: inline-block;
	padding: 9px 22px;
	border: 0;
	border-radius: 2px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.cpi-button--primary {
	background: #0b4a8f;
	color: #fff;
}

.cpi-button--primary:hover,
.cpi-button--primary:focus {
	background: #093a70;
	color: #fff;
}

.cpi-button--secondary {
	background: #fff;
	color: #0b4a8f;
	border: 1px solid #0b4a8f;
}

.cpi-filters__reset {
	font-size: 14px;
	color: #5c636a;
}

.cpi-results.is-loading {
	opacity: 0.5;
	transition: opacity 0.15s ease;
}

/* ------------------------------------------------------------------ Badge */

.cpi-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: inline-block;
	padding: 5px 12px;
	border-radius: 2px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
	background: #0b4a8f;
}

.cpi-badge--sold {
	background: #444a52;
}

.cpi-badge--inline {
	position: static;
	margin-bottom: 12px;
}

/* ------------------------------------------------------------------ Cards */

/*
 * Equal-height cards. The theme's card markup predates flexbox, so the columns
 * are made flex here rather than relying on the wrapper's height alone —
 * otherwise a card with a shorter title leaves the row ragged.
 */
.cpi-grid {
	display: flex;
	flex-wrap: wrap;
}

.cpi-card {
	display: flex;
	margin-bottom: 26px;
}

.cpi-card .wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #fff;
	border: 1px solid var(--cpi-border, #e3e5e8);
	border-radius: 3px;
	overflow: hidden;
}

.cpi-card__thumb {
	position: relative;
}

/*
 * The theme's .thumbnail.rectangular already establishes the 56% aspect ratio
 * with a ::before spacer and absolutely positions the image inside it. The
 * placeholder has to sit in that same absolute layer — giving it its own
 * padding-based ratio would stack a second box on top of the first and produce a
 * card twice as tall as one with a photo.
 */
.cpi-card__placeholder {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: #eef0f2 linear-gradient(135deg, #eef0f2 0%, #e4e7ea 100%);
}

.cpi-card__details {
	flex: 1 1 auto;
}

.cpi-card__details {
	padding: 18px 20px 22px;
}

.cpi-card__title {
	font-size: 19px;
	margin: 0 0 4px;
	line-height: 1.3;
}

.cpi-card__address {
	color: #5c636a;
	font-size: 14px;
	margin: 0 0 10px;
}

.cpi-card__price {
	font-size: 21px;
	font-weight: 700;
	margin: 0 0 10px;
	color: #0b4a8f;
}

.cpi-card--sold .cpi-card__price {
	color: #444a52;
}

.cpi-card__specs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 14px;
	color: #5c636a;
}

.cpi-card__specs li {
	margin: 0;
}

.cpi-empty {
	padding: 40px 0;
	text-align: center;
	color: #5c636a;
	font-size: 17px;
}

.cpi-pagination {
	margin-top: 30px;
	text-align: center;
}

.cpi-pagination .page-numbers {
	display: inline-block;
	padding: 7px 13px;
	margin: 0 2px;
	border: 1px solid var(--cpi-border, #e3e5e8);
	border-radius: 2px;
	text-decoration: none;
}

.cpi-pagination .page-numbers.current {
	background: #0b4a8f;
	border-color: #0b4a8f;
	color: #fff;
}

/* ------------------------------------------------------------- Single hero */

.cpi-hero__image {
	position: relative;
	margin-bottom: 26px;
}

.cpi-hero__image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 3px;
}

.cpi-hero__image .cpi-badge {
	top: 18px;
	left: 18px;
	font-size: 13px;
	padding: 7px 16px;
}

.cpi-hero__title {
	margin: 0 0 6px;
}

.cpi-hero__address {
	font-size: 17px;
	color: #5c636a;
	margin: 0 0 10px;
}

.cpi-hero__address-note {
	display: block;
	font-size: 14px;
	font-style: italic;
}

.cpi-hero__price {
	font-size: 30px;
	font-weight: 700;
	color: #0b4a8f;
	margin: 0 0 8px;
}

.cpi-property.cpi-status-sold .cpi-hero__price {
	color: #444a52;
}

.cpi-hero__available,
.cpi-hero__sold {
	margin: 0 0 4px;
	color: #5c636a;
}

/* ------------------------------------------------------------------ Facts */

.cpi-facts {
	list-style: none;
	margin: 0 0 28px;
	padding: 20px 0;
	border-top: 1px solid var(--cpi-border, #e3e5e8);
	border-bottom: 1px solid var(--cpi-border, #e3e5e8);
	display: flex;
	flex-wrap: wrap;
	gap: 26px;
}

.cpi-facts__item {
	margin: 0;
	min-width: 90px;
}

.cpi-facts__value {
	display: block;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
}

.cpi-facts__label {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #5c636a;
	margin-top: 2px;
}

.cpi-mls-link {
	margin: -10px 0 26px;
}

.cpi-short-description {
	font-size: 18px;
	line-height: 1.6;
	margin-bottom: 24px;
}

.cpi-section-title {
	font-size: 22px;
	margin: 34px 0 16px;
}

/* ------------------------------------------------------------- Highlights */

.cpi-highlights__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 10px 24px;
}

.cpi-highlights__item {
	position: relative;
	padding-left: 24px;
	margin: 0;
}

.cpi-highlights__item::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 0.55em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #0b4a8f;
}

/* ------------------------------------------------------------------ Media */

.cpi-gallery__cell {
	margin-bottom: 16px;
}

.cpi-gallery__link img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 2px;
}

.cpi-video__embed {
	position: relative;
	padding-top: 56.25%;
}

.cpi-video__embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.cpi-floorplan img {
	max-width: 100%;
	height: auto;
}

/* -------------------------------------------------------------- CTA/agent */

.cpi-cta {
	background: #f7f8f9;
	border: 1px solid var(--cpi-border, #e3e5e8);
	border-radius: 3px;
	padding: 24px;
	margin-bottom: 24px;
}

.cpi-cta__heading {
	font-size: 20px;
	margin: 0 0 16px;
}

.cpi-cta__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.cpi-cta__note {
	margin: 16px 0 0;
	font-size: 14px;
	color: #5c636a;
}

.cpi-agent__card {
	display: flex;
	gap: 16px;
	align-items: center;
	border: 1px solid var(--cpi-border, #e3e5e8);
	border-radius: 3px;
	padding: 18px;
}

.cpi-agent__photo {
	flex: 0 0 84px;
	width: 84px;
}

.cpi-agent__photo img {
	width: 100%;
	height: auto;
	border-radius: 50%;
	display: block;
}

.cpi-agent__name {
	font-weight: 700;
	margin: 0 0 2px;
}

.cpi-agent__title,
.cpi-agent__email {
	margin: 0;
	font-size: 14px;
	color: #5c636a;
}

/* ------------------------------------------------------------------- Form */

.cpi-form {
	background: #f7f8f9;
	border: 1px solid var(--cpi-border, #e3e5e8);
	border-radius: 3px;
	padding: 30px;
}

.cpi-form__intro {
	color: #5c636a;
	margin-bottom: 20px;
}

.cpi-admin-note {
	padding: 14px;
	background: #fff6e5;
	border: 1px solid #f0d090;
	border-radius: 2px;
}

.cpi-related__all {
	margin-top: 20px;
}

/* ------------------------------------------------------------------ Small */

@media (max-width: 782px) {
	.cpi-filters__field {
		flex: 1 1 100%;
	}

	.cpi-filters__actions {
		width: 100%;
	}

	.cpi-hero__price {
		font-size: 25px;
	}

	.cpi-facts {
		gap: 18px;
	}

	.cpi-agent__card {
		flex-direction: column;
		text-align: center;
	}
}
