/*
 * The listing card: bh_render_listing_card() (inc/listing-card.php) enqueues this
 * file (handle bh-listing-card) on every page that prints a card: home page
 * Featured listings, /listings/, town pages, Similar homes.
 * Uses only theme.json tokens, with fallbacks so a card never renders unstyled.
 */

.bh-property-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; list-style: none; margin: 0; padding: 0; }
.bh-property-grid > li { display: flex; min-width: 0; }
.bh-card {
	position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0;
	border-radius: var(--wp--custom--radius-lg, 6px);
	background: var(--wp--preset--color--white);
	box-shadow: 0 0 0 1px var(--wp--preset--color--line);
	transition: box-shadow var(--wp--custom--duration, 300ms) var(--wp--custom--ease, ease);
}
.bh-card:hover { box-shadow: 0 0 0 1px var(--wp--preset--color--stone), var(--wp--preset--shadow--card); }
.bh-card:has(.bh-card__link:focus-visible) { box-shadow: 0 0 0 2px var(--wp--preset--color--accent); }
.bh-card.is-selected { box-shadow: 0 0 0 2px var(--wp--preset--color--accent), var(--wp--preset--shadow--card); }
.bh-card__media {
	position: relative; aspect-ratio: 3 / 2; overflow: hidden;
	border-radius: var(--wp--custom--radius-lg, 6px) var(--wp--custom--radius-lg, 6px) 0 0;
	background: var(--wp--preset--color--linen);
}
.bh-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--wp--custom--ease, ease); }
.bh-card:hover .bh-card__media img { transform: scale(1.04); }
/* Photo browsing (assets/js/card-photos.js): photos 2–5 sit over the featured
   image and fade in; bars at the bottom show which one is on. Mouse only. */
.bh-card__media .bh-card__alt { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.bh-card__media .bh-card__alt.is-on { opacity: 1; }
.bh-card__dots {
	position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2;
	display: flex; gap: 4px;
	opacity: 0; pointer-events: none;
	transition: opacity 200ms ease;
}
.bh-card__dots i { flex: 1; height: 2px; border-radius: 1px; background: color-mix(in srgb, var(--wp--preset--color--light) 45%, transparent); box-shadow: 0 0 2px color-mix(in srgb, var(--wp--preset--color--primary) 30%, transparent); }
.bh-card__dots i.is-on { background: var(--wp--preset--color--light); }
@media (hover: hover) and (pointer: fine) {
	.bh-card--photos:hover .bh-card__dots { opacity: 1; }
	/* No zoom while browsing photos; single-photo cards keep it. */
	.bh-card--photos:hover .bh-card__media img { transform: none; }
}
/* No photo (v1): linen, a thin house outline, the address and the town. */
.bh-card__fallback {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	padding: 48px 20px 20px;
	background: var(--wp--preset--color--linen);
	text-align: center;
	color: var(--wp--preset--color--slate);
}
.bh-card__fallback svg { margin-bottom: 8px; color: var(--wp--preset--color--accent); opacity: .8; }
.bh-card__fallback b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 1.0625rem/1.25 var(--wp--preset--font-family--display); color: var(--wp--preset--color--primary); }
.bh-card__fallback span { font-size: 0.8125rem; }
.bh-card__fallback small { margin-top: 6px; font-size: 0.6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.bh-card__status {
	position: absolute; top: 14px; left: 14px; z-index: 2;
	padding: 7px 10px; border-radius: 2px;
	background: color-mix(in srgb, var(--wp--preset--color--light) 95%, transparent);
	font: 700 0.65625rem/1 var(--wp--preset--font-family--body); letter-spacing: .1em; text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}
.bh-card__status--soon { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--white); }
.bh-card__status--pending { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--light); }
.bh-card__status--sold { background: var(--wp--preset--color--dark); color: var(--wp--preset--color--accent-light); }
.bh-card__fav {
	position: absolute; top: 10px; right: 10px; z-index: 3;
	display: grid; place-items: center; width: var(--wp--custom--tap, 44px); height: var(--wp--custom--tap, 44px); padding: 0;
	border: 0; border-radius: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--light) 95%, transparent);
	color: var(--wp--preset--color--primary);
	box-shadow: 0 1px 2px color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
	cursor: pointer;
	transition: transform var(--wp--custom--duration, 300ms) var(--wp--custom--ease, ease), background-color var(--wp--custom--duration, 300ms);
}
.bh-card__fav[hidden] { display: none !important; }
.bh-card__fav:hover { transform: scale(1.06); background: var(--wp--preset--color--white); }
.bh-card__fav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: fill var(--wp--custom--duration, 300ms), stroke var(--wp--custom--duration, 300ms); }
.bh-card__fav[aria-pressed="true"] svg { fill: var(--wp--preset--color--accent); stroke: var(--wp--preset--color--accent); }
.bh-card__fav.is-pop svg { animation: bhFavPop 320ms var(--wp--custom--ease, ease); }
@keyframes bhFavPop { 40% { transform: scale(1.3); } }

