/**
 * Heart (like) buttons and the "You liked …" toast.
 * Colours come from the theme's --hhl-* variables, with safe fallbacks.
 */

.hhl-like {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35em;
	min-width: 48px;
	min-height: 48px;
	padding: 0 0.85em;
	border: 2px solid var(--hhl-like-border, currentColor);
	border-radius: 999px;
	background: var(--hhl-like-bg, transparent);
	color: inherit;
	font: inherit;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.hhl-like:focus-visible {
	outline: 3px solid var(--hhl-focus, Highlight);
	outline-offset: 2px;
}

.hhl-like__heart {
	flex: none;
	width: 1.5em;
	height: 1.5em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}

.hhl-like.is-liked .hhl-like__heart {
	fill: var(--hhl-accent, #ec1d38);
	stroke: var(--hhl-accent, #ec1d38);
}

.hhl-like__count[hidden] {
	display: none;
}

.hhl-like__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.hhl-like.is-popping .hhl-like__heart {
		animation: hhl-like-pop 0.35s ease-out;
	}

	@keyframes hhl-like-pop {
		50% {
			transform: scale(1.3);
		}
	}
}

/* Over a photo (gallery cards, leaderboard): a solid pill so it reads on any image. */
.hhl-like--overlay {
	--hhl-like-bg: var(--hhl-surface, #fff);
	--hhl-like-border: transparent;
	color: var(--hhl-like-text, var(--color-text, #15201a));
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hhl-like-toast {
	position: fixed;
	z-index: 10000;
	bottom: max(16px, env(safe-area-inset-bottom));
	left: 50%;
	max-width: min(92vw, 30rem);
	margin: 0;
	padding: 0.75rem 1.1rem;
	border-radius: 0.75rem;
	background: var(--hhl-surface, #17231d);
	color: var(--hhl-like-text, var(--color-text, #fff));
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
	font-weight: 600;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 8px);
}

.hhl-like-toast:empty {
	padding: 0;
}

.hhl-like-toast.is-shown {
	opacity: 1;
	transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: no-preference) {
	.hhl-like-toast {
		transition: opacity 0.2s, transform 0.2s;
	}
}
