/**
 * OptConnect checklist marker (PR 3.6).
 *
 * A marker treatment for a plain `core/list`, deliberately **not** prefixed with a
 * family: any pattern can put `oc-checklist` in a `className`, so it gets its own handle
 * on `button.css`'s precedent rather than living in a family stylesheet. Worn today by
 * `optconnect/checklist-promo` and both `optconnect/pricing-row*` patterns.
 *
 * **The marker is a `::before`, not an icon font, because both widgets this replaces
 * depend on a stylesheet the block theme does not load.** `restly_list` emits
 * `div > div > div` with no `<ul>` or `<li>` at all, and with Restly's CSS retired
 * `.restly-list-box` computes to `display: block`, stacking each badge above its label.
 * Elementor Pro's `price-table` does emit a real list, then hides the marker and draws an
 * icon-font `<i>` — `bi bi-bar-chart` from `restly-bootstrap`, which measures 0px wide
 * with its 10px margin intact, indenting every line past nothing. A real list plus a
 * `::before` fixes semantics, layout and marker at once, and an editor adds an item by
 * pressing Enter instead of opening a repeater.
 *
 * No `margin` on `.oc-checklist` itself, per the family stylesheets' no-margins
 * convention — its spacing from its neighbours is the surrounding group's own
 * `blockGap`. The `li + li` rule below is **not** an exception to that: `core/list`
 * declares neither `spacing.blockGap` nor `layout` support in core or in the active
 * Gutenberg build, so it emits no flow container and there is no
 * `.wp-container-… > * + *` rule on these `li`s to fight. Checked in both `block.json`s,
 * not assumed.
 *
 * The check glyph is an inline data URI rather than a file in `assets/images/icons/`.
 * `sync-icons.sh` exists so the icon set can be re-derived, and this is the same
 * Bootstrap Icons `check2` path the live site's `restly-bootstrap` font drew — but it has
 * to be **white on a blue badge**, and the sync script bakes `fill="#0081c2"` for icons
 * loaded through `<img src>`. A `mask-image` would sidestep the fill at the cost of a
 * second pseudo-element and a `-webkit-` prefix; one data URI on one `::before` is
 * smaller, needs no prefix, and costs no HTTP request. If the badge colour ever changes,
 * only `background-color` below moves — the glyph is white in both.
 *
 * `--oc-checklist-badge` sizes the badge so a caller in a narrow measure can shrink it
 * without a `.oc-price-card .oc-checklist` counter-rule here — i.e. without a pricing
 * selector in a site-wide file. `pricing.css` sets it to 1rem.
 */

.oc-checklist {
	list-style: none;
	padding-inline-start: 0;
}

.oc-checklist li {
	position: relative;
	padding-inline-start: calc(var(--oc-checklist-badge, 1.25rem) + 0.875rem);
}

/* 8px, against the live section's 5px: six items at 5px read as one block of text. */
.oc-checklist li + li {
	margin-block-start: 0.5rem;
}

/* `0.2em` rather than `0` aligns the badge with the cap height of the first line
   instead of its line box, so a label that wraps to two lines keeps its check beside
   the first line. Decorative, and correctly invisible to assistive tech — the list
   semantics carry the meaning. */
.oc-checklist li::before {
	content: "";
	position: absolute;
	inset-block-start: 0.2em;
	inset-inline-start: 0;
	width: var(--oc-checklist-badge, 1.25rem);
	height: var(--oc-checklist-badge, 1.25rem);
	border-radius: 4px;
	background-color: var(--wp--preset--color--accent-1, #0081c2);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: calc(var(--oc-checklist-badge, 1.25rem) * 0.7);
}
