/**
 * Shared rules for segmented headings (`.split-reveal-heading` + `.text-pill`).
 *
 * Loaded as a style dependency of every widget that emits `.text-pill`.
 * Per-widget CSS files keep their own pill recipes for capsule styling
 * (background, ring, padding overrides) — this file only owns spacing
 * defaults that should be uniform across every segmented heading.
 *
 * Set 2026-05-08 (Strategy B). See `.cursor/reports/2026-05-08-pill-pull-trait/`.
 */

/*
 * Pill capsule horizontal pull-in.
 *
 * Pill internal padding (1.25rem ≈ 20px) stacks with inter-word .split-word
 * margin (0.2em ≈ 7px) AND the literal whitespace character that sits between
 * adjacent inline-block spans (~0.27em ≈ 10px). Without compensation, a
 * pill-adjacent visual gap reads ~37px vs. ~17px for natural inter-word
 * spacing. Negative margin pulls the pill capsule back ~9.6px on each side
 * so the effective gap matches natural word spacing within ~3px.
 *
 * Per-widget override via "Pill horizontal pull-in" Elementor control
 * (CW_Widget_Pill_Pull_Trait); the control's `{{WRAPPER}}` selector wins
 * over this rule due to higher specificity when the editor sets a value.
 */
.split-reveal-heading .text-pill {
	margin-left: -0.6rem;
	margin-right: -0.6rem;
}

/*
 * Drop the inter-word margin on a `.split-word` that immediately precedes
 * a `.text-pill` (or a wrapper containing a pill). The pill's negative
 * margin already absorbs the space; the artificial 0.2em margin would
 * otherwise compound with it.
 *
 * Two selectors cover both DOM shapes:
 *   • `<word/> <pill/>`                       — section-intro, dedicated-resources
 *   • `<word/> <wrapper><pill/></wrapper>`    — zones / aajt-device (pill wrapped
 *                                               in `.cw-zones-heading-accent`)
 *
 * Requires `:has()` (Chrome 105+, Safari 15.4+, Firefox 121+ — all current
 * browsers as of 2026-05).
 */
.split-reveal-heading .split-word:has(+ .text-pill),
.split-reveal-heading .split-word:has(+ * .text-pill) {
	margin-right: 0;
}
