/*
 * aieo/favourite (Brands B, B1): the heart of a brand, a category, a need or a post. The designer's two looks
 * (brand-single-b `.follow`, post-b `.share__fav` and `.rel__fav`): `icon`, the heart alone in a 44 px target;
 * `button`, the heart and its words. No colour of its own: the theme's ink and muted ink, and once pressed the shop's
 * heart colour (--aieo-fav-on, the inline data AIEO_Favourite prints from Wishlist Display), currentColor without them.
 */
.aieo-favourite {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--3, 0.75rem);
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.aieo-favourite.is-look-icon {
	width: 44px;
	height: 44px;
	color: var(--wp--preset--color--muted, currentColor);
}
.aieo-favourite.is-look-icon:hover { color: var(--wp--preset--color--fg, currentColor); }
.aieo-favourite.is-look-button {
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	font-weight: 600;
	line-height: 1.3;
}
.aieo-favourite[aria-pressed="true"].is-look-icon,
.aieo-favourite[aria-pressed="true"] .aieo-favourite__icon { color: var(--aieo-fav-on, currentColor); }
.aieo-favourite[aria-busy="true"] { cursor: progress; opacity: 0.6; }

/* The drawing, 20 px: the theme's heart (a mask, filled when pressed) or ours (outline and fill, swapped). */
.aieo-favourite__icon {
	flex: none;
	width: 20px;
	height: 20px;
	transition: transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.aieo-favourite.is-look-icon:hover .aieo-favourite__icon { transform: scale(1.12); }
.aieo-favourite[aria-pressed="true"] .rooster-icon--heart { --rooster-icon-line: var(--rooster-icon-fill); }
.aieo-favourite[aria-pressed="true"] svg.rooster-icon { fill: currentColor; }
.aieo-favourite__fill { opacity: 0; }
.aieo-favourite[aria-pressed="true"] .aieo-favourite__line { opacity: 0; }
.aieo-favourite[aria-pressed="true"] .aieo-favourite__fill { opacity: 1; }

/* The two words in one cell: the button keeps the longer one's width in both states; the other is hidden (and so
   out of the accessible name). */
.aieo-favourite__words { display: inline-grid; text-align: start; }
.aieo-favourite__word { grid-area: 1 / 1; }
.aieo-favourite[aria-pressed="true"] .aieo-favourite__word--off,
.aieo-favourite:not([aria-pressed="true"]) .aieo-favourite__word--on { visibility: hidden; }

/* The page's one live region for the hearts' words (FB1), made by the view script. */
.aieo-favourite-status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.aieo-favourite__icon { transition: none; }
	.aieo-favourite.is-look-icon:hover .aieo-favourite__icon { transform: none; }
}
