/**
 * RealNest Frontend CSS
 * v0.2.0 — Phase 2: Listing Display + Block Editor
 * All selectors prefixed with .rn- to avoid theme conflicts.
 */

/* ─── Custom Properties ──────────────────────────────────────────────────────── */
:root {
	--rn-navy:        #1B2A4A;
	--rn-teal:        #0F7173;
	--rn-gold:        #C9961A;
	--rn-text:        #2C2C2C;
	--rn-muted:       #6B7280;
	--rn-border:      #E2E8F0;
	--rn-bg:          #F8FAFC;
	--rn-white:       #FFFFFF;
	--rn-green:       #1A6B3C;
	--rn-green-l:     #D6EFE2;
	--rn-radius:      8px;
	--rn-radius-lg:   12px;
	--rn-shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
	--rn-shadow:      0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
	--rn-shadow-lg:   0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.04);
	--rn-transition:  150ms ease;
	--rn-card-gap:    20px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--rn-text:    #E2E8F0;
		--rn-muted:   #94A3B8;
		--rn-border:  #334155;
		--rn-bg:      #0F172A;
		--rn-white:   #1E293B;
		--rn-shadow-sm: 0 1px 3px rgba(0,0,0,.3);
		--rn-shadow:    0 4px 6px rgba(0,0,0,.3);
	}
}

/* ─── Utility ───────────────────────────────────────────────────────────────── */
.rn-sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border-width: 0;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.rn-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 20px;
	border-radius: var(--rn-radius);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background var(--rn-transition), border-color var(--rn-transition), transform var(--rn-transition);
	white-space: nowrap;
}
.rn-btn:active { transform: scale(.98); }
.rn-btn--primary {
	background: var(--rn-teal);
	color: var(--rn-white);
	border-color: var(--rn-teal);
}
.rn-btn--primary:hover { background: var(--rn-navy); border-color: var(--rn-navy); color: var(--rn-white); }
.rn-btn--secondary {
	background: var(--rn-white);
	color: var(--rn-navy);
	border-color: var(--rn-border);
}
.rn-btn--secondary:hover { border-color: var(--rn-teal); color: var(--rn-teal); }
.rn-btn--sm     { padding: 6px 14px; font-size: 13px; }
.rn-btn--full-width { width: 100%; margin-top: 8px; }

