/* Site-wide CSS overrides applied after the original WordPress/Elementor CSS.
 * Loaded via inject-overrides.js as a <link> at the end of <head>.
 *
 * Each rule explains why it exists. */

/* === Elementor button hover — force the standard "ghost" hover everywhere ===
 *
 * Several Elementor elements have per-element CSS overrides that set the
 * hover bg to var(--e-global-color-d43c13a) = #01FFC1A1 (mint with 63%
 * alpha — just a faded version of the default). The rest of the site uses
 * a "ghost button" hover: gray bg, mint text, mint border. The faded-mint
 * variant looks like a slightly-dimmed version of the default state and
 * doesn't read as a hover state at all.
 *
 * These per-element rules have specificity (0,3,1)
 * (.elementor-NNNN + .elementor-element + .elementor-element-XXX + button +
 * :hover), so we win the cascade by matching that specificity AND coming
 * later in source order. Source-order alone (we're a stylesheet at the end
 * of <head>) gives us that.
 *
 * !important is used so this rule wins over any future per-element override
 * Elementor might emit, even on pages we haven't audited.
 *
 * Affected so far:
 *   - Contact form Send button (post 16, element db64298)
 *   - Submission-successful "Back to home" button (post 5961, element 2e32885)
 *   - Likely others on pages we haven't checked yet
 */

.elementor-button:hover,
.elementor-button:focus {
  background-color: rgba(122, 122, 122, 0.43) !important;
  color: var(--e-global-color-astglobalcolor0) !important;
  border-color: var(--e-global-color-astglobalcolor0) !important;
}

/* Default state: a 1px solid border whose color matches the bg (so it's
 * invisible) prevents a 1px layout shift on hover when the border changes
 * color. Skip cookie-consent (cmplz-*) buttons since they have their own
 * styling. */
.elementor-button:not([class*="cmplz"]) {
  border: 1px solid var(--e-global-color-astglobalcolor0);
}

/* === Stop the "Manage consent" tab blinking ===
 *
 * The default Complianz CSS plays mc_slideOut on the pill's default
 * state. Any CSS recalc (variable change, breakpoint shift, parent
 * layout change) re-triggers the keyframe animation, producing a
 * visible blink as the pill slides down again.
 *
 * Fix: disable the DEFAULT-state animation but keep the hover slide-in
 * animation that brings the pill up. The pill rests at its configured
 * --cmplz-manage-consent-offset (-35px = peeking above viewport edge),
 * applied as a plain `bottom:` value (no animation), and animates up on
 * hover. Complianz's show/hide JS continues to toggle visibility via the
 * cmplz-hidden class, which is independent of this rule. */
#cmplz-manage-consent .cmplz-manage-consent {
  animation: none !important;
  bottom: var(--cmplz-manage-consent-offset);
}

/* (Custom slide-in animation removed — we now use Elementor's native
 * elementor-invisible + data-settings animation mechanism on the injected
 * Let's-talk buttons. See post-process/site-edits.js for the markup.) */

/* === Remove the divider line above the Let's-talk button on the
 * market-making sub-pages ===
 *
 * Section 512dc75 is the last content section on /market-making-for-token-issuers/
 * and /market-making-for-exchanges/, immediately above the Let's-talk button
 * (the new container we injected to replace the deleted "Talk to our team"
 * section). Section 512dc75's CSS sets a 1px bottom border that originally
 * served to separate it from the now-removed "Talk to our team" header.
 * With that header gone the border just floats above the button. Hide it.
 */
.elementor-element.elementor-element-512dc75 {
  border-bottom-width: 0 !important;
}

/* Footer + burger-menu SERVICES column: keep each service label on ONE
   line ("MM for Prediction Markets" used to wrap to three lines). */
li.elementor-icon-list-item a[href^="/market-making-for-"] .elementor-icon-list-text { white-space: nowrap; }

/* === Footer/burger MiCA link — match the other COMPANY links ===
 * The MiCA link was added as a CLONED icon-list widget whose data-id lacks
 * the per-element rules the original footer links carry. Two side effects:
 *   1. its text rendered mint-green (the default <a> link color) instead of
 *      white like Home / About Us / Blog;
 *   2. its hover-underline ::after was stuck at full column width, drawing a
 *      long green bar under "MiCA" on every page.
 * Force it back in line with its siblings: white text, no persistent line.
 * Scoped to li.elementor-icon-list-item so it never touches the header nav
 * MiCA item (which is a .elementor-item menu link, not an icon-list link). */
