/**
 * Property Card Styles (§3.2).
 *
 * SINGLE SOURCE OF TRUTH for `.maxer-search-card`. Every surface that shows a
 * property tile renders `templates/property-card.php` and loads this file:
 * the search map, /my-account/ saved homes, the admin Clients screen, and the
 * "Similar homes" strip on property detail. Do not restyle these classes in
 * another stylesheet — the tiles are required to stay pixel-identical across
 * all four surfaces, so any change belongs here.
 *
 * The design tokens below are declared on the card itself (not :root) so the
 * card renders the same whether or not it sits inside `.maxer-search-app`,
 * which declares its own same-named tokens for the surrounding map chrome.
 */

:root {
	--ms-accent: #0056b3;
	--ms-accent-soft: rgba(0, 86, 179, 0.08);
}

.maxer-search-card {
	--ms-surface: #fff;
	--ms-radius: 12px;
	--ms-shadow-card: 0 8px 20px rgba(0, 0, 0, 0.15);
	--ms-shadow-card-hover: 0 16px 30px rgba(0, 0, 0, 0.15);
	--ms-ink: #111116;
	--ms-muted: #596b82;
	--ms-attr: #7c8798;
	--ms-line: #d1d1d5;
	--ms-outline-hover: 2.4px;

	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--ms-surface);
	border: 1px solid var(--ms-line);
	border-radius: var(--ms-radius);
	box-shadow: var(--ms-shadow-card);
	transition: box-shadow 0.15s ease, outline 0.15s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
	/* Pinned rather than inherited: the theme's base size differs from surface
	   to surface and the tile must not resize with it. */
	font-size: 16px;
	line-height: 1.4;
	color: var(--ms-ink);
	text-align: left;
	box-sizing: border-box;
}

.maxer-search-card *,
.maxer-search-card *::before,
.maxer-search-card *::after {
	box-sizing: border-box;
}

.maxer-search-card:hover,
.maxer-search-card.is-hovered {
	outline: var(--ms-outline-hover) solid var(--ms-ink);
	outline-offset: calc(-1 * var(--ms-outline-hover));
	box-shadow: var(--ms-shadow-card-hover);
}

.maxer-search-card-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	color: inherit;
	text-decoration: none;
}

/* The card clips its own corners per-region rather than with a blanket
   `overflow: hidden`, which would swallow a tall tag list on saved homes. */
.maxer-search-card-media {
	position: relative;
	aspect-ratio: 19 / 10;
	background: #e9e9ec;
	overflow: hidden;
	border-radius: calc(var(--ms-radius) - 1px) calc(var(--ms-radius) - 1px) 0 0;
}

.maxer-search-card > :last-child {
	border-radius: 0 0 calc(var(--ms-radius) - 1px) calc(var(--ms-radius) - 1px);
}

.maxer-search-card-photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
}

.maxer-search-card-photo--empty {
	width: 100%;
	height: 100%;
	background: #e9e9ec;
}

.maxer-search-card-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	max-width: calc(100% - 62px);
	padding: 5px 12px;
	background: #fff;
	border-radius: 999px;
	color: var(--ms-ink);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.maxer-search-card-badge[hidden] {
	display: none;
}

.maxer-search-card-dots {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 5px 8px;
	border-radius: 999px;
	background: rgba(17, 17, 22, 0.45);
}

.maxer-search-card-dots:empty {
	display: none;
}

.maxer-search-card-dot {
	width: 5px;
	height: 5px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.55);
}

.maxer-search-card-dot.is-active {
	background: #fff;
}

.maxer-search-card-body {
	padding: 10px 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: left;
}

/* Text rules are written as `.maxer-search-card p.<class>` so they outrank the
   `.maxer-search-app p` reset the map shell applies to everything inside it. */
.maxer-search-card p.maxer-search-card-price {
	margin: 0;
	padding: 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.3px;
	color: var(--ms-ink);
}

.maxer-search-card p.maxer-search-card-specs {
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.4;
	color: var(--ms-ink);
}

.maxer-search-card-specs b {
	font-weight: 700;
}

.maxer-search-card-specs .maxer-search-sep {
	margin: 0 5px;
	color: var(--ms-line);
}

