/**
 * JezPress Woo RRP - frontend styles
 *
 * Deliberately minimal and scoped to `.jpwrrp*`. Colours are inherited rather
 * than declared so the block picks up the theme's own text colour instead of
 * fighting it; only the muted tone and the size step are opinionated.
 *
 * @package JezPress\WooRRP
 * @since   1.0.0
 */

.jpwrrp {
	display: block;
	margin: 0 0 0.75em;
	font-size: 0.9em;
	line-height: 1.5;
}

.jpwrrp__label {
	margin-right: 0.25em;
	opacity: 0.75;
}

.jpwrrp__amount del,
.jpwrrp__amount del .amount,
.jpwrrp__amount del .woocommerce-Price-amount {
	text-decoration: line-through;
	opacity: 0.7;
}

/*
 * No margin: WooCommerce's own suffix string already starts with a literal
 * space, so adding one here doubles the gap against every other price on the
 * page. Opacity only - the suffix sits outside the <del>, so it needs no
 * text-decoration reset.
 */
.jpwrrp__amount .woocommerce-price-suffix {
	opacity: 0.7;
}

.jpwrrp__saving {
	margin-left: 0.5em;
	font-weight: 600;
}

/*
 * "After the price" mode: the RRP is injected INSIDE
 * `.woocommerce-variation-price`, so it must sit on the same line as the
 * amount rather than starting a new block the way `.jpwrrp` otherwise does.
 */
.jpwrrp--after-price {
	display: inline;
	margin: 0 0 0 0.5em;
}

.jpwrrp--loop {
	margin-bottom: 0.5em;
	font-size: 0.85em;
}

/*
 * `:not()` matters. The SR container starts empty - that is its normal state
 * until a variation is chosen - and `.jpwrrp-variation:empty` (0,2,0) outranks
 * `.jpwrrp-variation--sr` (0,1,0), so without this exclusion the live region
 * would be `display: none` at page load, which drops it out of the
 * accessibility tree and silently undoes the announcement entirely.
 */
.jpwrrp-variation:empty:not(.jpwrrp-variation--sr) {
	display: none;
}

/*
 * Visually hidden, still announced. Used in `after_price`, where the visible
 * RRP lives inside the price element and this container exists only to be the
 * live region. Not `display: none` - that removes it from the accessibility
 * tree too, which would defeat the entire purpose.
 */
.jpwrrp-variation--sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
