/* Nav — source: sections/Nav.tsx */

/*
 * Built from native Pro widgets: nav-menu (x2, bound to the "LifeTec LP" WP
 * menu), off-canvas (the drawer), button (x4) and icon (x2). The presentation
 * lives here rather than in the widgets' style controls, for the same reason it
 * does in every other section: this file always loads, whereas Elementor's own
 * settings only reach the page through generated CSS.
 *
 * Two facts about this install shape almost every selector below, and neither
 * is the Elementor default you would find in the docs:
 *   - e_optimized_markup is ACTIVE, so there is no .elementor-widget-container
 *     and no .elementor-button-wrapper. Widgets' inner markup hangs directly
 *     off .elementor-element.
 *   - e_font_icon_svg is ACTIVE, so icon widgets render <svg class="e-font-icon-svg">
 *     rather than <i class="eicon-…">.
 */

/*
 * Block, not Elementor's flex column: the off-canvas widget is a sibling of the
 * pill wrapper and a flex parent would apply its gap between them, padding out
 * the fixed header's height for a child that renders at position:fixed anyway.
 */
#lt-nav {
  display: block;
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  padding: 10px 0;
}

/* The pill is inset by .lt-container's padding rather than being the 1280 band
   itself, so its edges line up with the Hero grid's content edges. */
#lt-nav .lt-nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  /* Physical, as in the source: 15px on the logo side, 10px on the CTA side. */
  padding: 0 15px 0 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 2px 12px rgba(41, 128, 242, 0.06), inset 0 0 0 1px rgba(41, 128, 242, 0.18);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* lifetec.js toggles .is-scrolled on #lt-nav at scrollY > 40. */
#lt-nav.is-scrolled .lt-nav-pill {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 24px rgba(41, 128, 242, 0.14), inset 0 0 0 1px rgba(41, 128, 242, 0.14);
}

/* Elementor sizes direct child widgets from --container-widget-width; left at
   100% the three groups stack instead of sitting on one row. */
#lt-nav .lt-nav-pill > .elementor-element {
  width: auto;
  max-width: none;
  flex: 0 0 auto;
}

#lt-nav .lt-nav-logo a {
  display: flex;
  align-items: center;
}

#lt-nav .lt-nav-logo img {
  height: 30px;
  width: auto;
  display: block;
}

/*
 * Links — nav-menu widget, menu "LifeTec LP" (Appearance > Menus).
 * pointer:none is set in the JSON, so the widget renders .e--pointer-none and
 * none of Elementor's :before/:after pointer rules match. Nothing to undo here.
 */
#lt-nav .lt-nav-links .elementor-nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

/*
 * Typography goes on .elementor-item (the <a>), never on the widget wrapper.
 * Two resets are load-bearing here, both because Elementor styles the anchor
 * for a standalone menu rather than one dropped into an existing design:
 *   - `padding: 13px 20px` would space the links on top of the 24px gap;
 *   - `line-height: 20px` would replace the 1.6 the source's <a> inherited
 *     from body. It changes no glyph position inside the centred pill, but the
 *     drawer's links below are padded and bordered, where the same override
 *     is the difference between a 55px and a 48px row.
 */
#lt-nav .lt-nav-links .elementor-item {
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--page-fg);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

#lt-nav .lt-nav-links .elementor-item:hover {
  color: var(--brand-primary);
}

/* Phone + CTA */
#lt-nav .lt-nav-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 0;
}

/*
 * .elementor-button hardcodes line-height:1; the source's <a> inherited body's
 * 1.6, so every .elementor-button rule in this file restates it or the control
 * comes out ~8px shorter than the design.
 */
#lt-nav .lt-nav-phone .elementor-button {
  display: flex;
  align-items: center;
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--brand-primary);
  text-decoration: none;
  white-space: nowrap;
  transition: none;
}

/*
 * The three Lucide glyphs (phone, burger, X) are drawn here as masked
 * data-URIs rather than picked in the icon control. SVG uploads are disabled on
 * this site by a deliberate security decision (see assets-manifest.json), and
 * Icons_Manager::render_uploaded_svg_icon() needs a media-library attachment
 * ID — so no icon control can reach these exact shapes. The widgets still carry
 * a real eicon so they render and stay editable; the glyph is presentation, and
 * it is aria-hidden decoration in the source either way.
 *
 * .elementor-button-content-wrapper already ships display:flex and gap:5px,
 * which is exactly the source's phone layout — only align-items is missing.
 */
