/**
 * "Search with AI" header CTA. header-cta.js inserts this SAME element
 * as a real sibling immediately after the existing header search
 * widget's container (`.search_con_big`, which also carries the site's
 * own `ai_search` class), in the same row that also holds the logo --
 * never position: fixed, never a floating element, never a second/
 * duplicate button, and never moved elsewhere for narrower viewports.
 * Its appearance (text + icon, size, padding, colors) is intentionally
 * identical at every width the container itself remains visible at.
 */
.angstrom-ai-search-header-cta {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  margin-left: 12px;
  padding: 10px 18px;
  background: #5142a2;
  color: #ffffff;
  font-family: "Poppins", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

/**
 * The theme's own generic `a:visited` rule has HIGHER specificity
 * (0,1,1 -- one element selector plus one pseudo-class) than the single
 * class selector above (0,1,0), so without an explicit override here it
 * wins once the link has been visited and turns the text (and, via
 * currentColor, the icon) a dark theme-default color instead of white.
 * `color` is one of the few properties `:visited` is allowed to change
 * at all, which is exactly why only THIS property needs the explicit
 * per-state override -- background/padding/etc. are never affected by
 * `:visited` in any browser. !important guards against any other theme/
 * Elementor rule with its own higher specificity doing the same thing,
 * scoped only to this one CTA's class so no other link on the site is
 * touched.
 */
.angstrom-ai-search-header-cta:link,
.angstrom-ai-search-header-cta:visited,
.angstrom-ai-search-header-cta:hover,
.angstrom-ai-search-header-cta:active,
.angstrom-ai-search-header-cta:focus,
.angstrom-ai-search-header-cta:focus-visible {
  color: #ffffff !important;
}

.angstrom-ai-search-header-cta:hover,
.angstrom-ai-search-header-cta:focus-visible {
  background: #413383;
}

.angstrom-ai-search-header-cta:focus-visible {
  outline: 2px solid #413383;
  outline-offset: 2px;
}

/**
 * Defensive, in addition to the currentColor inheritance the icon
 * already gets from the color rule above: the icon uses
 * stroke="currentColor" with no fill, so fixing the anchor's color
 * already fixes the icon too, but this guards against any other theme
 * rule that targets svg/path color directly inside a link.
 */
.angstrom-ai-search-header-cta svg,
.angstrom-ai-search-header-cta:link svg,
.angstrom-ai-search-header-cta:visited svg,
.angstrom-ai-search-header-cta:hover svg,
.angstrom-ai-search-header-cta:active svg,
.angstrom-ai-search-header-cta:focus svg,
.angstrom-ai-search-header-cta:focus-visible svg {
  flex-shrink: 0;
  color: #ffffff !important;
  stroke: #ffffff !important;
}

/**
 * Below 1024px the row this CTA sits in (`.search_logo_header
 * .e-con-inner`) renders too much space above the button and almost
 * none below it -- confirmed directly, by computed-style measurement
 * against the live page, to come from `.search_con_big` (the same
 * element the site tags `ai_search`): it's empty, but still carries a
 * leftover ~465px width from when it held a real search input. Below
 * 1024px that's wider than the row has room for, so flexbox wraps it
 * onto its own line above the CTA -- an invisible line, since the
 * container has no content, but one that still consumes vertical
 * space. That phantom line, not the button's own box, is what was
 * creating the uneven gap (confirmed directly: no asymmetry exists at
 * wider widths where both fit on one line without wrapping).
 *
 * Zeroing the container's width removes it from the row's wrapping and
 * height calculation at any width without any visible effect of its
 * own (it already rendered at zero height with no content). With the
 * phantom line gone, `justify-content: flex-start` keeps the CTA at
 * the row's start -- its existing horizontal position, which it only
 * kept before because it was alone on its own wrapped line. The row's
 * fixed per-breakpoint height is also overridden to `auto` so it sizes
 * to the CTA alone.
 *
 * Even with that fixed, the row's own `padding-top: 10px` /
 * `padding-bottom: 0px` (confirmed directly by computed-style
 * measurement -- an existing asymmetry, unrelated to the wrap) would
 * still add 10px above and 0 below on top of the CTA's own margin, so
 * both are zeroed here too, leaving the CTA's own 5px top/bottom
 * margin (below) as the only source of spacing -- giving exactly 5px
 * above and below regardless of whatever fixed height or padding
 * Elementor sets at a given width.
 */
@media (max-width: 1024px) {
  .search_con_big.ai_search {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex-basis: 0 !important;
  }

  .search_logo_header .e-con-inner {
    height: auto !important;
    justify-content: flex-start !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /**
   * Scoped to exclude the icon-only variant below -- this margin is
   * sized for the CTA sitting in flow next to the search box (true for
   * 993-1024px, the only part of this range where that box is still
   * visible); below 992px the icon-only variant is absolutely
   * positioned beside the mobile header's hamburger instead (see
   * further down), where this same margin would otherwise throw off
   * its measured, centered placement.
   */
  .angstrom-ai-search-header-cta:not(.angstrom-ai-search-header-cta--icon-only) {
    margin-top: 5px;
    margin-bottom: 5px;
  }
}

/**
 * At and below the width where the site's own CSS hides the entire
 * desktop header (confirmed directly: @media (max-width: 992px)
 * { .site-header{display:none;} ... }), header-cta.js moves this same
 * CTA into the mobile header's hamburger-toggle wrapper
 * (`.menu-icon-etc`) instead, collapsed to icon-only, as a genuine flex
 * sibling of the toggle -- inserted immediately before or after it in
 * the DOM (see header-cta.js), not absolutely positioned against a
 * measured pixel offset. An earlier, absolutely-positioned version
 * placed the CTA's edge flush against the toggle's own measured
 * position, which rendered it partly off-screen at several widths in
 * this range: the toggle sits close enough to this wrapper's own edge
 * there that a 32px icon plus its gap had nowhere to go. Letting it
 * take part in the wrapper's own flex layout instead means the
 * browser's layout engine -- not a measured pixel guess -- guarantees
 * it always has room, confirmed directly by testing across the whole
 * range this was specified at, down to 320px.
 *
 * `margin: 0 6px` (rather than only on whichever side faces the
 * toggle) is what creates that required gap regardless of which side
 * the CTA is inserted on -- the toggle-facing side's margin is the one
 * that actually matters; the other is inert extra breathing room next
 * to the wrapper's own edge.
 *
 * Still the one source of truth for the CTA's own appearance -- size,
 * color, border-radius -- unchanged from the in-flow version, just
 * reduced to icon-only (`span` hidden) since there's no room here for
 * the full label.
 */
.angstrom-ai-search-header-cta--icon-only {
  margin: 0 6px;
  padding: 8px;
}

.angstrom-ai-search-header-cta--icon-only span {
  display: none;
}
