/* =========================================================
   Property Search (v1.18.0): inc/property-search.php
     - .ich-search-panel   filter panel (Search Listings + Map Search)
     - .ich-page--search   Search Listings page (page-property-search.php)
   Cards, buttons, banner, section heading and closing band come from
   home.css and featured-listings.css (loaded on these pages too).
   ========================================================= */

/* ---- Search Listings: shorter banner, so the filters sit near the top ---- */
.ich-page--search .ich-hero--page{ min-height: clamp(260px, 36vh, 360px); }
.ich-page--search .ich-hero--page .ich-hero-inner{ padding-top: 64px; padding-bottom: clamp(36px, 5vh, 56px); }

.ich-search{
	background: var(--ich-card);
	border-bottom: 1px solid var(--ich-line);
	padding: 28px 0 30px;
	font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Homes / Office Suites switch ---- */
.ich-search-types{
	display: flex;
	gap: 28px;
	margin: 0 0 20px;
	border-bottom: 1px solid var(--ich-line);
}
.ich-home .ich-search-types a{
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-bottom: -1px;
	color: var(--ich-ink-soft);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}
.ich-home .ich-search-types a:hover{ color: var(--ich-ink); }
.ich-home .ich-search-types a.is-current{ color: var(--ich-accent); border-bottom-color: var(--ich-brass); }
.ich-home .ich-search-types a:focus-visible{ outline: 2px solid var(--ich-accent); outline-offset: 2px; }

/* ---- Filters ---- */
.ich-search-grid{
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 16px 18px;
}
.ich-search-field--q{ grid-column: span 2; }
.ich-search-more{ margin-top: 16px; }
.ich-search-more[hidden],
.ich-search-grid[hidden]{ display: none; }
.ich-search-field{ min-width: 0; }
.ich-home .ich-search-field label{
	display: block;
	margin: 0 0 6px;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ich-ink-soft);
}
.ich-home .ich-search-field input,
.ich-home .ich-search-field select{
	box-sizing: border-box;
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 14px;
	font: inherit;
	font-size: 1rem; /* 16px: phones don't zoom in on focus */
	color: var(--ich-ink);
	background: var(--ich-bg);
	border: 1px solid var(--ich-line);
	border-radius: 0;
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ich-home .ich-search-field select{
	appearance: none;
	-webkit-appearance: none;
	padding-right: 38px;
	background-image: linear-gradient(45deg, transparent 50%, var(--ich-ink-soft) 50%), linear-gradient(135deg, var(--ich-ink-soft) 50%, transparent 50%);
	background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	text-overflow: ellipsis;
}
.ich-home .ich-search-field input:hover,
.ich-home .ich-search-field select:hover{ border-color: var(--ich-accent-soft); }
.ich-home .ich-search-field input:focus,
.ich-home .ich-search-field select:focus{
	outline: 2px solid var(--ich-accent);
	outline-offset: 0;
	border-color: var(--ich-accent);
	background-color: #fff;
}
.ich-home .ich-search-field input::placeholder{ color: #8A8F95; }
/* A filter that is switched on reads as "on" */
.ich-home .ich-search-field select.is-set{ border-color: var(--ich-accent); background-color: #fff; }

.ich-search-actions{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 22px;
	margin-top: 20px;
}
.ich-home .ich-search-actions .ich-btn{ border: 0; cursor: pointer; font-family: inherit; min-width: 140px; }
.ich-home .ich-search-clear{
	color: var(--ich-accent);
	font-size: 0.92rem;
	font-weight: 500;
	text-decoration: none;
	border-bottom: 1px solid var(--ich-accent-soft);
}
.ich-home .ich-search-clear:hover{ color: var(--ich-ink); border-color: var(--ich-ink); }
.ich-search-more-toggle{
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 18px;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--ich-accent);
	background: transparent;
	border: 1px solid var(--ich-line);
	cursor: pointer;
}
.ich-search-more-toggle[hidden]{ display: none; }
.ich-search-more-toggle::after{ content: ""; width: 7px; height: 7px; margin-top: -4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.15s ease; }
.ich-search-more-toggle[aria-expanded="true"]::after{ margin-top: 4px; transform: rotate(-135deg); }
.ich-search-more-toggle:focus-visible{ outline: 2px solid var(--ich-accent); outline-offset: 2px; }
.ich-search-more-count{
	min-width: 20px;
	padding: 1px 6px;
	border-radius: 10px;
	background: var(--ich-accent);
	color: #fff;
	font-size: 0.75rem;
	line-height: 18px;
	text-align: center;
}

/* ---- Results ---- */
.ich-search-results{ padding-top: clamp(40px, 6vw, 72px); }
.ich-search-head{ margin-bottom: 28px; }
.ich-search-empty{ margin-top: 4px; }

@media (max-width: 760px){
	.ich-search{ padding: 20px 0 24px; }
	.ich-search-types{ margin-bottom: 16px; }
	.ich-search-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
	.ich-search-field--q,
	.ich-search-field--community,
	.ich-search-field--building{ grid-column: 1 / -1; }
	.ich-search-actions{ gap: 12px; }
	.ich-search-actions > *{ flex: 1 1 auto; }
	.ich-home .ich-search-actions .ich-btn{ text-align: center; }
	.ich-home .ich-search-clear{ flex: 0 0 100%; text-align: center; border: 0; padding: 6px 0; text-decoration: underline; text-underline-offset: 4px; }
	.ich-search-panel--map .ich-search-grid[hidden] + .ich-search-more[hidden] + .ich-search-actions{ margin-top: 0; }
}

@media (prefers-reduced-motion: reduce){
	.ich-search-more-toggle::after{ transition: none; }
}

@media print{
	.ich-search{ display: none; }
}
