/**
 * MyListing Vendor Directory — Breeders List
 *
 * Every size and colour is a variable on .mlvd; override those rather than
 * editing the rules below.
 *
 * Selectors are all scoped under .mlvd so they outrank the generic list and
 * typography rules most themes apply to .entry-content. The handful of
 * !important flags are on the load-bearing layout properties only — themes
 * and page builders routinely force display/float/width on list items, and
 * losing those specific declarations is what collapses the grid.
 */

.mlvd {
	/* Palette */
	--mlvd-ink: #1c1c1c;
	--mlvd-muted: #5f6368;
	--mlvd-faint: #a8adb5;
	--mlvd-border: #e2e5e9;
	--mlvd-accent: #2b6cb0;
	--mlvd-star: #f5a623;
	--mlvd-star-off: #d6d9de;
	--mlvd-surface: #fff;

	/* Sizes */
	--mlvd-logo: 100px;
	--mlvd-columns: 3;              /* Overridden inline by the shortcode. */
	--mlvd-name-size: 14pt;
	--mlvd-body-size: 11pt;

	/* Raise to clear a sticky site header. */
	--mlvd-sticky-offset: 0px;

	max-width: 1400px;
	margin: 0 auto;
	color: var(--mlvd-ink);
}

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

/* Heading --------------------------------------------------------------- */
.mlvd .mlvd-heading {
	margin: 0 0 20px;
	font-size: 30pt;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -.01em;
}

/* Controls -------------------------------------------------------------- */
.mlvd .mlvd-controls {
	position: sticky;
	top: var(--mlvd-sticky-offset);
	z-index: 5;
	padding: 14px 0 12px;
	background: var(--mlvd-surface);
	border-bottom: 1px solid var(--mlvd-border);
}

.mlvd .mlvd-search-label {
	display: block;
	margin-bottom: 6px;
	font-size: 11pt;
	font-weight: 600;
	color: var(--mlvd-muted);
}

.mlvd .mlvd-search {
	width: 100%;
	max-width: none;
	padding: 12px 16px;
	font-size: 11pt;
	font-family: inherit;
	line-height: 1.4;
	color: var(--mlvd-ink);
	background: #fafbfc;
	border: 1px solid var(--mlvd-border);
	border-radius: 8px;
}

.mlvd .mlvd-search::placeholder {
	color: var(--mlvd-faint);
	opacity: 1;
	font-weight: 400;
}

.mlvd .mlvd-search:focus {
	background: var(--mlvd-surface);
	outline: 2px solid var(--mlvd-accent);
	outline-offset: 1px;
}

.mlvd .mlvd-alphabet {
	display: flex !important;
	flex-wrap: wrap;
	gap: 2px;
	margin-top: 12px;
}

.mlvd .mlvd-letter {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 5px;
	font-size: 11pt;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	color: var(--mlvd-accent);
	border-radius: 6px;
	transition: background-color .12s ease, color .12s ease;
}

.mlvd .mlvd-letter:hover,
.mlvd .mlvd-letter:focus-visible {
	background: var(--mlvd-accent);
	color: #fff;
}

.mlvd .mlvd-letter.is-empty {
	color: #c9ccd1;
	pointer-events: none;
}

/* Groups ---------------------------------------------------------------- */
.mlvd .mlvd-group {
	padding-top: 28px;
	scroll-margin-top: calc(var(--mlvd-sticky-offset) + 130px);
}

.mlvd .mlvd-group-heading {
	margin: 0 0 16px;
	padding-bottom: 6px;
	font-size: 16pt;
	font-weight: 700;
	letter-spacing: .08em;
	color: var(--mlvd-muted);
	border-bottom: 1px solid var(--mlvd-border);
}

/* Grid ------------------------------------------------------------------ */
.mlvd ul.mlvd-list {
	display: grid !important;
	grid-template-columns: repeat(var(--mlvd-columns, 3), minmax(0, 1fr)) !important;
	gap: 16px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	width: 100%;
}