.bh-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 18px; }
.bh-card__price {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
	font: 400 1.6875rem/1.15 var(--wp--preset--font-family--display); letter-spacing: -.01em; font-variant-numeric: lining-nums;
	color: var(--wp--preset--color--primary);
}
.bh-card__price small { font: 500 var(--wp--preset--font-size--small)/1 var(--wp--preset--font-family--body); letter-spacing: 0; color: var(--wp--preset--color--slate); }
.bh-card__pre { align-self: center; font: 600 var(--wp--preset--font-size--x-small)/1 var(--wp--preset--font-family--body); letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.bh-card__title { margin-top: 8px !important; font: 600 1rem/1.35 var(--wp--preset--font-family--body); letter-spacing: 0; color: var(--wp--preset--color--primary); }
.bh-card__link { color: inherit; text-decoration: none; }
.bh-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--wp--custom--radius-lg, 6px); }
.bh-card__link:focus-visible { outline: none; }
.bh-card:hover .bh-card__link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.bh-card__where { margin-top: 2px !important; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--slate); }
.bh-card__facts {
	display: flex; flex-wrap: wrap; gap: 4px 0;
	margin: 16px 0 0; padding: 14px 0 0; list-style: none;
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--body);
}
/* Every item carries its divider 12px to its left. The list is pulled left
   by 25px and that strip is clipped, so no row starts with a divider. */
.bh-card__facts { margin-left: -25px; padding-left: 0; clip-path: inset(0 0 0 25px); }
.bh-card__facts li { position: relative; display: inline-flex; align-items: baseline; gap: 4px; padding-left: 25px; }
.bh-card__facts li::before { content: ""; position: absolute; left: 12px; top: 50%; width: 1px; height: 12px; margin-top: -6px; background: var(--wp--preset--color--stone); }
.bh-card__facts b { font-weight: 700; color: var(--wp--preset--color--primary); }
.bh-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: auto; padding-top: 14px; font-size: 0.8125rem; }
.bh-card__oh { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--wp--preset--color--accent); }
.bh-card__oh svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.bh-card__meta { color: var(--wp--preset--color--muted); }
.bh-card__side { font-size: 0.75rem; font-style: italic; color: var(--wp--preset--color--slate); }
.bh-card__sample { font-size: 0.6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--wp--preset--color--muted); }


/* Toast (favorites) */
.bh-toast {
	position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: var(--z-toast);
	display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
	padding: 12px 18px; border-radius: var(--wp--custom--radius-lg, 6px);
	background: var(--wp--preset--color--primary); color: var(--wp--preset--color--light);
	box-shadow: var(--wp--preset--shadow--search);
	font: 500 var(--wp--preset--font-size--small)/1.4 var(--wp--preset--font-family--body);
	transform: translateX(-50%);
}

@media (max-width: 991px) {
	.bh-property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
	.bh-property-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
	.bh-card__media img, .bh-card:hover .bh-card__media img { transform: none; }
	.bh-card__media .bh-card__alt, .bh-card__dots { transition: none; }
}
