/* Materials block: brands ~30% square tiles; materials fill remaining width/same height */
.lkf-materials {
	--lkf-mat-ink: #222;
	color: var(--lkf-mat-ink);
}

.lkf-materials .lkf-mat-matqual {
	display: grid;
	grid-template-columns: minmax(0, 30%) minmax(0, 1fr);
	gap: 24px;
	align-items: stretch;
}

.lkf-materials .lkf-mat-matqual__brands,
.lkf-materials .lkf-mat-matqual__mats {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.lkf-materials .lkf-mat-matqual__label {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.35;
	color: rgba(34, 34, 34, 0.55);
	flex: 0 0 auto;
}

.lkf-materials .lkf-mat-brands {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	align-content: start;
}

.lkf-materials .lkf-mat-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	aspect-ratio: 1 / 1;
	width: 100%;
	min-height: 0;
	padding: 10px 8px;
	box-sizing: border-box;
	background: #fff;
	border-radius: 0;
	border: 1px solid rgba(17, 17, 17, 0.08);
	text-align: center;
}

.lkf-materials .lkf-mat-brand__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
}

.lkf-materials .lkf-mat-brand__logo img {
	max-width: 78%;
	max-height: 42%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.lkf-materials .lkf-mat-brand__name {
	flex: 0 0 auto;
	font-size: 10px;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(34, 34, 34, 0.55);
}

.lkf-materials .lkf-mat-materials {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	gap: 10px;
	min-height: 0;
	/* Match brands column height: 3 square rows + gaps */
	/* brands height ≈ 3 * (0.3W/3) + 2*gap = 0.3W + 20px; materials fill via stretch */
	height: 100%;
}

.lkf-materials .lkf-mat-card {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 0;
	color: inherit;
	text-decoration: none;
	background: #d8d8d8;
	min-width: 0;
	min-height: 0;
	height: 100%;
	aspect-ratio: auto;
}

.lkf-materials .lkf-mat-card__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lkf-materials .lkf-mat-card__cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 28px 12px 12px;
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.62) 100%);
	color: #fff;
}

.lkf-materials .lkf-mat-card__title {
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.25;
}

.lkf-materials .lkf-mat-matqual__foot {
	margin-top: 32px;
}

/* Keep brands column height driving the row: materials stretch to it */
@media (min-width: 768px) {
	.lkf-materials .lkf-mat-matqual__mats {
		/* equal height with brands via grid stretch */
	}

	.lkf-materials .lkf-mat-matqual__brands .lkf-mat-brands {
		/* 3x3 squares define height */
	}

	/* Make materials grid occupy the same visual height as brands grid */
	.lkf-materials .lkf-mat-matqual__mats .lkf-mat-materials {
		/* Use same track sizing logic: height follows brands via parent stretch,
		   cards fill with 2 rows of equal height */
		grid-template-rows: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1100px) {
	.lkf-materials .lkf-mat-matqual {
		grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
		gap: 18px;
	}

	.lkf-materials .lkf-mat-materials {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.lkf-materials .lkf-mat-card__title {
		font-size: 0.82rem;
	}
}

@media (max-width: 991px) {
	.lkf-materials .lkf-mat-matqual {
		grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
	}

	.lkf-materials .lkf-mat-materials {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.lkf-materials .lkf-mat-matqual {
		grid-template-columns: 1fr;
		gap: 28px;
		align-items: start;
	}

	.lkf-materials .lkf-mat-brands {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 10px;
	}

	.lkf-materials .lkf-mat-brand {
		aspect-ratio: 1 / 1;
		padding: 10px 6px;
	}

	.lkf-materials .lkf-mat-brand__logo img {
		max-width: 72%;
		max-height: 40%;
	}

	.lkf-materials .lkf-mat-brand__name {
		font-size: 9px;
	}

	.lkf-materials .lkf-mat-materials {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: none;
		height: auto;
		gap: 10px;
	}

	.lkf-materials .lkf-mat-card {
		aspect-ratio: 1 / 1;
		height: auto;
	}
}
