/**
 * WEPRO-CTA — Side CTA auto-collapse resting state (v5.10.1)
 * ---------------------------------------------------------------------------
 * Loaded ONLY when auto-collapse is on (`side_cta_dock`, via
 * Cta_Renderer::ensure_side_cta_dock_assets), versioned by filemtime so it
 * cache-busts independently of the plugin version.
 *
 * ── WHAT CHANGED IN 5.7.0, AND WHY ─────────────────────────────────────────
 * Through 5.6.x the resting state slid the WHOLE rail off the screen edge with
 * `translateX(min(35px, 100% - 15px))`, leaving a 15px UNLABELED sliver. That
 * had three consequences, and each one is the failure this release exists to
 * remove:
 *
 *   1. THE VISITOR COULD NO LONGER READ WHAT THE CONTROL DID. A sliver of a
 *      plate is an icon by another name — the label, which is the entire
 *      accessible and commercial payload of a text tab, was off-screen.
 *   2. IT NEEDED A SECOND CONTROL TO UNDO IT. Because a 15px sliver is not a
 *      hittable target, a transparent 44px "grab layer" had to be injected on
 *      touch, whose only job was to intercept a tap and bring the rail back —
 *      a discovery step in front of the real CTA.
 *   3. IT WAS A MOVING TARGET. A control that relocates itself under a
 *      pointer is exactly the vestibular/attention problem `prefers-reduced-
 *      motion` exists to prevent, which is why the old file had to suppress
 *      docking entirely under that preference.
 *
 * The resting state is now a REDUCTION of the same rail rather than a
 * withdrawal of it: the labelled primary tab stays fully on screen, at full
 * size, full contrast and full tap-target, and only an optional SECONDARY
 * sibling is withdrawn. There is no sliver, so there is nothing to grab and the
 * grab layer is gone with it. There is no translation, so there is no motion to
 * suppress and no target that moves out from under a pointer.
 *
 * A single-action rail therefore has no resting state to enter at all — there
 * is no secondary tab to withdraw, and the primary one may never be hidden.
 * That is deliberate: "collapse" must never be able to reach zero visible CTAs.
 *
 * ── THE PHONE GATE (v5.10.0) ───────────────────────────────────────────────
 * EVERY RULE IN THIS FILE IS NOW GATED TO >= 769px, i.e. to the widths where
 * the rail's own responsive step already says "not a phone".
 *
 * The reason is the one thing this resting state cannot supply on a touch
 * screen: A GESTURE THAT UNDOES IT. The wake condition is
 * `:not(:hover):not(:focus-within)` plus the enhancer's `mouseenter` /
 * `focusin` listeners — all three are pointer or keyboard affordances. On a
 * phone there is no hover and no keyboard, so once the timer fires the
 * secondary tab is simply GONE, and the only thing that brings it back is a
 * touch on the tab still on screen. On the fleet's own rails that remaining
 * tab is frequently `tel:` — so the only way to see the second call to action
 * was to place a phone call. Measured on two local tenants at 390x844: after
 * the 4s timer the secondary tab reported `display:none` and no amount of
 * scrolling, in either direction, restored it.
 *
 * A rail that reduces itself with no way back is not a resting state, it is a
 * hidden control. So below the breakpoint the phone behaviour is owned by
 * `side_cta_mobile_behaviour` instead (Side_Cta_Scroll::behaviour), whose
 * default withdraws the WHOLE rail only while the visitor's own downward
 * scroll is driving it and restores it on the inverse gesture, on scroll idle
 * and at the top of every page.
 *
 * `--idle-on-mobile` is the deliberate opt-out: a site that chooses
 * `idle_collapse` gets the historical behaviour on phones too, and the class
 * is emitted server-side so the choice can never be inferred from CSS alone.
 *
 * 769px is `Side_Cta_Scroll::BREAKPOINT + 1`. A media query cannot read a PHP
 * constant, so the pair is kept in step by hand — change one, change the
 * other — exactly as side-cta-scroll.css already documents for its own half.
 *
 * ── THE INVARIANTS THIS FILE MUST NEVER BREAK ──────────────────────────────
 *   · the primary tab is visible, labelled and >= 44px in EVERY state;
 *   · NO TAB MOVES when another one is withdrawn or restored (F-3068, 5.10.1);
 *   · no state introduces an icon-only control, a launcher, a popover, a
 *     detached close button or a click-to-reveal step;
 *   · the resting state is reachable and reversible by keyboard alone;
 *   · nothing here changes the awake rail's paint;
 *   · NO STATE MAY WITHDRAW A TAB THAT THE VISITOR'S INPUT DEVICE CANNOT
 *     BRING BACK.
 */

