/*
 * Kategooriakastid poe kohal. Vaikimisi peidus — nähtavaks teeb selle
 * pistikprogrammi lisatud murdepunkti reegel, nii et arvutiekraanil kaste ei ole.
 * Värvid tulevad Blocksy muutujatest, et kastid sobiks teemaga kokku.
 */

.wilc-categories {
	display: none;
	margin: 0 0 30px;
}

.wilc-categories__title {
	margin: 0 0 12px;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--theme-text-color, #242424);
}

.wilc-categories__grid {
	display: grid;
	grid-template-columns: repeat(var(--wilc-columns, 3), minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wilc-categories__item {
	display: block;
	margin: 0;
}

.wilc-categories__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	text-decoration: none;
	color: var(--theme-text-color, #242424);
	background: var(--theme-palette-color-8, #fff);
	border: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.1));
	border-radius: 4px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wilc-categories__link:hover,
.wilc-categories__link:focus-visible {
	color: var(--theme-text-color, #242424);
	border-color: var(--theme-palette-color-1, #b98f6b);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.wilc-categories__item.is-current .wilc-categories__link {
	border-color: var(--theme-palette-color-1, #b98f6b);
	box-shadow: inset 0 0 0 1px var(--theme-palette-color-1, #b98f6b);
}

.wilc-categories__image {
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--theme-palette-color-7, #f2f2f2);
}

.wilc-categories__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.wilc-categories__text {
	display: flex;
	flex-grow: 1;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	padding: 8px 8px 10px;
	text-align: center;
}

.wilc-categories--text .wilc-categories__text {
	padding: 12px 10px;
}

.wilc-categories__name {
	font-size: 13px;
	line-height: 1.25;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.wilc-categories__count {
	font-size: 11px;
	line-height: 1.2;
	opacity: 0.6;
}

/* Märkeruut hoiab „Näita kõiki" olekut ilma JavaScriptita. Ekraanilt peidus,
   aga fookusesse saab ta ikka, nii et klaviatuuriga kasutamine töötab. */
.wilc-categories__toggle {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
}

.wilc-categories__more {
	display: inline-block;
	margin-top: 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--theme-palette-color-1, #b98f6b);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.wilc-categories__more::after {
	content: attr(data-more);
}

.wilc-categories__toggle:checked ~ .wilc-categories__more::after {
	content: attr(data-less);
}

.wilc-categories__toggle:focus-visible ~ .wilc-categories__more {
	outline: 2px solid var(--theme-palette-color-1, #b98f6b);
	outline-offset: 3px;
}
