/* Property Listings - public-facing styles.
 *
 * Theming: internal rules read the private --_propls-* variables below.
 * Each private variable resolves, in order, from (1) a --propls-*
 * override the site defines anywhere (e.g. on :root in the theme's
 * stylesheet), then (2) the theme's own preset palette variables where
 * the theme provides them, then (3) a neutral built-in default. The
 * private/public split avoids the self-reference cycle that would make
 * a variable invalid per the CSS custom properties spec. */

.propls-main,
.propls-rentals,
.propls-portfolio,
.propls-detail {
	--_propls-primary: var(--propls-primary, var(--wp--preset--color--primary, #1d3557));
	--_propls-accent: var(--propls-accent, var(--wp--preset--color--secondary, #b8860b));
	--_propls-bg: var(--propls-bg, var(--wp--preset--color--base, #ffffff));
	--_propls-surface: var(--propls-surface, #f7f7f8);
	--_propls-text: var(--propls-text, var(--wp--preset--color--contrast, #1a1a1a));
	--_propls-muted: var(--propls-muted, #6b6b6b);
	--_propls-border: var(--propls-border, #dcdcde);

	color: var(--_propls-text);
}

.propls-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: end;
	background: var(--_propls-surface);
	border: 1px solid var(--_propls-border);
	border-radius: 6px;
	padding: 16px;
	margin-bottom: 24px;
}

.propls-filters label {
	display: flex;
	flex-direction: column;
	font-size: 0.85rem;
	gap: 4px;
}

.propls-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.propls-card {
	background: var(--_propls-bg);
	border: 1px solid var(--_propls-border);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.propls-card-photo {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--_propls-surface);
}

.propls-card-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.propls-card-photo-placeholder {
	display: block;
	width: 100%;
	height: 100%;
}

.propls-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--_propls-primary);
	color: #fff;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 9px;
	border-radius: 3px;
}

.propls-badge-leased {
	background: var(--_propls-muted);
}

.propls-badge-coming_soon {
	background: var(--_propls-accent);
}

.propls-card-body {
	padding: 14px 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.propls-card-address a {
	color: inherit;
	text-decoration: none;
}

.propls-card-facts {
	color: var(--_propls-muted);
	font-size: 0.9rem;
	margin: 0;
}

.propls-card-price {
	font-weight: 600;
	margin: 4px 0;
}

.propls-btn {
	display: inline-block;
	background: var(--_propls-primary);
	color: #fff;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 0.9rem;
	border: none;
	cursor: pointer;
	text-align: center;
}

.propls-btn-apply {
	background: var(--_propls-accent);
	color: #1a1a1a;
}

.propls-btn-large {
	padding: 12px 22px;
	font-size: 1rem;
	margin: 14px 0;
}

.propls-detail-address {
	margin-bottom: 2px;
}

.propls-detail-citystate {
	color: var(--_propls-muted);
	margin-top: 0;
}

.propls-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px;
	margin: 16px 0;
}

.propls-gallery-item img {
	width: 100%;
	height: 110px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.propls-detail-facts {
	list-style: none;
	margin: 20px 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 8px 20px;
}

.propls-detail-description {
	margin: 20px 0;
	line-height: 1.6;
}

.propls-contact-block {
	background: var(--_propls-surface);
	border: 1px solid var(--_propls-border);
	border-radius: 6px;
	padding: 20px;
	margin-top: 24px;
}

.propls-no-results {
	grid-column: 1 / -1;
	color: var(--_propls-muted);
}

/* Pagination */
.propls-pagination {
	margin: 24px 0;
}

.propls-pagination ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
}

.propls-pagination a,
.propls-pagination .propls-page-current {
	display: inline-block;
	min-width: 36px;
	padding: 6px 10px;
	text-align: center;
	border: 1px solid var(--_propls-border);
	border-radius: 4px;
	text-decoration: none;
	color: var(--_propls-text);
	background: var(--_propls-bg);
}

.propls-pagination .propls-page-current {
	background: var(--_propls-primary);
	border-color: var(--_propls-primary);
	color: #fff;
	font-weight: 600;
}

/* Lightbox */
.propls-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
}

.propls-lightbox-overlay img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
}

.propls-lightbox-close,
.propls-lightbox-prev,
.propls-lightbox-next {
	position: absolute;
	background: transparent;
	color: #fff;
	border: none;
	font-size: 2rem;
	cursor: pointer;
	padding: 10px 16px;
}

.propls-lightbox-close {
	top: 10px;
	right: 10px;
}

.propls-lightbox-prev {
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
}

.propls-lightbox-next {
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
}