/* ─── Badges ────────────────────────────────────────────────────────────────── */
.rn-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.rn-badge--type     { background: #EEF2FF; color: #4338CA; }
.rn-badge--status   { background: #F0FDF4; color: #166534; }
.rn-badge--featured { background: #FFFBEB; color: #92400E; }

/* ─── Property Card ─────────────────────────────────────────────────────────── */
.rn-property-card {
	background: var(--rn-white);
	border: 1px solid var(--rn-border);
	border-radius: var(--rn-radius-lg);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: var(--rn-shadow-sm);
	transition: box-shadow var(--rn-transition), transform var(--rn-transition);
}
.rn-property-card:hover {
	box-shadow: var(--rn-shadow-lg);
	transform: translateY(-2px);
}

/* Media */
.rn-property-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3/2;
	background: var(--rn-bg);
}
.rn-property-card__image-link { display: block; height: 100%; }
.rn-property-card__image {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 300ms ease;
}
.rn-property-card:hover .rn-property-card__image { transform: scale(1.03); }
.rn-property-card__no-image {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	font-size: 48px; color: var(--rn-border);
}
.rn-property-card__badges {
	position: absolute; top: 12px; left: 12px;
	display: flex; flex-wrap: wrap; gap: 6px;
}

/* Body */
.rn-property-card__body {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.rn-property-card__price {
	font-size: 20px;
	font-weight: 700;
	color: var(--rn-teal);
	line-height: 1.2;
}
.rn-price__postfix { font-size: 13px; font-weight: 400; color: var(--rn-muted); }
.rn-property-card__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--rn-text);
}
.rn-property-card__title a { color: inherit; text-decoration: none; }
.rn-property-card__title a:hover { color: var(--rn-teal); }
.rn-property-card__location {
	font-size: 13px;
	color: var(--rn-muted);
}

/* Specs */
.rn-property-card__specs {
	display: flex;
	gap: 14px;
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	border-top: 1px solid var(--rn-border);
	padding-top: 10px;
	flex-wrap: wrap;
}
.rn-property-card__spec {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: var(--rn-muted);
}
.rn-spec__icon { font-size: 14px; line-height: 1; }
.rn-spec__value { font-weight: 600; color: var(--rn-text); }
.rn-spec__label { color: var(--rn-muted); }

/* Footer */
.rn-property-card__footer { padding: 12px 16px; border-top: 1px solid var(--rn-border); }

/* Horizontal card variant */
.rn-property-card--horizontal {
	flex-direction: row;
}
.rn-property-card--horizontal .rn-property-card__media {
	width: 260px;
	flex-shrink: 0;
	aspect-ratio: auto;
	min-height: 180px;
}
.rn-property-card--horizontal .rn-property-card__body { padding: 20px; }

/* Compact variant */
.rn-property-card--compact .rn-property-card__body { padding: 12px; }
.rn-property-card--compact .rn-property-card__price { font-size: 16px; }
.rn-property-card--compact .rn-property-card__title { font-size: 14px; }

/* ─── Property Grid ─────────────────────────────────────────────────────────── */
.rn-property-grid {
	display: grid;
	gap: var(--rn-card-gap);
	grid-template-columns: 1fr;
}
.rn-property-grid--2col { grid-template-columns: repeat(2, 1fr); }
.rn-property-grid--3col { grid-template-columns: repeat(3, 1fr); }
.rn-property-grid--4col { grid-template-columns: repeat(4, 1fr); }
.rn-property-grid--list { grid-template-columns: 1fr; }

@media (max-width: 1024px) {
	.rn-property-grid--4col { grid-template-columns: repeat(2, 1fr); }
	.rn-property-grid--3col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.rn-property-grid--2col,
	.rn-property-grid--3col,
	.rn-property-grid--4col { grid-template-columns: 1fr; }
	.rn-property-card--horizontal { flex-direction: column; }
	.rn-property-card--horizontal .rn-property-card__media { width: 100%; aspect-ratio: 3/2; min-height: auto; }
}

/* ─── Pagination ────────────────────────────────────────────────────────────── */
.rn-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 32px;
}
.rn-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: var(--rn-radius);
	border: 1px solid var(--rn-border);
	font-size: 14px;
	color: var(--rn-text);
	text-decoration: none;
	background: var(--rn-white);
	transition: background var(--rn-transition);
}
.rn-pagination .page-numbers:hover { background: var(--rn-bg); border-color: var(--rn-teal); }
.rn-pagination .page-numbers.current { background: var(--rn-teal); color: var(--rn-white); border-color: var(--rn-teal); }

/* ─── Search Bar ────────────────────────────────────────────────────────────── */
.rn-search-bar { margin-bottom: 24px; }
.rn-search-bar__form { display: flex; flex-direction: column; gap: 12px; }
.rn-search-bar__fields {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: flex-end;
}
.rn-search-bar__field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; min-width: 0; }
.rn-search-bar__field--keyword { flex: 2 1 240px; }
.rn-search-bar__field--submit  { flex: 0 0 auto; }
.rn-search-bar__input,
.rn-search-bar__select {
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--rn-border);
	border-radius: var(--rn-radius);
	font-size: 14px;
	color: var(--rn-text);
	background: var(--rn-white);
	width: 100%;
	box-sizing: border-box;
}
.rn-search-bar__input:focus,
.rn-search-bar__select:focus {
	border-color: var(--rn-teal);
	outline: none;
	box-shadow: 0 0 0 3px rgba(15,113,115,.15);
}
.rn-search-bar__btn { height: 42px; padding: 0 24px; }

@media (max-width: 640px) {
	.rn-search-bar__fields { flex-direction: column; }
	.rn-search-bar__field,
	.rn-search-bar__field--keyword,
	.rn-search-bar__field--submit { flex: none; width: 100%; }
}

/* ─── Archive Page ──────────────────────────────────────────────────────────── */
.rn-archive-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
.rn-archive__page-header { margin-bottom: 24px; }
.rn-archive__page-title  { margin: 0; font-size: 28px; color: var(--rn-navy); }
.rn-archive__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 12px;
}
.rn-archive__count { font-size: 14px; color: var(--rn-muted); margin: 0; }
.rn-archive__sort-select {
	padding: 6px 10px;
	border: 1px solid var(--rn-border);
	border-radius: var(--rn-radius);
	font-size: 13px;
	background: var(--rn-white);
	color: var(--rn-text);
	cursor: pointer;
}