.maxer-search-card p.maxer-search-card-address {
	margin: 6px 0 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.35;
	color: var(--ms-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.maxer-search-card p.maxer-search-card-attr {
	margin: 8px 0 0;
	padding: 0;
	font-size: 11px;
	line-height: 1.35;
	color: var(--ms-attr);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.maxer-search-card-attr:empty {
	display: none;
}

/* Heart button */
.maxer-search-fav,
.maxer-search-card > [data-maxer-fav] {
	position: absolute;
	top: 6px;
	right: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	z-index: 2;
	cursor: pointer;
}

/* maxer-idx.css draws a bordered pill + ♡ glyph for generic `[data-maxer-fav]`
   buttons. The card heart is an SVG overlay, so cancel the glyph here. */
.maxer-search-fav::before,
.maxer-search-fav::after {
	content: none;
}

.maxer-search-fav:focus:not(:focus-visible),
[data-maxer-fav]:focus:not(:focus-visible) {
	outline: none;
	box-shadow: none;
}

.maxer-search-fav:focus-visible,
[data-maxer-fav]:focus-visible {
	outline: 2px solid #0056b3;
	outline-offset: 2px;
}

/* Scoped to the card so it outranks the map shell's generic 18px
   `.maxer-search-app .maxer-search-icon` sizing. */
.maxer-search-card .maxer-search-fav .maxer-search-icon,
.maxer-search-card .maxer-search-fav svg {
	width: 30px;
	height: 30px;
	fill: rgba(17, 17, 22, 0.82);
	stroke: #fff;
	stroke-width: 2.6;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
	transition: transform 0.15s ease, fill 0.15s ease;
}

.maxer-search-card .maxer-search-fav:hover .maxer-search-icon,
.maxer-search-card .maxer-search-fav:hover svg {
	transform: scale(1.1);
	fill: rgba(17, 17, 22, 0.95);
}

.maxer-search-card .maxer-search-fav.is-saved .maxer-search-icon,
.maxer-search-card .maxer-search-fav.is-saved svg,
.maxer-search-card .maxer-search-fav.is-saved svg path {
	fill: #d13b3b;
	stroke: #d13b3b;
}

/* Extras: notes, tags, provenance */
.maxer-card-extras {
	padding: 10px 12px 14px;
	border-top: 1px solid var(--ms-line);
	background: #fbfbfc;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 13px;
}

.maxer-card-provenance {
	font-size: 12px;
	color: var(--ms-muted, #6b7785);
	font-style: italic;
}

.maxer-card-notes-wrap {
	position: relative;
}

.maxer-card-notes {
	width: 100%;
	min-height: 60px;
	padding: 6px 8px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.4;
	resize: vertical;
	box-sizing: border-box;
	font-family: inherit;
}

.maxer-card-notes:focus {
	border-color: #0056b3;
	outline: none;
	box-shadow: 0 0 0 1px #0056b3;
}

.maxer-card-saved-flash {
	position: absolute;
	top: 6px;
	right: 8px;
	font-size: 11px;
	font-weight: 600;
	color: #007017;
	background: rgba(255, 255, 255, 0.9);
	padding: 2px 6px;
	border-radius: 4px;
	pointer-events: none;
}

.maxer-card-tags-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

/* `display: contents` lifts the chips out of their own flex line so they wrap
   inline with the "Add tag" input. Without it the chip list is a single
   block-level flex item and the input is pushed onto a second row as soon as
   a couple of tags are present. */
.maxer-card-tag-chips {
	display: contents;
}

.maxer-tag-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	background: #eef2f6;
	border: 1px solid #d0d7de;
	border-radius: 12px;
	font-size: 12px;
	color: #24292f;
	line-height: 1.2;
}

.maxer-tag-remove {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	color: #656d76;
}

.maxer-tag-remove:hover {
	color: #cf222e;
}

.maxer-card-tag-input {
	flex: 1 1 80px;
	min-width: 80px;
	padding: 3px 8px;
	border: 1px solid #d0d7de;
	border-radius: 12px;
	font-size: 12px;
	box-sizing: border-box;
}

.maxer-card-tag-input:focus {
	border-color: #0056b3;
	outline: none;
}

/* Card grid — shared by saved homes, the Clients screen, and "Similar homes".
   The map has its own fixed two-column grid in search-map.css. */
.maxer-saved-homes-grid,
.maxer-search-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-top: 12px;
	align-items: stretch;
}

/* Tag filter bar */
.maxer-tags-filter-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: 12px 0 16px;
	padding: 8px 12px;
	background: #f6f8fa;
	border: 1px solid #e1e4e8;
	border-radius: 6px;
	font-size: 13px;
}

.maxer-tag-filter-btn {
	background: #fff;
	border: 1px solid #d0d7de;
	border-radius: 12px;
	padding: 4px 10px;
	font-size: 12px;
	cursor: pointer;
	color: #24292f;
	transition: all 0.15s ease;
}

.maxer-tag-filter-btn:hover {
	border-color: #0056b3;
	color: #0056b3;
}

.maxer-tag-filter-btn.is-active {
	background: #0056b3;
	border-color: #0056b3;
	color: #fff;
}
