/*
 * Photo reaction hearts. The .tphg-has-favorite class is added by JS to each
 * image's parent element on init; position:relative is also set inline by JS
 * if the parent's computed position is "static". The heart button itself is
 * inserted as a sibling of the image, not a wrapper, to avoid breaking
 * direct-child CSS selectors used by Elementor and other page builders.
 */

.tphg-favorite {
	position: absolute;
	bottom: 8px;
	right: 8px;
	z-index: 10;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 10px;
	background: rgba(0, 0, 0, 0.45);
	color: #ffffff;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	opacity: 0.35;
	transition: opacity 150ms ease, transform 150ms ease, background-color 150ms ease;
	font-family: inherit;
	font-size: 13px;
	line-height: 1;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	user-select: none;
}

.tphg-has-favorite:hover .tphg-favorite,
.tphg-favorite:hover,
.tphg-favorite:focus-visible {
	opacity: 1;
}

.tphg-heart {
	display: block;
	fill: none;
	transition: fill 200ms ease;
}

.tphg-favorited .tphg-heart {
	fill: var(--tphg-accent, #e63946);
	color: var(--tphg-accent, #e63946);
}

.tphg-favorite.tphg-pulse {
	animation: tphg-pop 300ms ease;
}

@keyframes tphg-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.25); }
	100% { transform: scale(1); }
}

.tphg-count {
	min-width: 1ch;
	font-variant-numeric: tabular-nums;
}

.tphg-favorite.tphg-pending {
	opacity: 0.6;
	cursor: wait;
}

.tphg-favorite.tphg-error {
	background: rgba(220, 38, 38, 0.7);
}

.tphg-favorite:focus-visible {
	outline: 2px solid var(--tphg-accent, #e63946);
	outline-offset: 2px;
}

@media (max-width: 640px) {
	.tphg-favorite {
		opacity: 0.7;
	}
}

/* Lightbox footer variant. Lives inside Elementor's slideshow footer (the
   element bearing class .elementor-lightbox-prevent-close), which means
   Elementor's own click handlers skip events here — no swipe/dismiss
   conflict. Inserted inside .elementor-slideshow__title when present so it
   reads inline with the title text. */
.tphg-favorite.tphg-lightbox-footer {
	position: static;
	display: inline-flex;
	margin-right: 10px;
	margin-bottom: 0;
	vertical-align: middle;
	opacity: 1;
	background: rgba(255, 255, 255, 0.12);
	padding: 4px 10px;
	font-size: 13px;
	gap: 4px;
}

.tphg-favorite.tphg-lightbox-footer .tphg-heart {
	width: 18px;
	height: 18px;
}

.tphg-favorite.tphg-lightbox-footer:hover {
	background: rgba(255, 255, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
	.tphg-favorite,
	.tphg-heart {
		transition: none;
	}
	.tphg-favorite.tphg-pulse {
		animation: none;
	}
}
