/**
 * LCOLB Property Directory styles.
 *
 * Brand adaptation happens via the custom properties below (swap during the
 * site-rebuild theming pass). Every shipped color pair is contrast-verified:
 *   text #1f2937 on #fff ............ 14.7:1   panel text #fff on #1e3a5f ... 12.6:1
 *   link #0b5bd3 on #fff ............ 6.0:1    badges (white on each bg) .... ≥ 6.7:1
 * Links inside content areas are underlined — color is never the only signal.
 */

.lcolb-page,
.lcolb-directory {
	--lcolb-text: #1f2937;
	--lcolb-bg: #ffffff;
	--lcolb-panel-bg: #1e3a5f;
	--lcolb-panel-text: #ffffff;
	--lcolb-link: #0b5bd3;
	--lcolb-focus: #005fcc;
	--lcolb-border: #d1d5db;
	--lcolb-badge-for-sale: #0b6b3a;
	--lcolb-badge-pending: #92400e;
	--lcolb-badge-upcoming: #1d4ed8;
	--lcolb-badge-sold: #4b5563;
	--lcolb-radius: 6px;

	color: var(--lcolb-text);
	font-size: 1rem;
	line-height: 1.6;
}

.lcolb-page__main {
	max-width: 72rem;
	margin: 0 auto;
	padding: 1rem;
}

/* ---------- Focus (2.4.7 / 1.4.11) ---------- */

.lcolb-directory :focus-visible,
.lcolb-page :focus-visible {
	outline: 3px solid var(--lcolb-focus);
	outline-offset: 2px;
}

.lcolb-filters :focus-visible {
	outline-color: #ffffff;
}

/* ---------- Reduced motion (2.3.3) ---------- */

@media (prefers-reduced-motion: reduce) {
	.lcolb-page *,
	.lcolb-directory * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Screen-reader-only text ---------- */

.lcolb-page .screen-reader-text,
.lcolb-directory .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Filter panel (brand-colored, per reference UI) ---------- */

.lcolb-filters {
	background: var(--lcolb-panel-bg);
	color: var(--lcolb-panel-text);
	border-radius: var(--lcolb-radius);
	padding: 1rem;
	margin-bottom: 1rem;
}

.lcolb-filters__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	align-items: end;
}

.lcolb-filters__row + .lcolb-filters__row {
	margin-top: 0.75rem;
}

.lcolb-filters__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 9rem;
	flex: 1 1 9rem;
}

.lcolb-filters__field label,
.lcolb-filters__range legend {
	color: var(--lcolb-panel-text);
	font-size: 0.875rem;
	font-weight: 600;
}

.lcolb-filters__field input,
.lcolb-filters__field select {
	font-size: 1rem;
	padding: 0.5rem;
	border: 1px solid var(--lcolb-border);
	border-radius: 4px;
	background: #ffffff;
	color: var(--lcolb-text);
	min-height: 44px;
}

.lcolb-filters__range {
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
	padding: 0.5rem 0.75rem 0.75rem;
	display: flex;
	gap: 0.75rem;
	flex: 1 1 14rem;
	margin: 0;
}

.lcolb-filters__range .lcolb-filters__field {
	min-width: 5.5rem;
	flex: 1 1 5.5rem;
}

.lcolb-filters__field--checkbox {
	flex-direction: row;
	align-items: center;
	gap: 0.5rem;
	min-width: auto;
}

.lcolb-filters__field--checkbox input {
	width: 1.35rem;
	height: 1.35rem;
	min-height: 0;
}

/* ---------- View toggles ---------- */

.lcolb-views {
	display: flex;
	gap: 0.5rem;
	flex: 0 0 auto;
}

.lcolb-view-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 0.9rem;
	min-height: 44px;
	font-size: 1rem;
	border: 2px solid #ffffff;
	border-radius: 4px;
	background: transparent;
	color: #ffffff;
	cursor: pointer;
}

.lcolb-view-btn[aria-pressed="true"] {
	background: #ffffff;
	color: var(--lcolb-panel-bg);
	font-weight: 700;
}