/* No results */
.rn-no-results-state {
	text-align: center;
	padding: 60px 24px;
}
.rn-no-results-state__icon { font-size: 64px; display: block; margin-bottom: 16px; }
.rn-no-results-state__title { font-size: 22px; margin: 0 0 8px; color: var(--rn-navy); }
.rn-no-results-state__text  { color: var(--rn-muted); margin-bottom: 24px; }
.rn-no-results { color: var(--rn-muted); font-style: italic; }

/* ─── Single Property ───────────────────────────────────────────────────────── */
.rn-single-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
.rn-single__breadcrumb { margin-bottom: 20px; }

/* Gallery */
.rn-gallery {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: 280px 280px;
	gap: 4px;
	border-radius: var(--rn-radius-lg);
	overflow: hidden;
	margin-bottom: 28px;
	position: relative;
}
.rn-gallery__item { display: block; overflow: hidden; cursor: pointer; background: var(--rn-bg); }
.rn-gallery__item--main { grid-row: 1 / 3; }
.rn-gallery__item:nth-child(n+5) { display: none; }
.rn-gallery__image {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 300ms ease;
}
.rn-gallery__item:hover .rn-gallery__image { transform: scale(1.04); }
.rn-gallery__view-all {
	position: absolute;
	bottom: 16px; right: 16px;
	background: rgba(255,255,255,.92);
	border: none;
	border-radius: var(--rn-radius);
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	color: var(--rn-navy);
	backdrop-filter: blur(4px);
}
.rn-gallery__view-all:hover { background: var(--rn-white); }

@media (max-width: 768px) {
	.rn-gallery {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 200px 200px;
	}
	.rn-gallery__item--main { grid-column: 1 / 3; grid-row: 1; }
	.rn-gallery__item:nth-child(n+4) { display: none; }
}
@media (max-width: 480px) {
	.rn-gallery {
		grid-template-columns: 1fr;
		grid-template-rows: 240px;
	}
	.rn-gallery__item:nth-child(n+2) { display: none; }
}

/* Floor plans gallery (smaller) */
.rn-gallery--floor-plans {
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	grid-template-rows: auto;
}
.rn-gallery--floor-plans .rn-gallery__item { aspect-ratio: 4/3; }
.rn-gallery--floor-plans .rn-gallery__item--main { grid-row: auto; grid-column: auto; }
.rn-gallery--floor-plans .rn-gallery__item:nth-child(n+5) { display: block; }

/* Single header */
.rn-single__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 24px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}
.rn-single__badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rn-single__title  { margin: 0 0 6px; font-size: 26px; line-height: 1.2; color: var(--rn-navy); }
.rn-single__address { margin: 0 0 4px; color: var(--rn-muted); font-size: 15px; }
.rn-single__mls-id  { margin: 0; font-size: 12px; color: var(--rn-muted); }
.rn-single__price {
	font-size: 28px;
	font-weight: 700;
	color: var(--rn-teal);
	white-space: nowrap;
}
.rn-single__price-postfix { font-size: 15px; font-weight: 400; color: var(--rn-muted); }
.rn-single__price-por { font-size: 18px; }

/* Specs strip */
.rn-single__specs {
	display: flex;
	gap: 0;
	background: var(--rn-bg);
	border: 1px solid var(--rn-border);
	border-radius: var(--rn-radius);
	overflow: hidden;
	margin-bottom: 28px;
	flex-wrap: wrap;
}
.rn-single__spec {
	flex: 1 1 100px;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 16px 12px;
	border-right: 1px solid var(--rn-border);
	min-width: 80px;
	text-align: center;
}
.rn-single__spec:last-child { border-right: none; }
.rn-single__spec-icon  { font-size: 20px; margin-bottom: 4px; }
.rn-single__spec-value { font-size: 18px; font-weight: 700; color: var(--rn-navy); line-height: 1; }
.rn-single__spec-label { font-size: 11px; color: var(--rn-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* Body layout */
.rn-single__body {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 32px;
	align-items: start;
}
@media (max-width: 900px) {
	.rn-single__body { grid-template-columns: 1fr; }
}

/* Section */
.rn-single__section { margin-bottom: 36px; }
.rn-single__section-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--rn-navy);
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--rn-teal);
	display: inline-block;
}
.rn-single__description { line-height: 1.7; color: var(--rn-text); }