#lt-nav .lt-nav-phone .elementor-button-content-wrapper {
  align-items: center;
}

#lt-nav .lt-nav-phone .elementor-button-content-wrapper::before {
  content: "";
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12a19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 3.6 1.29h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.91 8.83a16 16 0 0 0 6 6l.91-.91a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 21.73 16.92z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12a19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 3.6 1.29h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.91 8.83a16 16 0 0 0 6 6l.91-.91a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 21.73 16.92z'/%3E%3C/svg%3E") center / contain no-repeat;
}

#lt-nav .lt-nav-cta .elementor-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  padding: 9px 20px;
  border-radius: var(--r-pill);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

#lt-nav .lt-nav-cta .elementor-button:hover {
  background: #c20202; /* unified with Hero, which the source spelled #c90303 here */
  transform: translateY(-1px);
}

/*
 * Burger — icon widget whose link is the off-canvas open action hash. It has to
 * be an <a>: Pro's off-canvas handler discovers its triggers by scanning
 * document.body for anchors whose href carries a matching elementor-action.
 * Shown only under 900px (see the media queries at the foot).
 */
#lt-nav .lt-burger-w {
  display: none;
}

#lt-nav .lt-burger-w .elementor-icon-wrapper {
  display: flex;
}

#lt-nav .lt-burger-w .elementor-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--brand-primary);
  cursor: pointer;
  transition: none;
}

/* Whatever the icon control resolved to — <svg> here, <i> if e_font_icon_svg
   is ever turned off — is replaced by the masked glyph on ::before. */
#lt-nav .lt-burger-w .elementor-icon > * {
  display: none;
}

#lt-nav .lt-burger-w .elementor-icon::before {
  content: "";
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E") center / contain no-repeat;
}

/*
 * Drawer — Pro's off-canvas widget.
 *
 * It sits OUTSIDE .lt-nav-pill on purpose: backdrop-filter makes an element the
 * containing block for position:fixed descendants, so a drawer nested in the
 * pill would be laid out against the 58px pill instead of the viewport. #lt-nav
 * is only position:fixed, which creates no such containing block.
 *
 * Elementor's own `.e-con .elementor-widget-off-canvas { position: absolute }`
 * takes the widget out of #lt-nav's flow, so it adds no height — deliberately
 * left alone rather than forced back to static.
 *
 * The widget's geometry is driven by its own custom properties, overridden here
 * instead of through the style controls: --e-off-canvas-width has to hold
 * min(320px, 85vw), which the control's slider cannot express.
 */
#lt-nav .lt-drawer-w {
  --e-off-canvas-width: min(320px, 85vw);
  /*
   * RTL: flex-end is the physical LEFT edge — the same side space-between puts
   * the burger on, so the panel opens from under the control that summoned it.
   * (The source wrote inset-inline-start, but its 4px 0 32px shadow casts to the
   * right, which only reads correctly on a left-anchored panel: LTR authoring
   * that survived the RTL flip.)
   */
  --e-off-canvas-justify-content: flex-end;
}

/* The scrim. Elementor pins `transition: 0s` on it and drives opacity from
   --e-off-canvas-overlay-opacity; re-driving opacity off [aria-hidden] is what
   restores the source's fade-in. There is no blur control on the widget. */
#lt-nav .lt-drawer-w .e-off-canvas__overlay {
  background-color: rgba(10, 26, 54, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

#lt-nav .lt-drawer-w .e-off-canvas[aria-hidden="false"] .e-off-canvas__overlay {
  opacity: var(--e-off-canvas-overlay-opacity, 1);
}

/*
 * The panel. .e-off-canvas__content already carries the width, the 100vh height
 * and overflow:auto; it only needs the source's padding, shadow and slide.
 *
 * The slide is done here rather than with the widget's entrance/exit animation
 * controls: those animate .e-off-canvas__main, which spans the whole viewport,
 * so a slideInLeft would travel 100vw and the 320px panel would only appear in
 * the last few frames. Leaving both animations unset makes the widget's own
 * open/close instant (it adds `animated none`), which is the same visibility
 * flip the hand-rolled drawer did — so transforming __content reproduces the
 * source exactly, including the fact that closing does not animate.
 */
