/* ============================================================================
   Global managed CSS — HDC Automation
   ==========================================================================*/

/* Header nav vs Contact button overlap (Header template #12).
   The desktop header row is flex-wrap:nowrap with three fixed-width children:
   logo 173px + nav content 723px + button 217px = 1113px. The row is the
   viewport minus 60px padding, so they collide once the viewport falls below
   ~1173px — but the desktop header stays visible down to the 1025px tablet
   breakpoint, leaving a broken band of 1025-1173px. Elementor's per-device
   controls cannot reach that band (its "tablet" values apply only at <=1024px),
   so it is handled here and ONLY here. Above 1180px nothing changes, so the
   Figma-matched desktop header is untouched.

   Budget at the worst case (1025px): available = 1025 - 60 = 965px.
     logo 150 + nav 598 + button 195 = 943px  ->  22px clearance.
   Nav 598px comes from ~563px glyphs x (11.5/13.5) + 58 chars x 0.8px
   letter-spacing + ~40px carets + 4 items x 8px padding. */
@media (min-width: 1025px) and (max-width: 1180px) {

  /* Nav: the largest single saving, ~125px. */
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--main .elementor-item {
    padding-left: 4px;
    padding-right: 4px;
    font-size: 11.5px;
    letter-spacing: 0.8px;
    white-space: nowrap;
  }

  /* Logo: 173px -> 150px. Height follows via the theme's img{height:auto}. */
  .elementor-12 .elementor-element.elementor-element-9481da2 img {
    max-width: 150px;
  }

  /* Button: 217px -> 195px, and never let it be squeezed or wrap. */
  .elementor-12 .elementor-element.elementor-element-fae95cb {
    width: 195px;
    flex-shrink: 0;
  }
  .elementor-12 .elementor-element.elementor-element-fae95cb .elementor-button {
    white-space: nowrap;
  }
}

/* The band immediately ABOVE the block above, 1181-1240px.
   The rules above stop at 1180px and full-size desktop values resume, but
   1113px of fixed children still do not fit a 1240 - 60 = 1180px row once the
   nav is at its Figma 13.5px/1.49px tracking. The menu UL is the part that
   gives: it wraps ABOUT onto a second line, which is what was reported at
   1200-1233px. Reported band is ~1200-1233; 1181-1240 is used so there is no
   untreated gap on either side of it.

   Deliberately a LIGHTER touch than the 1025-1180 block — 12.5px rather than
   11.5px, 6px padding rather than 4px, logo 160 rather than 150 — so the step
   at the 1180px boundary stays small instead of the type jumping twice.

   flex-wrap:nowrap on the UL is the rule that actually forces one line;
   the size trims are what stop that one line from then overflowing. */
