/* Turnkey: Homes for Sale (/homes/). Scoped to .tk-homes-page and .tk-homes. Square corners only. */

.tk-homes {
	--hf-ink: var(--tk-ink, #2b3a4a);
	--hf-ink-d: var(--tk-ink-d, #1f2a36);
	--hf-paper: var(--tk-paper, #f7f4ee);
	--hf-linen: var(--tk-linen, #ece4d6);
	--hf-ochre-d: var(--tk-ochre-dk, #9c7322);
	--hf-muted: var(--tk-muted, #5d6773);
	--hf-line: var(--tk-line, rgba(43, 58, 74, .16));
	--hf-sans: var(--tk-sans, "Instrument Sans", "Helvetica Neue", Arial, sans-serif);
	--hf-serif: var(--tk-serif, "Cormorant Garamond", Georgia, serif);
	--hf-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%232b3a4a' stroke-width='1.3'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
	position: relative;
	font-family: var(--hf-sans);
	color: var(--hf-ink);
}
.tk-homes [hidden] { display: none !important; }
.tk-homes *, .tk-homes *::before, .tk-homes *::after { border-radius: 0; }

/* Page frame: a short title band, then the bar right under it */
.tk-homes-page .ct2-hero-title::after { display: none !important; }
.tk-homes-page .ct2-hero-type .ct2-hero-sentence { margin-bottom: 0; }
/* title band on a bright great-room photo (shared photo band rules in screen.css) */
.tk-homes-page .ct2-hero-action .ct2-ha { min-height: calc(var(--ct-header-h, 100px) + clamp(340px, 44svh, 480px)); }
.tk-homes-page .ct2-hero-action .ct2-ha-img { object-position: 50% 60%; }
.tk-homes-page .tk-all > .section { padding-top: 24px !important; }

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.tk-hf {
	position: sticky;
	top: var(--tk-hf-top, 0px);
	z-index: 40;
	margin: 0;
	padding: 18px 0 20px;
	background: var(--hf-paper);
	/* full-bleed ground and bottom rule without widening the page */
	box-shadow: 0 0 0 100vmax var(--hf-paper), 0 1px 0 100vmax var(--hf-line);
	clip-path: inset(0 -100vmax -1px);
}
.tk-hf.is-open { z-index: 100000; clip-path: none; box-shadow: none; }
.tk-homes-page .tk-all { background: var(--tk-paper, #f7f4ee) !important; }
.tk-hf-bar, .tk-hf-head { display: none; }
.tk-hf-fields {
	display: grid;
	grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1.15fr) minmax(220px, 1.7fr) minmax(76px, .6fr) minmax(76px, .6fr) auto;
	gap: 16px 22px;
	align-items: end;
}
.tk-hf-f { margin: 0; padding: 0; border: 0; min-width: 0; }
.tk-hf label, .tk-hf legend, .tk-hr-sort label {
	display: block;
	padding: 0;
	margin: 0 0 6px;
	font: 600 12.5px/1.2 var(--hf-sans);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--hf-muted);
}
.tk-hf label.tk-hf-tg { margin: 0; }
.tk-hf legend { float: left; width: 100%; }
.tk-hf legend + * { clear: both; }
.tk-homes input[type="search"], .tk-homes select {
	display: block;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 26px 0 0;
	border: 0;
	border-bottom: 1px solid rgba(43, 58, 74, .45);
	background: transparent;
	box-shadow: none;
	font: 400 16px/1.2 var(--hf-sans);
	color: var(--hf-ink);
	-webkit-appearance: none;
	appearance: none;
}
.tk-homes input[type="search"] { padding-right: 0; }
.tk-homes input[type="search"]::placeholder { color: #6f7883; opacity: 1; }
.tk-homes input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.tk-homes select { background: var(--hf-chev) right 4px center / 12px 8px no-repeat; cursor: pointer; text-overflow: ellipsis; }
.tk-homes input[type="search"]:hover, .tk-homes select:hover { border-bottom-color: var(--hf-ink); }
.tk-hf-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.tk-hf-to { font-size: 14px; color: var(--hf-muted); }

/* Status: three square toggles (native checkboxes, styled) */
.tk-hf-toggles { display: flex; }
.tk-hf-tg { position: relative; display: block; cursor: pointer; }
.tk-hf-tg + .tk-hf-tg { margin-left: -1px; }
.tk-hf-tg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tk-hf-tg span {
	display: flex; align-items: center; justify-content: center;
	height: 44px; padding: 0 16px;
	border: 1px solid rgba(43, 58, 74, .45);
	font: 500 13px/1 var(--hf-sans); letter-spacing: .06em; white-space: nowrap;
	color: var(--hf-ink); background: transparent;
	transition: background-color .2s, color .2s;
}
.tk-hf-tg input:checked + span { background: var(--hf-ink); border-color: var(--hf-ink); color: var(--hf-paper); position: relative; z-index: 1; }
.tk-hf-tg:hover span { border-color: var(--hf-ink); }

/* No-JS: the submit button sits at the end of the bar */
.tk-hf-foot { margin-top: 16px; }
.tk-hf.is-js .tk-hf-foot { display: none; }

/* Focus */
.tk-homes :is(input, select, button, a):focus { outline: none; }
.tk-homes :is(input[type="search"], select, button, a):focus-visible { outline: 2px solid var(--hf-ink); outline-offset: 3px; }
.tk-hf-tg input:focus-visible + span { outline: 2px solid var(--hf-ink); outline-offset: 3px; z-index: 2; }
.tk-homes .tk-card-link:focus-visible { outline-offset: 4px; }

/* Buttons (ink on paper) */
.tk-homes .tk-hf-apply, .tk-homes .tk-homes-btn {
	display: inline-block; text-align: center; height: auto; width: auto; float: none;
	min-height: 0; padding: 19px 28px 18px; margin: 0; line-height: 1.2 !important;
	border: 1px solid var(--hf-ink); background: var(--hf-ink); color: var(--hf-paper) !important;
	font: 600 13px/1.2 var(--hf-sans) !important; letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
	box-shadow: none; cursor: pointer; transition: background-color .2s;
}
.tk-homes .tk-hf-apply:hover, .tk-homes .tk-homes-btn:hover { background: var(--hf-ink-d); }
.tk-homes .tk-hf-apply::before, .tk-homes .tk-hf-apply::after, .tk-homes .tk-homes-btn::before, .tk-homes .tk-homes-btn::after { display: none !important; }
.tk-homes input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1) brightness(.6); }

/* ── Results row ────────────────────────────────────────────────────────── */
.tk-hr-meta { display: flex; align-items: flex-end; gap: 8px 24px; flex-wrap: wrap; margin: clamp(32px, 4vw, 48px) 0 clamp(24px, 3vw, 36px); }
.tk-hr-count { margin: 0; font: 400 clamp(28px, 2.4vw, 36px)/1 var(--hf-serif); color: var(--hf-ink); }
.tk-hr-clear {
	font: 500 14px/1.2 var(--hf-sans); color: var(--hf-ink) !important;
	text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; padding-bottom: 3px;
}
.tk-hr-clear:hover { text-decoration-color: var(--hf-ochre-d); }
.tk-hr-sort { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tk-hr-sort label { margin: 0; }
.tk-hr-sort select { width: auto; min-width: 190px; height: 40px; }

/* Grid: the shared .tk-cards-3 (3 / 2 / 1) from screen.css */

/* ── Empty state ────────────────────────────────────────────────────────── */
.tk-homes-empty { padding: clamp(48px, 7vw, 96px) 0 clamp(24px, 4vw, 48px); border-top: 1px solid var(--hf-line); max-width: 640px; }
.tk-homes-empty-h { margin: 0 0 18px; font: 300 clamp(40px, 4.6vw, 64px)/1 var(--hf-serif) !important; letter-spacing: -0.01em; color: var(--hf-ink) !important; }
.tk-homes-empty-h em { font-style: italic; color: var(--hf-ochre-d); }
.tk-homes-empty p { margin: 0; font-size: 18px; line-height: 1.65; color: var(--tk-body, #3a4552); }
.tk-homes-empty .tk-homes-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }

/* ── Sheet mode (phones and small tablets) ──────────────────────────────── */
@media (max-width: 1099px) {
	.tk-hf-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tk-hf-q, .tk-hf-area, .tk-hf-price, .tk-hf-status { grid-column: 1 / -1; }

	.tk-hf.is-js { padding-top: 12px; padding-bottom: 12px; }
	.tk-hf.is-js .tk-hf-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
	.tk-hf-toggle {
		display: inline-flex; align-items: center; gap: 4px;
		height: 44px; padding: 0 20px; margin: 0;
		border: 1px solid var(--hf-ink); background: transparent; color: var(--hf-ink);
		font: 600 13px/1 var(--hf-sans); letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
	}
	.tk-hf-toggle::before {
		content: ""; width: 16px; height: 12px; margin-right: 8px;
		background: linear-gradient(currentColor, currentColor) 0 0 / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) 0 50% / 70% 1px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 40% 1px no-repeat;
	}
	.tk-hf-barcount { margin: 0; font: 400 24px/1 var(--hf-serif); color: var(--hf-ink); }

	.tk-hf.is-js .tk-hf-sheet {
		display: none;
		position: fixed; top: var(--tk-hf-top, 0px); right: 0; bottom: 0; z-index: 100000; /* below the fixed site header (the section is its own stacking context) */
		width: min(440px, 100%);
		background: var(--hf-paper);
		overflow-y: auto; overscroll-behavior: contain;
		box-shadow: 0 0 0 100vmax rgba(31, 42, 54, .45);
		flex-direction: column;
	}
	.tk-hf.is-js.is-open .tk-hf-sheet { display: flex; }
	.tk-hf.is-js .tk-hf-head {
		display: flex; align-items: center; justify-content: space-between;
		padding: 20px 24px; border-bottom: 1px solid var(--hf-line);
	}
	.tk-hf-title { margin: 0; font: 400 32px/1 var(--hf-serif) !important; color: var(--hf-ink) !important; }
	.tk-hf-close { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 -10px 0 0; padding: 0; border: 0; background: none; color: var(--hf-ink); cursor: pointer; }
	.tk-hf.is-js .tk-hf-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; padding: 28px 24px 32px; flex: 1 0 auto; }
	.tk-hf.is-js .tk-hf-foot {
		display: block; position: sticky; bottom: 0; margin: 0;
		padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
		background: var(--hf-paper); border-top: 1px solid var(--hf-line);
	}
	.tk-hf.is-js .tk-hf-apply { width: 100%; }
	.tk-hf-toggles { display: grid; grid-template-columns: repeat(3, 1fr); }
	html.tk-hf-locked, html.tk-hf-locked body { overflow: hidden !important; }

	.tk-hr-meta { margin-top: 20px; }
	.tk-hf.is-js ~ .tk-hr-meta .tk-hr-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 599px) {
	.tk-hr-sort { margin-left: 0; width: 100%; }
	.tk-hr-sort select { flex: 1; min-width: 0; }
	.tk-hf.is-js .tk-hf-sheet { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
	.tk-homes *, .tk-homes *::before { transition: none !important; }
}