/* Simple geometric icons so the toggles read as icon + text (per reference). */
.lcolb-view-btn__icon {
	width: 1em;
	height: 1em;
	display: inline-block;
	background: currentColor;
}
.lcolb-view-btn__icon--grid { clip-path: polygon(0 0, 45% 0, 45% 45%, 0 45%, 0 0, 55% 0, 100% 0, 100% 45%, 55% 45%, 55% 100%, 100% 100%, 100% 55%, 0 55%, 0 100%, 45% 100%, 45% 55%); }
.lcolb-view-btn__icon--list { clip-path: polygon(0 5%, 100% 5%, 100% 25%, 0 25%, 0 40%, 100% 40%, 100% 60%, 0 60%, 0 75%, 100% 75%, 100% 95%, 0 95%); }
.lcolb-view-btn__icon--map  { clip-path: polygon(50% 0, 85% 20%, 85% 60%, 50% 100%, 15% 60%, 15% 20%); }

/* ---------- Buttons ---------- */

.lcolb-clear-filters,
.lcolb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.6rem 1.2rem;
	font-size: 1rem;
	font-weight: 700;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
}

.lcolb-clear-filters {
	background: #ffffff;
	color: var(--lcolb-panel-bg);
	border: 2px solid #ffffff;
	flex: 0 0 auto;
}

.lcolb-empty .lcolb-clear-filters {
	background: var(--lcolb-panel-bg);
	color: #ffffff;
	border-color: var(--lcolb-panel-bg);
}

.lcolb-btn--primary {
	background: var(--lcolb-badge-for-sale);
	color: #ffffff;
	border: 2px solid var(--lcolb-badge-for-sale);
}

.lcolb-btn--secondary {
	background: var(--lcolb-panel-bg);
	color: #ffffff;
	border: 2px solid var(--lcolb-panel-bg);
}

.lcolb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1rem 0 1.5rem;
}

/* ---------- Mobile filter disclosure ---------- */

@media (max-width: 782px) {
	.lcolb-filters-toggle {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		min-height: 44px;
		padding: 0.6rem 1rem;
		font-size: 1rem;
		font-weight: 700;
		border-radius: 4px;
		border: 2px solid var(--lcolb-panel-bg);
		background: var(--lcolb-panel-bg);
		color: #ffffff;
		margin-bottom: 0.75rem;
		cursor: pointer;
	}

	.lcolb-filters-toggle[hidden] { display: none; }

	.lcolb-filters-toggle__icon {
		width: 0;
		height: 0;
		border-left: 0.4em solid transparent;
		border-right: 0.4em solid transparent;
		border-top: 0.5em solid currentColor;
	}

	.lcolb-filters-toggle[aria-expanded="true"] .lcolb-filters-toggle__icon {
		border-top: none;
		border-bottom: 0.5em solid currentColor;
	}

	.lcolb-filters.is-collapsed {
		display: none;
	}
}

/* ---------- Result count ---------- */

.lcolb-count {
	font-weight: 600;
	margin: 0.5rem 0 1rem;
}

/* ---------- Status badges (text + color, never color alone) ---------- */

.lcolb-badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 4px;
	color: #ffffff;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	margin: 0;
}

.lcolb-badge--for-sale { background: var(--lcolb-badge-for-sale); }
.lcolb-badge--pending  { background: var(--lcolb-badge-pending); }
.lcolb-badge--upcoming { background: var(--lcolb-badge-upcoming); }
.lcolb-badge--sold     { background: var(--lcolb-badge-sold); }

/* ---------- Grid view ---------- */

.lcolb-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 1.25rem;
}

.lcolb-card {
	border: 1px solid var(--lcolb-border);
	border-radius: var(--lcolb-radius);
	overflow: hidden;
	background: var(--lcolb-bg);
	height: 100%;
	display: flex;
	flex-direction: column;
}

.lcolb-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #e5e7eb;
}

.lcolb-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lcolb-card__media .lcolb-badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
}

.lcolb-card__media--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #4b5563;
	font-size: 0.875rem;
}

.lcolb-card__body {
	padding: 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	flex: 1;
}

.lcolb-card__title {
	font-size: 1.1rem;
	line-height: 1.35;
	margin: 0;
}

.lcolb-card__title a {
	color: var(--lcolb-link);
	text-decoration: underline;
}

.lcolb-card__price {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0;
}

.lcolb-card__meta {
	margin: 0;
	font-size: 0.9rem;
	color: #374151;
}

/* ---------- List view ---------- */

.lcolb-table-wrap {
	overflow-x: auto;
	max-width: 100%;
	border: 1px solid var(--lcolb-border);
	border-radius: var(--lcolb-radius);
}

