/*
 * Wohnungsbestand list block. Tokens from Figma 1:168 (desktop) / 18:211 (mobile).
 * Convention: spacing and dimensions in px, typography in rem.
 */

.wb-wohnungsbestand {
	--wb-color-text: #000;
	--wb-color-muted: #7b7f8c;
	--wb-color-accent: #d90000;
	--wb-color-divider: #000;
	--wb-color-surface: #fff;

	--wb-border-width: 2px;
	--wb-radius-control: 5px;
	--wb-radius-pill: 999px;

	--wb-font-family: 'Outfit', 'Helvetica Neue', Arial, sans-serif;

	max-width: 100%;
	color: var(--wb-color-text);
	font-family: var(--wb-font-family);
	font-weight: 400;
}

/* Filters --------------------------------------------------------------- */

.wb-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 0 0 42px;
	align-items: flex-end;
}

.wb-filters label {
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: var(--wb-color-text);
	font-family: var(--wb-font-family);
	font-size: 1.25rem;
	line-height: 1.2;
}

.wb-filters select {
	width: 140px;
	height: 49px;
	padding: 0 36px 0 16px;
	border: var(--wb-border-width) solid var(--wb-color-text);
	border-radius: var(--wb-radius-control);
	background-color: transparent;
	color: var(--wb-color-text);
	font-family: var(--wb-font-family);
	font-size: 1.25rem;
	line-height: 1.2;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='8' viewBox='0 0 15 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M0 0L7.5 7.5L15 0' /></svg>");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 15px 8px;
}

/* List & cards ---------------------------------------------------------- */

.wb-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.wb-card {
	display: grid;
	grid-template-columns: 496px minmax(0, 1fr) auto;
	grid-template-rows: auto auto 1fr auto;
	column-gap: 24px;
	row-gap: 24px;
	align-items: start;
	padding: 0 0 22px;
	border: 0;
	border-bottom: var(--wb-border-width) solid var(--wb-color-divider);
	border-radius: 0;
}

.wb-list > .wb-card:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.wb-card .wb-slider {
	grid-column: 1;
	grid-row: 1 / -1;
}

.wb-card__subtitle {
	grid-column: 2 / -1;
	grid-row: 1;
	margin: 0;
	padding-top: 6px;
	color: var(--wb-color-muted);
	font-size: 1.25rem;
	line-height: 1.2;
}

.wb-card__title {
	grid-column: 2 / -1;
	grid-row: 2;
	margin: 0;
	color: var(--wb-color-text);
	font-weight: 400;
	font-size: 2.25rem;
	line-height: 1.1;
}

.wb-card__meta {
	grid-column: 2;
	grid-row: 4;
	align-self: end;
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 30px;
	color: var(--wb-color-text);
	font-size: 1.5rem;
	line-height: 1.2;
}

.wb-card__meta li {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 1px;
	color: var(--wb-color-text);
	font-size: 1.5rem;
	line-height: 1.2;
}

.wb-card__meta strong {
	order: -1;
	font-weight: 400;
	color: var(--wb-color-muted);
	font-size: 1.25rem;
	line-height: 1.2;
}

/* Arrow link button (Group 27) ----------------------------------------- */

.wb-card__link {
	grid-column: 3;
	grid-row: 4;
	align-self: end;
	justify-self: end;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	margin: 0;
	border-radius: 50%;
	border: var(--wb-border-width) solid var(--wb-color-accent);
	color: var(--wb-color-accent);
	text-decoration: none;
	line-height: 0;
}

.wb-card__link:hover,
.wb-card__link:focus {
	color: var(--wb-color-accent);
}

.wb-card__link-icon {
	display: block;
	width: 24px;
	height: 16px;
}

/* Image / slider ------------------------------------------------------- */

.wb-slider {
	position: relative;
	width: 100%;
	aspect-ratio: 496 / 360;
}

.wb-slider__track {
	position: absolute;
	inset: 0;
	background: #f4f4f4;
	border-radius: 0;
	overflow: hidden;
}

.wb-slider__slide,
.wb-slider__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Restore [hidden] behaviour overridden by the rule above. */
.wb-slider__slide[hidden] {
	display: none;
}

