/**
 * MRMVR Elements — Logo Wall.
 *
 * A centred heading above a wall of logos. Every tile is the same width and
 * height, and every logo is fitted by `object-fit: contain` into the same
 * inner box, so wide wordmarks and square emblems take equal visual space.
 * Rows are wrapped flex lines centred on the page, which keeps a short last
 * row centred with its tiles still at full size.
 *
 * @package MRMVR\Elements
 * @since   1.52.0
 */

.mrx-wall-wrap {
	container-type: inline-size;
	container-name: mrxw;
	min-height: 0;
}

.mrx-wall {
	--mrx-w-cols: 6;
	--mrx-w-gap: 14px;
	--mrx-w-tile-h: 76px;
	--mrx-w-logo-h: 52%;
	--mrx-w-radius: 14px;

	--mrx-w-tile-bg: #ffffff;
	--mrx-w-tile-line: rgba(207, 161, 144, .28);
	--mrx-w-accent: var(--mrmvr-amber, #f57528);
	--mrx-w-title: var(--mrmvr-navy, #1a2142);
	--mrx-w-text: var(--mrmvr-navy, #1a2142);

	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(22px, 3.4cqi, 40px);
	width: 100%;
	font-family: var(--mrmvr-font-body, "Jost", sans-serif);
}

.mrx-wall__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 62rem;
	text-align: center;
}

.mrx-wall__eyebrow {
	display: block;
	margin-bottom: 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .24em;
	text-transform: uppercase;
	color: var(--mrx-w-accent);
}

.mrx-wall__title {
	margin: 0;
	font-family: var(--mrmvr-font-display, "Cormorant Garamond", serif);
	font-size: clamp(30px, 4cqi, 52px);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -.01em;
	color: var(--mrx-w-title);
	text-wrap: balance;
}

/* A short hairline with a clay centre mark sits between heading and text. */
.mrx-wall__title::after {
	content: "";
	display: block;
	width: 64px;
	height: 2px;
	margin: 16px auto 0;
	background: linear-gradient(90deg, transparent, var(--mrmvr-clay, #cfa190), transparent);
}

.mrx-wall__text {
	margin: clamp(12px, 1.6cqi, 18px) 0 0;
	font-size: clamp(14px, 1.45cqi, 17px);
	line-height: 1.65;
	color: var(--mrx-w-text);
	text-wrap: balance;
}

/* -------------------------------------------------------------------------
 * Grid
 * ---------------------------------------------------------------------- */

.mrx-wall__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--mrx-w-gap);
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrx-wall__grid > li {
	box-sizing: border-box;
	flex: 0 0 calc((100% - (var(--mrx-w-cols) - 1) * var(--mrx-w-gap)) / var(--mrx-w-cols));
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrx-wall__tile {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	height: var(--mrx-w-tile-h);
	padding: 0 14px;
	background: var(--mrx-w-tile-bg);
	border: 1px solid var(--mrx-w-tile-line);
	border-radius: var(--mrx-w-radius);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 10px 22px -18px rgba(26, 33, 66, .35);
	text-decoration: none;
	overflow: hidden;
	transition:
		transform 400ms var(--mrmvr-ease, ease),
		box-shadow 400ms var(--mrmvr-ease, ease),
		border-color 400ms var(--mrmvr-ease, ease);
}

a.mrx-wall__tile:hover,
a.mrx-wall__tile:focus-visible,
.mrx-wall__grid > li:hover .mrx-wall__tile {
	transform: translateY(-3px);
	border-color: rgba(207, 161, 144, .75);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 22px 30px -20px rgba(26, 33, 66, .5);
}

a.mrx-wall__tile:focus-visible {
	outline: 2px solid var(--mrx-w-accent);
	outline-offset: 3px;
}

/*
 * The one box every logo is fitted into. Width and height are both set, and
 * `contain` scales the artwork to fit without distorting it, so nothing
 * depends on the shape of the file that was uploaded.
 */
.mrx-wall__logo {
	display: block;
	width: 100%;
	max-width: 100%;
	height: var(--mrx-w-logo-h);
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	transition: filter 400ms ease, opacity 400ms ease;
}

/* Until a logo is uploaded the name stands in as a wordmark. */
.mrx-wall__wordmark {
	font-size: clamp(13px, 1.5cqi, 18px);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	color: var(--mrx-w-title);
}

.mrx-wall-soft-yes .mrx-wall__logo {
	filter: grayscale(.55);
	opacity: .82;
}

.mrx-wall-soft-yes .mrx-wall__tile:hover .mrx-wall__logo,
.mrx-wall-soft-yes a.mrx-wall__tile:focus-visible .mrx-wall__logo {
	filter: none;
	opacity: 1;
}

@container mrxw (max-width: 560px) {
	.mrx-wall__tile {
		padding: 0 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mrx-wall__tile,
	.mrx-wall__logo {
		transition: none;
	}
}