.lcolb-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.lcolb-table th,
.lcolb-table td {
	text-align: left;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--lcolb-border);
	white-space: nowrap;
}

.lcolb-table th button {
	all: unset;
	cursor: pointer;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.25rem 0.15rem;
}

.lcolb-table th button:focus-visible {
	outline: 3px solid var(--lcolb-focus);
	outline-offset: 2px;
}

.lcolb-table [aria-sort="ascending"] .lcolb-sort-icon::after { content: "▲"; font-size: 0.7em; }
.lcolb-table [aria-sort="descending"] .lcolb-sort-icon::after { content: "▼"; font-size: 0.7em; }
.lcolb-table [aria-sort="none"] .lcolb-sort-icon::after { content: "↕"; font-size: 0.7em; opacity: 0.55; }

.lcolb-table a {
	color: var(--lcolb-link);
	text-decoration: underline;
}

/* ---------- Map view ---------- */

.lcolb-map {
	height: 32rem;
	max-height: 75vh;
	border-radius: var(--lcolb-radius);
	border: 1px solid var(--lcolb-border);
}

.lcolb-map--single {
	height: 24rem;
}

.lcolb-map-note,
.lcolb-map-caption {
	font-size: 0.9rem;
	color: #374151;
}

.lcolb-map .leaflet-popup-content a {
	color: var(--lcolb-link);
	text-decoration: underline;
}

/* ---------- Empty state ---------- */

.lcolb-empty {
	text-align: center;
	border: 2px dashed var(--lcolb-border);
	border-radius: var(--lcolb-radius);
	padding: 2.5rem 1rem;
	margin-top: 1rem;
}

/* ---------- Detail page ---------- */

.lcolb-breadcrumb {
	margin-bottom: 1rem;
}

.lcolb-breadcrumb a {
	color: var(--lcolb-link);
	text-decoration: underline;
}

.lcolb-property__header {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 0.5rem;
}

.lcolb-property__header .lcolb-badge {
	align-self: flex-start;
}

.lcolb-property__title {
	margin: 0;
	line-height: 1.2;
}

.lcolb-property__locality {
	margin: 0;
	color: #374151;
}

.lcolb-property__price {
	font-size: 1.75rem;
	font-weight: 800;
	margin: 0.25rem 0 0;
}

.lcolb-property__price--sold,
.lcolb-property__price--tbd {
	font-size: 1.15rem;
	font-weight: 700;
	color: #374151;
}

.lcolb-gallery__list {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
	gap: 0.75rem;
}

.lcolb-gallery__open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	border-radius: 4px;
	overflow: hidden;
}

.lcolb-gallery__open img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.lcolb-lightbox {
	border: 0;
	border-radius: var(--lcolb-radius);
	padding: 1rem;
	max-width: min(60rem, 92vw);
	background: #111827;
	color: #ffffff;
}

.lcolb-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.8);
}

.lcolb-lightbox img {
	max-width: 100%;
	max-height: 70vh;
	display: block;
	margin: 0 auto;
}

.lcolb-lightbox__bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
}

.lcolb-lightbox__counter { margin: 0; }

.lcolb-lightbox__close,
.lcolb-lightbox__prev,
.lcolb-lightbox__next {
	background: #ffffff;
	color: #111827;
	border: 0;
	border-radius: 4px;
	min-width: 44px;
	min-height: 44px;
	font-size: 1.25rem;
	cursor: pointer;
}

.lcolb-lightbox__nav {
	display: flex;
	justify-content: space-between;
	margin-top: 0.5rem;
}

.lcolb-details {
	margin: 1.5rem 0;
}

.lcolb-details__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: 0.75rem 1.5rem;
	margin: 0;
}

.lcolb-details__list > div {
	border-bottom: 1px solid var(--lcolb-border);
	padding-bottom: 0.5rem;
}

.lcolb-details__list dt {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #4b5563;
}

.lcolb-details__list dd {
	margin: 0;
	font-weight: 600;
}

.lcolb-auditor {
	margin: 1.5rem 0;
}

.lcolb-auditor a {
	color: var(--lcolb-link);
	text-decoration: underline;
	font-weight: 600;
}

.lcolb-disclaimer {
	border-top: 1px solid var(--lcolb-border);
	margin-top: 2rem;
	padding-top: 1rem;
	font-size: 0.9rem;
	color: #374151;
}
