/* ==========================================================================
   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-suche / .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: dark cover hero
   ========================================================================== */

.lv-kaufen-suche {
	position: relative;
	background: #1a1a1a url("https://liventra.webux.ch/wp-content/uploads/2026/07/liventra-hero.jpg") center / cover no-repeat;
	border-bottom: 1px solid #ece7de;
	/* Fallbacks: the group block supplies padding-block 64/48 via inline style;
	   these keep the hero correct if that attribute is ever missing.
	   padding-inline is a defensive gutter so content never touches the edge
	   on narrow viewports (absorbed into the gutter on wide screens). */
	padding-block: 64px 48px;
	padding-inline: 24px;
}

.lv-kaufen-suche::before {
	content: "";
	position: absolute;
	inset: 0;
	/* Figma's overlay is .5 over a dark placeholder photo; the live brand hero
	   (liventra-hero.jpg) is brighter, so a slightly stronger scrim restores the
	   dark cover mood and keeps the cream lead text readable (WCAG). */
	background: rgba(26, 26, 26, 0.6);
	z-index: 0;
}

/* Lift real content above the overlay. Pseudo-elements are not matched by > *. */
.lv-kaufen-suche > * {
	position: relative;
	z-index: 1;
}

/* 28px gap between the section-heading and the filter card. Defensive: works
   whether or not the theme's blockGap resolves for this constrained group. */
.lv-kaufen-suche > * + * {
	margin-block-start: 28px;
}

/* ---- Suche copy over dark ---- */
.lv-kaufen-suche .webux-section-heading {
	text-align: left;
}

.lv-kaufen-suche .webux-section-heading__eyebrow {
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 1.82px;
	text-transform: uppercase;
	line-height: 1.2;
	color: #e8dec8;
}

.lv-kaufen-suche .webux-section-heading__title {
	margin: 0;
	font-size: 36px;
	font-weight: 600;
	letter-spacing: -0.72px;
	line-height: 1.1;
	color: #fff;
	overflow-wrap: break-word;
}

.lv-kaufen-suche .webux-section-heading__lead {
	margin: 0;
	max-width: 860px;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.65;
	color: #f4efe3;
	overflow-wrap: break-word;
}

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

.lv-kaufen-suche .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-suche .wxa-filter__field {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lv-kaufen-suche .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-suche .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-suche .wxa-filter__control::placeholder {
	color: #8a847d;
}

.lv-kaufen-suche .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-suche 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-suche .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-suche .wxa-filter__submit:hover {
	background: var(--wp--preset--color--primary-dark, #6f665e);
}

.lv-kaufen-suche .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-suche .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;
	min-height: 100px;
	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 210px;
	width: 210px;
	align-self: stretch;
	margin: 0;
}

.lv-kaufen-list .webux-property-card__media img {
	width: 100%;
	height: 100%;
	min-height: 100px;
	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__eyebrow {
	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;
}

.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-suche .wxa-filter {
		flex-wrap: wrap;
	}
	.lv-kaufen-suche .wxa-filter__field {
		flex: 1 1 45%;
	}
	.lv-kaufen-suche .wxa-filter__submit {
		flex: 1 1 100%;
	}
}

/* Phone: listing stacks (image on top), results-bar stacks (count above sort). */
@media (max-width: 600px) {
	.lv-kaufen-suche,
	.lv-kaufen-results {
		padding-inline: 20px;
	}
	.lv-kaufen-suche .webux-section-heading__title {
		font-size: 30px;
	}

	.lv-kaufen-list .webux-property-card--media {
		flex-direction: column;
	}
	.lv-kaufen-list .webux-property-card__media {
		flex: 0 0 auto;
		flex-basis: auto;
		width: 100%;
		height: 180px;
		align-self: auto;
	}
	.lv-kaufen-list .webux-property-card__media img {
		height: 180px;
	}

	.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;
	}
}

/* Never allow horizontal overflow from long tokens/words. */
.lv-kaufen-suche,
.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-suche .wxa-filter__submit,
	.lv-kaufen-results .webux-results-bar__sort {
		transition: none;
	}
	.lv-kaufen-list a.webux-property-card--media:hover {
		transform: none;
	}
}