/* Features list */
.rn-single__features {
	list-style: none;
	margin: 0; padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 8px;
}
.rn-single__feature {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--rn-text);
}
.rn-single__feature span { color: var(--rn-teal); font-weight: 700; }

/* Video / tour embeds */
.rn-single__embed {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: var(--rn-radius);
}
.rn-single__embed iframe {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
}

/* Open house */
.rn-single__open-house { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rn-single__open-house-item {
	display: flex;
	gap: 16px;
	padding: 10px 16px;
	background: var(--rn-bg);
	border-radius: var(--rn-radius);
	font-size: 14px;
}
.rn-single__open-house-date { font-weight: 600; color: var(--rn-navy); }
.rn-single__open-house-time { color: var(--rn-muted); }

/* EPC */
.rn-epc { display: flex; align-items: center; gap: 12px; }
.rn-epc__badge {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px;
	border-radius: 50%;
	font-size: 18px; font-weight: 700; color: white;
}
.rn-epc__badge--a { background: #00A550; }
.rn-epc__badge--b { background: #50B848; }
.rn-epc__badge--c { background: #BED600; }
.rn-epc__badge--d { background: #FFD100; color: #333; }
.rn-epc__badge--e { background: #F7941D; }
.rn-epc__badge--f { background: #F15A29; }
.rn-epc__badge--g { background: #ED1C24; }
.rn-epc__score { font-size: 14px; color: var(--rn-muted); }

/* Sidebar */
.rn-single__sidebar { display: flex; flex-direction: column; gap: 20px; }
.rn-single__widget {
	background: var(--rn-white);
	border: 1px solid var(--rn-border);
	border-radius: var(--rn-radius-lg);
	padding: 20px;
}
.rn-single__widget-title {
	font-size: 16px; font-weight: 600;
	color: var(--rn-navy);
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--rn-border);
}

/* ─── Agent Card ────────────────────────────────────────────────────────────── */
.rn-agent-card { display: flex; gap: 14px; align-items: flex-start; }
.rn-agent-card__photo {
	width: 64px; height: 64px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid var(--rn-border);
}
.rn-agent-card__info { flex: 1; min-width: 0; }
.rn-agent-card__name { margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--rn-navy); }
.rn-agent-card__role { margin: 0 0 4px; font-size: 12px; color: var(--rn-muted); text-transform: uppercase; letter-spacing: .04em; }
.rn-agent-card__bio  { margin: 0 0 8px; font-size: 13px; color: var(--rn-muted); }
.rn-agent-card__meta { display: flex; flex-direction: column; gap: 4px; }
.rn-agent-card__listings { font-size: 12px; color: var(--rn-teal); font-weight: 500; }
.rn-agent-card__phone,
.rn-agent-card__email { font-size: 13px; color: var(--rn-teal); text-decoration: none; word-break: break-all; }
.rn-agent-card__phone:hover,
.rn-agent-card__email:hover { text-decoration: underline; }

/* ─── Inquiry Form ──────────────────────────────────────────────────────────── */
.rn-inquiry-form__title { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--rn-navy); }
.rn-inquiry-form__note { font-size: 12px; color: var(--rn-muted); margin: 0 0 12px; font-style: italic; }
.rn-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 12px;
}
@media (max-width: 480px) { .rn-form-grid { grid-template-columns: 1fr; } }
.rn-form-group { display: flex; flex-direction: column; gap: 4px; }
.rn-form-group--full { grid-column: 1 / -1; }
.rn-form-group label { font-size: 12px; font-weight: 500; color: var(--rn-muted); }
.rn-form-input,
.rn-form-textarea {
	padding: 8px 12px;
	border: 1px solid var(--rn-border);
	border-radius: var(--rn-radius);
	font-size: 14px;
	color: var(--rn-text);
	background: var(--rn-white);
	transition: border-color var(--rn-transition);
	width: 100%;
	box-sizing: border-box;
	font-family: inherit;
}
.rn-form-input:focus,
.rn-form-textarea:focus {
	border-color: var(--rn-teal);
	outline: none;
	box-shadow: 0 0 0 3px rgba(15,113,115,.12);
}
.rn-form-textarea { resize: vertical; min-height: 80px; }

/* ─── Breadcrumb ────────────────────────────────────────────────────────────── */
.rn-breadcrumb { font-size: 13px; }
.rn-breadcrumb__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rn-breadcrumb__item { display: flex; align-items: center; gap: 4px; }
.rn-breadcrumb__link { color: var(--rn-teal); text-decoration: none; }
.rn-breadcrumb__link:hover { text-decoration: underline; }
.rn-breadcrumb__current { color: var(--rn-muted); }
.rn-breadcrumb__sep { color: var(--rn-border); }

/* ─── Map Placeholder ───────────────────────────────────────────────────────── */
.rn-map-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--rn-bg);
	border: 1px dashed var(--rn-border);
	border-radius: var(--rn-radius);
	min-height: 300px;
}
.rn-map-placeholder--single { min-height: 280px; }
.rn-map-placeholder__inner { text-align: center; padding: 24px; }
.rn-map-placeholder__icon  { font-size: 48px; display: block; margin-bottom: 10px; }
.rn-map-placeholder__title { font-weight: 600; color: var(--rn-navy); margin: 0 0 4px; font-size: 16px; }
.rn-map-placeholder__coords { font-size: 12px; color: var(--rn-muted); font-family: monospace; margin: 4px 0; }
.rn-map-placeholder__note  { font-size: 12px; color: var(--rn-muted); margin: 6px 0 0; font-style: italic; }

/* ─── Block Placeholder (editor) ─────────────────────────────────────────────── */
.rn-block-placeholder {
	padding: 20px;
	background: var(--rn-bg);
	border: 1px dashed var(--rn-border);
	border-radius: var(--rn-radius);
	text-align: center;
	color: var(--rn-muted);
}

/* ─── Auth Form ─────────────────────────────────────────────────────────────── */
.rn-auth-form { padding: 16px; background: var(--rn-bg); border-radius: var(--rn-radius); }
.rn-auth-form__note { font-size: 14px; margin: 0; }
.rn-auth-form__note--muted { color: var(--rn-muted); font-style: italic; }

/* ─── Lightbox ──────────────────────────────────────────────────────────────── */
.rn-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.rn-lightbox[hidden] { display: none; }
.rn-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.9);
}
.rn-lightbox__stage {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 90vw;
	max-height: 90vh;
}
.rn-lightbox__content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.rn-lightbox__image {
	max-width: 85vw;
	max-height: 82vh;
	object-fit: contain;
	border-radius: 4px;
	display: block;
}
.rn-lightbox__counter { font-size: 13px; color: rgba(255,255,255,.7); }
.rn-lightbox__close,
.rn-lightbox__prev,
.rn-lightbox__next {
	background: rgba(255,255,255,.15);
	border: none;
	color: white;
	cursor: pointer;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	transition: background var(--rn-transition);
	flex-shrink: 0;
	backdrop-filter: blur(4px);
}
.rn-lightbox__close:hover,
.rn-lightbox__prev:hover,
.rn-lightbox__next:hover { background: rgba(255,255,255,.3); }
.rn-lightbox__close {
	position: absolute;
	top: -16px; right: -16px;
	width: 36px; height: 36px;
	font-size: 20px;
}
.rn-lightbox__prev,
.rn-lightbox__next { width: 44px; height: 44px; font-size: 28px; }

