/* ==========================================================================
   Liventra /kaufen/  — page-kaufen.css
   Styles the NEW webux/apify markup (section-heading, wx-apify/filter,
   webux/results-bar, wx-apify/list + webux/property-card) to match the
   Figma target (node 30:242 "03 Kaufen").

   Numeric values mirror the legacy .lv-kaufen-* rules in site.css (~465-505),
   but every selector here targets the NEW markup. All overrides are scoped
   under .lv-kaufen-filter / .lv-kaufen-results / .lv-kaufen-list so they beat
   inc/field-blocks/property-card/style.css regardless of enqueue order.
   Do NOT edit site.css — this file is additive only.
   ========================================================================== */

/* ==========================================================================
   1) Suche-Kopf
   The dark cover hero is a regular webux/page-hero block since 2026-07 (image,
   overlay, min-height and copy all live in the block's own fields/styles). This
   file only styles the floating filter card group (.lv-kaufen-filter) below it.
   ========================================================================== */

/* ==========================================================================
   2) Filterbar — wx-apify/filter styled as the white card
   ========================================================================== */

/* Wrapper group: floats the white card up over the hero's bottom edge.
   position+z-index are required — the page-hero is position:relative and would
   otherwise paint OVER the (static) overlapping card. padding-inline mirrors
   .lv-kaufen-results so the card lines up with the results column. */
.lv-kaufen-filter {
	position: relative;
	z-index: 1;
	margin-top: -46px;
	padding-inline: 24px;
}

.lv-kaufen-filter .wxa-filter {
	display: flex;
	gap: 16px;
	align-items: flex-end;
	width: 100%;
	background: #fff;
	border: 1px solid #ece7de;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 8px 28px rgba(26, 26, 26, 0.06);
	padding: 20px;
}

.lv-kaufen-filter .wxa-filter__field {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lv-kaufen-filter .wxa-filter__field label {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	color: #1a1a1a;
}

/* Controls (input & select share .wxa-filter__control) */
.lv-kaufen-filter .wxa-filter__control {
	width: 100%;
	height: 48px;
	border: 1px solid #cfc9c0;
	border-radius: 12px;
	padding: 0 16px;
	font-size: 15px;
	font-family: inherit;
	color: #1a1a1a;
	background: #fff;
}

.lv-kaufen-filter .wxa-filter__control::placeholder {
	color: #8a847d;
}

.lv-kaufen-filter .wxa-filter__control:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #8b8178);
	outline-offset: 1px;
	border-color: transparent;
}

/* Select variant: native chevron off, custom down-chevron data-URI (stroke #8a847d) */
.lv-kaufen-filter select.wxa-filter__control {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 42px;
	color: #8a847d;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a847d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
}