li.elementor-icon-list-item a[href="/regulation/"] .elementor-icon-list-text { color: #fff !important; font-size: 15px !important; line-height: 1.857 !important; }

/* === Footer/burger link underline: as wide as the LABEL, on hover + current ===
 * The theme draws the underline on <a>::after and expands it to width:100% —
 * i.e. the whole link. That equals the word for normal inline links, but the
 * whole COLUMN for the (full-width) Regulation item and for every footer link
 * on mobile (where the columns stack and each link goes full-width). Move the
 * underline onto the label span so it always matches the word, and show it on
 * hover as well as for the current page. */
.elementor-icon-list-item a:after { width: 0 !important; }
.elementor-icon-list-item a .elementor-icon-list-text { position: relative; display: inline-block; }
.elementor-icon-list-item a .elementor-icon-list-text:after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background-color: #01ffc1; transition: width .3s ease-in-out;
}
.elementor-icon-list-item a:hover .elementor-icon-list-text:after,
.elementor-icon-list-item a.active .elementor-icon-list-text:after { width: 100% !important; }

/* === Header: don't collapse to the burger so early ===
 * The header nav widget is configured as "dropdown on tablet", and this site's
 * tablet breakpoint is 1150px (see the @media (max-width:1150px) block in
 * wp-content/uploads/elementor/css/custom-pro-widget-nav-menu.min.css). So any
 * window under 1150px lost the whole menu and showed only a burger — including
 * ordinary laptop widths, which is what "the top menu disappears when the
 * window is smaller" was about.
 *
 * The header row (d536098) holds these siblings:
 *   8153be4  logo
 *   14e399d  the real horizontal menu (nav 5b7b25e)  — hidden below 1150
 *   b4ccf8f  CONTACT US wrapper — 459px wide with the button pinned to its
 *            right edge, which is the big empty gap next to the logo
 *   c533457  burger + dropdown (nav 47fbd0a)
 *
 * Below 1150px we bring the horizontal menu back and keep the burger, with
 * CONTACT US pulled in tight next to the burger so the freed space goes to
 * the menu. Showing the container alone is not enough: the nav widget inside
 * it (5b7b25e) is ALSO switched to burger mode by the same 1150px breakpoint,
 * so it would render a second burger of its own.
 *
 * Everything here is sized with clamp() rather than fixed px per breakpoint.
 * A fixed cutoff is always a cliff: the links fit at one width and vanish one
 * pixel below it (that was the 861 -> 801 chase). With clamp the logo, link
 * text and CONTACT US shrink continuously as the window narrows, so the links
 * survive all the way down to 768px instead of snapping away. 768 is a hard
 * floor: at 767px Elementor switches the header to its stacked phone layout,
 * and forcing the links in there breaks it into three rows.
 *
 * The button's default 40px side padding is the single biggest space hog at
 * narrow widths — trimming it is what buys room for the five links. */
@media (min-width: 768px) and (max-width: 1150px) {
  /* bring back the horizontal menu, and let it use the freed space.
   * flex:0 0 auto, NOT 1 1 auto: as a shrinkable item the container got
   * squeezed below the width the five items need and the <ul> simply
   * overflowed it, running the last items into the CONTACT US button. */
  .elementor-element-14e399d { display: flex !important; width: auto !important; flex: 0 0 auto !important; }
  .elementor-element-5b7b25e .elementor-nav-menu--main { display: flex !important; }
  .elementor-element-5b7b25e .elementor-menu-toggle { display: none !important; }
  .elementor-element-5b7b25e .elementor-nav-menu--dropdown { display: none !important; }
  .elementor-element-5b7b25e ul.elementor-nav-menu { flex-wrap: nowrap !important; }
  .elementor-element-5b7b25e ul.elementor-nav-menu > li > a { white-space: nowrap !important; }

  /* Keep the burger alongside the links. */
  .elementor-element-c533457 { display: flex !important; flex: 0 0 auto !important; width: auto !important; }

  /* Fluid: full size at 1150, gently smaller toward 601. */
  .elementor-element-8153be4 img {
    max-width: clamp(104px, 15vw, 200px) !important; height: auto !important;
  }
  .elementor-element-5b7b25e ul.elementor-nav-menu > li > a.elementor-item {
    font-size: clamp(11px, 1.45vw, 16px) !important;
    padding-left: clamp(2px, 0.4vw, 5px) !important;
    padding-right: clamp(2px, 0.4vw, 5px) !important;
  }
  .elementor-element-cc68040 .elementor-button {
    font-size: clamp(10px, 1.25vw, 14px) !important;
    padding: clamp(9px, 1.5vw, 17px) clamp(12px, 2.6vw, 40px) !important;
  }
}

