/* ============================================================
   RANK EDGE, home page  —  header treatment and CTA sheen

   Two things the home page was missing that the six inner pages
   have: a header that changes with the band underneath it, and
   the sweeping highlight on the "Let's Talk" button.

   THIS FILE ADDS NO JAVASCRIPT, AND DOES NOT NEED ANY.
   rankedge-home-init.js has been computing the answer since the
   home page was built. It puts two classes on <body>:

       at-top     scrollY < 30
       dark-nav   the band under the header is dark, which for
                  the hero means the scrub has passed --hero-t
                  0.55 and the footage is in space

   They were written for the design's own fixed nav. The
   WordPress build replaced that nav with the Elementor header
   and nothing has consumed the classes since. All that was
   missing is the stylesheet that reads them.

   ---------------------------------------------------------
   WHY THE INNER-PAGE HEADER CSS CANNOT SIMPLY BE REUSED HERE

   rankedge-inner-header.css forces the menu white over the hero
   and turns it black past 40px. That is correct for an inner
   page, which opens on a near-black hero, and WRONG here.

   The home hero starts LIGHT and darkens as you scroll into it.
   Measured from the scrub config in rankedge-home-init.js:

       bgFrom [247,247,251]  ->  bgTo [10,12,24]
       interpolated between 4% and 34% of the hero's scroll

   So at the top of this page the header sits on #F7F7FB. A
   forced-white menu there would be invisible: exactly the bug
   the inner-page file exists to fix, only inverted. Hence three
   states rather than two.

       at-top, not dark-nav   light hero, header untouched.
                              The theme's own dark menu is
                              already correct, so there is no
                              rule for this state at all.
       dark-nav               dark band or dark hero: transparent
                              header, white menu, logo inverted.
       neither                light band below the hero: solid
                              white bar, black menu, logo as-is.

   The menu half of those states is desktop only. At 1024px and
   below the menu is an off-canvas panel with its own background,
   so it is not on the band at all and must not follow it. Section
   1 has the measurement and the reasoning.

   ---------------------------------------------------------
   WHY !important, WHICH IS NOT A HABIT

   Same reason as on the inner pages. The declaration being
   overridden is Elementor's generated per-page stylesheet:

     .elementor-12193
       .elementor-element.elementor-element-6187f77d
         .elementskit-navbar-nav > li > a { color:#16213e }

   Four classes and two elements, (0,4,2). Beating that without
   !important means hard-coding elementor-12193 and
   elementor-element-6187f77d, a post id and a widget id that
   both change the next time somebody rebuilds the header in
   Elementor. The override would break silently. One !important
   on a body-class-gated selector is the more durable choice.

   Everything here is gated on body.re-home, which the home
   template already adds, so no other page on the site is
   touched.
   ============================================================ */


/* ==========================================================================
   1. OVER A DARK BAND  (body.dark-nav)

   The child combinator is load-bearing. `.elementskit-navbar-nav > li > a`
   reaches only the top row; dropdown items live another level down in
   .elementskit-submenu-panel, which sits on a WHITE background. Whitening
   those too would trade one invisible menu for another.

   ---------------------------------------------------------
   WHY THE MENU COLOURS ARE GATED AT 1025px AND THE BAR IS NOT

   At 1024px and below the ElementsKit widget stops being a row over the page.
   Its <nav> carries ekit_menu_responsive_tablet, and below that width the same
   <ul> is re-homed into .elementskit-menu-offcanvas-elements: a panel that
   slides in over the page on its own #F7F7F7 sheet. Measured on the live page,
   the hamburger has width at 1024 and zero width at 1025, so 1025px is the
   real seam.

   Same <ul> means the same `> li > a`, so an ungated white here reached
   straight into that panel. The moment the scrub put the header over a dark
   band, opening the menu on a phone gave white text on a near-white sheet.

   The band under the header says nothing about what is behind an overlay, so
   the panel is left out of this file entirely and keeps the theme's own
   colours at every scroll position, which are already right: #000 on #F7F7F7.

   What is NOT gated is everything that really does sit on the band, the bar
   background, the logo and the hamburger. Those are over the dark hero on a
   phone exactly as they are on a desktop, and they are handled below.
   ========================================================================== */
@media (min-width:1025px){
  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li > a,
  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li > a *,
  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li > .elementskit-submenu-indicator{
    color:#fff !important;
  }

  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li > a:hover,
  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li > a:hover *,
  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li > a:focus-visible,
  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li.current-menu-item > a,
  body.re-home.dark-nav .ekit-template-content-header .elementskit-navbar-nav > li.current-menu-ancestor > a{
    color:#5BD8FF !important;   /* the brand cyan the hero already uses */
  }
}

/* The logo has nothing in it that reads on a dark ground: rankedge-logo.png is
   904x363 and of its opaque pixels 43% are dark and 0% are light. brightness(0)
   flattens it to black, invert(1) flips that to white, which is the treatment
   the design system already gives the logo on its own dark footer.

   If you have a white-on-transparent logo asset, swapping the image in is
   better than filtering: the filter also flattens the magenta in the mark. */
body.re-home.dark-nav .ekit-template-content-header img{
  filter:brightness(0) invert(1);
}

