.wp-block-realhomes-property-list,
.wp-block-realhomes-property-search,
.wp-block-realhomes-property-map,
.wp-block-realhomes-featured-property,
.wp-block-realhomes-property-taxonomy {
	--rhgb-primary: #1b6b58;
	--rhgb-ink: #1e2933;
	--rhgb-muted: #69737c;
	--rhgb-surface: #ffffff;
	--rhgb-border: #e3e8e6;
	color: var(--rhgb-ink);
}

.rhgb-block-title {
	margin: 0 0 1.25rem;
	color: var(--rhgb-ink);
	font-size: clamp(1.45rem, 2vw, 2rem);
	line-height: 1.25;
}

.rhgb-empty-state {
	margin: 0;
	padding: 1.25rem;
	border: 1px dashed var(--rhgb-border);
	border-radius: 8px;
	color: var(--rhgb-muted);
	background: #fafcfb;
}

.rhgb-property-list__items {
	display: grid;
	grid-template-columns: repeat(var(--rhgb-columns, 3), minmax(0, 1fr));
	gap: 1.5rem;
}

/* The block adapts to its actual column width, including narrow page-builder areas. */
.rhgb-property-list {
	container-type: inline-size;
}

@container (max-width: 860px) {
	.rhgb-property-list--grid.rhgb-property-list--columns-3 .rhgb-property-list__items,
	.rhgb-property-list--grid.rhgb-property-list--columns-4 .rhgb-property-list__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container (max-width: 540px) {
	.rhgb-property-list--grid .rhgb-property-list__items {
		grid-template-columns: 1fr;
	}
}

.rhgb-property-list--list .rhgb-property-list__items {
	grid-template-columns: 1fr;
}

.rhgb-property-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--rhgb-border);
	border-radius: 10px;
	background: var(--rhgb-surface);
	box-shadow: 0 5px 18px rgb(23 42 35 / 5%);
}

.rhgb-property-card--list {
	flex-direction: row;
	align-items: stretch;
}

.rhgb-property-card__image {
	position: relative;
	display: block;
	min-height: 13rem;
	background: #eaf0ed;
}

.rhgb-property-card--grid .rhgb-property-card__image {
	aspect-ratio: 1.5;
}

.rhgb-property-card--list .rhgb-property-card__image {
	flex: 0 0 min(38%, 19rem);
	min-height: 100%;
}

.rhgb-property-card__image img,
.rhgb-featured-property__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rhgb-property-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	min-height: inherit;
	background: linear-gradient(135deg, #dce7e2, #b8cbc1);
}

.rhgb-property-card__status {
	position: absolute;
	top: .8rem;
	left: .8rem;
	padding: .32rem .55rem;
	border-radius: 4px;
	color: #fff;
	background: var(--rhgb-primary);
	font-size: .78rem;
	font-weight: 700;
}

.rhgb-property-card__content {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 1.1rem 1.15rem 1.2rem;
}

.rhgb-property-card__price,
.rhgb-featured-property__price {
	margin: 0 0 .45rem;
	color: var(--rhgb-primary);
	font-size: 1.1rem;
	font-weight: 700;
}

.rhgb-property-card__title {
	margin: 0;
	font-size: 1.12rem;
	line-height: 1.32;
}

.rhgb-property-card__title a,
.rhgb-property-taxonomy a,
.rhgb-featured-property a {
	color: inherit;
	text-decoration: none;
}

.rhgb-property-card__title a:hover,
.rhgb-property-card__title a:focus-visible,
.rhgb-property-taxonomy a:hover,
.rhgb-property-taxonomy a:focus-visible {
	color: var(--rhgb-primary);
}

.rhgb-property-card__address {
	margin: .6rem 0 1rem;
	color: var(--rhgb-muted);
	font-size: .9rem;
}

.rhgb-property-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: .45rem .85rem;
	margin: auto 0 0;
	padding: .85rem 0 0;
	border-top: 1px solid var(--rhgb-border);
	color: var(--rhgb-muted);
	font-size: .85rem;
	list-style: none;
}

.rhgb-search {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
	gap: .9rem;
	padding: 1.25rem;
	border: 1px solid var(--rhgb-border);
	border-radius: 10px;
	background: var(--rhgb-surface);
	box-shadow: 0 5px 18px rgb(23 42 35 / 5%);
}

.rhgb-search__field {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	min-width: 0;
	color: var(--rhgb-ink);
	font-size: .83rem;
	font-weight: 650;
}

.rhgb-search__field--keyword {
	grid-column: span 2;
}

.rhgb-search input,
.rhgb-search select {
	box-sizing: border-box;
	width: 100%;
	min-height: 2.7rem;
	padding: .6rem .7rem;
	border: 1px solid #cdd8d2;
	border-radius: 5px;
	color: var(--rhgb-ink);
	background: #fff;
	font: inherit;
}

.rhgb-search input:focus,
.rhgb-search select:focus {
	outline: 2px solid color-mix(in srgb, var(--rhgb-primary) 35%, transparent);
	border-color: var(--rhgb-primary);
}

.rhgb-search__submit,
.rhgb-button {
	align-self: end;
	min-height: 2.7rem;
	padding: .65rem 1.1rem;
	border: 0;
	border-radius: 5px;
	color: #fff;
	background: var(--rhgb-primary);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}