/* ── Resting state ───────────────────────────────────────────────────────
 * The ONLY thing that happens: an optional secondary tab is withdrawn.
 *
 * `visibility: hidden` rather than a fade, and rather than `display: none`
 * (v5.10.1). A partially-transparent tab is still hit-testable and still
 * focusable, so a fade would leave an invisible-but-clickable CTA over the
 * page and a keyboard tab-stop that announces a control the visitor cannot
 * see. `visibility: hidden` has none of those problems: the subtree leaves the
 * accessibility tree, leaves sequential focus navigation, and stops being a
 * hit-test target — exactly like `display: none`, and unlike opacity.
 *
 * ── WHY IT IS NO LONGER `display: none` (F-3068) ───────────────────────────
 * Because `display: none` took the tab OUT OF THE BOX TREE, and this rail is a
 * `position: fixed` flex column centred with `translateY(-50%)`. Removing a
 * child shortens the column, and a shorter centred column re-centres — so the
 * tab that STAYED moved.
 *
 * Measured on the agency reference install at 390x844, weprocta 5.8.0: when
 * the secondary tab was withdrawn the remaining tab travelled from y=271.3 to
 * y=330.8 — 59.5px, with no gesture, while a pointer was on its way to it.
 * The file's own header claimed "no target that moves out from under a
 * pointer". That claim was false for the whole life of the resting state, and
 * this is the change that makes it true.
 *
 * `visibility: hidden` keeps the box — and the flex `gap` that goes with it —
 * so the column's height does not change, the survivor does not move, and the
 * rail's footprint is identical awake and at rest. The withdrawn band is inert:
 * the stack itself is `pointer-events: none` and a `visibility: hidden` subtree
 * is not a hit-test target, so clicks in that band reach the page beneath.
 *
 * It also removes the reason the old rule had to be careful about `display`
 * values at all (see the note below): nothing is restored to a guessed value,
 * because nothing was ever taken out of flow.
 *
 * Cumulative Layout Shift contribution is zero, and now so is the rail's own
 * internal shift — by measurement (`gate-rail.js` G-8), not by construction.
 */
/*
 * WAKE IS EXPRESSED IN THE SAME SELECTOR, NOT IN A SECOND RULE.
 *
 * The obvious shape — hide in one rule, restore in a `:hover` rule — is WRONG
 * here, and silently so. It was fatal while the mechanism was `display`, whose
 * base value on this tab is not one value: `weprocta.css` paints
 * `--desktop-only { display: block }` and flips both visibility classes at the
 * phone breakpoint, so a restore rule would have had to GUESS. Since 5.10.1
 * the mechanism is `visibility`, whose restore value would be knowable — but
 * the single-selector shape is kept anyway, because it is what makes the wake
 * conditions below structurally impossible to get out of step with the hide.
 *
 * Folding `:not(:hover):not(:focus-within)` into the hiding selector means the
 * rule simply stops applying while the rail is engaged, so the tab returns to
 * whatever display value it actually had. Nothing is guessed and nothing is
 * overridden.
 *
 * `:focus-within` is the keyboard guarantee: while focus is anywhere inside the
 * rail it CANNOT be in the resting state, no matter what the timer does, so a
 * keyboard user can never have the tab they are on withdrawn from under them.
 *
 * Reduced motion is deliberately NOT handled here. It is a behavioural choice
 * (`side_cta_reduced_motion`) and it is owned by the enhancer, which either
 * never enters the resting state ('no_collapse', the default) or enters it
 * immediately and without animation ('instant'). Encoding it in a media query
 * as well would make the 'instant' choice unreachable.
 */
