/**
 * Front-end styles for [landbrokermls].
 *
 * Every colour, font, and size comes from custom properties that the shortcode
 * sets inline from the plugin settings, so the admin screen controls the look
 * without this file changing.
 */

.lbm-listings {
	font-family: var(--lbm-font, inherit);
	font-size: var(--lbm-size, 16px);
	color: var(--lbm-text, #1c1c1c);
}

.lbm-listings *,
.lbm-listings *::before,
.lbm-listings *::after {
	box-sizing: border-box;
}

.lbm-heading {
	margin: 0 0 1rem;
	font-size: 1.5em;
	line-height: 1.25;
	color: inherit;
}

.lbm-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(var(--lbm-cols, 3), minmax(0, 1fr));
}

.lbm-listings--list .lbm-grid {
	grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 900px) {
	.lbm-grid {
		grid-template-columns: repeat(min(var(--lbm-cols, 3), 2), minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.lbm-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Card */

.lbm-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--lbm-card-bg, #fff);
	border: 1px solid var(--lbm-border, #e5e7eb);
	border-radius: var(--lbm-radius, 10px);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.lbm-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.lbm-card {
		transition: none;
	}

	.lbm-card:hover {
		transform: none;
	}
}

.lbm-listings--list .lbm-card {
	flex-direction: row;
}

.lbm-listings--list .lbm-card__media {
	flex: 0 0 34%;
}

@media (max-width: 600px) {
	.lbm-listings--list .lbm-card {
		flex-direction: column;
	}

	.lbm-listings--list .lbm-card__media {
		flex: none;
	}
}

/* Photo */

.lbm-card__media {
	position: relative;
	display: block;
	aspect-ratio: var(--lbm-ratio, 4 / 3);
	overflow: hidden;
	background: #f1f1f1;
}

.lbm-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lbm-badge {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	padding: 0.2em 0.6em;
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #fff;
	background: rgba(17, 17, 17, 0.82);
	border-radius: calc(var(--lbm-radius, 10px) / 2);
}

.lbm-badge--soon {
	background: var(--lbm-primary, #2f6b3c);
}

/* Card text */

/* The column gap is the only thing that spaces these children apart. Children must
   not add their own vertical margins or the two stack and the card reads loose. */
.lbm-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.3rem;
	padding: 0.9rem 1rem 1rem;
}

.lbm-card__title {
	margin: 0;
	font-size: 1.05em;
	line-height: 1.35;
	color: inherit;
}

.lbm-card__title a {
	color: inherit;
	text-decoration: none;
}

.lbm-card__title a:hover,
.lbm-card__title a:focus {
	color: var(--lbm-primary, #2f6b3c);
	text-decoration: underline;
}

.lbm-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: baseline;
	margin: 0;
}

.lbm-price {
	font-size: 1.1em;
	font-weight: 700;
	color: var(--lbm-primary, #2f6b3c);
}

.lbm-acres {
	font-weight: 600;
}

.lbm-sep {
	color: var(--lbm-muted, #6b7280);
}

.lbm-card__location {
	margin: 0;
	font-size: 0.9em;
	color: var(--lbm-muted, #6b7280);
}

.lbm-card__excerpt {
	margin: 0;
	font-size: 0.9em;
	line-height: 1.5;
	color: var(--lbm-muted, #6b7280);
}

.lbm-card__cta {
	margin-top: auto;
	padding-top: 0.2rem;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--lbm-primary, #2f6b3c);
	text-decoration: none;
}

.lbm-card__cta:hover,
.lbm-card__cta:focus {
	text-decoration: underline;
}

/* Footer */

.lbm-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	align-items: baseline;
	justify-content: space-between;
	margin: 1.1rem 0 0;
	font-size: 0.9em;
}

.lbm-footer__all {
	font-weight: 600;
	color: var(--lbm-primary, #2f6b3c);
}

.lbm-footer__credit {
	color: var(--lbm-muted, #6b7280);
}

.lbm-footer__credit a {
	color: inherit;
	text-decoration: underline;
}

.lbm-error {
	padding: 0.75rem 1rem;
	color: #7a2c2c;
	background: #fdf1f1;
	border: 1px solid #f0c7c7;
	border-radius: 6px;
}

/* Search and filter bar */

.lbm-filters {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 0.9rem 1rem;
	margin: 0 0 1.1rem;
	background: var(--lbm-card-bg, #fff);
	border: 1px solid var(--lbm-border, #e5e7eb);
	border-radius: var(--lbm-radius, 10px);
}

.lbm-filters__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: flex-end;
}

.lbm-field {
	display: flex;
	flex: 1 1 8rem;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.lbm-field--grow {
	flex: 3 1 14rem;
}

.lbm-field--actions {
	flex: 0 0 auto;
	flex-direction: row;
	gap: 0.5rem;
	align-items: center;
}

.lbm-field__label {
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--lbm-muted, #6b7280);
}

.lbm-filters input,
.lbm-filters select {
	width: 100%;
	max-width: 100%;
	padding: 0.45em 0.6em;
	font-family: inherit;
	font-size: 0.95em;
	color: var(--lbm-text, #1c1c1c);
	background: var(--lbm-card-bg, #fff);
	border: 1px solid var(--lbm-border, #e5e7eb);
	border-radius: calc(var(--lbm-radius, 10px) / 2);
}

.lbm-filters input:focus,
.lbm-filters select:focus {
	border-color: var(--lbm-primary, #2f6b3c);
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--lbm-primary, #2f6b3c) 30%, transparent);
}

.lbm-btn {
	display: inline-block;
	padding: 0.5em 1.1em;
	font-family: inherit;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.4;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	background: var(--lbm-primary, #2f6b3c);
	border: 1px solid var(--lbm-primary, #2f6b3c);
	border-radius: calc(var(--lbm-radius, 10px) / 2);
}

.lbm-btn:hover,
.lbm-btn:focus {
	color: #fff;
	filter: brightness(0.93);
}

.lbm-btn--reset,
.lbm-btn--page {
	color: var(--lbm-text, #1c1c1c);
	background: transparent;
	border-color: var(--lbm-border, #e5e7eb);
}

.lbm-btn--reset:hover,
.lbm-btn--reset:focus,
.lbm-btn--page:hover,
.lbm-btn--page:focus {
	color: var(--lbm-text, #1c1c1c);
	border-color: var(--lbm-primary, #2f6b3c);
	filter: none;
}

@media (max-width: 600px) {
	.lbm-field,
	.lbm-field--grow {
		flex: 1 1 100%;
	}

	.lbm-field--actions {
		flex: 1 1 100%;
	}

	.lbm-field--actions .lbm-btn {
		flex: 1;
		text-align: center;
	}
}

/* Pagination and empty state */

.lbm-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: center;
	margin-top: 1.1rem;
}

.lbm-pagination__status {
	font-size: 0.9em;
	color: var(--lbm-muted, #6b7280);
}

.lbm-empty {
	padding: 1.5rem 1rem;
	margin: 0;
	font-size: 0.95em;
	color: var(--lbm-muted, #6b7280);
	text-align: center;
	background: var(--lbm-card-bg, #fff);
	border: 1px dashed var(--lbm-border, #e5e7eb);
	border-radius: var(--lbm-radius, 10px);
}