body.rn-lightbox-open { overflow: hidden; }

/* ─── Notice ────────────────────────────────────────────────────────────────── */
.rn-notice { font-size: 14px; color: var(--rn-muted); padding: 10px 14px; background: var(--rn-bg); border-radius: var(--rn-radius); }

/* ─── Print ─────────────────────────────────────────────────────────────────── */
@media print {
	.rn-lightbox,
	.rn-gallery__view-all,
	.rn-btn,
	.rn-archive__sort,
	.rn-search-bar { display: none !important; }
	.rn-single__body { grid-template-columns: 1fr; }
	.rn-single__sidebar { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 3 — Search & Filters
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Search bar row layout ──────────────────────────────────────────────────── */
.rn-search-bar__row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: flex-end;
}
.rn-search-bar--full { width: 100%; }

/* ─── More Filters button ─────────────────────────────────────────────────── */
.rn-search-bar__more-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 0 14px; height: 42px;
	border: 1px solid var(--rn-border); border-radius: var(--rn-radius);
	background: var(--rn-white); color: var(--rn-text);
	font-size: 14px; cursor: pointer;
	transition: border-color var(--rn-transition);
	white-space: nowrap;
}
.rn-search-bar__more-btn:hover          { border-color: var(--rn-teal); color: var(--rn-teal); }
.rn-search-bar__more-btn--active        { border-color: var(--rn-teal); color: var(--rn-teal); }
.rn-search-bar__more-arrow              { font-size: 16px; transition: transform 200ms; }
.rn-search-bar__more-btn[aria-expanded="true"] .rn-search-bar__more-arrow { transform: rotate(180deg); }

