/**
 * Pattern-info chips (opt-in convention, demo/staging affordance).
 *
 * A group with the `lp-pattern-info` class, placed as a section's FIRST
 * inner block, renders as a small (i) pinned to the section's top-right;
 * the group's paragraph is the hover/focus tooltip naming the pattern the
 * section came from. Seeds inject these at bake time — the class is the
 * whole contract, so removing the block removes the affordance cleanly.
 */

/* The chip anchors to whatever section contains it. */
.wp-block-group:has(> .lp-pattern-info),
.wp-block-cover__inner-container:has(> .lp-pattern-info),
.wp-block-query:has(> .lp-pattern-info) {
	position: relative;
}

.lp-pattern-info {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	z-index: 60;
	width: 1.625rem;
	height: 1.625rem;
	margin: 0 !important;
}

.lp-pattern-info::before {
	content: "i";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background-color: color-mix(in srgb, var(--wp--preset--color--contrast) 55%, transparent);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 45%, transparent);
	color: var(--wp--preset--color--base);
	font-family: georgia, "times new roman", serif;
	font-style: italic;
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1;
	cursor: help;
}

.lp-pattern-info p {
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	margin: 0;
	white-space: nowrap;
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.02em;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	box-shadow: var(--wp--preset--shadow--console);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

.lp-pattern-info:hover p,
.lp-pattern-info:focus-within p {
	opacity: 1;
	visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
	.lp-pattern-info p {
		transition: none;
	}
}
