/* ==========================================================================
   HAVN — one hover contract for every button in the app (v2.2.178)

   CEO directive: get rid of the highlight colour. A button filled with gold
   hid its own label, and the marketing site's unfenced `.havn-btn` rule filled
   them with a far brighter #FFC03D, which hid it completely. Nothing in the
   app is a block of yellow any more.

   What replaces it, everywhere, is one gesture:

       hover  ->  the button lifts 1px and takes a gold edge

   Four details in here are deliberate and easy to undo by accident:

   1. THE LIFT USES `translate`, NOT `transform`. The independent `translate`
      property composes with whatever `transform` an element already carries;
      `transform: translateY(-1px)` would REPLACE it. Several buttons are
      centred with a transform of their own — `.havn-ot-car-arrow` sits at
      `top:50%; transform:translateY(-50%)` — and writing this as a transform
      drops them half their height down the page on hover.

   2. THE GOLD EDGE IS A RING, NOT A BORDER. Buttons in this app disagree
      about whether they have a border at all (`.havn-ag-mx-alt` sets
      `border:0`), so `border-color` alone is invisible on half of them and
      adding a border changes the layout on the other half. A 1px box-shadow
      ring paints the same edge on both and moves nothing. `border-color` is
      set as well, so a button that already has a border turns gold rather
      than growing a second line just outside it.

   3. THE EXCLUSIONS ARE `:not()`, NOT AN UNDO RULE. A later rule setting
      `border-color: initial` does not restore the button's own border colour —
      `initial` for border-color is `currentColor`, so it would repaint the
      border in the text colour. The only way to leave an element's own styling
      untouched is to never match it, which is what the :not() list does.

   4. THE GOLD IS A FIXED PAIR, NOT `--mc-accent`. The shell writes
      `--mc-accent` inline from the agency's own brand colour, so reading it
      here would make "gold" mean whatever an agency picked — and v2.2.177
      found that inline accent landing at 2:1 in light mode. This is gold
      because the directive says gold.

   Loaded last of the plugin's stylesheets (see havn-dashboard.php), so it
   settles the hover for modules whose own sheets come earlier. The classes
   the marketing site reaches with `!important` — .havn-btn, .havn-btn-primary,
   .havn-btn-ghost — cannot be answered from here at all; they are answered in
   the body-qualified block havn-dashboard.php prints at wp_head priority 99.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens.

   `html:root` rather than `:root`: the marketing site prints its own `:root`
   block AFTER every plugin stylesheet, so a plain `:root` here loses on source
   order — that is exactly how --havn-text got flipped to black on every
   dashboard page. `html:root` is (0,1,1) against its (0,1,0) and wins whatever
   the order.
   -------------------------------------------------------------------------- */
html:root {
	--havn-hover-line:  #D4B370;                  /* the gold edge */
	--havn-hover-glow:  rgba(0, 0, 0, .45);       /* what sells the lift */
	--havn-hover-rise:  -1px;                     /* "slight" is the point */
}

/* Light mode: #D4B370 on white is a pale smear, so the edge goes deeper. The
   toggle mirrors its class onto <html> and <body>, but the shell carries
   `.havn-mc.is-light` from the first paint, before that JS has run — so the
   token is declared in both places or the first frame is wrong. */
html.havn-mc-light:root,
body.havn-mc-light,
.havn-mc.is-light {
	--havn-hover-line: #A8843C;
	--havn-hover-glow: rgba(21, 23, 28, .18);
}

/* --------------------------------------------------------------------------
   What counts as a button, and what is exempt.

   Kept as two long lists rather than a dozen module-specific rules so there is
   exactly one place to read the contract. Every argument is a simple type,
   class or attribute selector, so :is() and :not() each contribute (0,1,0) and
   the whole thing sits at a predictable (0,3,1) — high enough to settle a
   module's own hover, low enough that a module can still answer it on purpose
   without reaching for !important.

   The exemptions are each here for something that shows on screen:

     .havn-ag-mx-open   an invisible <button> stretched over a whole metric
                        tile. Ringing it in gold outlines the tile, not a
                        button, and the tile already has a hover of its own.
     switch tracks      a toggle is a switch, not a button. The knob inside is
                        what moves; lifting the track fights it.
     fixed chrome       the sidebar FAB and the mobile tab bar are pinned
                        furniture, and the FAB's position is written with a
                        translate of its own that this would overwrite.
     nav items          the sidebar has its own selected/hover language, and a
                        row of lifting nav links reads as a fault.
     disabled           a button that cannot be pressed must not offer to be.
   -------------------------------------------------------------------------- */

.havn-mc :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act),
.havn-app-bg :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act),
body.havn-dashboard-page :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act) {
	transition: translate .16s ease, box-shadow .16s ease, border-color .16s ease,
	            background .16s ease, color .16s ease;
}