.rn-badge-dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--rn-teal); flex-shrink: 0;
}

/* ─── More Filters expandable panel ──────────────────────────────────────── */
.rn-more-filters-panel {
	padding: 20px;
	background: var(--rn-bg);
	border: 1px solid var(--rn-border);
	border-top: none;
	border-radius: 0 0 var(--rn-radius) var(--rn-radius);
	animation: rnSlideDown 180ms ease;
}
@keyframes rnSlideDown {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: translateY(0); }
}
.rn-more-filters-panel[hidden] { display: none; }
.rn-more-filters-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}
.rn-more-filters__group  { display: flex; flex-direction: column; gap: 6px; }
.rn-more-filters__label  { font-size: 12px; font-weight: 600; color: var(--rn-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.rn-more-filters-footer  { display: flex; justify-content: flex-end; }

/* ─── Range inputs (price, area) ─────────────────────────────────────────── */
.rn-range-inputs       { display: flex; align-items: center; gap: 8px; }
.rn-range-sep          { color: var(--rn-muted); flex-shrink: 0; font-size: 14px; }
.rn-input-group-prefix { display: flex; align-items: stretch; flex: 1; }
.rn-input-group-prefix .rn-input-group__addon {
	display: flex; align-items: center;
	padding: 0 8px;
	background: var(--rn-bg);
	border: 1px solid var(--rn-border);
	border-right: 0;
	border-radius: var(--rn-radius) 0 0 var(--rn-radius);
	font-size: 13px; color: var(--rn-muted); white-space: nowrap;
}
.rn-input-group-prefix .rn-search-bar__input {
	border-radius: 0 var(--rn-radius) var(--rn-radius) 0;
	flex: 1;
}
.rn-input--price { max-width: 120px; }
.rn-input--area  { max-width: 100px; }

/* ─── Results container ──────────────────────────────────────────────────── */
.rn-results--loading {
	opacity: .5;
	pointer-events: none;
	position: relative;
}
.rn-results--loading::after {
	content: '';
	position: absolute; inset: 0;
	background: transparent;
	cursor: wait;
}

/* ─── Filter chips ───────────────────────────────────────────────────────── */
.rn-filter-chips-wrap { margin-bottom: 12px; }
.rn-filter-chips      { display: flex; flex-wrap: wrap; gap: 8px; }
.rn-filter-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 12px;
	background: var(--rn-light); color: var(--rn-teal);
	border: 1px solid var(--rn-mid); border-radius: 20px;
	font-size: 13px; font-weight: 500; cursor: pointer;
	transition: background var(--rn-transition);
}
.rn-filter-chip:hover          { background: var(--rn-mid); }
.rn-filter-chip span           { font-size: 15px; font-weight: 700; color: var(--rn-teal); }
.rn-filter-chip--clear {
	background: transparent; color: var(--rn-muted);
	border-color: var(--rn-border);
}
.rn-filter-chip--clear:hover   { background: var(--rn-bg); color: var(--rn-text); }

/* ─── Mobile filter bar ──────────────────────────────────────────────────── */
.rn-mobile-filter-bar {
	display: none;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}
.rn-mobile-filter-btn        { position: relative; }
.rn-filter-count-badge {
	position: absolute; top: -6px; right: -6px;
	min-width: 18px; height: 18px;
	background: var(--rn-teal); color: #fff;
	border-radius: 9px; font-size: 11px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	padding: 0 4px;
}
.rn-mobile-sort { flex: 1; }

/* ─── Bottom Sheet ───────────────────────────────────────────────────────── */
.rn-bottom-sheet {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	z-index: 99998;
	background: var(--rn-white);
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -4px 32px rgba(0,0,0,.18);
	max-height: 88vh;
	display: flex; flex-direction: column;
	transform: translateY(100%);
	transition: transform 280ms cubic-bezier(.32,1,.23,1);
}
.rn-bottom-sheet[aria-hidden="false"] { transform: translateY(0); }
.rn-bottom-sheet[hidden]              { display: flex; }
.rn-bottom-sheet__handle {
	width: 40px; height: 4px;
	background: var(--rn-border);
	border-radius: 2px;
	margin: 12px auto 0; flex-shrink: 0;
}
.rn-bottom-sheet__header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 20px;
	border-bottom: 1px solid var(--rn-border);
	flex-shrink: 0;
}
.rn-bottom-sheet__title  { font-size: 16px; font-weight: 600; color: var(--rn-navy); }
.rn-bottom-sheet__close  {
	background: none; border: none; font-size: 22px;
	color: var(--rn-muted); cursor: pointer; padding: 0 4px; line-height: 1;
}
.rn-bottom-sheet__body   { flex: 1; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch; }
.rn-bottom-sheet__footer {
	display: flex; gap: 12px;
	padding: 16px 20px;
	border-top: 1px solid var(--rn-border);
	flex-shrink: 0;
	padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.rn-bottom-sheet__footer .rn-btn { flex: 1; }

/* Bottom sheet field */
.rn-bs-field          { margin-bottom: 18px; }
.rn-bs-label          { display: block; font-size: 13px; font-weight: 600; color: var(--rn-muted); margin-bottom: 6px; }
.rn-bs-field .rn-search-bar__input,
.rn-bs-field .rn-search-bar__select { width: 100%; }

/* Bottom sheet backdrop */
.rn-bottom-sheet__backdrop {
	position: fixed; inset: 0;
	background: rgba(0,0,0,.48);
	z-index: 99997;
}
.rn-bottom-sheet__backdrop[hidden] { display: none; }
body.rn-bs-open { overflow: hidden; }

/* ─── No-results actions ─────────────────────────────────────────────────── */
.rn-no-results-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Responsive: mobile shows bottom-sheet controls, hides desktop bar ─── */
@media (max-width: 767px) {
	.rn-search-bar--full .rn-search-bar__row { display: none; }
	.rn-more-filters-panel                   { display: none !important; }
	.rn-mobile-filter-bar                    { display: flex; }
	/* Hide desktop sort on mobile — mobile sort is in .rn-mobile-filter-bar */
	.rn-archive__sort                        { display: none; }
}
@media (min-width: 768px) {
	.rn-mobile-filter-bar { display: none !important; }
	.rn-bottom-sheet      { display: none !important; }
	/* Desktop: show the sort in results header */
	.rn-archive__sort     { display: block; }
}

/* ─── Phase 5: Single property map address ───────────────────────────────────── */
.rn-single__map-address {
	font-size: 13px;
	color: var(--rn-muted);
	margin: 8px 0 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 6 — User Accounts
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Auth wrap / form container ─────────────────────────────────────────── */
.rn-auth-wrap {
	display: flex;
	justify-content: center;
	padding: 32px 16px;
}
.rn-auth-form {
	background: var(--rn-white);
	border: 1px solid var(--rn-border);
	border-radius: var(--rn-radius-lg);
	padding: 32px;
	width: 100%;
	max-width: 440px;
	box-shadow: var(--rn-shadow);
}
.rn-auth-form__title {
	margin: 0 0 24px;
	font-size: 22px;
	font-weight: 700;
	color: var(--rn-navy);
	text-align: center;
}
.rn-auth-form__error {
	background: #FEF2F2;
	border: 1px solid #FECACA;
	color: #991B1B;
	border-radius: var(--rn-radius);
	padding: 10px 14px;
	font-size: 14px;
	margin-bottom: 20px;
}
.rn-auth-form__success {
	background: var(--rn-green-l);
	border: 1px solid #86EFAC;
	color: var(--rn-green);
	border-radius: var(--rn-radius);
	padding: 10px 14px;
	font-size: 14px;
	margin-bottom: 20px;
}
.rn-auth-form__form .rn-form-group {
	margin-bottom: 16px;
}
.rn-auth-form__form .rn-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--rn-text);
	margin-bottom: 5px;
}
.rn-form-hint {
	font-size: 12px;
	color: var(--rn-muted);
	margin-top: 4px;
	display: block;
}
.rn-form-group--row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.rn-auth-form__remember {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	cursor: pointer;
}
.rn-auth-form__forgot {
	font-size: 13px;
	color: var(--rn-teal);
}
.rn-auth-form__forgot:hover { text-decoration: underline; }
.rn-auth-form__switch {
	text-align: center;
	font-size: 14px;
	color: var(--rn-muted);
	margin-top: 20px;
}
.rn-auth-form__switch a { color: var(--rn-teal); }
.rn-auth-form__switch a:hover { text-decoration: underline; }
.rn-auth-form--logged-in { text-align: center; }
.rn-auth-form__hp { display: none !important; }

