/* Step 6: persistent list, grid and map result presentations. */

.swre-property-result-view {
	min-width: 0;
}

.swre-property-results--grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.swre-property-results--grid .swre-property-card--grid {
	display: flex;
	flex-direction: column;
}

.swre-property-results--grid .swre-property-card__media {
	aspect-ratio: 16 / 10;
	min-height: 0;
}

.swre-property-results--grid .swre-property-card__body {
	flex: 1;
	padding: 1.25rem;
}

.swre-property-results--grid .swre-property-card__price > span {
	font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.swre-property-results--grid .swre-property-card__excerpt {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	display: -webkit-box;
	overflow: hidden;
}

.swre-property-map-panel[hidden] {
	display: none;
}

.swre-property-result-view--map {
	align-items: start;
	display: grid;
	gap: 1rem;
	grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr);
}

.swre-property-map-panel {
	background: var(--swre-property-surface);
	border: 1px solid var(--swre-property-line);
	min-width: 0;
	position: sticky;
	top: 1rem;
}

.swre-property-map-panel__heading {
	align-items: flex-end;
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	padding: 1rem;
}

.swre-property-map-panel__heading h2 {
	font-family: var(--swrep-heading-font, Arial, Helvetica, sans-serif);
	font-size: clamp(1.25rem, 2vw, 1.75rem);
	line-height: 1.2;
	margin: 0;
}

.swre-property-map-panel__heading > p {
	color: var(--swre-property-muted);
	font-size: 0.75rem;
	line-height: 1.45;
	margin: 0;
	max-width: 16rem;
}

.swre-property-map {
	background: #e9e4d8;
	height: min(68vh, 690px);
	min-height: 480px;
	position: relative;
	z-index: 0;
}

.swre-property-map__status {
	align-items: center;
	background: var(--swre-property-canvas);
	color: var(--swre-property-muted);
	display: flex;
	inset: 0;
	justify-content: center;
	margin: 0;
	padding: 2rem;
	position: absolute;
	text-align: center;
	z-index: 500;
}

.swre-property-map__status[hidden] {
	display: none;
}

.swre-property-results--map {
	max-height: min(78vh, 790px);
	overflow: auto;
	overscroll-behavior: contain;
	padding-right: 0.25rem;
	scrollbar-gutter: stable;
}

.swre-property-results--map .swre-property-card {
	display: block;
	min-width: 0;
}

.swre-property-results--map .swre-property-card__media {
	aspect-ratio: 16 / 8;
	min-height: 0;
}

.swre-property-results--map .swre-property-card__body {
	padding: 1rem;
}

.swre-property-results--map .swre-property-card__price > span {
	font-size: 1.25rem;
}

.swre-property-results--map .swre-property-card__title {
	font-size: 1.05rem;
}

.swre-property-results--map .swre-property-card__facts {
	gap: 0.45rem 0.8rem;
	margin-top: 0.8rem;
}

.swre-property-results--map .swre-property-card__facts li {
	font-size: 0.75rem;
}

.swre-property-results--map :where(.swre-property-card__highlights, .swre-property-card__excerpt) {
	display: none;
}

.swre-property-card.is-map-active {
	border-color: var(--swre-property-gold-strong);
	box-shadow: 0 0 0 2px var(--swre-property-gold);
}

.swre-property-map-marker {
	align-items: center;
	background: var(--swre-property-ink);
	border: 2px solid #fff;
	box-shadow: 0 4px 13px rgba(11, 11, 13, 0.28);
	color: #fff;
	display: flex;
	font-size: 0.7rem;
	font-weight: 850;
	justify-content: center;
	line-height: 1;
	min-width: 3.6rem;
	padding: 0.5rem 0.6rem;
	position: relative;
	white-space: nowrap;
}

.swre-property-map-marker::after {
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid var(--swre-property-ink);
	content: "";
	left: 50%;
	position: absolute;
	top: 100%;
	transform: translateX(-50%);
}

.leaflet-marker-icon.is-card-active .swre-property-map-marker {
	background: var(--swre-property-gold);
	color: var(--swre-property-ink);
	transform: translateY(-3px);
}

.leaflet-marker-icon.is-card-active .swre-property-map-marker::after {
	border-top-color: var(--swre-property-gold);
}

.swre-property-map-popup {
	display: grid;
	gap: 0.25rem;
	min-width: 12rem;
}

.swre-property-map-popup strong {
	font-size: 0.9rem;
}

.swre-property-map-popup span {
	color: #65645f;
	font-size: 0.75rem;
}

.swre-property-map-popup a {
	color: #8a6810;
	font-size: 0.78rem;
	font-weight: 800;
	margin-top: 0.2rem;
}

@media (max-width: 1180px) {
	.swre-property-result-view--map {
		grid-template-columns: minmax(0, 1fr);
	}

	.swre-property-map-panel {
		position: static;
	}

	.swre-property-results--map {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-height: none;
		overflow: visible;
		padding-right: 0;
	}
}

@media (max-width: 860px) {
	.swre-property-results--grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 767px) {
	.swre-property-archive__toolbar-actions .swre-property-view-switcher {
		order: -1;
	}

	.swre-property-map-panel__heading {
		align-items: flex-start;
		flex-direction: column;
	}

	.swre-property-map {
		height: min(62vh, 470px);
		min-height: 360px;
	}

	.swre-property-results--map {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.swre-property-map-marker,
	.swre-property-card.is-map-active {
		transition: none;
	}
}
