/* shell/cursor.css — Figma-style cursor with a hint tag (see assets/js/cursor.js).
   The normal cursor is hidden only after the script has run (html.dba-cursor-on) and only for mouse / trackpad. */

.dba-cursor {
	position: fixed;
	z-index: 100000;
	top: 0;
	left: 0;
	display: none;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
	will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
	.dba-cursor {
		display: block;
	}

	/* The arrow cursor is only for the Move tool; the drawing tools use the normal crosshair / text cursors */
	html.dba-cursor-on:not(.dba-cursor-native):not(.dba-tool-active),
	html.dba-cursor-on:not(.dba-cursor-native):not(.dba-tool-active) * {
		cursor: none !important;
	}

	html.dba-cursor-native .dba-cursor,
	html.dba-tool-active .dba-cursor {
		opacity: 0 !important;
	}
}

.dba-cursor.is-on {
	opacity: 1;
}

.dba-cursor__arrow {
	display: block;
	width: 32px;
	height: 32px;
	margin: -4px 0 0 -4px;
	fill: var(--dba-accent);
	stroke: var(--dba-accent-ink);
	stroke-width: 1.5;
	stroke-linejoin: round;
	filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.3));
}

.dba-cursor__tag {
	position: absolute;
	top: 30px;
	left: 24px;
	padding: 0.4rem 0.75rem;
	border-radius: 0.625rem 0.625rem 0.625rem 0.15rem;
	background: var(--dba-accent);
	color: var(--dba-accent-ink);
	font: 600 0.9375rem/1.2 var(--wp--preset--font-family--inter, system-ui, sans-serif);
	box-shadow: 0 0 0 1.5px var(--dba-accent-ink), 0 4px 12px rgb(0 0 0 / 0.25); /* a ring keeps the tag readable over accent-coloured buttons */
	white-space: nowrap;
	opacity: 0;
	transform: translateY(-3px);
	transition: opacity 0.15s, transform 0.2s;
}

.dba-cursor.has-tag .dba-cursor__tag {
	opacity: 1;
	transform: none;
}

/* Near the right edge the tag opens to the left, near the bottom it opens upward */
.dba-cursor.is-flip-x .dba-cursor__tag {
	right: 8px;
	left: auto;
	border-radius: 0.625rem 0.625rem 0.15rem 0.625rem;
}

.dba-cursor.is-flip-y .dba-cursor__tag {
	top: auto;
	bottom: 8px;
	transform: translateY(3px);
}

.dba-cursor.is-flip-y.has-tag .dba-cursor__tag {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.dba-cursor,
	.dba-cursor__tag {
		transition: none;
	}
}