.havn-mc :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act):not(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open, [disabled], [aria-disabled="true"]):hover,
.havn-app-bg :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act):not(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open, [disabled], [aria-disabled="true"]):hover,
body.havn-dashboard-page :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act):not(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open, [disabled], [aria-disabled="true"]):hover {
	translate: 0 var(--havn-hover-rise);
	border-color: var(--havn-hover-line);
	box-shadow: 0 0 0 1px var(--havn-hover-line),
	            0 6px 16px -8px var(--havn-hover-glow);
}

/* Pressed: the button goes back down under the finger, keeping the edge. */
.havn-mc :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act):not(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open, [disabled], [aria-disabled="true"]):active,
.havn-app-bg :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act):not(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open, [disabled], [aria-disabled="true"]):active,
body.havn-dashboard-page :is(button, [role="button"], input[type="submit"], input[type="button"], a[class*="-btn"], a[class*="-cta"], a.havn-ot-act, a.havn-buyer-act, a.havn-doc-act):not(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open, [disabled], [aria-disabled="true"]):active {
	translate: 0 0;
	box-shadow: 0 0 0 1px var(--havn-hover-line);
}

/* --------------------------------------------------------------------------
   The theme's yellow, which is a specificity problem rather than a colour one.

   Astra styles every bare <button> in the document:

       button                        { background-color: var(--ast-global-color-0) }  #ffc03d
       button:hover, button:focus    { background-color: var(--ast-global-color-1) }  #f8b526

   The resting rule is (0,0,1) and any class of ours outranks it. The hover and
   focus rule is **(0,1,1)** — a type selector plus a pseudo-class — and that
   beats a plain single-class rule like `.havn-ag-mx-open { background: none }`
   at (0,1,0). Specificity is decided before source order, so loading after the
   theme does not help.

   Buttons that declare their own :hover background are already at (0,1,1) or
   better and win on order. The ones at risk are buttons with no hover rule at
   all — which, in this app, is exactly the exempt list above: they are exempt
   precisely BECAUSE nothing else styles their hover. So they are the ones that
   need the theme's paint taken back off, and they are listed here rather than
   blanket-covering every button, because a blanket `background-color` on hover
   would overwrite the hover colour every other module deliberately sets.

   `:focus` matters as much as `:hover` here: it is the same Astra rule, and it
   is what made the yellow survive a mouse leaving the element.
   -------------------------------------------------------------------------- */
.havn-mc :is(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open):is(:hover, :focus, :focus-visible),
.havn-app-bg :is(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open):is(:hover, :focus, :focus-visible),
body.havn-dashboard-page :is(.havn-ag-mx-open, .havn-crm-toggle, .havn-crm-auto-toggle, .havn-es-switch, .havn-mc-switch, .havn-mc-side-fab, .havn-mc-side-toggle, .havn-mc-mobile-tab, .havn-mc-nav-item, .havn-mc-nav-group, .havn-mc-nav-open):is(:hover, :focus, :focus-visible) {
	background-color: transparent;
}

/* And a disabled button, which Astra also repaints on focus. */
.havn-mc :is(button, [role="button"])[disabled]:is(:hover, :focus),
.havn-app-bg :is(button, [role="button"])[disabled]:is(:hover, :focus),
body.havn-dashboard-page :is(button, [role="button"])[disabled]:is(:hover, :focus) {
	background-color: transparent;
}

/* --------------------------------------------------------------------------
   Primary buttons keep a rank without keeping a fill.

   Dropping the gold fill flattens primary and secondary into the same object,
   which is a real loss on screens like the pipeline where the primary action
   matters. They keep the gold, as the edge the directive asks for, at rest —
   so the hover lifts an already-gold-edged button rather than inventing the
   colour from nothing.
   -------------------------------------------------------------------------- */
.havn-mc :is(.havn-mc-btn-primary, .havn-ag-btn-primary, .havn-buyer-act-primary, .havn-crm-btn.is-primary, .havn-ot-act.is-primary),
.havn-app-bg :is(.havn-mc-btn-primary, .havn-ag-btn-primary, .havn-buyer-act-primary, .havn-crm-btn.is-primary, .havn-ot-act.is-primary),
body.havn-dashboard-page :is(.havn-mc-btn-primary, .havn-ag-btn-primary, .havn-buyer-act-primary, .havn-crm-btn.is-primary, .havn-ot-act.is-primary) {
	border-color: var(--havn-hover-line);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--havn-hover-line), transparent 55%);
}

/* --------------------------------------------------------------------------
   Motion preference. The gold edge is the affordance and it stays; only the
   movement goes, which is the whole point of the setting.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html:root { --havn-hover-rise: 0px; }
}
