/**
 * Omnia Elevate Property Manager – front end.
 * Override any --oepm-* variable in your theme's Additional CSS to match branding.
 */

.oepm-listings,
.oepm-single {
	--oepm-text: #1b2430;
	--oepm-muted: #5b6573;
	--oepm-border: #e3e6ea;
	--oepm-surface: #ffffff;
	--oepm-soft: #f5f6f8;
	--oepm-accent: #1b2a3a;
	--oepm-accent-text: #ffffff;
	--oepm-radius: 10px;

	--oepm-active: #1f7a4d;
	--oepm-option_pending: #1d4ed8;
	--oepm-pending_contingency: #a35200;
	--oepm-pending: #c2410c;
	--oepm-sold: #b91c1c;
	--oepm-withdrawn: #4b5563;

	color: var(--oepm-text);
	box-sizing: border-box;
}

.oepm-listings *,
.oepm-listings *::before,
.oepm-listings *::after,
.oepm-single *,
.oepm-single *::before,
.oepm-single *::after {
	box-sizing: inherit;
}

.oepm-listings .screen-reader-text,
.oepm-single .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Filter ---------- */
.oepm-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
}

.oepm-filter__btn {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--oepm-border);
	border-radius: 999px;
	background: var(--oepm-surface);
	color: var(--oepm-text) !important;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none !important;
	transition: background-color .15s, border-color .15s;
}

.oepm-filter__btn:hover,
.oepm-filter__btn:focus-visible {
	border-color: var(--oepm-accent);
}

.oepm-filter__btn.is-active {
	background: var(--oepm-accent);
	border-color: var(--oepm-accent);
	color: var(--oepm-accent-text) !important;
}

/* ---------- Grid ---------- */
.oepm-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
	margin: 0 0 28px;
}

.oepm-listings,
.oepm-single { container-type: inline-size; }

/* Columns respond to the width of the content area, not the screen. */
@container (min-width: 600px) {
	.oepm-grid.oepm-cols-2,
	.oepm-grid.oepm-cols-3,
	.oepm-grid.oepm-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (min-width: 900px) {
	.oepm-grid.oepm-cols-3,
	.oepm-grid.oepm-cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container (min-width: 1180px) {
	.oepm-grid.oepm-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Card ---------- */
.oepm-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--oepm-surface);
	border: 1px solid var(--oepm-border);
	border-radius: var(--oepm-radius);
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
	transition: box-shadow .2s, transform .2s;
}

.oepm-card:hover {
	box-shadow: 0 10px 24px rgba(16, 24, 40, .12);
	transform: translateY(-2px);
}

.oepm-card__media,
.oepm-single__media {
	position: relative;
	display: block;
	overflow: hidden;
	background: var(--oepm-soft);
}

.oepm-card__media { aspect-ratio: 10 / 7; }

.oepm-photo {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	margin: 0 !important;
	border-radius: 0 !important;
}

.oepm-photo--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	color: var(--oepm-muted);
	font-size: 15px;
}

/* Sold / withdrawn photos are slightly muted. */
.oepm-status--sold .oepm-photo,
.oepm-status--withdrawn .oepm-photo { filter: saturate(.75); }

/* ---------- Status banner ---------- */
.oepm-banner {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2;
	padding: 10px 14px;
	background: var(--oepm-active);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.oepm-banner--active { background: var(--oepm-active); }
.oepm-banner--option_pending { background: var(--oepm-option_pending); }
.oepm-banner--pending_contingency { background: var(--oepm-pending_contingency); }
.oepm-banner--pending { background: var(--oepm-pending); }
.oepm-banner--sold { background: var(--oepm-sold); }
.oepm-banner--withdrawn { background: var(--oepm-withdrawn); }

.oepm-single .oepm-banner {
	padding: 14px 18px;
	font-size: clamp(16px, 2.2vw, 22px);
}

/* ---------- Card body ---------- */
.oepm-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	padding: 18px 20px 20px;
}

.oepm-listings p,
.oepm-single p { margin: 0; }

.oepm-price {
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	color: var(--oepm-text);
}

.oepm-price--lg { font-size: clamp(28px, 4vw, 40px); }

.oepm-card__title {
	margin: 0 !important;
	font-size: 17px !important;
	font-weight: 600;
	line-height: 1.35 !important;
}

.oepm-card__title a {
	color: var(--oepm-text) !important;
	text-decoration: none !important;
}

.oepm-card__title a:hover .oepm-addr1 { text-decoration: underline; }

.oepm-addr1,
.oepm-addr2 { display: block; }

.oepm-addr2 {
	margin-top: 2px;
	color: var(--oepm-muted);
	font-size: 15px;
	font-weight: 400;
}

/* ---------- Facts ---------- */
.oepm-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin: 0 !important;
	padding: 12px 0 !important;
	border-top: 1px solid var(--oepm-border);
	border-bottom: 1px solid var(--oepm-border);
	list-style: none !important;
}

.oepm-facts__item {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 15px;
	font-weight: 600;
}

.oepm-facts__item::before { content: none !important; }

.oepm-icon {
	flex: none;
	width: 20px;
	height: 20px;
	color: var(--oepm-muted);
}

/* ---------- Representation ---------- */
.oepm-rep-badge {
	align-self: flex-start;
	padding: 4px 10px;
	border: 1px solid var(--oepm-border);
	border-radius: 4px;
	background: var(--oepm-soft);
	color: var(--oepm-text);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .02em;
}

