/*
 * MRC Directory — a theme-neutral default design.
 *
 * This file used to be structure-only, on the principle that the brand's theme
 * supplies every pixel of appearance. In practice a brand that has not built an
 * Elementor Theme Builder template for its vendor and category pages was left
 * with an unstyled list, which reads as broken rather than as minimal. So this
 * now ships a finished-looking default.
 *
 * It stays theme-neutral on purpose. It sets NO font family and NO fixed
 * colours: every colour is derived from `currentColor` with `color-mix`, so the
 * cards, borders and chips take the theme's own text colour and work on a light
 * or a dark theme without being told which. The few things a brand may want to
 * tune are CSS custom properties with sensible fallbacks — override
 * `--mrc-accent` in the theme and the whole directory follows.
 *
 * An Elementor Theme Builder template still wins over all of this, exactly as
 * before: the plugin only falls back to its bundled templates when a brand has
 * not designed its own, and this styling rides on those fallbacks.
 */

.mrc-dir-vendor,
.mrc-dir-category,
.mrc-dir-grid,
.mrc-dir-list {
	/* Everything below is expressed through these, so a theme overrides the look
	   by redefining a handful of properties rather than fighting every rule. */
	--mrc-accent: currentColor;
	--mrc-radius: 0.75rem;
	--mrc-gap: 1.5rem;
	--mrc-pad: 1.25rem;
	--mrc-border: color-mix(in srgb, currentColor 16%, transparent);
	--mrc-surface: color-mix(in srgb, currentColor 4%, transparent);
	--mrc-muted: color-mix(in srgb, currentColor 65%, transparent);
	--mrc-chip-bg: color-mix(in srgb, currentColor 8%, transparent);
}

/* ---- The grid: a responsive set of cards ---------------------------------- */

.mrc-dir-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: var(--mrc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * An explicit column count, for [mrc_vendor_grid columns="N"]. The Elementor
 * widget gets this from its own responsive control, which writes CSS through
 * Elementor's selectors; a shortcode has no such control and must not write an
 * inline style, so the count arrives as one of these classes. With no columns
 * attribute the auto-fill rule above stays in force, which is the responsive
 * default. N is a fixed count at every width, as asked for.
 */
.mrc-dir-columns-1 .mrc-dir-grid {
	grid-template-columns: minmax(0, 1fr);
}

.mrc-dir-columns-2 .mrc-dir-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mrc-dir-columns-3 .mrc-dir-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mrc-dir-columns-4 .mrc-dir-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mrc-dir-columns-5 .mrc-dir-grid {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mrc-dir-columns-6 .mrc-dir-grid {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* ---- A card (a grid item, and a category-list item) ----------------------- */

.mrc-dir-grid .mrc-dir-item,
.mrc-dir-list .mrc-dir-item {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: var(--mrc-pad);
	border: 1px solid var(--mrc-border);
	border-radius: var(--mrc-radius);
	background: var(--mrc-surface);
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.mrc-dir-grid .mrc-dir-item:hover,
.mrc-dir-list .mrc-dir-item:hover {
	border-color: color-mix(in srgb, var(--mrc-accent) 45%, transparent);
	transform: translateY(-2px);
}

.mrc-dir-logo {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 3.5rem;
	object-fit: contain;
	margin-bottom: 0.25rem;
}

.mrc-dir-name {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.3;
}

.mrc-dir-link {
	text-decoration: none;
	color: inherit;
}

.mrc-dir-link:hover {
	color: var(--mrc-accent);
	text-decoration: underline;
}

.mrc-dir-description {
	margin: 0;
	color: var(--mrc-muted);
	font-size: 0.925rem;
	line-height: 1.5;
}

/* ---- The "Verified" pill, shared by cards and the single vendor page ------- */

.mrc-dir-verified {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 0.35em;
	padding: 0.15em 0.65em;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--mrc-accent);
	background: color-mix(in srgb, var(--mrc-accent) 14%, transparent);
}

.mrc-dir-verified::before {
	content: "\2713"; /* check mark */
	font-weight: 700;
}

/* ---- The website link ----------------------------------------------------- */

.mrc-dir-website {
	margin: 0.25rem 0 0;
}

.mrc-dir-website a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-size: 0.9rem;
	color: var(--mrc-accent);
	text-decoration: none;
	word-break: break-word;
}

.mrc-dir-website a:hover {
	text-decoration: underline;
}

/* ---- The category listing page -------------------------------------------- */

.mrc-dir-category > h1 {
	margin: 0 0 1.25rem;
}

.mrc-dir-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: var(--mrc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrc-dir-truncated,
.mrc-dir-empty {
	margin-top: 1.5rem;
	color: var(--mrc-muted);
	font-size: 0.925rem;
}

/* ---- The single vendor page ----------------------------------------------- */

.mrc-dir-vendor {
	max-width: 48rem;
	margin: 0 auto;
	padding: 2rem 1.25rem 3rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.mrc-dir-vendor__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
}

.mrc-dir-vendor__logo {
	flex: 0 0 auto;
	width: auto;
	max-width: 6rem;
	max-height: 4.5rem;
	object-fit: contain;
}

.mrc-dir-vendor__heading {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
}

.mrc-dir-vendor > h1,
.mrc-dir-vendor__heading > h1 {
	margin: 0;
	line-height: 1.2;
}

.mrc-dir-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.mrc-dir-islandwide {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	margin: 0;
	font-size: 0.85rem;
	color: var(--mrc-muted);
}

.mrc-dir-section {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.mrc-dir-section__title {
	margin: 0;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--mrc-muted);
}

.mrc-dir-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrc-dir-chip {
	padding: 0.3em 0.75em;
	border: 1px solid var(--mrc-border);
	border-radius: 999px;
	background: var(--mrc-chip-bg);
	font-size: 0.85rem;
	line-height: 1.3;
}

.mrc-dir-chip a {
	color: inherit;
	text-decoration: none;
}

.mrc-dir-chip a:hover {
	color: var(--mrc-accent);
}

.mrc-dir-vendor__body {
	line-height: 1.65;
}

/* ---- The call to action --------------------------------------------------- */

.mrc-dir-cta {
	margin: 0.5rem 0;
	padding: 1.25rem;
	border: 1px solid var(--mrc-border);
	border-radius: var(--mrc-radius);
	background: var(--mrc-surface);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.mrc-dir-cta__text {
	margin: 0;
	font-weight: 600;
}

/*
 * The button uses the CSS system colours `Canvas` (page background) and the
 * `--mrc-accent` fill, so its label is legible against the fill on a light or a
 * dark theme without this file naming a colour. A theme that wants its own
 * button look overrides `.mrc-dir-button` or sets `--mrc-accent`.
 */
.mrc-dir-button {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.7em 1.4em;
	border-radius: 0.5rem;
	border: 1px solid var(--mrc-accent);
	background: var(--mrc-accent);
	color: Canvas;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 0.15s ease;
}

.mrc-dir-button:hover {
	opacity: 0.9;
	color: Canvas;
	text-decoration: none;
}

/* ---- Reviews -------------------------------------------------------------- */

.mrc-dir-reviews__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrc-dir-review {
	padding: 1rem;
	border: 1px solid var(--mrc-border);
	border-radius: var(--mrc-radius);
	background: var(--mrc-surface);
}

.mrc-dir-review + .mrc-dir-review {
	margin-top: 1rem;
}
