/* CAMRED partner logo grid — About page placeholders */

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.md-partners {
	margin: 0 0 2.5rem;
}

.md-partners__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	gap: 1.25rem 1.5rem;
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
	font-family: var(--wp--preset--font-family--inclusive-sans, "Inclusive Sans", system-ui, sans-serif);
	color: var(--md-color-contrast, #1c1b1a);
	text-align: center;
}

/* Beat theme .entry-content ul { text-align: left } on project pages. */
.entry-content .md-partners__grid,
.wp-block-post-content .md-partners__grid {
	text-align: center;
}

.md-partners__item {
	display: flex;
	margin: 0;
	box-shadow: none;
}

.md-partners__item.md-reveal,
.md-partners__item.md-reveal.md-reveal--in {
	box-shadow: none;
}

.md-partners__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 0;
	padding: var(--md-space, 1.5rem);
	background: #fff;
	border: none;
	border-radius: var(--md-radius, 0.5rem);
	text-decoration: none;
	text-align: center;
	font-family: var(--wp--preset--font-family--inclusive-sans, "Inclusive Sans", system-ui, sans-serif);
	font-size: var(--md-text-card-title, clamp(1.35rem, 2vw, 1.55rem));
	line-height: 1.25;
	font-weight: 600;
	color: var(--md-color-contrast, #1c1b1a);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	box-shadow: none !important;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.entry-content .md-partners__link,
.wp-block-post-content .md-partners__link {
	font-family: var(--wp--preset--font-family--inclusive-sans, "Inclusive Sans", system-ui, sans-serif);
	font-size: var(--md-text-card-title, clamp(1.35rem, 2vw, 1.55rem));
	line-height: 1.25;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

.md-partners__link:not(:hover):not(:focus-visible) {
	box-shadow: none !important;
}

/* Match team card names (.md-team__name). */
.md-partners__label {
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	text-align: inherit;
	color: inherit;
}

.entry-content .md-partners__label,
.wp-block-post-content .md-partners__label {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	text-align: inherit;
	color: inherit;
}

html[data-md-theme="dark"] .md-partners__grid,
html[data-md-theme="dark"] .md-partners__label {
	color: var(--md-color-contrast, #f5f5f4);
}

/* Neutral lift in every region — no project-colour tint on the logo tiles. */
.md-partners__link:hover,
.md-partners__link:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(28, 27, 26, 0.12) !important;
	outline: none;
}

html[data-md-theme="dark"] .md-partners__link {
	background: #fff;
	color: #1c1b1a;
	box-shadow: none !important;
}

html[data-md-theme="dark"] .md-partners__link:not(:hover):not(:focus-visible) {
	box-shadow: none !important;
}

html[data-md-theme="dark"] .md-partners__link:hover,
html[data-md-theme="dark"] .md-partners__link:focus-visible {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
}

/* Fixed logo box keeps every tile the same height whatever the artwork ratio. */
.md-partners__logo {
	display: block;
	width: 100%;
	max-width: 11.5rem;
	height: 5.5rem;
	object-fit: contain;
}

/* Two funder tiles, the same width as the partner tiles above them. */
.md-partners[data-md-funders="1"] .md-partners__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: calc((100% - 3rem) * 2 / 3 + 1.5rem);
}

@media (max-width: 62rem) {
	.md-partners__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.md-partners[data-md-funders="1"] .md-partners__grid {
		max-width: none;
	}
}

@media (max-width: 36rem) {
	.md-partners__grid,
	.md-partners[data-md-funders="1"] .md-partners__grid {
		grid-template-columns: minmax(0, 1fr);
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.md-partners__link,
	.md-partners__link:hover,
	.md-partners__link:focus-visible {
		transition: none;
		transform: none;
	}
}