@media (min-width: 769px) {

	.weprocta-side-cta-stack--autocollapse.weprocta-sc-idle:not(:hover):not(:focus-within) .weprocta-side-cta--secondary {
		visibility: hidden;
	}
}

/* The phone opt-out. Same rule, same guarantees, reachable only when the site
 * has explicitly chosen `idle_collapse` — the class is emitted server-side by
 * Cta_Renderer, so a phone can never enter this state by CSS accident. */
@media (max-width: 768px) {

	.weprocta-side-cta-stack--autocollapse.weprocta-side-cta-stack--idle-on-mobile.weprocta-sc-idle:not(:hover):not(:focus-within) .weprocta-side-cta--secondary {
		visibility: hidden;
	}
}

/* ── The share tab (v5.8.0) ──────────────────────────────────────────────
 *
 * The third surface participates in the resting state on exactly the same
 * terms as the secondary tab, and under one extra guarantee that is worth
 * being explicit about:
 *
 *   IT CAN ONLY BE WITHDRAWN WHILE ANOTHER LABELLED TAB REMAINS.
 *
 * That is not asserted by these selectors — it is asserted by the class they
 * require. `--share-collapsible` is emitted by the renderer only when the
 * primary tab is also on the page (Cta_Renderer::build_side_cta_html), and a
 * share-only rail never receives `--autocollapse` at all, so neither rule
 * below can match one. The alternative — asking CSS whether a sibling exists
 * via `:has()` — would silently hide the last call to action on every engine
 * that does not support it, which is the exact failure this plugin spent 5.7.0
 * removing. Permission is decided in PHP; CSS only carries it out.
 *
 * `visibility: hidden` for the same reasons as above: a faded tab is still
 * hit-testable and still focusable, so it would leave an invisible clickable
 * control and a phantom tab stop — and a `display: none` share tab would
 * shorten the column and move its siblings (F-3068).
 *
 * TWO RULES, NOT ONE, because the share tab may run on its own timer. When it
 * does, `--share-delay` is present and the tab must ignore the rail's class
 * entirely — otherwise a shorter rail delay would withdraw it early and the
 * configured delay would read as broken. `:not(--share-delay)` on the first
 * rule is what keeps the two timers from overlapping.
 */
@media (min-width: 769px) {

	.weprocta-side-cta-stack--autocollapse.weprocta-side-cta-stack--share-collapsible:not(.weprocta-side-cta-stack--share-delay).weprocta-sc-idle:not(:hover):not(:focus-within) .weprocta-side-cta--share {
		visibility: hidden;
	}
}

@media (max-width: 768px) {

	.weprocta-side-cta-stack--autocollapse.weprocta-side-cta-stack--idle-on-mobile.weprocta-side-cta-stack--share-collapsible:not(.weprocta-side-cta-stack--share-delay).weprocta-sc-idle:not(:hover):not(:focus-within) .weprocta-side-cta--share {
		visibility: hidden;
	}
}

@media (min-width: 769px) {

	.weprocta-side-cta-stack--autocollapse.weprocta-side-cta-stack--share-delay.weprocta-sc-share-idle:not(:hover):not(:focus-within) .weprocta-side-cta--share {
		visibility: hidden;
	}
}

@media (max-width: 768px) {

	.weprocta-side-cta-stack--autocollapse.weprocta-side-cta-stack--idle-on-mobile.weprocta-side-cta-stack--share-delay.weprocta-sc-share-idle:not(:hover):not(:focus-within) .weprocta-side-cta--share {
		visibility: hidden;
	}
}

/* ── Retired in 5.7.0 ────────────────────────────────────────────────────
 * `.weprocta-sc-grab` no longer exists in the markup — the enhancer stopped
 * creating it when the sliver it compensated for was removed. This rule stays
 * as a one-line guard so a cached 5.6.x script that still injects the layer
 * cannot leave an invisible, page-blocking overlay pinned over the rail during
 * the window between a CSS and a JS cache expiring.
 */
.weprocta-sc-grab {
	display: none !important;
}