/* Auth required notice */
.rn-auth-required {
	padding: 20px;
	background: var(--rn-bg);
	border-radius: var(--rn-radius);
	text-align: center;
	color: var(--rn-muted);
}

/* Favourites empty state */
.rn-favourites-empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--rn-muted);
}

/* ─── Favourite heart button ─────────────────────────────────────────────── */
.rn-fav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--rn-border);
	background: var(--rn-white);
	color: var(--rn-muted);
	font-size: 18px;
	cursor: pointer;
	flex-shrink: 0;
	transition: background var(--rn-transition), color var(--rn-transition), border-color var(--rn-transition), transform var(--rn-transition);
	line-height: 1;
}
.rn-fav-btn:hover {
	color: #E53E3E;
	border-color: #E53E3E;
	transform: scale(1.1);
}
.rn-fav-btn--saved {
	color: #E53E3E;
	background: #FEF2F2;
	border-color: #E53E3E;
}
.rn-fav-btn:disabled {
	opacity: .6;
	cursor: wait;
	transform: none;
}

/* Card footer with fav button */
.rn-property-card__footer {
	display: flex;
	align-items: center;
	gap: 8px;
}
.rn-property-card__footer .rn-btn {
	flex: 1;
}

/* ══════════════════════════════════════════════════════
   Phase 7 — Inquiry / Tour Forms & My Inquiries
   ══════════════════════════════════════════════════════ */