@media (min-width: 1181px) and (max-width: 1240px) {

  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--main ul.elementor-nav-menu {
    flex-wrap: nowrap;
  }
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--main .elementor-item {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12.5px;
    letter-spacing: 1px;
    white-space: nowrap;
  }

  .elementor-12 .elementor-element.elementor-element-9481da2 img {
    max-width: 160px;
  }

  .elementor-12 .elementor-element.elementor-element-fae95cb {
    flex-shrink: 0;
  }
  .elementor-12 .elementor-element.elementor-element-fae95cb .elementor-button {
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------------------
   Handoff section 3: "Right-align the navigation group with the page margin.
   The current centered/floating alignment is not desired."

   The header row's inner flex box is justify-content:space-between, so with
   three children the nav is pushed to the MIDDLE of the row and floats there,
   its position decided by how wide the logo and button happen to be. Measured
   before this write: .e-con-inner resolved to space-between, 1365px wide.

   Rather than change the container's own justify-content control — which is a
   stored Elementor setting on a LIVE global template, and would also move the
   logo — the row is switched to flex-end and the logo given margin-right:auto.
   That pins the logo to the left margin and lets the nav and the Contact HDC
   button travel together to the right margin, with their existing 30px gap
   preserved between them.

   Desktop only: below 1025px the separate mobile header (65b421a) renders and
   this row is not on screen at all. */
@media (min-width: 1025px) {
  .elementor-12 .elementor-element.elementor-element-4917a5c > .e-con-inner {
    justify-content: flex-end;
  }
  .elementor-12 .elementor-element.elementor-element-9481da2 {
    margin-right: auto;
  }
}

/* ---------------------------------------------------------------------------
   Collapsed menu — Header template #12.

   TWO widgets render the collapsed menu, at different widths, because the two
   header rows are hidden on different devices:

     tablet  768-1024px  ->  mobile header 65b421a, nav 3317a86
     mobile  below 768px ->  desktop header row, nav 6a5acc6 collapsed to a
                             toggle (65b421a carries elementor-hidden-mobile)

   So both ids have to be styled or the two sizes do not match. 6a5acc6 is ALSO
   the desktop nav, and its stored dropdown colours are the green hover panels
   the desktop design uses — those must survive. Everything here is therefore
   capped at 1024px, which the desktop dropdown never reaches.

   Selectors repeat .elementor-element to match the specificity of Elementor's
   own generated rules; this sheet loads last, so equal specificity wins.

   Brand colours, from kit 6: green 309B31, menu black 16232E, blue 005AA1.
   ------------------------------------------------------------------------ */
@media (max-width: 1024px) {

  /* The panel itself. 6a5acc6 carries a green background for desktop. */
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown {
    background-color: #FFFFFF;
  }

  /* Every row sits on white. Only hover and the current page carry colour. */
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-item,
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-sub-item,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-item,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-sub-item {
    background-color: #FFFFFF;
    color: #16232E;
    transition: background-color .18s ease, color .18s ease;
  }

  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-item:hover,
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-item:focus,
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-item.elementor-item-active,
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-sub-item:hover,
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-sub-item:focus,
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-sub-item.elementor-item-active,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-item:hover,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-item:focus,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-item.elementor-item-active,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-sub-item:hover,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-sub-item:focus,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-sub-item.elementor-item-active {
    background-color: #309B31;
    color: #FFFFFF;
  }

  /* 1px brand-blue rule between rows. 3317a86 sets this on the widget;
     6a5acc6 has a white divider for the green desktop panel, so it is
     restated here. */
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown li:not(:last-child),
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown li:not(:last-child) {
    border-bottom-style: solid;
    border-bottom-width: 1px;
    border-bottom-color: #005AA1;
  }

  /* Second level steps in from its parent. The widgets' own horizontal
     padding is 42px, so this reads as a 22px indent. There is no widget
     control for the nested level. */
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown a.elementor-sub-item,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown a.elementor-sub-item {
    padding-left: 64px;
  }

  /* The caret follows the row instead of staying dark on green. */
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown .sub-arrow i,
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-nav-menu--dropdown .sub-arrow svg,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown .sub-arrow i,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-nav-menu--dropdown .sub-arrow svg {
    color: inherit;
    fill: currentColor;
  }

  /* Toggle: the widgets set the blue outline, radius and size. This is the
     movement between the two states. */
  .elementor-12 .elementor-element.elementor-element-3317a86 .elementor-menu-toggle,
  .elementor-12 .elementor-element.elementor-element-6a5acc6 .elementor-menu-toggle {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
  }
}

/* ---------------------------------------------------------------------------
   Client review 31 Oct, item 7: "Add Contact HDC to the phone menu."

   The green Contact HDC button in the header carries Hide On Mobile, so on a
   phone there is no way into the contact page from the header at all. The fix
   is a "Contact HDC" item added to the WordPress menu, which Elementor renders
   into BOTH navs — so it would then also appear in the desktop bar, duplicating
   the button that already sits beside it.

   Elementor's Nav Menu has no per-item visibility control and WordPress has no
   per-breakpoint one, so this is the one part that has to be CSS. It is scoped
   to .elementor-nav-menu--main, the desktop nav wrapper, rather than to a media
   query: the collapsed panel is a separate wrapper (--dropdown), so the item
   survives there at every width while never showing in the desktop bar.

   Depends on the menu item carrying the CSS class "mobile-only"
   (Appearance > Menus > Screen Options > CSS Classes).
   ------------------------------------------------------------------------ */
.elementor-nav-menu--main .menu-item.mobile-only {
  display: none;
}

/* ---------------------------------------------------------------------------
   Sticky header stands down over the footer.

   Elementor's sticky knows nothing about any element other than its own
   parent — "Stay In Column" reaches no further than that, and the header's
   parent lives inside the header document, nowhere near the footer. So the
   footer template carries a small IntersectionObserver (widget 6431171) that
   reports itself by toggling body.hdc-at-footer, and the header is moved out
   of the way from here.

   Transform rather than display:none on purpose: Elementor leaves a spacer
   behind a stuck header, and hiding the element outright would collapse that
   spacer and jump the page under the reader's cursor.
   ------------------------------------------------------------------------ */
.elementor-location-header .elementor-sticky--active {
  transition: transform .28s ease, opacity .28s ease;
}

body.hdc-at-footer .elementor-location-header .elementor-sticky--active {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