/* CONTACT US sits in a 459px-wide wrapper with the button pinned right, which
 * strands a big empty gap beside the logo. Shrink the wrapper to its button so
 * CONTACT US sits next to the burger, across the whole tablet/narrow-laptop
 * range — both where the links are shown (above) and where the burger is
 * alone. Not applied below 768px: at 767px Elementor switches the header to
 * its stacked phone layout, where these row-level tweaks do not apply. */
@media (min-width: 768px) and (max-width: 1150px) {
  .elementor-element-b4ccf8f { flex: 0 0 auto !important; width: auto !important; }
}

/* === Phone header (below 768px) ===
 * Elementor lays this row out as a COLUMN on phones, so the logo, the burger
 * and CONTACT US each took a full-width line: a 149px-tall header eating ~18%
 * of a 812px screen, with CONTACT US stranded at the bottom-left, far from the
 * burger, and the burger's centre sitting 12px below the logo's.
 *
 * Layout is now two tight rows:
 *   row 1  logo | CONTACT US | burger      (~49px)
 *   row 2  HOME SERVICES ABOUT US BLOG REGULATION
 *
 * Row 2 exists because the links cannot share row 1 on a phone. At 375px the
 * five links need ~256px at a readable size; logo (120) + links (256) +
 * CONTACT US (102) + burger (38) + gaps is ~540px. Even deleting CONTACT US
 * entirely does not make one row fit, so a second row is the only way to keep
 * the links visible at phone widths.
 *
 * As in the 768-1150 band, the two nav widgets split the work:
 *   14e399d / 5b7b25e  -> the horizontal links (row 2, full width)
 *   c533457 / 47fbd0a  -> the burger + its dropdown (row 1)
 * One widget cannot do both, since each renders EITHER a menu OR a toggle. */
