/**
 * Causes — "Резултати" (Results) tab affordance.
 *
 * Enqueued ONLY on single "causes" pages by inc/causes-results-tab.php.
 * Full analysis + design rationale: plans/cause-results-tab-ux.md
 *
 * PROBLEM: on a completed cause the Tabs widget renders a second tab,
 * "Резултати". Stock styling leaves an inactive tab with a *transparent*
 * underline (border-bottom: 10px solid transparent) — so it reads as plain
 * text, not a clickable tab.
 *
 * APPROACH — smooth, geometry-preserving:
 *   The stock widget already reserves a 10px underline on every tab (transparent
 *   when inactive, teal when active), so the underline never shifts anything
 *   vertically. We make minimal, colour/weight-only changes and touch NO box
 *   geometry — no padding, size, display, or border-WIDTH changes — so switching
 *   tabs only changes the underline COLOUR and never reflows (this is what fixes
 *   the "text jumps when I click" choppiness):
 *     1. Inactive tab: colour the reserved 10px underline a FAINT teal (was
 *        transparent) → it now reads as a sibling tab.
 *     2. Equalize font-weight to 600 on BOTH states. Stock makes the active tab
 *        bold (700) and the inactive 400; the bold label is wider, so activating
 *        it widened the row and shoved the neighbouring tab sideways — a
 *        horizontal "jump". Same weight in both states removes that.
 *   Hover/focus brings the inactive underline to full teal as an affordance cue.
 *   No chip, no arrow, no layout change.
 *
 *   NOTE: we OVERRIDE Elementor's stock `transition: .3s` (on every .elementor-tab-title)
 *   to `none`. That transition misfires with Elementor's JS class-toggle on init and
 *   leaves the ACTIVE underline stuck at the faint start colour instead of settling on
 *   full teal. Disabling it makes the colour resolve correctly; an instant colour swap
 *   is still perfectly smooth (geometry never changes, so nothing reflows/jumps).
 *
 * Scoping / safety:
 *   .single-causes           — WP core body class for the causes CPT single.
 *   :not(.elementor-active)   — inactive tabs only; an active/in-progress cause's
 *                              lone (always-active) tab is untouched.
 *   doubled .elementor-tabs-custom-styles.elementor-tabs-custom-styles
 *     .elementor-widget-tabs  — mirrors Elementor's own specificity hack so our
 *                              rules win over stock (which is (0,5,0)) without
 *                              !important, regardless of WP Rocket combine order.
 *
 * Because we only change border-COLOUR, font-weight, and outline, the desktop
 * rules are inert on the (display:none) mobile titles and vice-versa — no media
 * query and no display override are needed (and none of the earlier
 * resurrect-hidden-titles risk applies).
 *
 * Presentation only — no markup, no ARIA, no JS. Brand: navy #1A3059, teal #88CCCA.
 */

/* ---------- DESKTOP ---------- */

/* Equalize weight across both states (a bold active tab is wider and would shove
   its neighbour sideways on click — the horizontal "jump"). */
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-desktop-title:not(.elementor-active),
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-desktop-title.elementor-active {
    font-weight: 600;
    transition: none;   /* override stock `transition:.3s`, which leaves the active underline stuck faint */
}

/* Inactive: the reserved 10px underline becomes faint teal (only the colour
   changes — same 10px height the stock rule already reserves). */
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-desktop-title:not(.elementor-active) {
    border-bottom-color: rgba(136, 204, 202, 0.5);
}

/* Hover / keyboard focus: underline comes to full teal (preview of selection). */
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-desktop-title:not(.elementor-active):hover,
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-desktop-title:not(.elementor-active):focus-visible {
    border-bottom-color: #88CCCA;
}

/* Keyboard focus ring (stock has no focus state at all). */
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-desktop-title:not(.elementor-active):focus-visible {
    outline: 2px solid #1A3059;
    outline-offset: 2px;
}

/* Active: keep the stock full-teal 10px underline explicit (weight set to 600 above). */
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-desktop-title.elementor-active {
    border-bottom-color: #88CCCA;
}

/* ---------- MOBILE (accordion): same subtle-underline logic on the stacked headers ---------- */
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-mobile-title:not(.elementor-active),
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-mobile-title.elementor-active {
    font-weight: 600;
    transition: none;
}
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-mobile-title:not(.elementor-active) {
    border-bottom-color: rgba(136, 204, 202, 0.5);
}
.single-causes .elementor-tabs-custom-styles.elementor-tabs-custom-styles.elementor-widget-tabs
  .elementor-tab-mobile-title.elementor-active {
    border-bottom-color: #88CCCA;
}