/* Submit ("Suchen") pill */
.lv-kaufen-filter .wxa-filter__submit {
	flex: 0 0 auto;
	align-self: flex-end;
	height: 52px;
	border: 0;
	border-radius: 999px;
	padding: 0 30px;
	background: var(--wp--preset--color--primary, #8b8178);
	color: #fff;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.16px;
	font-family: inherit;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.lv-kaufen-filter .wxa-filter__submit:hover {
	background: var(--wp--preset--color--primary-dark, #6f665e);
}

.lv-kaufen-filter .wxa-filter__submit:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary-dark, #6f665e);
	outline-offset: 2px;
}

/* showCount=false, but hide any stray count defensively. */
.lv-kaufen-filter .wxa-filter__count {
	display: none;
}

/* ==========================================================================
   3) Ergebnisse — light results section + results-bar
   ========================================================================== */

.lv-kaufen-results {
	/* Fallbacks; the group block supplies padding-block 48/96 via inline style. */
	padding-block: 48px 96px;
	padding-inline: 24px;
}

/* Defensive gap between the results-bar and the listing when blockGap is absent. */
.lv-kaufen-results > * + * {
	margin-block-start: 24px;
}

.lv-kaufen-results .webux-results-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 16px;
}

.lv-kaufen-results .webux-results-bar__count {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: #1a1a1a;
	font-variant-numeric: tabular-nums;
}

/* Sort control styled as a pill <select> */
.lv-kaufen-results .webux-results-bar__sort {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding: 0 40px 0 14px;
	border: 1px solid #cfc9c0;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	color: #1a1a1a;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.lv-kaufen-results .webux-results-bar__sort:hover {
	border-color: var(--wp--preset--color--primary, #8b8178);
}

.lv-kaufen-results .webux-results-bar__sort:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #8b8178);
	outline-offset: 2px;
}

/* ==========================================================================
   4) Listing rows — webux/property-card (media) rendered horizontally
   ========================================================================== */

/* .lv-kaufen-list carries .wxa-list--rows on the same element; the second
   selector covers a nested variant just in case. */
.lv-kaufen-list.wxa-list--rows,
.lv-kaufen-list .wxa-list--rows {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Card shell -> horizontal row. Scoped selectors beat property-card/style.css. */
.lv-kaufen-list .webux-property-card--media {
	flex-direction: row;
	align-items: stretch;
	/* Fixed height (not min-height) so EVERY card — and therefore every image —
	   is exactly the same size, independent of title length / text amount. The
	   title is clamped to 2 lines below so it can never push the card taller. */
	height: 200px;
	border: 1px solid #ece7de;
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 8px 28px rgba(26, 26, 26, 0.06);
	overflow: hidden;
}

/* Media rail */
.lv-kaufen-list .webux-property-card__media {
	flex: 0 0 300px;
	width: 300px;
	align-self: stretch;
	margin: 0;
}

.lv-kaufen-list .webux-property-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Badge overlay: top 12 / left 12 (media mode base sets 16; tighten for rows) */
.lv-kaufen-list .webux-property-card__media .webux-property-card__badge {
	top: 12px;
	left: 12px;
	height: 28px;
	padding: 0 14px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.26px;
	background: var(--wp--preset--color--primary, #8b8178);
	color: #fff;
}

/* Body */
.lv-kaufen-list .webux-property-card__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 22px 24px;
	justify-content: center;
}

.lv-kaufen-list .webux-property-card__overline {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 1.68px;
	text-transform: uppercase;
	line-height: 1.2;
	color: var(--wp--preset--color--primary, #8b8178);
}

/* Extra .webux-property-card--media specificity so this beats the block
   style.css rule .webux-property-card--media .webux-property-card__title. */
.lv-kaufen-list .webux-property-card--media .webux-property-card__title {
	margin: 0;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.22;
	color: #1a1a1a;
	overflow-wrap: break-word;
	/* Max 2 lines so a long title cannot grow the fixed-height card. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.lv-kaufen-list .webux-property-card__meta {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	color: #6b6661;
}

.lv-kaufen-list .webux-property-card--media .webux-property-card__price {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	color: #1a1a1a;
	font-variant-numeric: tabular-nums;
}

/* Card link interactions */
.lv-kaufen-list a.webux-property-card--media {
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lv-kaufen-list a.webux-property-card--media:hover {
	transform: translateY(-2px);
	box-shadow: 0 2px 6px rgba(26, 26, 26, 0.06), 0 16px 48px rgba(26, 26, 26, 0.1);
}

.lv-kaufen-list a.webux-property-card--media:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #8b8178);
	outline-offset: 3px;
}

/* ==========================================================================
   5) Responsive + motion / overflow guards
   ========================================================================== */

/* Tablet: filterbar wraps; each field ~half width, submit full width. */
@media (max-width: 768px) {
	.lv-kaufen-filter .wxa-filter {
		flex-wrap: wrap;
	}
	.lv-kaufen-filter .wxa-filter__field {
		flex: 1 1 45%;
	}
	.lv-kaufen-filter .wxa-filter__submit {
		flex: 1 1 100%;
	}
}

/* Phone: one column. At 375px the two 45% columns leave a 139px select, and the
   longest Objektart labels ("Büro/Praxen", "Grundstück") were clipped mid-word
   inside it - the visitor could not read what was selected. The "Weitere
   Filter" panel is already single-column at this width, so this also lines the
   two up. */
@media (max-width: 480px) {
	.lv-kaufen-filter .wxa-filter__field {
		flex: 1 1 100%;
	}
}

/* Phone: listing stacks (image on top), results-bar stacks (count above sort). */
@media (max-width: 600px) {
	/* NOTE: the former `padding-inline: 20px` for .lv-kaufen-filter /
	   .lv-kaufen-results was removed here. It contradicted the 24px declared
	   further up and made the page read 24 -> 20 -> 20 -> 24 down the scroll,
	   while every other page keeps a single 24px gutter. */

	.lv-kaufen-list .webux-property-card--media {
		flex-direction: column;
		height: auto; /* stacked layout — image height fixed on the media below */
	}
	.lv-kaufen-list .webux-property-card__media {
		flex: 0 0 auto;
		flex-basis: auto;
		width: 100%;
		height: 220px;
		align-self: auto;
	}
	.lv-kaufen-list .webux-property-card__media img {
		height: 220px;
	}

	.lv-kaufen-results .webux-results-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	/* Keep the sort a comfortable touch target on mobile (48px = filter-field height). */
	.lv-kaufen-results .webux-results-bar__sort {
		height: 48px;
	}

	/* iOS Safari zooms the whole page in when a focused control renders below
	   16px, and the user has to pinch back out afterwards. The 15px/14px design
	   sizes above are desktop figures; this is the only page on the site with a
	   search UI, so the ≥16px rule that inc/field-blocks/form/style.css applies
	   to the five webux/form blocks does not reach these 12 controls. Phone-gated,
	   so the desktop typography is untouched. */
	.lv-kaufen-filter .wxa-filter__control,
	.lv-kaufen-results .webux-results-bar__sort {
		font-size: 16px;
	}
}

/* Never allow horizontal overflow from long tokens/words. */
.lv-kaufen-filter,
.lv-kaufen-results {
	overflow-wrap: break-word;
}

/* Respect reduced-motion. */
@media (prefers-reduced-motion: reduce) {
	.lv-kaufen-list a.webux-property-card--media,
	.lv-kaufen-filter .wxa-filter__submit,
	.lv-kaufen-results .webux-results-bar__sort {
		transition: none;
	}
	.lv-kaufen-list a.webux-property-card--media:hover {
		transform: none;
	}
}
