/**
 * Checkmark bullets for content lists.
 *
 * Loaded on the site after style.css and in the block editor canvas (see
 * functions.php), so editors see the same bullets while editing; the compiled
 * style.css never reaches the canvas.
 *
 * Applies to unordered core List blocks (ul.wp-block-list) and plain
 * unclassed lists in post content (classic / WYSIWYG lists). Navigation,
 * footer menus, tag pills, the A-Z index and the other block lists all carry
 * their own classes and styling, so they are not matched. Ordered lists keep
 * their numbers. Opt out with the "No bullets" list style
 * (.is-style-no-bullets).
 *
 * The checkmark is images/icons/bullet-check.svg used as a mask, so its colour comes
 * from --ivy-bullet-color: black by default, white in dark sections. Logical
 * properties put it on the right in RTL.
 */

:root {
	--ivy-bullet-color: #000;
}

/* Dark sections: white text, the blue CTA band, covers that aren't light. */
.has-white-color,
.is-style-teal-blue-gradient,
.wp-block-cover:not(.is-light) {
	--ivy-bullet-color: #fff;
}

:is(ul.wp-block-list, .entry-content ul:not([class])):not(.is-style-no-bullets) {
	list-style: none;
	/* Room for the checkmark plus the gap before the text. */
	padding-inline-start: 1.5em;
}

:is(ul.wp-block-list, .entry-content ul:not([class])):not(.is-style-no-bullets) > li {
	position: relative;
}

/* Hangs in the list's indent, so wrapped lines line up with the text. */
:is(ul.wp-block-list, .entry-content ul:not([class])):not(.is-style-no-bullets) > li::before {
	content: "";
	position: absolute;
	inset-inline-start: -1.5em;
	/* Centred on the first line; 0.25em where lh units aren't supported. */
	top: 0.25em;
	top: calc((1lh - 0.93em) / 2);
	/* bullet-check.svg is 14 x 13. */
	width: 1em;
	height: 0.93em;
	background-color: var(--ivy-bullet-color, #000);
	-webkit-mask: url("../images/icons/bullet-check.svg") no-repeat center / contain;
	mask: url("../images/icons/bullet-check.svg") no-repeat center / contain;
}

/* The "No bullets" list style: no marker at all. */
ul.wp-block-list.is-style-no-bullets {
	list-style: none;
	padding-inline-start: 0;
}

/* Nested lists: a smaller checkmark, same indent. */
:is(ul.wp-block-list, .entry-content ul:not([class])):not(.is-style-no-bullets) li :is(ul.wp-block-list, ul:not([class])):not(.is-style-no-bullets) > li::before {
	top: calc((1lh - 0.74em) / 2);
	width: 0.8em;
	height: 0.74em;
	inset-inline-start: -1.35em;
}
