/* =============================================================
 * Block: Що приготувати? (kl-w2c)
 *
 * Shared palette with "Читайте також":
 *   bg   : #F5EBDF
 *   text : #1E1E1E
 *   red  : #9E0909
 *
 * Specificity strategy (same reasoning as kl-also-read):
 * Theme rules like `.single-recipe-layout1 .item-description span`
 * are 0,2,1 — so all text rules below are 0,3,0 (3-class chain).
 * ============================================================= */

.kl-w2c {
	background: #F5EBDF;
	padding: 36px 36px 40px;
	border-radius: 14px;
	margin: 32px 0;
	font-family: Rubik, sans-serif;
	color: #1E1E1E;
}

/* ---------- Title ---------- */
.kl-w2c .kl-w2c__title,
h2.kl-w2c__title,
.site-main .kl-w2c__title,
.single-recipe-layout1 .item-description .kl-w2c__title {
	margin: 0 0 28px;
	padding: 0;
	border: 0;
	text-align: center;
	font-family: Rubik, sans-serif;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: uppercase;
	color: #1E1E1E;
}

/* ---------- Grid ---------- */
.kl-w2c .kl-w2c__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px 24px;
	justify-items: center;
}

.kl-w2c.kl-w2c--cols-1 .kl-w2c__grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.kl-w2c.kl-w2c--cols-2 .kl-w2c__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kl-w2c.kl-w2c--cols-3 .kl-w2c__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kl-w2c.kl-w2c--cols-4 .kl-w2c__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kl-w2c.kl-w2c--cols-5 .kl-w2c__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kl-w2c.kl-w2c--cols-6 .kl-w2c__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- Item ---------- */
.kl-w2c .kl-w2c__grid .kl-w2c__item {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: center;
	width: 100%;
}

.kl-w2c .kl-w2c__item .kl-w2c__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 14px;
	text-decoration: none;
	color: inherit;
	width: 100%;
	max-width: 180px;
	transition: transform 0.18s ease;
}

.kl-w2c .kl-w2c__item .kl-w2c__link:hover,
.kl-w2c .kl-w2c__item .kl-w2c__link:focus {
	color: inherit;
	text-decoration: none;
	transform: translateY(-2px);
}

.kl-w2c .kl-w2c__item .kl-w2c__link:hover .kl-w2c__label,
.kl-w2c .kl-w2c__item .kl-w2c__link:focus .kl-w2c__label {
	color: #9E0909;
}

/* ---------- Icon ---------- */
.kl-w2c .kl-w2c__link .kl-w2c__icon-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 96px;
}

.kl-w2c .kl-w2c__icon-wrap .kl-w2c__icon {
	width: auto;
	max-width: 100%;
	height: 96px;
	max-height: 100%;
	object-fit: contain;
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
}

/* Placeholder when icon file is missing on disk */
.kl-w2c .kl-w2c__icon-wrap .kl-w2c__icon--placeholder {
	width: 96px;
	height: 96px;
	border: 1.5px dashed rgba(158, 9, 9, 0.35);
	border-radius: 8px;
	background: rgba(158, 9, 9, 0.06);
	position: relative;
}

.kl-w2c .kl-w2c__icon-wrap .kl-w2c__icon--placeholder::after {
	content: attr(data-key);
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	color: #9E0909;
	opacity: 0.6;
	font-family: Rubik, sans-serif;
	text-transform: none;
	padding: 4px;
	text-align: center;
	word-break: break-word;
	line-height: 1.1;
}

/* ---------- Label ---------- */
.kl-w2c .kl-w2c__link .kl-w2c__label,
.single-recipe-layout1 .item-description .kl-w2c__label {
	display: block;
	text-align: center;
	color: #1E1E1E;
	font-family: Rubik, sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	letter-spacing: 0;
	text-transform: uppercase;
	margin: 0;
	padding: 0;
	transition: color 0.18s ease;
}

/* ---------- Tablet ---------- */
@media (max-width: 991px) {
	.kl-w2c {
		padding: 28px 20px 32px;
	}

	.kl-w2c .kl-w2c__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 24px 16px;
	}

	.kl-w2c .kl-w2c__link .kl-w2c__icon-wrap {
		height: 84px;
	}

	.kl-w2c .kl-w2c__icon-wrap .kl-w2c__icon {
		height: 84px;
	}

	.kl-w2c .kl-w2c__icon-wrap .kl-w2c__icon--placeholder {
		width: 84px;
		height: 84px;
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
	.kl-w2c {
		padding: 22px 16px 26px;
		margin: 24px 0;
	}

	.kl-w2c .kl-w2c__title,
	h2.kl-w2c__title,
	.site-main .kl-w2c__title,
	.single-recipe-layout1 .item-description .kl-w2c__title {
		font-size: 18px;
		margin-bottom: 20px;
	}

	.kl-w2c .kl-w2c__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 18px 12px;
	}

	.kl-w2c .kl-w2c__link .kl-w2c__icon-wrap {
		height: 72px;
	}

	.kl-w2c .kl-w2c__icon-wrap .kl-w2c__icon {
		height: 72px;
	}

	.kl-w2c .kl-w2c__icon-wrap .kl-w2c__icon--placeholder {
		width: 72px;
		height: 72px;
	}

	.kl-w2c .kl-w2c__link .kl-w2c__label,
	.single-recipe-layout1 .item-description .kl-w2c__label {
		font-size: 12px;
		line-height: 16px;
	}
}