@media (max-width: 767px) {
  .elementor-element-d536098 > .e-con-inner {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  /* logo left; margin-right:auto pushes the other two to the right edge.
   * Its stock 41px right margin is a column-layout leftover — drop it so the
   * spacing comes from the auto margin and the row gap instead. */
  .elementor-element-8153be4 {
    flex: 0 1 auto !important; width: auto !important;
    margin: 0 auto 0 0 !important;
  }
  .elementor-element-8153be4 img {
    max-width: clamp(120px, 38vw, 160px) !important; height: auto !important;
  }

  /* CONTACT US then burger, both sized to content and vertically centred */
  /* margin-top:15px was the gap above the old CONTACT US row; on one line it
   * just pushes the button 7px below the logo and burger. */
  .elementor-element-b4ccf8f {
    flex: 0 0 auto !important; width: auto !important; order: 2 !important;
    align-items: center !important;
    margin: 0 !important;
  }
  /* Burger on row 1, from the c533457 widget.
   * margin-top:-50px is a leftover from the column layout, where it yanked the
   * burger up onto the logo's line. In a row it drags the burger above the
   * header entirely (top: -13px), so reset it. The toggle's 46px line-height
   * also inflated its box to 59px — normalise that so it centres cleanly. */
  .elementor-element-c533457 {
    display: flex !important;
    flex: 0 0 auto !important; width: auto !important; order: 3 !important;
    align-items: center !important;
    margin-top: 0 !important;
  }
  .elementor-element-c533457 .elementor-widget-container { align-items: center !important; }
  .elementor-element-c533457 .elementor-menu-toggle {
    line-height: 1 !important; padding: 6px !important; align-self: center !important;
  }

  /* Links on row 2: full width, forced out of burger mode, evenly spread. */
  /* justify-content:flex-end is inherited from the desktop header, where this
   * container is right-aligned; on the full-width links row it pushed the menu
   * over and left a gap under the logo. */
  .elementor-element-14e399d {
    display: flex !important;
    order: 4 !important;
    flex: 1 0 100% !important; width: 100% !important;
    justify-content: flex-start !important;
    margin: 0 !important;
  }
  .elementor-element-5b7b25e { width: 100% !important; flex: 1 1 auto !important; }
  .elementor-element-5b7b25e .elementor-nav-menu--main { display: flex !important; }
  .elementor-element-5b7b25e .elementor-menu-toggle { display: none !important; }
  .elementor-element-5b7b25e .elementor-nav-menu--dropdown { display: none !important; }
  .elementor-element-5b7b25e .elementor-widget-container { width: 100% !important; }
  .elementor-element-5b7b25e ul.elementor-nav-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    width: 100% !important;
  }
  .elementor-element-5b7b25e ul.elementor-nav-menu > li > a.elementor-item {
    font-size: clamp(9px, 2.9vw, 13px) !important;
    padding: 4px 1px !important;
    white-space: nowrap !important;
  }

  /* compact button so it sits inline instead of filling its own row */
  .elementor-element-cc68040 .elementor-button {
    font-size: 12px !important;
    padding: 10px 14px !important;
    white-space: nowrap !important;
  }

  /* Panel position. Elementor's "stretch" JS writes inline top/left/width onto
   * the dropdown, measured from the nav widget — with the widget now narrow and
   * right-aligned it computed left:-271px, leaving the panel inset 47px and
   * overflowing the right edge, floating ~100px below the header.
   *
   * Re-anchor it instead: make the nav wrappers static so the nearest
   * positioned ancestor is the header row, then top:100% pins the panel to the
   * header's bottom edge whatever its height, and the margin-left calc pulls it
   * out to full viewport width regardless of the row's side padding.
   * !important is required — it has to beat the JS's inline styles.
   *
   * Note: the open/close animation uses transform: scaleY(), so the panel can
   * NOT be centred with a transform here. */
  .elementor-element-d536098 { position: relative !important; }
  .elementor-element-14e399d,
  .elementor-element-5b7b25e,
  .elementor-element-c533457,
  .elementor-element-47fbd0a { position: static !important; }

  /* The 90px void between header and panel comes from the widget's "distance
   * from menu" setting, emitted per page as
   *   .elementor-1142 .elementor-element.elementor-element-5b7b25e
   *     .elementor-nav-menu__container.elementor-nav-menu--dropdown
   *       { margin-top: 90px !important }
   * That is five classes (0,5,0) AND !important, so a short selector loses even
   * with !important. The .elementor-NNNN prefix is the POST ID and differs on
   * every page, so we cannot match it — instead the dropdown class is repeated
   * below purely to reach the same specificity, and site-overrides.css loads
   * last so equal specificity resolves in our favour.
   * Both nav widgets are covered: 5b7b25e drives the burger at phone widths,
   * 47fbd0a at some others. */
  .elementor-element.elementor-element-5b7b25e .elementor-nav-menu__container.elementor-nav-menu--dropdown.elementor-nav-menu--dropdown,
  .elementor-element.elementor-element-47fbd0a .elementor-nav-menu__container.elementor-nav-menu--dropdown.elementor-nav-menu--dropdown {
    top: 100% !important;
    left: 0 !important;
    width: 100vw !important;
    margin: 0 0 0 calc(50% - 50vw) !important;
  }

  /* Roomy tap targets in the panel, and a hairline between items so the list
   * reads as separate rows rather than one block of text. */
  .elementor-element-5b7b25e .elementor-nav-menu--dropdown a.elementor-item,
  .elementor-element-47fbd0a .elementor-nav-menu--dropdown a.elementor-item {
    padding: 16px 24px !important;
    font-size: 15px !important;
  }
  .elementor-element-5b7b25e .elementor-nav-menu--dropdown li:not(:last-child) > a,
  .elementor-element-47fbd0a .elementor-nav-menu--dropdown li:not(:last-child) > a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
}
