/**
 * MAWE Categorieën
 *
 * Alle kleuren staan als variabele bovenaan, zodat het thema ze kan overschrijven
 * zonder dat je in deze CSS hoeft te knippen.
 */

.mawecat,
.mawecat-balk {
	--mawecat-kaart-bg: #ffffff;
	--mawecat-tekst: #1c1c1c;
	--mawecat-dof: #6b6b6b;
	--mawecat-rand: rgba(0, 0, 0, 0.06);
	--mawecat-accent: #3f7d5c;
	--mawecat-radius: 10px;
	--mawecat-gap: 24px;
	--mawecat-kolommen: 4;
	--mawecat-kolommen-tablet: 3;
	--mawecat-kolommen-mobiel: 2;
	--mawecat-balk-top: 0px;
}

/* ---------- Het raster ---------- */

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

.mawecat__kaart {
	display: flex;
	flex-direction: column;
	background: var(--mawecat-kaart-bg);
	border: 1px solid var(--mawecat-rand);
	border-radius: var(--mawecat-radius);
	overflow: hidden;
	text-decoration: none;
	color: var(--mawecat-tekst);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mawecat__kaart:hover,
.mawecat__kaart:focus-visible {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
	text-decoration: none;
	color: var(--mawecat-tekst);
}

.mawecat__kaart:focus-visible {
	outline: 2px solid var(--mawecat-accent);
	outline-offset: 2px;
}

.mawecat__beeld {
	display: block;
	aspect-ratio: 1 / 1;
	padding: 18px;
	background: var(--mawecat-kaart-bg);
}

.mawecat__beeld img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	margin: 0;
}

.mawecat__tekst {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	justify-content: flex-start;
	padding: 4px 16px 20px;
	text-align: center;
}

.mawecat__naam {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--mawecat-tekst);
	/* Ruimte voor twee regels reserveren. Anders zakt het aantal bij een lange
	   naam een regel omlaag en lopen de kaarten in een rij niet meer gelijk. */
	min-height: 2.6em;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mawecat__aantal {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 400;
	text-transform: none;
	color: var(--mawecat-dof);
}

/* ---------- De balk ---------- */

.mawecat-balk {
	position: relative;
	margin: 0 0 var(--mawecat-gap);
	background: var(--mawecat-kaart-bg);
	border-bottom: 1px solid var(--mawecat-rand);
}

.mawecat-balk--plakkend {
	position: sticky;
	top: var(--mawecat-balk-top);
	z-index: 20;
}

.mawecat-balk::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 1px;
	width: 42px;
	pointer-events: none;
	background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--mawecat-kaart-bg));
}

.mawecat-balk__spoor {
	display: flex;
	gap: 22px;
	align-items: center;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 12px 2px;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
}

.mawecat-balk__spoor::-webkit-scrollbar {
	display: none;
}

.mawecat-balk__item,
.mawecat-balk__terug {
	flex: 0 0 auto;
	scroll-snap-align: start;
	font-size: 14px;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
	color: var(--mawecat-dof);
	padding: 4px 0;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.mawecat-balk__item:hover,
.mawecat-balk__terug:hover,
.mawecat-balk__item:focus-visible,
.mawecat-balk__terug:focus-visible {
	color: var(--mawecat-tekst);
	text-decoration: none;
}

.mawecat-balk__item.is-actief {
	color: var(--mawecat-tekst);
	font-weight: 600;
	border-bottom-color: var(--mawecat-accent);
}

.mawecat-balk__terug {
	font-weight: 600;
	color: var(--mawecat-accent);
	padding-right: 22px;
	border-right: 1px solid var(--mawecat-rand);
}

.mawecat-balk__terug::before {
	content: "\2190";
	margin-right: 8px;
}

/* ---------- Kleinere schermen ---------- */

@media (max-width: 1024px) {
	.mawecat {
		grid-template-columns: repeat(var(--mawecat-kolommen-tablet), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.mawecat {
		grid-template-columns: repeat(var(--mawecat-kolommen-mobiel), minmax(0, 1fr));
		--mawecat-gap: 14px;
	}

	.mawecat__beeld {
		padding: 12px;
	}

	.mawecat__naam {
		font-size: 13px;
		min-height: 3.2em;
	}

	.mawecat__aantal {
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mawecat__kaart,
	.mawecat-balk__item,
	.mawecat-balk__terug {
		transition: none;
	}

	.mawecat__kaart:hover,
	.mawecat__kaart:focus-visible {
		transform: none;
	}
}
