/**
 * Pantone Reference — frontend (also loaded inside the editor for parity).
 * Themed neutrally so it inherits the surrounding theme's typography.
 */

.pantone-ref {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.15em 0.55em 0.15em 0.4em;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.6 );
	line-height: 1.3;
	vertical-align: baseline;
	cursor: help;
	font-size: inherit;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.pantone-ref:hover,
.pantone-ref:focus,
.pantone-ref.is-open {
	border-color: rgba( 0, 0, 0, 0.35 );
	box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.08 );
	outline: none;
}

.pantone-ref__swatch {
	display: inline-block;
	width: 1em;
	height: 1em;
	border-radius: 50%;
	border: 1px solid rgba( 0, 0, 0, 0.18 );
	box-shadow: inset 0 0 0 1px rgba( 255, 255, 255, 0.25 );
	flex: 0 0 auto;
}

.pantone-ref__label {
	color: inherit;
	opacity: 0.85;
}

.pantone-ref__code {
	font-weight: 600;
	letter-spacing: 0.01em;
}

/* Optional product photo: shown next to the swatch line. */
.pantone-ref--has-photo {
	gap: 0.55em;
	padding-right: 0.35em;
}

.pantone-ref__photo {
	display: inline-block;
	width: 2.4em;
	height: 2.4em;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	margin-left: 0.3em;
	flex: 0 0 auto;
}

/* Popover (hover/focus). Hidden by default. */
.pantone-ref__popover {
	position: absolute;
	left: 0;
	top: calc( 100% + 6px );
	z-index: 10;
	display: none;
	min-width: 200px;
	max-width: 260px;
	padding: 10px 12px;
	background: #1a1a1a;
	color: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.18 );
	font-size: 0.82em;
	line-height: 1.4;
	pointer-events: none;
	white-space: normal;
}

.pantone-ref__popover::before {
	content: '';
	position: absolute;
	top: -5px;
	left: 14px;
	width: 10px;
	height: 10px;
	background: #1a1a1a;
	transform: rotate( 45deg );
	border-radius: 2px;
}

.pantone-ref__popover > * {
	display: block;
}

.pantone-ref__hex {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: 0.04em;
	margin-top: 2px;
	opacity: 0.95;
}

.pantone-ref__disclaimer {
	margin-top: 6px;
	opacity: 0.7;
	font-size: 0.92em;
}

.pantone-ref:hover .pantone-ref__popover,
.pantone-ref:focus .pantone-ref__popover,
.pantone-ref:focus-within .pantone-ref__popover,
.pantone-ref.is-open .pantone-ref__popover {
	display: block;
}

/* Respect reduced motion + dark themes a touch. */
@media ( prefers-color-scheme: dark ) {
	.pantone-ref {
		background: rgba( 255, 255, 255, 0.04 );
		border-color: rgba( 255, 255, 255, 0.18 );
	}
	.pantone-ref:hover,
	.pantone-ref:focus,
	.pantone-ref.is-open {
		border-color: rgba( 255, 255, 255, 0.45 );
	}
}

/* Print: drop the chip styling, keep info readable. */
@media print {
	.pantone-ref {
		border: none;
		padding: 0;
		background: transparent;
		box-shadow: none;
	}
	.pantone-ref__popover {
		display: none !important;
	}
}