.rhgb-search__submit:hover,
.rhgb-search__submit:focus-visible,
.rhgb-button:hover,
.rhgb-button:focus-visible {
	color: #fff;
	background: #124b3d;
	transform: translateY(-1px);
}

.rhgb-map {
	overflow: hidden;
	border: 1px solid var(--rhgb-border);
	border-radius: 10px;
	background: #e6ece9;
}

.rhgb-map .leaflet-control-attribution {
	font-size: 10px;
}

.rhgb-map-popup {
	display: flex;
	gap: .65rem;
	min-width: 13rem;
	color: var(--rhgb-ink);
	line-height: 1.25;
}

.rhgb-map-popup img {
	flex: 0 0 3.8rem;
	width: 3.8rem;
	height: 3.8rem;
	object-fit: cover;
}

.rhgb-map-popup strong {
	display: block;
	margin-bottom: .25rem;
}

.rhgb-map-popup__price,
.rhgb-map-popup__address {
	margin: .15rem 0 0;
	font-size: .8rem;
}

.rhgb-map-popup__price {
	color: var(--rhgb-primary);
	font-weight: 700;
}

.rhgb-map-popup__address {
	color: var(--rhgb-muted);
}

.rhgb-featured-property {
	display: grid;
	grid-template-columns: minmax(15rem, 1fr) minmax(17rem, 1fr);
	overflow: hidden;
	border-radius: 10px;
	background: var(--rhgb-ink);
	box-shadow: 0 8px 25px rgb(23 42 35 / 12%);
}

.rhgb-featured-property__media {
	min-height: 22rem;
}

.rhgb-featured-property__media a,
.rhgb-featured-property__media .rhgb-property-card__placeholder {
	display: block;
	height: 100%;
}

.rhgb-featured-property__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(1.7rem, 5vw, 4rem);
	color: #fff;
}

.rhgb-featured-property__eyebrow {
	margin: 0 0 .6rem;
	color: #9ecfbe;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.rhgb-featured-property__content h2 {
	margin: 0;
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	line-height: 1.15;
}

.rhgb-featured-property__price {
	margin-top: 1rem;
	color: #b7e7d6;
	font-size: 1.25rem;
}

.rhgb-featured-property__description {
	margin: .3rem 0 1.4rem;
	color: #e1ede8;
	line-height: 1.6;
}

.rhgb-featured-property .rhgb-button {
	align-self: auto;
	background: #fff;
	color: var(--rhgb-ink);
}

.rhgb-featured-property .rhgb-button:hover,
.rhgb-featured-property .rhgb-button:focus-visible {
	color: #fff;
	background: var(--rhgb-primary);
}

.rhgb-property-taxonomy__items {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
	gap: .75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rhgb-property-taxonomy__items a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	padding: 1rem;
	border: 1px solid var(--rhgb-border);
	border-radius: 8px;
	background: var(--rhgb-surface);
	font-weight: 700;
}

.rhgb-property-taxonomy__items small {
	display: grid;
	place-items: center;
	min-width: 1.7rem;
	height: 1.7rem;
	border-radius: 999px;
	color: var(--rhgb-primary);
	background: #e5f0eb;
	font-size: .75rem;
}

.rhgb-property-taxonomy--pills .rhgb-property-taxonomy__items {
	display: flex;
	flex-wrap: wrap;
}

.rhgb-property-taxonomy--pills .rhgb-property-taxonomy__items a {
	padding: .6rem .8rem;
	border-radius: 999px;
}

.rhgb-property-taxonomy--list .rhgb-property-taxonomy__items {
	grid-template-columns: 1fr;
	gap: 0;
}

.rhgb-property-taxonomy--list .rhgb-property-taxonomy__items a {
	padding: .85rem 0;
	border-width: 0 0 1px;
	border-radius: 0;
	box-shadow: none;
}

.rhgb-editor-preview {
	padding: .5rem 0;
}

.rhgb-editor-term-filter {
	margin: 1rem 0;
	padding: .8rem;
	border: 1px solid #d9e3de;
	border-radius: 4px;
}

.rhgb-editor-term-filter legend {
	padding: 0 .2rem;
	font-weight: 600;
}

@media (max-width: 720px) {
	.rhgb-property-card--list,
	.rhgb-featured-property {
		grid-template-columns: 1fr;
		flex-direction: column;
	}

	.rhgb-property-card--list .rhgb-property-card__image {
		flex-basis: auto;
		min-height: 13rem;
	}

	.rhgb-featured-property__media {
		min-height: 15rem;
	}

	.rhgb-search__field--keyword {
		grid-column: span 1;
	}
}

/* Fallback for older browsers that do not yet support container queries. */
@supports not (container-type: inline-size) {
	@media (max-width: 860px) {
		.rhgb-property-list--grid.rhgb-property-list--columns-3 .rhgb-property-list__items,
		.rhgb-property-list--grid.rhgb-property-list--columns-4 .rhgb-property-list__items {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
	}

	@media (max-width: 540px) {
		.rhgb-property-list--grid .rhgb-property-list__items {
			grid-template-columns: 1fr;
		}
	}
}