/* The selector above is the whole header template, and on mobile the off-canvas
   panel is inside it. Its images are megamenu decoration that currently render
   0x0, so nothing is visibly wrong today, but they are behind the panel's own
   light sheet rather than on the dark band, and must not be inverted with the
   logo the day somebody gives them a size. */
body.re-home.dark-nav .ekit-template-content-header .elementskit-menu-offcanvas-elements img{
  filter:none;
}

/* The hamburger is an inline SVG that paints from currentColor. */
body.re-home.dark-nav .ekit-template-content-header .elementskit-menu-hamburger,
body.re-home.dark-nav .ekit-template-content-header .elementskit-menu-hamburger svg,
body.re-home.dark-nav .ekit-template-content-header .elementskit-menu-hamburger svg *{
  color:#fff !important; fill:currentColor !important; stroke:currentColor !important;
}


/* ==========================================================================
   2. THE SOLID BAR  (scrolled, over a light band)

   :not(.at-top):not(.dark-nav) is the "below the hero, on light content"
   state. Written as two :not()s rather than a third class so that
   rankedge-home-init.js does not have to change: it already publishes
   everything this needs.

   NOT GATED ON ELEMENTOR'S OWN STICKY CLASSES. elementor-sticky--active and
   --effects would be the obvious hook and they are unusable here: the header
   container is position:absolute at the very top of the page, so Elementor
   counts it as stuck from the first pixel. Measured on the live page at
   scrollY 0 on a clean load, both classes were already applied. A class that
   is on before you scroll cannot tell you that you scrolled.
   ========================================================================== */

/* Targeted through .elementor-sticky rather than the element id: Elementor
   puts that class on whatever is set to stick, so this keeps working when
   somebody rebuilds the header and the id changes. */
body.re-home .ekit-template-content-header .elementor-sticky{
  transition:background-color .28s ease, box-shadow .28s ease;
}
body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementor-sticky{
  background-color:#fff !important;
  box-shadow:0 6px 24px -14px rgba(10,12,24,.35);
}

/* Gated at 1025px for the reason set out in section 1: below it these same
   selectors are the off-canvas panel, not the bar. Nothing on a phone changes
   colour either way, since the theme already paints the panel #000, but
   keeping the panel out of the scroll-state machinery altogether is what stops
   the next colour change from landing on it by accident. */
@media (min-width:1025px){
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li > a,
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li > a *,
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li > .elementskit-submenu-indicator{
    color:#000 !important;
  }

  /* Hover is the brand purple, not the cyan used over dark bands. Cyan on white
     is about 1.9:1 and unreadable; the purple is the ramp the design system
     already uses on its light bands. */
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li > a:hover,
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li > a:hover *,
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li > a:focus-visible,
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li.current-menu-item > a,
  body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-navbar-nav > li.current-menu-ancestor > a{
    color:#5B38A8 !important;
  }
}

body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-menu-hamburger,
body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-menu-hamburger svg,
body.re-home:not(.at-top):not(.dark-nav) .ekit-template-content-header .elementskit-menu-hamburger svg *{
  color:#000 !important;
}

/* The logo transition is declared once, unconditionally, so it eases in both
   directions rather than only on the way in. */
body.re-home .ekit-template-content-header img{
  transition:filter .28s ease;
}


/* ==========================================================================
   3. THE CTA SHEEN

   The button already carries the right classes. Its markup on the live site is

       <a class="elementskit-btn btn sheen whitespace--normal">

   so somebody has already added `btn sheen` to the Elementor widget. Nothing
   happened because the rule that draws the sweep is scoped:

       #re-home .btn.sheen::after { ... }

   and the header sits OUTSIDE #re-home. Measured on the live page: the button
   computed `content: none` on its ::after, meaning no pseudo-element was ever
   generated. The identical problem existed on the inner pages, where the same
   rule was sealed inside .rankedge-seo.

   So this restates the two rules without the wrapper. Declarations copied from
   rankedge-home.css verbatim; if the sweep is ever retuned there, retune it
   here too. Gated on body.re-home like everything else in this file, so it
   cannot reach another page's buttons.

   The keyframes are NOT redeclared. btnSheen is already defined at the top
   level of rankedge-home.css, and @keyframes are global regardless of what
   selector uses them.
   ========================================================================== */
body.re-home .btn.sheen{position:relative;overflow:hidden}
body.re-home .btn.sheen::after{
  content:"";position:absolute;top:0;left:0;width:40%;height:100%;pointer-events:none;
  background:linear-gradient(115deg,transparent,rgba(255,255,255,.55),transparent);
  animation:btnSheen 2.6s ease-in-out infinite;
}


/* ==========================================================================
   4. REDUCED MOTION

   The colour states stay: they are legibility, not decoration, and a reader
   who has asked for less movement still needs to be able to read the menu.
   What goes is the movement itself, which is the sweep and the two fades.
   ========================================================================== */
@media (prefers-reduced-motion: reduce){
  body.re-home .btn.sheen::after{display:none}
  body.re-home .ekit-template-content-header .elementor-sticky,
  body.re-home .ekit-template-content-header img{ transition:none; }
}
