/**
 * The four listings pages. Sale and Lease: a photo band with a search box, then a four-up grid
 * with Sort by and Filter. Sold and Leased: a plain title over a three-up grid of larger cards.
 */

/* ---------------------------------------------------------------------------------------------
 * The photo band. A fixed height with the search block standing on its bottom padding; the red
 * chevron hangs off the right edge and is clipped by the band.
 * ------------------------------------------------------------------------------------------- */

.as-listings-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	overflow: hidden;
	height: 386px;
	padding: 0 32px 40px;
}

.as-listings-hero__photo,
.as-listings-hero__photo img,
.as-listings-hero__overlay {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.as-listings-hero__photo img {
	object-fit: cover;
}

.as-listings-hero__overlay {
	background: linear-gradient(rgba(8, 14, 28, 0.35) 0%, rgba(8, 14, 28, 0.15) 45%, rgba(8, 14, 28, 0.45) 100%);
}

.as-listings-hero__chevron {
	position: absolute;
	top: 110px;
	right: -30px;
	width: 330px;
	height: 451px;
	pointer-events: none;
}

.as-listings-hero__search {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 24px;
	align-items: center;
	width: 100%;
	max-width: 800px;
}

.as-listings-hero__title {
	width: 100%;
	margin: 0;
	font-size: 32px;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.02em;
	text-align: center;
	color: var(--as-mist);
}

.as-search {
	display: flex;
	gap: 12px;
	align-items: center;
	width: 100%;
	height: 54px;
	padding: 0 12px 0 24px;
	border-radius: 100px;
	background: var(--as-white);
}

.as-search__icon {
	flex: 0 0 auto;
	color: #949797;
}

.as-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	padding: 12px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	color: var(--as-page-ink);
	appearance: none;
}

.as-search__input::placeholder {
	color: #999;
	opacity: 1;
}

.as-search__input:focus {
	outline: none;
}

.as-search:focus-within {
	box-shadow: 0 0 0 2px var(--as-page-marker);
}

.as-search__input::-webkit-search-cancel-button {
	cursor: pointer;
}

/* ---------------------------------------------------------------------------------------------
 * The grid and its heading.
 * ------------------------------------------------------------------------------------------- */

.as-listings {
	display: flex;
	justify-content: center;
	padding: 40px 32px 96px;
}

.as-listings__inner {
	display: flex;
	flex-direction: column;
	gap: 40px;
	width: 100%;
	max-width: var(--as-container-narrow);
}

.as-listings__head {
	display: flex;
	gap: 32px;
	align-items: center;
}

.as-listings__title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 32px;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: -0.02em;
	color: var(--as-page-ink);
}

.as-listings__tools {
	display: flex;
	flex: 0 0 auto;
	gap: 16px;
}

.as-tool {
	position: relative;
}

.as-tool__button {
	display: flex;
	gap: 10px;
	align-items: center;
	height: 50px;
	padding: 14px 24px;
	border: 0;
	border-radius: 30px;
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--as-page-ink);
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--as-page-ink);
	cursor: pointer;
}

.as-tool__icon {
	flex: 0 0 auto;
}

.as-tool__button[aria-expanded="true"],
.as-tool__button.is-active {
	background: var(--as-page-ink);
	color: var(--as-white);
}

/* The menus are not in the design, which draws the buttons but gives them nothing to open. */
.as-tool__menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 220px;
	margin: 0;
	padding: 8px;
	border-radius: 8px;
	background: var(--as-white);
	box-shadow: 0 10px 30px rgba(16, 26, 46, 0.12), 0 0 0 1px rgba(16, 26, 46, 0.06);
	list-style: none;
}

.as-tool__menu[hidden] {
	display: none;
}

.as-tool__menu button {
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.35;
	text-align: left;
	white-space: nowrap;
	color: var(--as-ink);
	cursor: pointer;
}

.as-tool__menu button:hover,
.as-tool__menu button:focus-visible {
	background: var(--as-grey);
}

.as-tool__menu button[aria-pressed="true"] {
	color: var(--as-page-marker);
}

