/**
 * Jones Listings — archive (RealtyPress-style)
 */

.jj-archive {
	--jj-ink: #1a1a1a;
	--jj-muted: #6b6b6b;
	--jj-line: #e5e5e5;
	--jj-soft: #f4f4f4;
	--jj-red: #e10600;
	--jj-red-dark: #b80500;
	--jj-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--jj-max: 1200px;
	font-family: var(--jj-font);
	color: var(--jj-ink);
	background: #fff;
	padding: 28px 0 48px;
}

.jj-archive__container {
	max-width: var(--jj-max);
	margin: 0 auto;
	padding: 0 20px;
}

.jj-archive__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 28px;
	align-items: start;
}

/* Toolbar */
.jj-archive__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--jj-line);
}

.jj-archive__sort select {
	min-height: 38px;
	border: 1px solid var(--jj-line);
	border-radius: 3px;
	padding: 0 10px;
	font-size: 13px;
	background: #fff;
}

.jj-archive__count {
	margin: 0;
	font-size: 13px;
	color: var(--jj-muted);
}

.jj-archive__toolbar-right {
	display: flex;
	align-items: center;
	gap: 14px;
}

.jj-archive__views,
.jj-archive__per-page {
	display: flex;
	gap: 4px;
}

.jj-archive__view,
.jj-archive__per {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border: 1px solid var(--jj-line);
	border-radius: 3px;
	color: var(--jj-muted);
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
	background: #fff;
	cursor: pointer;
	font-family: inherit;
}

.jj-archive.is-loading .jj-archive__body {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.jj-archive__view.is-active,
.jj-archive__per.is-active {
	background: var(--jj-red);
	border-color: var(--jj-red);
	color: #fff;
}

/* Results */
.jj-archive__results--grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.jj-archive__results--list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.jj-archive__empty {
	padding: 40px 0;
	color: var(--jj-muted);
}

/* Card */
.jj-card-listing {
	background: #fff;
	border: 1px solid var(--jj-line);
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease;
}

.jj-card-listing:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.jj-card-listing__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: #222;
	overflow: hidden;
}

.jj-card-listing__media img,
.jj-card-listing__placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.jj-card-listing__placeholder {
	background: linear-gradient(135deg, #333, #111);
}

.jj-card-listing__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--jj-red);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 5px 9px;
	border-radius: 2px;
}

.jj-card-listing__price {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 12px 10px;
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
	color: #fff;
	font-size: 22px;
	font-weight: 800;
}

.jj-card-listing__body {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.jj-card-listing__address {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.jj-card-listing__address a {
	color: var(--jj-red);
	text-decoration: none;
}

.jj-card-listing__address a:hover {
	text-decoration: underline;
}

.jj-card-listing__loc {
	margin: 0;
	font-size: 13px;
	color: var(--jj-muted);
}

.jj-card-listing__specs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.jj-card-listing__specs span {
	display: inline-flex;
	padding: 4px 8px;
	border-radius: 999px;
	background: var(--jj-soft);
	font-size: 11px;
	font-weight: 650;
	color: #555;
}

.jj-card-listing__agent {
	margin: 6px 0 0;
	font-size: 11px;
	color: #888;
}

.jj-card-listing--list {
	flex-direction: row;
}

.jj-card-listing--list .jj-card-listing__media {
	flex: 0 0 280px;
	aspect-ratio: auto;
	min-height: 180px;
}

.jj-card-listing--list .jj-card-listing__body {
	justify-content: center;
}

/* Search sidebar */
.jj-search {
	border: 1px solid var(--jj-line);
	border-radius: 4px;
	padding: 16px;
	background: #fff;
	position: sticky;
	top: 20px;
}

.jj-search__title {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 800;
}

.jj-search__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.jj-search__field select,
.jj-search__field input[type="text"] {
	width: 100%;
	min-height: 40px;
	border: 1px solid var(--jj-line);
	border-radius: 3px;
	padding: 0 10px;
	font-size: 13px;
	background: #fff;
	color: var(--jj-ink);
}

.jj-search__range {
	padding: 4px 0 2px;
}

.jj-search__range-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	margin-bottom: 4px;
}

.jj-search__range-values {
	display: flex;
	gap: 6px;
	font-size: 12px;
	color: var(--jj-muted);
	margin-bottom: 6px;
}

.jj-search__range input[type="range"] {
	width: 100%;
	accent-color: var(--jj-red);
	margin: 0 0 4px;
}

.jj-search__submit {
	min-height: 42px;
	border: 0;
	border-radius: 3px;
	background: var(--jj-red);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	cursor: pointer;
}

.jj-search__submit:hover {
	background: var(--jj-red-dark);
}

.jj-search__reset {
	text-align: center;
	font-size: 12px;
	color: var(--jj-muted);
	text-decoration: underline;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
}

/* Pagination */
.jj-archive__pagination {
	margin-top: 28px;
}

.jj-archive__pagination .page-numbers {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.jj-archive__pagination .page-numbers li {
	margin: 0;
}

.jj-archive__pagination a,
.jj-archive__pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--jj-line);
	border-radius: 3px;
	text-decoration: none;
	color: var(--jj-ink);
	font-size: 13px;
	font-weight: 650;
}

.jj-archive__pagination .current {
	background: var(--jj-red);
	border-color: var(--jj-red);
	color: #fff;
}

@media (max-width: 1024px) {
	.jj-archive__results--grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.jj-archive__layout {
		grid-template-columns: 1fr;
	}

	.jj-search {
		position: static;
		order: -1;
	}
}

@media (max-width: 640px) {
	.jj-archive__results--grid {
		grid-template-columns: 1fr;
	}

	.jj-card-listing--list {
		flex-direction: column;
	}

	.jj-card-listing--list .jj-card-listing__media {
		flex-basis: auto;
		aspect-ratio: 4 / 3;
	}
}
