/* Clients & Partners - filterable logo wall
   Scoped under .ev-cp so it cannot leak into the theme. */

.ev-cp {
	--ev-cp-cols: 5;
	--ev-cp-gap: 20px;
	--ev-cp-tile-bg: #fff;
	--ev-cp-tile-border: #e6e8eb;
	--ev-cp-accent: #1a1a1a;
	--ev-cp-accent-fg: #fff;
	--ev-cp-muted: #6b7280;
	--ev-cp-radius: 10px;

	margin: 0 0 32px;
}

/* ---------- filter bar ---------- */

.ev-cp__filters {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 28px;
}

.ev-cp__group {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px 12px;
}

.ev-cp__label {
	flex: 0 0 auto;
	min-width: 80px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ev-cp-muted);
}

.ev-cp__btns {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ev-cp__btn {
	appearance: none;
	cursor: pointer;
	border: 1px solid var(--ev-cp-tile-border);
	background: #fff;
	color: #374151;
	font: inherit;
	font-size: 16px;
	line-height: 1.25;
	/* em padding, so the chips grow with the text rather than getting cramped */
	padding: 0.45em 0.95em;
	border-radius: 999px;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ev-cp__btn:hover {
	border-color: #c9ced6;
	background: #f6f7f9;
}

.ev-cp__btn.is-active {
	background: var(--ev-cp-accent);
	border-color: var(--ev-cp-accent);
	color: var(--ev-cp-accent-fg);
}

.ev-cp__btn:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.ev-cp__count {
	margin: 0;
	font-size: 15px;
	color: var(--ev-cp-muted);
}

/* ---------- grid ---------- */

.ev-cp__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--ev-cp-gap);
	grid-template-columns: repeat(var(--ev-cp-cols), minmax(0, 1fr));
}

.ev-cp__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ev-cp__item[hidden] {
	display: none;
}

.ev-cp__tile {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 110px;
	padding: 18px;
	background: var(--ev-cp-tile-bg);
	border: 1px solid var(--ev-cp-tile-border);
	border-radius: var(--ev-cp-radius);
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.ev-cp__tile:hover,
a.ev-cp__tile:focus-visible {
	transform: translateY(-3px);
	border-color: #d4d8de;
	box-shadow: 0 8px 22px rgba(16, 24, 40, 0.09);
}

a.ev-cp__tile:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.ev-cp__logo {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 62px;
	height: auto;
	object-fit: contain;
}

/* Greyscale until hover - a common logo-wall treatment that keeps a mixed
   set of brand colours from fighting each other. Opt out with greyscale="no". */
.ev-cp.is-greyscale .ev-cp__logo {
	filter: grayscale(100%);
	opacity: 0.72;
	transition: filter 0.2s ease, opacity 0.2s ease;
}

.ev-cp.is-greyscale .ev-cp__tile:hover .ev-cp__logo,
.ev-cp.is-greyscale .ev-cp__tile:focus-visible .ev-cp__logo {
	filter: grayscale(0);
	opacity: 1;
}

/* Name shown when no logo image has been set yet. */
.ev-cp__fallback {
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	color: #374151;
	line-height: 1.3;
}

/* ---------- empty states ---------- */

.ev-cp__none,
.ev-cp-empty {
	margin: 24px 0 0;
	padding: 20px;
	text-align: center;
	color: var(--ev-cp-muted);
	background: #f9fafb;
	border: 1px dashed var(--ev-cp-tile-border);
	border-radius: var(--ev-cp-radius);
}

.ev-cp__none[hidden] {
	display: none;
}

.ev-cp__reset {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	margin-left: 6px;
	font: inherit;
	color: #2563eb;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
	.ev-cp__grid {
		grid-template-columns: repeat(min(var(--ev-cp-cols), 4), minmax(0, 1fr));
	}
}

@media (max-width: 782px) {
	.ev-cp__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.ev-cp__label {
		min-width: 100%;
	}
}

@media (max-width: 480px) {
	.ev-cp {
		--ev-cp-gap: 12px;
	}
	.ev-cp__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.ev-cp__tile {
		min-height: 88px;
		padding: 14px;
	}
	.ev-cp__logo {
		max-height: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ev-cp__tile,
	.ev-cp__logo,
	.ev-cp__btn {
		transition: none;
	}
	a.ev-cp__tile:hover,
	a.ev-cp__tile:focus-visible {
		transform: none;
	}
}