#lt-nav .lt-drawer-w .e-off-canvas__content {
  padding: 28px 24px;
  box-shadow: 4px 0 32px rgba(41, 128, 242, 0.15);
  /* Transforms are physical and never flip: -100% is off-screen left. */
  transform: translateX(-100%);
  transition: transform var(--dur-slow) var(--ease);
}

#lt-nav .lt-drawer-w .e-off-canvas[aria-hidden="false"] .e-off-canvas__content {
  transform: none;
}

#lt-nav .lt-drawer-w .lt-drawer-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  padding: 0;
}

#lt-nav .lt-drawer-w .lt-drawer-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 0;
  margin-bottom: 28px;
}

#lt-nav .lt-drawer-w .lt-drawer-head > .elementor-element {
  width: auto;
  max-width: none;
  flex: 0 0 auto;
}

#lt-nav .lt-drawer-w .lt-drawer-logo img {
  height: 28px;
  width: auto;
  display: block;
}

/* Close — the off-canvas close action hash. Escape and a scrim click also close
   it, both handled by Pro. */
#lt-nav .lt-drawer-w .lt-drawer-close .elementor-icon-wrapper {
  display: flex;
}

#lt-nav .lt-drawer-w .lt-drawer-close .elementor-icon {
  display: flex;
  color: var(--page-fg-muted);
  cursor: pointer;
  transition: none;
}

#lt-nav .lt-drawer-w .lt-drawer-close .elementor-icon > * {
  display: none;
}

#lt-nav .lt-drawer-w .lt-drawer-close .elementor-icon::before {
  content: "";
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Drawer links — the same WP menu, vertical. */
#lt-nav .lt-drawer-w .lt-drawer-links .elementor-nav-menu {
  display: flex;
  flex-direction: column;
}

#lt-nav .lt-drawer-w .lt-drawer-links .elementor-item {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--page-fg);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

/*
 * The source's drawer CTA and phone were the <a> itself, stretched by the
 * panel's align-items:stretch. The widget div is the flex item now and
 * .elementor-button is inline-block inside it, so the width is restated at both
 * levels.
 */
#lt-nav .lt-drawer-w .lt-drawer-cta {
  width: 100%;
  margin-top: 26px;
}

#lt-nav .lt-drawer-w .lt-drawer-cta .elementor-button {
  display: block;
  width: 100%;
  background: var(--brand-red);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.6;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  text-align: center;
  text-decoration: none;
  transition: background var(--dur) var(--ease);
}

#lt-nav .lt-drawer-w .lt-drawer-cta .elementor-button:hover {
  background: #c20202;
}

#lt-nav .lt-drawer-w .lt-drawer-phone {
  width: 100%;
  margin-top: 14px;
}

#lt-nav .lt-drawer-w .lt-drawer-phone .elementor-button {
  display: block;
  width: 100%;
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  text-decoration: none;
  transition: none;
}

/*
 * 900px is the Nav's own switch, not an Elementor breakpoint, so it stays a
 * plain media query. The hide targets are the Elementor widget wrappers, not
 * the markup inside them: a display:none inner element leaves a zero-width
 * wrapper still participating in space-between, which drags the visible groups
 * off the pill's edges.
 */
/*
 * 1000px, not the source's 900px. The source's nav collapsed 5 top-level items
 * (the sixth lived behind a "התוכנית" dropdown); this landing page is a single
 * page, so that dropdown was flattened into six sibling anchors — a wider bar.
 * At 950px the CTA overflowed the pill by 16px. The switch has to follow the
 * content, so it moves up rather than the pill losing its right-hand group.
 */
@media (max-width: 1000px) {
  #lt-nav .lt-nav-desktop {
    display: none !important;
  }
  #lt-nav .lt-burger-w {
    display: block !important;
  }
}

/* The burger is hidden by its base rule above; the drawer is pinned off so a
   viewport resize can never leave an open panel stranded on desktop. */
@media (min-width: 1001px) {
  #lt-nav .lt-drawer-w {
    display: none !important;
  }
}
