/**
 * Estate archive: the filter, the card grid and the pagination.
 *
 * Split out of estates.css because the detail renders none of it and the whole
 * file is render-blocking. Only the two Bricks elements that call
 * BaseElement::renderCard() enqueue this one; see Frontend\Assets::LISTING.
 *
 * It loads after estates.css and depends on it: the shared ground - custom
 * properties on .laner-estates, .laner-container, .laner-tag, .laner-btn, the
 * type scale - lives there and is not repeated here.
 */

/* ------------------------------ FILTER ------------------------------ */

/* The tinted band the design puts the filter panel on. No bottom padding: the
   panel's lower edge is meant to sit on the boundary with the white section. */
.laner-section--filter {
	padding-block: 64px 0;
}

/* Two groups side by side, wrapping under each other when the row runs out of room.
   The design's third control - a price slider - is deliberately not built. */
.laner-filter {
	background: var(--wm-color__white, #fff);
	padding: 48px;
	display: flex;
	flex-wrap: wrap;
	gap: 32px 64px;
}

.laner-filter__label {
	display: block;
	color: var(--wm-color__green-muted, #67705C);
	font-size: var(--wm-font-size__small, 1.6rem);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 16px;
}

.laner-filter__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Every option is a real link to its own URL rather than a form control, so the
   active one is a state of the page and not of a widget: .is-active is set from the
   URL and :hover only ever previews the link. */
.laner-filter__pill {
	display: inline-block;
	padding: 10px 24px;
	border: 1px solid var(--wm-color__green-200, #E2E9E3);
	color: var(--wm-color__black, #000);
	font-size: var(--wm-font-size__small, 1.6rem);
	line-height: normal;
	text-decoration: none;
	transition: border-color var(--wm-transition-duration__default, 0.5s) ease,
		background-color var(--wm-transition-duration__default, 0.5s) ease;
}

.laner-filter__pill:hover {
	border-color: var(--wm-color__green-light, #97B09B);
}

.laner-filter__pill.is-active {
	background: var(--wm-color__green, #2E4C44);
	border-color: var(--wm-color__green, #2E4C44);
	color: var(--wm-color__white, #fff);
}

/* The design gives the two rows different active fills: the offer type is black,
   like the panel's own submit button, and the category is the brand green. */
.laner-filter__group--transaction .laner-filter__pill.is-active {
	background: var(--wm-color__black, #000);
	border-color: var(--wm-color__black, #000);
}

.laner-filter__pill:focus-visible {
	outline: 2px solid var(--wm-color__green, #2E4C44);
	outline-offset: 3px;
}

/* ------------------------------ GRID + CARD ------------------------------ */

.laner-grid {
	display: grid;
	grid-template-columns: repeat(var(--laner-columns, 3), minmax(0, 1fr));
	/* The design uses different gaps per axis: 16px between columns, but a much
	   larger row gap so one card visibly ends before the next begins. */
	column-gap: 16px;
	row-gap: 40px;
}

.laner-card {
	display: block;
	text-decoration: none;
	color: inherit;
	transition: transform var(--wm-transition-duration__default, 0.5s) ease;
}

.laner-card:hover {
	transform: translateY(-5px);
}

.laner-card:focus-visible {
	outline: 2px solid var(--wm-color__green, #2E4C44);
	outline-offset: 4px;
}

.laner-card__media {
	position: relative;
	overflow: hidden;
	height: 350px;
	margin-bottom: 24px;
	background: #D9D9D9;
}

.laner-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.laner-card__media .laner-tag {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
}

.laner-card__meta {
	color: var(--wm-color__green-muted, #67705C);
	font-size: var(--wm-font-size__small, 1.6rem);
	margin: 0 0 8px;
}

.laner-card__title {
	color: var(--wm-color__green, #2E4C44);
	text-transform: uppercase;
	font-size: var(--wm-font-size__h5, 2rem);
	line-height: var(--wm-line-height__tight, 1.2);
	margin: 0 0 12px;
}

.laner-card__price {
	color: var(--wm-color__green-900, #1F2118);
	font-weight: 700;
	font-size: var(--wm-font-size__h5, 2rem);
	text-transform: uppercase;
	margin: 0 0 12px;
}

.laner-card__price del {
	display: block;
	font-weight: 400;
	font-size: var(--wm-font-size__small, 1.6rem);
	color: var(--wm-color__green-muted, #67705C);
	text-transform: none;
}

.laner-card__detail {
	color: var(--wm-color__green, #2E4C44);
	text-decoration: underline;
	font-size: var(--wm-font-size__small, 1.6rem);
	transition: color var(--wm-transition-duration__default, 0.5s) ease;
}

.laner-card:hover .laner-card__detail {
	color: var(--wm-color__black, #000);
}

.laner-empty {
	color: var(--wm-color__green-muted, #67705C);
	margin: 0;
}

/* A sold card keeps its photo and its type pill and puts the verdict over the top.
   Same overlay as the gallery's "more photos" tile, deliberately - it is the one
   place on the site that already darkens an image to carry a label. */
.laner-card--sold .laner-card__media::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(46, 76, 68, 0.72);
}

/* Below the type pill's z-index: 2, above the overlay. */
.laner-card__sold {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	padding: 16px;
	color: var(--wm-color__white, #fff);
	font-size: var(--wm-font-size__h4, 2.4rem);
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-transform: uppercase;
}

.laner-teaser__more {
	margin: 48px 0 0;
}

/* ------------------------------ PAGINATION ------------------------------ */

/* paginate_links() emits .page-numbers on both the links and the current span, so
   the shared geometry goes there and only the fill distinguishes the two. */
.laner-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 64px;
	padding-top: 40px;
	border-top: 1px solid var(--wm-color__green-200, #E2E9E3);
}

.laner-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 8px;
	color: var(--wm-color__black, #000);
	font-size: var(--wm-font-size__small, 1.6rem);
	line-height: 1;
	text-decoration: none;
	transition: background-color var(--wm-transition-duration__default, 0.5s) ease;
}

.laner-pagination a.page-numbers:hover {
	background: var(--wm-color__green-200, #E2E9E3);
}

.laner-pagination .current {
	background: var(--wm-color__green, #2E4C44);
	color: var(--wm-color__white, #fff);
}

.laner-pagination .dots {
	color: var(--wm-color__green-muted, #67705C);
}

.laner-pagination a:focus-visible {
	outline: 2px solid var(--wm-color__green, #2E4C44);
	outline-offset: 3px;
}

/* ------------------------------ RESPONSIVE ------------------------------ */
/* The site's own breakpoints, matching estates.css: 1024 / 760 / 480. */

@media (max-width: 1024px) {
	.laner-grid {
		grid-template-columns: repeat(min(var(--laner-columns, 3), 2), minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.laner-section--filter {
		padding-block: 40px 0;
	}

	.laner-filter {
		padding: 24px 20px;
		/* The row gap has to stay clear of the 16px between a label and its own pills,
		   or the two groups read as one. */
		gap: 32px;
	}

	.laner-card__sold {
		font-size: var(--wm-font-size__h5, 2rem);
	}

	.laner-pagination {
		margin-top: 48px;
		padding-top: 32px;
	}

	.laner-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.laner-card,
	.laner-filter__pill,
	.laner-pagination .page-numbers,
	.laner-card__detail {
		transition: none;
	}

	.laner-card:hover {
		transform: none;
	}
}
