/* Wagtail 6.4.2 admin overrides.
 *
 * Fix: BooleanBlock checkboxes inside StreamField (e.g. "Is enabled" on
 * Trustpilot Badge / Google Badge in the Banner section) are unclickable.
 *
 * Cause: Wagtail renders a per-field "Add Comment" button as an
 * absolutely-positioned sibling inside `.w-field__input`. On normal-
 * width fields it sits to the right of the input; on a BooleanBlock the
 * input is only ~24px wide, so the button's padded hitbox overlaps the
 * checkbox. The button is `opacity: 0` until hover, so visually nothing
 * is there — but it still receives the click and the checkbox doesn't.
 *
 * Make the idle (not hovered) "Add Comment" button transparent to
 * pointer events. Its existing CSS restores opacity on hover, at which
 * point pointer-events return via the `:hover` exclusion in the
 * selector below, so commenting still works when intentionally aimed.
 */
.w-field__input
  > input[type="checkbox"]
  ~ .w-field__comment-button--add:not(:hover) {
  pointer-events: none;
}

/* Fix: BooleanBlock checked-state tick is invisible on the dark theme.
 *
 * Cause: Wagtail draws the tick with a `mask-image` set to check.svg and
 * `background: Highlight` (a CSS system color). On dark mode the OS
 * frequently resolves `Highlight` to a low-contrast value, leaving the
 * checkmark invisible against the checkbox background.
 *
 * Force a contrasting filled background on the checkbox itself and a
 * white tick on top. Scoped to `:checked` so the idle state still
 * follows Wagtail's own styling.
 */
input[type="checkbox"]:checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
}

input[type="checkbox"]:checked:before {
  background: #ffffff;
}