.as-listings__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 40px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.as-listings__item[hidden] {
	display: none;
}

/* "Load more", under the grid. Drawn like the Sort by and Filter buttons, which it sits with. */
.as-more {
	display: flex;
	justify-content: center;
}

.as-more[hidden] {
	display: none;
}

.as-more__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 200px;
	height: 50px;
	padding: 14px 32px;
	border-radius: 30px;
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--as-page-ink);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.35;
	text-decoration: none;
	color: var(--as-page-ink);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.as-more__button:hover,
.as-more__button:focus-visible {
	background: var(--as-page-ink);
	color: var(--as-white);
}

.as-listings__empty {
	margin: 0;
	font-size: 16px;
	color: var(--as-page-muted);
}

/* ---------------------------------------------------------------------------------------------
 * The listing card. See .as-card in common.css for the parts every card shares.
 * ------------------------------------------------------------------------------------------- */

.as-listing {
	height: 100%;
	border-radius: 4px;
	background: var(--as-white);
}

.as-listing .as-card__image {
	transition: transform var(--as-duration) var(--as-ease);
}

.as-listing__wash {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 22px;
	align-items: center;
	justify-content: center;
	background: rgba(2, 8, 22, 0.6);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--as-white);
	opacity: 0;
	transition: opacity var(--as-duration) var(--as-ease);
}

.as-listing__brochure {
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.as-listing__brochure:hover,
.as-listing__brochure:focus-visible {
	opacity: 0.85;
}

a.as-listing:hover .as-listing__wash,
a.as-listing:focus-visible .as-listing__wash {
	opacity: 1;
}

a.as-listing:hover .as-card__image,
a.as-listing:focus-visible .as-card__image {
	transform: scale(1.06);
}

.as-listing__info {
	padding-bottom: 18px;
}

.as-listing__type,
.as-listing .as-card__sub {
	text-transform: uppercase;
}

.as-listing__type {
	margin: 0;
	font-size: 14px;
	line-height: 1.25;
	letter-spacing: 0.02em;
	color: var(--as-page-muted);
}

.as-listing__areas {
	display: flex;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.as-listing__area {
	display: flex;
	gap: 6px;
	align-items: center;
	font-size: 14px;
	line-height: 1.25;
}

.as-listing__icon {
	flex: 0 0 auto;
}

/* Sold and Leased: a taller photo, a lighter badge, and nothing under the text. */
.as-listing--archive {
	--as-card-photo-h: 280px;
}

.as-listing--archive .as-card__badge {
	background: rgba(2, 8, 22, 0.5);
}

.as-listing--archive .as-listing__info {
	padding-bottom: 0;
}

.as-listings--archive .as-listings__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1199px) {
	.as-listings-hero {
		height: 340px;
		padding-bottom: 36px;
	}

	.as-listings-hero__chevron {
		top: 100px;
		right: -60px;
		width: 260px;
		height: 355px;
	}

	.as-listings-hero__title {
		font-size: 28px;
	}

	.as-listings__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.as-listings--archive .as-listings__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 809px) {
	.as-listings-hero {
		height: 320px;
		padding: 0 20px 28px;
	}

	.as-listings-hero__chevron {
		top: 70px;
		right: -80px;
		width: 180px;
		height: 246px;
	}

	.as-listings-hero__title {
		font-size: 22px;
	}

	.as-search {
		height: 48px;
		padding-left: 18px;
	}

	.as-listings {
		padding: 32px 20px 72px;
	}

	.as-listings__head {
		flex-direction: column;
		gap: 16px;
		align-items: flex-start;
	}

	.as-listings__title {
		align-self: stretch;
		font-size: 28px;
	}

	.as-listings__tools {
		gap: 10px;
	}

	.as-tool__button {
		height: 42px;
		padding: 10px 18px;
	}

	.as-tool__menu {
		right: auto;
		left: 0;
	}

	.as-listings__grid,
	.as-listings--archive .as-listings__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.as-listings--archive .as-listings__grid {
		gap: 32px;
	}
}