/* Container is click-through; only the buttons receive pointer events. */
.wb-slider__nav {
	position: absolute;
	right: 16px;
	bottom: 10px;
	display: flex;
	flex-direction: row;
	gap: 16px;
	pointer-events: none;
}

.wb-slider__btn {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 43px;
	height: 43px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wb-color-surface);
	color: var(--wb-color-accent);
	cursor: pointer;
	line-height: 1;
}

.wb-slider__btn:hover,
.wb-slider__btn:focus-visible {
	background: var(--wb-color-surface);
}

.wb-slider__btn svg {
	display: block;
	width: 9px;
	height: 21px;
}

.wb-slider__btn--prev svg {
	transform: scaleX(-1);
}

/* "Mehr laden" pill (Group 107) --------------------------------------- */

.wb-loadmore {
	margin-top: 32px;
	text-align: center;
}

.wb-loadmore a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 141px;
	height: 49px;
	padding: 0 28px;
	border: var(--wb-border-width) solid var(--wb-color-text);
	border-radius: var(--wb-radius-pill);
	color: var(--wb-color-text);
	font-family: var(--wb-font-family);
	font-size: 1.25rem;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
}

.wb-loadmore a:hover,
.wb-loadmore a:focus {
	color: var(--wb-color-text);
}

/* ----------------------------------------------------------------------
 * Mobile / tablet (≤ 1024px)
 * Values extracted from Figma frame 18:211 (mobile artboard, 402px wide).
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
	/* Filters --------------------------------------------------------- */

	.wb-filters {
		gap: 16px;
		margin-bottom: 26px;
	}

	.wb-filters label {
		flex: 1 1 calc(50% - 13.5px);
		gap: 6px;
		font-size: 0.875rem;
		line-height: 1.3;
	}

	.wb-filters select {
		width: 100%;
		height: 41px;
		padding: 0 28px 0 12px;
		border-width: 1px;
		font-size: 0.875rem;
		line-height: 1.3;
		background-position: right 12px center;
		background-size: 9px 4px;
	}

	/* Cards ----------------------------------------------------------- */

	.wb-list {
		gap: 22px;
	}

	.wb-card {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto auto auto auto;
		column-gap: 0;
		row-gap: 0;
		padding-bottom: 17px;
		border-bottom-width: 1px;
	}

	.wb-card .wb-slider {
		grid-column: 1;
		grid-row: 1;
	}

	.wb-card__subtitle {
		grid-column: 1;
		grid-row: 2;
		padding-top: 13px;
		font-size: 1rem;
		line-height: 1.2;
	}

	.wb-card__title {
		grid-column: 1;
		grid-row: 3;
		padding-top: 7px;
		font-size: 1.5rem;
		line-height: 1.2;
	}

	.wb-card__meta {
		grid-column: 1;
		grid-row: 4;
		align-self: start;
		/* Overrides Divi's `#left-area ul` rule (ID specificity wins otherwise). */
		padding: 14px 0 23px 0 !important;
		gap: 26px;
		font-size: 1rem;
		line-height: 1.2;
	}

	.wb-card__meta li {
		gap: 3px;
		font-size: 1rem;
		line-height: 1.2;
	}

	.wb-card__meta strong {
		font-size: 0.75rem;
		line-height: 1.2;
	}

	.wb-card__link {
		grid-column: 1;
		grid-row: 5;
		justify-self: end;
		align-self: end;
		width: 38px;
		height: 38px;
	}

	.wb-card__link-icon {
		width: 18px;
		height: 12px;
	}

	/* Slider ---------------------------------------------------------- */

	.wb-slider {
		aspect-ratio: 362 / 263;
	}

	.wb-slider__nav {
		right: 10px;
		bottom: 10px;
		gap: 16px;
	}

	.wb-slider__btn {
		width: 37px;
		height: 37px;
	}

	.wb-slider__btn svg {
		width: 8px;
		height: 18px;
	}

	/* "Mehr laden" pill ---------------------------------------------- */

	.wb-loadmore {
		margin-top: 24px;
	}

	.wb-loadmore a {
		min-width: 113px;
		height: 39px;
		padding: 0 22px;
		border-width: 1px;
		font-size: 1rem;
		line-height: 1.2;
	}
}