/* Form Response Messages */
.rn-form-response {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
	font-size: 14px;
	line-height: 1.5;
}
.rn-form-response--success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}
.rn-form-response--error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

/* Select input styling */
.rn-form-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
}

/* Tour form date highlight */
.rn-tour-form .rn-inquiry-form__title {
	color: var(--rn-primary, #1e3a5f);
}

/* My Inquiries table */
.rn-my-inquiries { max-width: 900px; margin: 0 auto; }
.rn-my-inquiries__title { margin-bottom: 24px; }

.rn-inquiry-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.rn-inquiry-table th,
.rn-inquiry-table td {
	padding: 10px 14px;
	border-bottom: 1px solid var(--rn-border, #e5e7eb);
	text-align: left;
	vertical-align: top;
}
.rn-inquiry-table th {
	background: var(--rn-surface, #f9fafb);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--rn-muted, #6b7280);
}
.rn-inquiry-table tbody tr:hover {
	background: var(--rn-surface, #f9fafb);
}

.rn-inq-message {
	color: var(--rn-muted, #6b7280);
	display: block;
	margin-top: 4px;
}

/* Inquiry status badges */
.rn-inq-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
}
.rn-inq-status--new       { background: #dbeafe; color: #1d4ed8; }
.rn-inq-status--contacted { background: #fef9c3; color: #854d0e; }
.rn-inq-status--qualified { background: #dcfce7; color: #15803d; }
.rn-inq-status--junk      { background: #f3f4f6; color: #6b7280; }
.rn-inq-status--won       { background: #d1fae5; color: #065f46; }
.rn-inq-status--lost      { background: #fee2e2; color: #991b1b; }

/* Auth required state */
.rn-auth-required {
	background: var(--rn-surface, #f9fafb);
	border: 1px solid var(--rn-border, #e5e7eb);
	border-radius: 8px;
	padding: 24px;
	text-align: center;
}

@media (max-width: 600px) {
	.rn-inquiry-table th:nth-child(3),
	.rn-inquiry-table td:nth-child(3) { display: none; }
}

/* ── Open Home Registration Form ─────────────────────────────────── */
.rn-oh-register {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--rn-border, #e5e7eb);
}
.rn-oh-form {
	background: var(--rn-surface, #f9fafb);
	border: 1px solid var(--rn-border, #e5e7eb);
	border-radius: 8px;
	padding: 20px;
}
.rn-oh-form__title {
	margin: 0 0 4px;
	font-size: 17px;
	color: var(--rn-heading, #1e3a5f);
}
.rn-oh-form__subtitle {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--rn-muted, #6b7280);
}
.rn-btn--secondary {
	background: var(--rn-surface, #f3f4f6);
	color: var(--rn-heading, #1e3a5f);
	border: 2px solid var(--rn-primary, #1e3a5f);
}
.rn-btn--secondary:hover {
	background: var(--rn-primary, #1e3a5f);
	color: #fff;
}
