/*
 * The listing surface: the status chips on a card, the way into a building's
 * units, and the small bar under the grid that offers the search on a map or
 * saved for later.
 *
 * Hand-written rather than Tailwind, because main.css is a compiled build and
 * the build toolchain is not on this host. Everything here is namespaced to the
 * card and the archive toolbar and reads its colours from the tokens main.css
 * defines, so it moves with the palette and touches nothing it does not own.
 *
 * @package Duncan
 */

/* ── Status chips on the card ───────────────────────────────────────────── */

/*
 * The base chip (main.css) is a translucent white pill that sits on the
 * photograph. The three below are the ones that carry a claim about the
 * listing rather than a label, so each is a solid colour: a buyer scanning the
 * grid reads a status faster than a word.
 *
 * "Managed by Duncan" keeps its light-green treatment (management.css). "New"
 * is the solid green mark, so the two never read as the same thing; at most one
 * of new/reduced is ever printed, and under-offer can sit beside either.
 */
.duncan-entry__chip--new {
	background: var(--brand-700, #0f5132);
	color: #fff;
}

.duncan-entry__chip--reduced {
	background: #9a1b1b;
	color: #fff;
}

.duncan-entry__chip--offer {
	background: var(--ink-900, #14181a);
	color: #fff;
}

/* ── Into the building ──────────────────────────────────────────────────── */

/*
 * The card is one stretched link (the .duncan-entry__link:after overlay). This
 * is the exception a tapable child needs: lifted above the overlay so a tap
 * lands on it and opens the units table rather than the listing top.
 *
 * It shares the .duncan-entry__managed-note type (management.css) and lays out
 * as a row — the count on the left, the way in on the right — so it reads like
 * a footer to the card rather than a second line of the price block.
 */
.duncan-entry__units-link {
	position: relative;
	z-index: 11;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	text-decoration: none;
}

.duncan-entry__units-link:hover .duncan-entry__units-link-go {
	text-decoration: underline;
}

.duncan-entry__units-link-go {
	color: var(--brand-600, #14673f);
	font-weight: 700;
	white-space: nowrap;
}

.duncan-entry__units-link-go::after {
	content: "→";
	margin-left: 0.25rem;
}

/* ── The bar under the grid ─────────────────────────────────────────────── */

.duncan-searchbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.duncan-searchbar__map,
.duncan-savesearch__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	border: 1px solid var(--sand-200, #e8e4dd);
	border-radius: 9999px;
	background: #fff;
	padding: 0.4rem 0.9rem;
	color: var(--ink-800, #22282b);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
}

.duncan-searchbar__map:hover,
.duncan-savesearch__btn:hover {
	border-color: var(--brand-600, #14673f);
	color: var(--brand-700, #0f5132);
	text-decoration: none;
}

.duncan-searchbar__map .duncan-navlink__icon {
	width: 15px;
	height: 15px;
}

/* ── Save this search ───────────────────────────────────────────────────── */

.duncan-savesearch {
	position: relative;
}

/* The default disclosure triangle, gone: the pill is the whole control. */
.duncan-savesearch > summary {
	list-style: none;
}

.duncan-savesearch > summary::-webkit-details-marker {
	display: none;
}

.duncan-savesearch[open] > .duncan-savesearch__btn {
	border-color: var(--brand-600, #14673f);
	color: var(--brand-700, #0f5132);
}

.duncan-savesearch__panel {
	margin-top: 0.5rem;
	width: min(100%, 34rem);
	border: 1px solid var(--sand-200, #e8e4dd);
	border-radius: 12px;
	background: #fff;
	padding: 1rem;
	box-shadow: 0 8px 24px -14px rgba(16, 24, 40, 0.3);
}

.duncan-savesearch__lead {
	margin-bottom: 0.75rem;
	color: var(--ink-600, #55605f);
	font-size: 13px;
	line-height: 1.5;
}

.duncan-savesearch__lead strong {
	color: var(--ink-900, #14181a);
}

.duncan-savesearch__form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.duncan-savesearch__form .input {
	flex: 1 1 12rem;
}

.duncan-savesearch__ok {
	margin-top: 0.6rem;
	color: var(--brand-700, #0f5132);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}

.duncan-savesearch__err {
	margin-top: 0.6rem;
	color: #9a1b1b;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}