.mlvd ul.mlvd-list > li.mlvd-item {
	display: flex !important;
	float: none !important;
	width: auto !important;
	align-items: flex-start;
	gap: 14px;
	margin: 0 !important;
	padding: 14px;
	text-align: left;
	list-style: none !important;
	background: var(--mlvd-surface);
	border: 1px solid var(--mlvd-border);
	border-radius: 8px;
	transition: border-color .12s ease, box-shadow .12s ease;
}

.mlvd ul.mlvd-list > li.mlvd-item::before,
.mlvd ul.mlvd-list > li.mlvd-item::marker {
	content: none;
}

.mlvd .mlvd-item:hover {
	border-color: #c8cdd4;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.mlvd img.mlvd-logo {
	flex: 0 0 var(--mlvd-logo);
	display: block;
	width: var(--mlvd-logo) !important;
	height: var(--mlvd-logo) !important;
	max-width: none !important;
	object-fit: cover;
	background: #f1f2f4;
	border: 1px solid var(--mlvd-border);
	border-radius: 6px;
}

.mlvd .mlvd-meta {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start;
	gap: 3px;
	min-width: 0;
	text-align: left;
}

/* Card text ------------------------------------------------------------- */
.mlvd .mlvd-name {
	max-width: 100%;
	font-size: var(--mlvd-name-size);
	font-weight: 700;
	line-height: 1.25;
	color: var(--mlvd-ink);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.mlvd a.mlvd-name:hover,
.mlvd a.mlvd-name:focus-visible {
	color: var(--mlvd-accent);
	text-decoration: underline;
}

.mlvd .mlvd-email,
.mlvd .mlvd-count,
.mlvd .mlvd-rating {
	max-width: 100%;
	font-size: var(--mlvd-body-size);
	line-height: 1.4;
	color: var(--mlvd-muted);
}

.mlvd a.mlvd-email {
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

.mlvd a.mlvd-email:hover {
	text-decoration: underline;
}

.mlvd .mlvd-count strong {
	color: var(--mlvd-ink);
	font-weight: 700;
}

/* Ratings --------------------------------------------------------------- */
.mlvd .mlvd-rating {
	display: flex !important;
	align-items: center;
	gap: 5px;
}

.mlvd .mlvd-stars {
	display: inline-flex;
	letter-spacing: 1px;
	line-height: 1;
}

.mlvd .mlvd-star {
	color: var(--mlvd-star-off);
	font-size: 12pt;
}

.mlvd .mlvd-star.is-full {
	color: var(--mlvd-star);
}

.mlvd .mlvd-star.is-half {
	position: relative;
	color: var(--mlvd-star-off);
}

.mlvd .mlvd-star.is-half::before {
	content: "\2605";
	position: absolute;
	left: 0;
	top: 0;
	width: 50%;
	overflow: hidden;
	color: var(--mlvd-star);
}

.mlvd .mlvd-rating-value {
	font-weight: 700;
	color: var(--mlvd-ink);
}

.mlvd .mlvd-rating--none {
	color: var(--mlvd-faint);
	font-style: italic;
}

/* States ---------------------------------------------------------------- */
.mlvd .mlvd-empty-state {
	padding: 32px 0;
	font-size: 11pt;
	color: var(--mlvd-muted);
}

.mlvd .mlvd-item[hidden],
.mlvd .mlvd-group[hidden] {
	display: none !important;
}

/* Breakpoints ----------------------------------------------------------- */
/* The chosen column count applies on desktop; narrower screens step down so
   cards never get too cramped for a 100px logo plus text beside it. */
@media (max-width: 1000px) {
	.mlvd ul.mlvd-list {
		grid-template-columns: repeat(min(var(--mlvd-columns, 3), 2), minmax(0, 1fr)) !important;
	}
}

@media (max-width: 640px) {
	.mlvd {
		--mlvd-logo: 80px;
	}

	.mlvd ul.mlvd-list {
		grid-template-columns: 1fr !important;
	}

	.mlvd .mlvd-heading {
		font-size: 22pt;
	}

	.mlvd .mlvd-letter {
		min-width: 28px;
		height: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mlvd * {
		transition: none !important;
	}
}
