/**
 * Member Roles Grid block.
 *
 * 5-column responsive tile grid that mirrors the MLC "Functional Roles
 * Represented in the MLC" graphic: rounded soft-blue tiles, line-icon
 * centered, label centered beneath, primary-blue heading above.
 *
 * Theme color tokens fall back to neutral defaults so the block also
 * renders sensibly outside the MLC theme.
 */

.member-roles-grid {
	--mrg-heading-color: var(--wdg-color-primary, #0032a0);
	--mrg-tile-bg: var(--wdg-color-white-gray, #eef1f5);
	--mrg-tile-bg-hover: var(--wdg-color-light-cyan, #dbe5f0);
	--mrg-tile-fg: var(--wdg-color-primary, #0032a0);
	--mrg-icon-color: var(--wdg-color-cyan, #00a5e0);
	--mrg-tile-radius: 12px;
	--mrg-gap: clamp(12px, 1.5vw, 20px);
	--mrg-icon-size: 72px;

	margin: clamp(24px, 4vw, 48px) auto;
	padding: 0 clamp(16px, 4vw, 32px);
	color: var(--mrg-tile-fg);
}

.member-roles-grid__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.member-roles-grid__heading {
	margin: 0 0 clamp(16px, 2vw, 28px);
	font-size: clamp(1.25rem, 1.5vw + 0.75rem, 1.75rem);
	font-weight: 700;
	color: var(--mrg-heading-color);
	line-height: 1.2;
}

.member-roles-grid__list {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--mrg-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

.member-roles-grid__item {
	display: flex;
}

.member-roles-grid__tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	width: 100%;
	min-height: 178px;
	padding: 20px 12px;
	background: var(--mrg-tile-bg);
	border-radius: var(--mrg-tile-radius);
	color: var(--mrg-tile-fg);
	text-align: center;
	text-decoration: none;
	transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.member-roles-grid__tile--link {
	cursor: pointer;
}

/* Theme gotcha: the sitewide `.entry-content a:not(...)` display rules
   out-rank block CSS on plain anchors and flatten the tile to an inline
   icon-beside-label row. Out-specify them with the :not(#nam-x) pattern
   used elsewhere in this theme. */
a.member-roles-grid__tile:not(#nam-x) {
	display: flex !important;
}

.member-roles-grid__tile--link:hover,
.member-roles-grid__tile--link:focus-visible {
	background: var(--mrg-tile-bg-hover);
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 50, 160, 0.12);
	outline: none;
}

.member-roles-grid__tile--link:focus-visible {
	outline: 2px solid var(--mrg-tile-fg);
	outline-offset: 2px;
}

.member-roles-grid__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--mrg-icon-size);
	height: var(--mrg-icon-size);
	color: var(--mrg-icon-color);
}

.member-roles-grid__icon svg {
	width: 100%;
	height: 100%;
	display: block;
	color: currentColor;
}

.member-roles-grid__icon svg [stroke],
.member-roles-grid__icon svg [fill]:not([fill="none"]) {
	/* Hardcoded color attributes inside inlined SVGs already mapped to
	   currentColor server-side; this keeps any stragglers in line. */
}

.member-roles-grid__icon--image img {
	max-width: 100%;
	max-height: 100%;
	display: block;
}

.member-roles-grid__label {
	font-size: clamp(0.95rem, 0.5vw + 0.8rem, 1.05rem);
	font-weight: 700;
	line-height: 1.25;
	color: var(--mrg-tile-fg);
}

.member-roles-grid__notice {
	padding: 16px;
	background: #fff8e1;
	border-left: 4px solid #f0b400;
	color: #5a4500;
}

@media (max-width: 1024px) {
	.member-roles-grid__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.member-roles-grid {
		--mrg-icon-size: 56px;
	}
	.member-roles-grid__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.member-roles-grid__tile {
		min-height: 150px;
	}
}
