/*
 * Mamer homepage topic-card refinement.
 * Scoped to the "Что вас волнует сейчас?" section only.
 */

.mamer-home .home-topics {
	background: linear-gradient(180deg, rgba(230, 239, 235, .40) 0%, rgba(244, 241, 236, .24) 100%);
}

.mamer-home .home-topics .home-section__heading {
	margin-bottom: 28px;
}

.mamer-home .home-topics .home-topics__grid {
	gap: 14px;
}

.mamer-home .home-topics .home-topic {
	position: relative;
	align-items: center;
	justify-content: flex-start;
	min-height: 190px;
	padding: 24px 18px 22px;
	border: 1px solid rgba(46, 106, 97, .10);
	border-radius: 18px;
	background: rgba(255, 255, 255, .88);
	box-shadow: 0 8px 24px rgba(31, 41, 51, .035);
	text-align: center;
	transition:
		transform 240ms cubic-bezier(.22, 1, .36, 1),
		border-color 240ms cubic-bezier(.22, 1, .36, 1),
		background 240ms cubic-bezier(.22, 1, .36, 1),
		box-shadow 240ms cubic-bezier(.22, 1, .36, 1);
}

.mamer-home .home-topics .home-topic__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	flex: 0 0 56px;
	border-radius: 50%;
	background: var(--mamer-sage-subtle);
	box-shadow: inset 0 0 0 1px rgba(46, 106, 97, .07);
	color: var(--mamer-primary);
	transition:
		transform 240ms cubic-bezier(.22, 1, .36, 1),
		background 240ms cubic-bezier(.22, 1, .36, 1),
		box-shadow 240ms cubic-bezier(.22, 1, .36, 1);
}

/* The original inline topic SVGs remain in the markup as a safe fallback.
 * The supplied Lucide artwork is rendered as a mask so all six icons inherit
 * one optical weight and the Mamer primary colour without asset recolouring.
 * Each home-topic is a <summary> FIRST child of its own <details> wrapper;
 * target the details position in the grid, NOT summary:nth-child(n).
 */
.mamer-home .home-topics .home-topic__icon > svg {
	display: none;
}

.mamer-home .home-topics .home-topic__icon::before {
	content: "";
	display: block;
	width: 29px;
	height: 29px;
	background: currentColor;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.mamer-home .home-topics .home-topics__grid > details.mamer-choice:nth-child(1) > summary.home-topic .home-topic__icon::before {
	-webkit-mask-image: url("../icons/topics/moon.svg");
	mask-image: url("../icons/topics/moon.svg");
}

.mamer-home .home-topics .home-topics__grid > details.mamer-choice:nth-child(2) > summary.home-topic .home-topic__icon::before {
	-webkit-mask-image: url("../icons/topics/stethoscope.svg");
	mask-image: url("../icons/topics/stethoscope.svg");
}

.mamer-home .home-topics .home-topics__grid > details.mamer-choice:nth-child(3) > summary.home-topic .home-topic__icon::before {
	-webkit-mask-image: url("../icons/topics/milk.svg");
	mask-image: url("../icons/topics/milk.svg");
}

.mamer-home .home-topics .home-topics__grid > details.mamer-choice:nth-child(4) > summary.home-topic .home-topic__icon::before {
	-webkit-mask-image: url("../icons/topics/face-slightly-frowning.svg");
	mask-image: url("../icons/topics/face-slightly-frowning.svg");
}

.mamer-home .home-topics .home-topics__grid > details.mamer-choice:nth-child(5) > summary.home-topic .home-topic__icon::before {
	-webkit-mask-image: url("../icons/topics/toothbrush-sparkles.svg");
	mask-image: url("../icons/topics/toothbrush-sparkles.svg");
}

.mamer-home .home-topics .home-topics__grid > details.mamer-choice:nth-child(6) > summary.home-topic .home-topic__icon::before {
	-webkit-mask-image: url("../icons/topics/bath.svg");
	mask-image: url("../icons/topics/bath.svg");
}

.mamer-home .home-topics .home-topic strong {
	margin-top: 17px;
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
	transition: color 220ms ease;
}

.mamer-home .home-topics .home-topic > span:last-child {
	max-width: 158px;
	margin-top: 7px;
	font-size: var(--mamer-type-compact);
	line-height: 1.45;
}

@media (hover: hover) and (pointer: fine) {
	.mamer-home .home-topics .home-topic:hover {
		transform: translateY(-5px);
		border-color: rgba(46, 106, 97, .24);
		background: #fff;
		box-shadow: 0 16px 34px rgba(31, 51, 59, .095);
	}

	.mamer-home .home-topics .home-topic:hover .home-topic__icon {
		transform: translateY(-2px) scale(1.07);
		background: #dceae4;
		box-shadow: inset 0 0 0 1px rgba(46, 106, 97, .12), 0 8px 18px rgba(46, 106, 97, .10);
	}

	.mamer-home .home-topics .home-topic:hover strong {
		color: var(--mamer-primary);
	}
}

.mamer-home .home-topics .home-topic:active {
	transform: translateY(-1px) scale(.99);
}

@media (max-width: 767px) {
	.mamer-home .home-topics {
		background: linear-gradient(180deg, rgba(230, 239, 235, .34), rgba(250, 248, 244, 0));
	}

	.mamer-home .home-topics .home-section__heading {
		margin-bottom: 20px;
	}

	.mamer-home .home-topics .home-topics__grid {
		gap: 10px;
	}

	.mamer-home .home-topics .home-topic {
		min-height: 164px;
		padding: 16px 10px 14px;
		border: 1px solid rgba(46, 106, 97, .10);
		border-radius: 14px;
		background: rgba(255, 255, 255, .82);
		box-shadow: none;
		text-align: center;
	}

	.mamer-home .home-topics .home-topic__icon {
		width: 46px;
		height: 46px;
		flex-basis: 46px;
	}

	.mamer-home .home-topics .home-topic__icon::before {
		width: 24px;
		height: 24px;
	}

	.mamer-home .home-topics .home-topic strong {
		margin-top: 11px;
		font-size: var(--mamer-type-compact);
		line-height: 1.45;
	}

	.mamer-home .home-topics .home-topic > span:last-child {
		max-width: 145px;
		margin-top: 5px;
		font-size: var(--mamer-type-compact);
		line-height: 1.45;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mamer-home .home-topics .home-topic,
	.mamer-home .home-topics .home-topic__icon,
	.mamer-home .home-topics .home-topic strong {
		transition: none;
	}
}
