/**
 * Floating WhatsApp bubble (bundled by figma-to-wp; see inc/floating-whatsapp.php).
 *
 * Parked at the visual RIGHT in RTL (inset-inline-start) — client request
 * 2026-09-30. The accessibility button moved to the bottom-left corner to make
 * room (style.css, "AccessibleWP toolbar"). Check both at 390 and 1440.
 */

/* The fixed corner: the bubble, and the group pill under it (2026-10-15).
   Both hug the inline-start edge (the visual right in RTL). */
.floating-whatsapp-stack {
	position: fixed;
	inset-inline-start: var(--space-4);
	inset-block-end: var(--space-4);
	/* Over the page, under the lightbox and the open mobile sheet. */
	z-index: 40;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-2);
}

.floating-whatsapp {
	--floating-whatsapp-size: clamp(3.25rem, 5vw, 3.875rem); /* 52-62px; lint-ok: component size, no design token */

	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--floating-whatsapp-size);
	height: var(--floating-whatsapp-size);
	background-color: var(--color-whatsapp); /* the app's own green (client, 2026-10-07) */
	border-radius: var(--radius-full);
	box-shadow: var(--shadow-card);
	transition: transform 200ms ease, background-color 200ms ease;
}

.floating-whatsapp:hover,
.floating-whatsapp:focus-visible {
	background-color: var(--color-whatsapp-dark);
	transform: scale(1.06);
}

/* The glyph is painted through a mask so it takes a token colour rather than
   whatever the SVG file was drawn in. */
.floating-whatsapp__icon {
	width: 56%;
	height: 56%;
	background-color: var(--color-white); /* white glyph, as WhatsApp draws it */
	mask: url("../img/icon-whatsapp.svg") center / contain no-repeat;
	-webkit-mask: url("../img/icon-whatsapp.svg") center / contain no-repeat;
}

/* "הצטרפות לקבוצת הוואטסאפ" pill. White with ink text: white on WhatsApp
   green is ~2:1, below the WCAG AA minimum; the green lives in the icon. */
.floating-whatsapp-group {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding-block: var(--space-2);
	padding-inline: var(--space-3) var(--space-4);
	font-size: var(--fs-100);
	font-weight: var(--fw-regular);
	line-height: 1.2;
	color: var(--color-ink);
	text-decoration: none;
	white-space: nowrap;
	background-color: var(--color-white);
	border-radius: var(--radius-full);
	box-shadow: var(--shadow-card);
	transition: background-color 200ms ease, color 200ms ease;
}

.floating-whatsapp-group:hover,
.floating-whatsapp-group:focus-visible {
	color: var(--color-white);
	background-color: var(--color-whatsapp-dark);
}

.floating-whatsapp-group__icon {
	flex: none;
	width: 1.25em;
	height: 1.25em;
	background-color: var(--color-whatsapp);
	mask: url("../img/icon-whatsapp.svg") center / contain no-repeat;
	-webkit-mask: url("../img/icon-whatsapp.svg") center / contain no-repeat;
	transition: background-color 200ms ease;
}

.floating-whatsapp-group:hover .floating-whatsapp-group__icon,
.floating-whatsapp-group:focus-visible .floating-whatsapp-group__icon {
	background-color: var(--color-white);
}

/* No business floating over a full-screen overlay. Rename the two root classes
   to whatever the theme's lightbox and mobile sheet set on <html>. */
.lightbox-open .floating-whatsapp-stack,
.nav-open .floating-whatsapp-stack {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.floating-whatsapp {
		transition: background-color 200ms ease;
	}

	.floating-whatsapp:hover,
	.floating-whatsapp:focus-visible {
		transform: none;
	}
}
