/*
 * GeekOut Listings UI
 * Shared presentation layer for Community, Home Search, Open House,
 * and other listing/map interfaces as they are migrated.
 *
 * Site owners can change the main colors from:
 * Elementor > Site Settings > Global Colors
 *
 * These aliases intentionally point at Elementor's standard global
 * color variables so templates do not need hard-coded brand colors.
 */
:root {
	--geekout-listings-primary: var(--e-global-color-primary, #682581);
	--geekout-listings-secondary: var(--e-global-color-secondary, #6b7077);
	--geekout-listings-text: var(--e-global-color-text, #242629);
	--geekout-listings-accent: var(--e-global-color-accent, var(--geekout-listings-primary));
	--geekout-listings-surface: #fff;
	--geekout-listings-border: rgba(0, 0, 0, .10);
}

/*
 * Community currently uses the shared file first.
 * Home Search and Open House can be moved onto these same controls/cards
 * incrementally after Community remains stable.
 */

/*
	 * Match the working Home Search / Open House desktop behavior:
	 * full browser width, 70/30 split, both panes 100vh, and only the
	 * results pane scrolls while the map remains visible beside it.
	 */
	/*
	 * The Community widget sits inside Elementor element f644be4, which
	 * adds 50px horizontal padding.  Remove only that horizontal padding
	 * so the listings/map workspace can span the page like Home Search
	 * and Open Houses.  Keep Elementor's top/bottom spacing intact.
	 */
	.elementor-647 .elementor-element.elementor-element-f644be4 {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.elementor-647 .elementor-element.elementor-element-f644be4 > .elementor-widget-container,
	.elementor-647 .elementor-element.elementor-element-f644be4 .elementor-widget-container {
		max-width: none !important;
		width: 100% !important;
	}

	/*
	 * Three explicit desktop viewing states:
	 * - Gallery: listings 100%, normal document flow
	 * - Split:   listings 70% / map 30%, 100vh workspace
	 * - Map:     map 100%, 100vh workspace
	 *
	 * State classes avoid competing inline height/overflow rules.
	 */
	.geekout-community-layout {
		display: flex;
		width: 100%;
		max-width: none;
		margin: 0;
		align-items: stretch;
		position: relative;
	}

	.geekout-community-layout > .results,
	.geekout-community-layout > .map {
		min-width: 0;
	}

	/* Default / Split view. */
	.geekout-community-layout.view-split {
		height: 100vh;
		overflow: hidden;
	}

	.geekout-community-layout.view-split > .results {
		display: block;
		width: 70%;
		height: 100vh;
		max-height: 100vh;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.geekout-community-layout.view-split > .map {
		display: block;
		width: 30%;
		height: 100vh;
		overflow: hidden;
		float: none !important;
	}

	.geekout-community-layout.view-split > .map #map {
		width: 100%;
		height: 100vh !important;
	}

	/* Gallery-only view. */
	.geekout-community-layout.view-gallery {
		display: block;
		height: auto;
		overflow: visible;
	}

	.geekout-community-layout.view-gallery > .results {
		display: block;
		width: 100%;
		height: auto;
		max-height: none;
		overflow: visible;
	}

	.geekout-community-layout.view-gallery > .map {
		display: none;
	}

	/* Map-only view. */
	.geekout-community-layout.view-map {
		height: 100vh;
		overflow: hidden;
	}

	.geekout-community-layout.view-map > .results {
		display: none;
	}

	.geekout-community-layout.view-map > .map {
		display: block;
		width: 100%;
		height: 100vh;
		overflow: hidden;
		float: none !important;
	}

	.geekout-community-layout.view-map > .map #map {
		width: 100%;
		height: 100vh !important;
	}

	#leftsideresults {
		width: 100%;
		max-width: none !important;
		overflow: visible !important;
	}

	#leftsideresults {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.searchresults {
		padding: 16px 20px 0;
		font-size: 14px;
		font-weight: 600;
		color: var(--geekout-listings-secondary);
	}

	.geekout-community-listing-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
		gap: 20px;
		width: 100%;
		padding: 18px 20px 32px;
		align-items: start;
	}

	.geekout-community-layout.view-gallery .geekout-community-listing-grid {
		grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
		gap: 24px;
		padding: 22px 24px 36px;
	}

	.geekout-community-property-card {
		position: relative;
		min-width: 0;
		overflow: hidden;
		border: 1px solid rgba(0, 0, 0, .10);
		border-radius: 12px;
		background: #fff;
		box-shadow: 0 3px 14px rgba(0, 0, 0, .08);
		transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
	}

	.geekout-community-property-card:hover {
		transform: none;
		border-color: rgba(0, 0, 0, .10);
		box-shadow: 0 3px 14px rgba(0, 0, 0, .08);
	}

	.geekout-community-card-media {
		position: relative;
		aspect-ratio: 4 / 3;
		overflow: hidden;
		background: #eceeef;
		line-height: 0;
	}

	.geekout-community-card-photo {
		position: absolute;
		inset: 0;
		display: block;
		width: 100% !important;
		height: 100% !important;
		max-width: none !important;
		max-height: none !important;
		margin: 0 !important;
		padding: 0 !important;
		object-fit: cover !important;
		object-position: center center;
		transition: none;
	}

	.geekout-community-card-photo-link {
		position: absolute;
		inset: 0;
		z-index: 1;
		display: block;
		margin: 0;
		padding: 0;
		text-decoration: none;
	}

	.geekout-community-card-photo-link:focus-visible {
		outline: 3px solid var(--geekout-listings-primary);
		outline-offset: -3px;
	}

	.geekout-community-property-card:hover .geekout-community-card-photo {
		transform: none;
	}

	.geekout-community-card-badges {
		position: absolute;
		top: 12px;
		left: 12px;
		z-index: 3;
		display: flex;
		flex-wrap: wrap;
		gap: 6px;
		max-width: calc(100% - 68px);
		pointer-events: none;
	}

	.geekout-community-card-badge,
	.geekout-community-status-badge {
		display: inline-flex;
		align-items: center;
		min-height: 25px;
		padding: 5px 9px;
		border-radius: 999px;
		font-size: 11px;
		font-weight: 800;
		line-height: 1;
		letter-spacing: .02em;
		box-shadow: 0 2px 7px rgba(0, 0, 0, .16);
	}

	.geekout-community-card-badge-new {
		background: var(--geekout-listings-primary);
		color: #fff;
	}

	.geekout-community-card-badge-openhouse {
		background: #fff;
		color: #222;
	}

	.geekout-community-status-badge {
		position: absolute;
		left: 12px;
		bottom: 12px;
		z-index: 3;
		max-width: calc(100% - 24px);
		background: rgba(20, 20, 20, .82);
		color: #fff;
		backdrop-filter: blur(3px);
		-webkit-backdrop-filter: blur(3px);
		pointer-events: none;
	}

	.geekout-community-card-favorite {
		position: absolute;
		top: 10px;
		right: 10px;
		z-index: 5;
	}

	.geekout-community-favorite-button,
	.geekout-community-favorite-login {
		appearance: none;
		-webkit-appearance: none;
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(255, 255, 255, .94) !important;
		color: var(--geekout-listings-primary);
		font-size: 20px;
		line-height: 1;
		text-decoration: none;
		box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
		cursor: pointer;
	}

	.geekout-community-favorite-button i,
	.geekout-community-favorite-login i {
		position: absolute;
		top: 50%;
		left: 50%;
		display: block;
		width: 1em;
		height: 1em;
		margin: 0;
		padding: 0;
		line-height: 1;
		text-align: center;
		transform: translate(-50%, -50%);
	}

	.geekout-community-favorite-button:hover,
	.geekout-community-favorite-login:hover {
		background: #fff !important;
		transform: scale(1.04);
		color: var(--geekout-listings-primary);
	}

	.geekout-community-card-content {
		position: relative;
		z-index: 1;
		padding: 16px 17px 15px;
	}

	.geekout-community-card-price {
		margin: 0 0 5px;
		color: var(--geekout-listings-text);
		font-size: clamp(21px, 2vw, 25px);
		font-weight: 800;
		line-height: 1.15;
		letter-spacing: -.02em;
	}

	.geekout-community-card-address {
		margin: 0;
		padding: 0;
		color: var(--geekout-listings-text);
		font-size: 16px;
		font-weight: 700;
		line-height: 1.3;
		text-transform: none;
	}

	.geekout-community-card-location {
		margin-top: 3px;
		color: var(--geekout-listings-secondary);
		font-size: 13px;
		line-height: 1.35;
	}

	.geekout-community-card-features {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
		margin-top: 15px;
		padding: 12px 0;
		border-top: 1px solid rgba(0, 0, 0, .08);
		border-bottom: 1px solid rgba(0, 0, 0, .08);
	}

	.geekout-community-card-feature {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		min-width: 0;
		color: var(--geekout-listings-secondary);
		font-size: 11px;
		line-height: 1.2;
		white-space: nowrap;
	}

	.geekout-community-card-feature + .geekout-community-card-feature {
		border-left: 1px solid rgba(0, 0, 0, .08);
	}

	.geekout-community-card-feature strong {
		display: block;
		color: var(--geekout-listings-text);
		font-size: 13px;
		font-weight: 800;
	}

	.geekout-community-feature-icon {
		display: inline-block;
		flex: 0 0 auto;
		width: 22px;
		height: 22px;
		color: var(--geekout-listings-primary);
		vertical-align: middle;
	}

	.geekout-community-feature-icon svg {
		display: block;
		width: 100%;
		height: 100%;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.geekout-community-card-meta {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin-top: 12px;
		color: #777c82;
		font-size: 11px;
		font-weight: 600;
	}

	.geekout-community-card-view {
		position: relative;
		z-index: 4;
		display: inline-flex;
		align-items: center;
		gap: 4px;
		padding: 4px 0;
		color: var(--geekout-listings-primary);
		font-size: 12px;
		font-weight: 800;
		line-height: 1.2;
		text-decoration: none;
		white-space: nowrap;
	}

	.geekout-community-card-view:hover,
	.geekout-community-card-view:focus-visible {
		color: var(--geekout-listings-primary);
		text-decoration: underline;
	}

	.geekout-community-card-view svg {
		width: 15px;
		height: 15px;
		fill: none;
		stroke: currentColor;
		stroke-width: 2;
		stroke-linecap: round;
		stroke-linejoin: round;
	}


	/*
	 * Leaflet result card: same visual language as gallery cards.
	 */
	#map .geekout-community-leaflet-popup .leaflet-popup-content-wrapper {
		padding: 0;
		overflow: hidden;
		border-radius: 12px;
		background: #fff;
		box-shadow: 0 8px 28px rgba(0, 0, 0, .20);
	}

	#map .geekout-community-leaflet-popup .leaflet-popup-content {
		width: 320px !important;
		margin: 0 !important;
		line-height: inherit;
	}

	#map .geekout-community-leaflet-popup .leaflet-popup-close-button {
		top: 8px;
		right: 8px;
		z-index: 20;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 30px;
		height: 30px;
		padding: 0;
		border-radius: 50%;
		background: rgba(255, 255, 255, .94);
		color: #333;
		font-size: 20px;
		font-weight: 400;
		line-height: 1;
		box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
	}

	#map .geekout-community-leaflet-popup .leaflet-popup-tip {
		background: #fff;
	}

	#map .geekout-community-map-property-card {
		width: 320px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		transform: none;
	}

	#map .geekout-community-map-property-card:hover {
		border: 0;
		box-shadow: none;
		transform: none;
	}

	#map .geekout-community-map-property-card .geekout-community-card-media {
		aspect-ratio: 4 / 3;
	}

	#map .geekout-community-map-property-card .geekout-community-card-content {
		padding: 14px 15px 13px;
	}

	#map .geekout-community-map-property-card .geekout-community-card-price {
		font-size: 22px;
	}

	#map .geekout-community-map-property-card .geekout-community-card-address {
		font-size: 15px;
	}

	#map .geekout-community-map-property-card .geekout-community-card-features {
		margin-top: 12px;
		padding: 10px 0;
	}

	#map .geekout-community-map-property-card .geekout-community-card-feature {
		gap: 5px;
		font-size: 10px;
	}

	#map .geekout-community-map-property-card .geekout-community-card-feature strong {
		font-size: 12px;
	}

	#map .geekout-community-map-property-card .geekout-community-feature-icon {
		width: 19px;
		height: 19px;
	}

	#map .geekout-community-map-property-card .geekout-community-card-meta {
		margin-top: 10px;
	}

	@media (max-width: 900px) and (min-width: 601px) {
		.geekout-community-layout.view-split .geekout-community-listing-grid {
			grid-template-columns: 1fr;
		}
	}

	@media (max-width: 600px) {
		.geekout-community-listing-grid,
		.geekout-community-layout.view-gallery .geekout-community-listing-grid {
			grid-template-columns: 1fr;
			gap: 18px;
			padding: 16px 14px 28px;
		}

		.searchresults {
			padding-left: 14px;
			padding-right: 14px;
		}
	}

	.geekout-community-message {
		margin: 20px;
		padding: 18px;
		border: 1px solid #ddd;
		border-radius: 6px;
		background: #fff;
	}

	.geekout-community-pagination {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px;
		margin: 0 0 50px;
		padding: 0;
		list-style: none;
	}

	.geekout-community-pagination .page-link.current {
		text-decoration: underline;
		pointer-events: none;
	}


	/* Community Gallery / Split / Map segmented control. */
	.geekout-community-viewbar {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		padding: 10px 12px;
		background: #fff;
		border-bottom: 1px solid rgba(0, 0, 0, .10);
	}

	.geekout-community-view-toggle {
		display: inline-flex;
		align-items: center;
		gap: 5px;
		padding: 4px;
		margin: 0;
		border-radius: 10px;
		background: rgba(0, 0, 0, .045);
		box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
	}

	.geekout-community-view-button {
		appearance: none;
		-webkit-appearance: none;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 7px;
		min-height: 38px;
		margin: 0;
		padding: 8px 14px;
		border: 0;
		border-radius: 7px;
		background: var(--geekout-listings-primary);
		color: #fff;
		font: inherit;
		font-size: 14px;
		font-weight: 700;
		line-height: 1;
		cursor: pointer;
		box-shadow: none;
		opacity: .62;
		transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
	}

	.geekout-community-view-button:hover {
		opacity: .82;
		transform: translateY(-1px);
	}

	.geekout-community-view-button:focus-visible {
		opacity: .9;
		outline: 2px solid currentColor;
		outline-offset: 2px;
	}

	.geekout-community-view-button.is-active {
		opacity: 1;
		transform: none;
		box-shadow: 0 2px 7px rgba(0, 0, 0, .18);
	}

	.geekout-community-view-button svg {
		display: block;
		width: 17px;
		height: 17px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
		flex: 0 0 auto;
	}

	@media (max-width: 600px) {
		.geekout-community-viewbar {
			padding: 8px;
		}

		.geekout-community-view-toggle {
			width: 100%;
			max-width: 360px;
		}

		.geekout-community-view-button {
			flex: 1 1 50%;
			padding-left: 10px;
			padding-right: 10px;
		}

		/* Split is intentionally desktop-only. */
		.geekout-community-view-button[data-view="split"] {
			display: none;
		}

		.geekout-community-layout.view-gallery {
			display: block;
			height: auto;
			overflow: visible;
		}

		.geekout-community-layout.view-gallery > .results {
			display: block;
			width: 100%;
			height: auto;
			max-height: none;
			overflow: visible;
		}

		.geekout-community-layout.view-gallery > .map {
			display: none;
		}

		.geekout-community-layout.view-map {
			display: block;
			height: 60vh;
			overflow: hidden;
		}

		.geekout-community-layout.view-map > .results {
			display: none;
		}

		.geekout-community-layout.view-map > .map {
			display: block;
			width: 100%;
			height: 60vh;
			overflow: hidden;
		}

		.geekout-community-layout.view-map > .map #map {
			width: 100%;
			height: 60vh !important;
		}

		/* Safety fallback if a desktop split state survives a resize. */
		.geekout-community-layout.view-split {
			display: block;
			height: auto;
			overflow: visible;
		}

		.geekout-community-layout.view-split > .results {
			display: block;
			width: 100%;
			height: auto;
			max-height: none;
			overflow: visible;
		}

		.geekout-community-layout.view-split > .map {
			display: none;
		}
	}