/* ---------- Agent ---------- */
.oepm-agent {
	display: flex;
	align-items: center;
	gap: 14px;
}

.oepm-agent__photo {
	flex: none;
	width: 72px;
	height: 72px;
	margin: 0 !important;
	border-radius: 50%;
	object-fit: cover;
}

.oepm-agent--compact .oepm-agent__photo {
	width: 56px;
	height: 56px;
}

.oepm-agent__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	font-size: 14px;
	line-height: 1.4;
}

.oepm-agent__eyebrow {
	color: var(--oepm-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.oepm-agent__name {
	font-size: 16px;
	font-weight: 700;
}

.oepm-agent__link {
	color: var(--oepm-text) !important;
	overflow-wrap: anywhere;
	text-decoration: none !important;
}

.oepm-agent__link:hover { text-decoration: underline !important; }

.oepm-agent__brokerage {
	margin-top: 2px;
	color: var(--oepm-muted);
	font-size: 13px;
	font-style: italic;
}

/* ---------- Button ---------- */
.oepm-btn {
	display: block;
	margin-top: auto;
	padding: 12px 16px;
	border-radius: 6px;
	background: var(--oepm-accent);
	color: var(--oepm-accent-text) !important;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none !important;
	transition: opacity .15s;
}

.oepm-btn:hover,
.oepm-btn:focus-visible { opacity: .88; }

/* ---------- Pagination / misc ---------- */
.oepm-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0 0 24px !important;
	padding: 0 !important;
	list-style: none !important;
}

.oepm-pagination li { margin: 0 !important; }

.oepm-pagination .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 8px 12px;
	border: 1px solid var(--oepm-border);
	border-radius: 6px;
	color: var(--oepm-text);
	text-align: center;
	text-decoration: none;
}

.oepm-pagination .page-numbers.current {
	background: var(--oepm-accent);
	border-color: var(--oepm-accent);
	color: var(--oepm-accent-text);
}

.oepm-empty {
	padding: 40px 20px !important;
	border: 1px dashed var(--oepm-border);
	border-radius: var(--oepm-radius);
	color: var(--oepm-muted);
	text-align: center;
}

.oepm-compliance {
	margin-top: 8px !important;
	color: var(--oepm-muted);
	font-size: 13px;
	text-align: center;
}

.oepm-compliance a { color: inherit; }

/* ---------- Single listing ---------- */
.oepm-single { margin: 0 0 40px; }

.oepm-back {
	margin-bottom: 16px !important;
	font-size: 15px;
}

.oepm-single__media {
	border-radius: var(--oepm-radius);
	aspect-ratio: 16 / 9;
}

.oepm-single__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px 32px;
	margin: 24px 0;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--oepm-border);
}

.oepm-single .oepm-single__address {
	margin: 8px 0 0 !important;
	padding: 0 !important;
	color: var(--oepm-text);
	font-size: clamp(20px, 2.6vw, 26px) !important;
	font-weight: 600 !important;
	letter-spacing: normal;
	line-height: 1.3 !important;
	text-transform: none;
}

.oepm-single .oepm-single__address .oepm-addr2 {
	font-size: .75em;
}

.oepm-single__meta {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.oepm-single__meta .oepm-facts {
	padding: 0 !important;
	border: 0;
}

.oepm-single__meta .oepm-facts__item { font-size: 17px; }

.oepm-single__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	margin-bottom: 24px;
}

@container (min-width: 760px) {
	.oepm-single__body { grid-template-columns: minmax(0, 1fr) 320px; }
}

.oepm-h2 {
	margin: 0 0 12px !important;
	font-size: 22px !important;
}

.oepm-single__description p { margin: 0 0 1em; }

.oepm-single__aside .oepm-agent {
	position: sticky;
	top: 24px;
	align-items: flex-start;
	padding: 20px;
	border: 1px solid var(--oepm-border);
	border-radius: var(--oepm-radius);
	background: var(--oepm-soft);
}

@media (prefers-reduced-motion: reduce) {
	.oepm-card,
	.oepm-filter__btn,
	.oepm-btn { transition: none; }
	.oepm-card:hover { transform: none; }
}

/* ---------- Listing gallery ---------- */
.oepm-gallery { margin: 0; }

.oepm-gallery__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0 0 4px;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 24, 39, .6);
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color .15s;
}

.oepm-gallery__nav:hover,
.oepm-gallery__nav:focus-visible { background: rgba(17, 24, 39, .85); }
.oepm-gallery__nav--prev { left: 12px; }
.oepm-gallery__nav--next { right: 12px; }

.oepm-gallery__counter {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(17, 24, 39, .7);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
}

.oepm-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 8px;
	margin: 10px 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.oepm-gallery__thumbs li {
	margin: 0 !important;
	padding: 0 !important;
}

.oepm-gallery__thumbs li::before { content: none !important; }

.oepm-gallery__thumb {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border: 2px solid transparent;
	border-radius: 6px;
	opacity: .7;
	transition: opacity .15s, border-color .15s;
}

.oepm-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	object-fit: cover;
}

.oepm-gallery__thumb:hover,
.oepm-gallery__thumb:focus-visible { opacity: 1; }

.oepm-gallery__thumb.is-active {
	border-color: var(--oepm-accent);
	opacity: 1;
}

@container (max-width: 480px) {
	.oepm-gallery__thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.oepm-gallery__nav { width: 38px; height: 38px; font-size: 28px; }
}
