/*
 * GoTop Custom Header CSS — verbatim from prototype
 * Source: design-prototypes/hero-implementation-v20/styles.css (lines 82-300, 514-789)
 * Scope: .site-header, .mega, .mobile-drawer, .hamburger
 */

/* Hello Elementor's own header is source-disabled via the official
   `hello_elementor_header_footer` filter in gotop-header.php. No CSS hide. */

/* Defeat Hello Elementor body padding so our sticky header has no gap */
body.elementor-default,
body.hello-elementor-default { padding-top: 0 !important; }

:root {
  --ink:           #070A12;
  --on-dark:       #F1F3F8;
  --on-dark-muted: #A9B1C8;
  --ice:           #5EEAFF;
  --ice-glow:      rgba(94, 234, 255, 0.30);
  --ice-soft:      rgba(94, 234, 255, 0.10);
  --border-dark:   rgba(255,255,255,0.06);
  --border-glass:  rgba(94, 234, 255, 0.30);
  --container:     1320px;
  --radius-lg:     18px;
  --font-head:  "Rubik", "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:  "Heebo", "Rubik", system-ui, -apple-system, sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

.site-header {
  /* CLEAN CASCADE — do NOT re-add width:100vw or backdrop-filter here.
     - width:100vw includes scrollbar → header 15px wider than viewport →
       horizontal overflow → forced body{overflow-x:hidden} bandaid → broke sticky.
     - backdrop-filter on a position:sticky element = known WebKit bug that
       silently unsticks the element on iOS Safari (Chrome tolerates it).
     Hello Elementor theme.css caps `.site-header:not(.dynamic-header)` at
     max-width:1140px — overridden below with max-width:100%.
     Background alpha bumped 0.96 → 0.98 to compensate for removed blur. */
  position: sticky; top: 0; z-index: 50;
  max-width: 100% !important;
  width: 100%;
  background: rgba(7, 17, 31, 0.98) !important;
  border-bottom: 1px solid var(--border-dark);
  direction: rtl;
  box-sizing: border-box !important;
}
.site-header::before,
.site-header::after { content: none !important; display: none !important; }
.site-header * { box-sizing: border-box; }
.site-header a { color: inherit; text-decoration: none; }

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px 40px;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  grid-template-rows: auto !important;
  grid-auto-rows: 0 !important;
  grid-auto-flow: column !important;
  align-items: center;
  gap: 32px;
}
/* Explicit grid placement (desktop only) — at <=860 mobile rules take over */
@media (min-width: 861px) {
  .site-header .header-inner > .brand        { grid-column: 1; grid-row: 1; }
  .site-header .header-inner > .primary-nav  { grid-column: 2; grid-row: 1; }
  .site-header .header-inner > .header-cta   { grid-column: 3; grid-row: 1; }
}

/* === Brand === */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 54px; height: 54px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon-img { width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; }
.brand-text {
  display: inline-flex; flex-direction: column; gap: 2px;
  line-height: 1; direction: ltr; text-align: start;
}
.brand-word {
  font-family: var(--font-head); font-weight: 800;
  font-size: 24px; letter-spacing: -0.01em;
  color: #FFFFFF !important; line-height: 1;
  white-space: nowrap;
}
.brand-tag {
  font-family: var(--font-mono); font-weight: 600;
  font-size: 10px; letter-spacing: 0.30em;
  color: var(--ice) !important; margin-top: 4px; text-transform: uppercase;
  white-space: nowrap;
}
.brand-text { flex-shrink: 0; }

/* === Primary nav === */
.primary-nav { display: flex; justify-content: center; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
.site-header .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  font-family: var(--font-head);
  font-weight: 500; font-size: 15.5px;
  color: #F1F3F8 !important;
  background: transparent !important;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background .2s, color .2s;
  position: relative;
  white-space: nowrap;
}
.site-header .nav-link.is-active { color: var(--ice) !important; }
.nav-link.is-active::after {
  content: ""; position: absolute; bottom: 4px; left: 14px; right: 14px;
  height: 1px; background: linear-gradient(90deg, transparent, var(--ice), transparent);
}
.site-header .nav-link:hover { background: rgba(255,255,255,0.05) !important; color: var(--ice) !important; }
.site-header .nav-link:visited { color: #F1F3F8 !important; }
.site-header .nav-link.is-active:visited { color: var(--ice) !important; }

/* === Featured nav-link (קידום ב-AI) — capsule, NOT active === */
.site-header .nav-link.nav-link--featured {
  border: 1px solid rgba(94, 234, 255, .22) !important;
  background: rgba(94, 234, 255, .06) !important;
  border-radius: 999px !important;
  padding: 7px 14px 7px 12px !important;
  box-shadow: 0 0 14px rgba(94, 234, 255, .08);
  position: relative;
  gap: 8px;
}
.site-header .nav-link.nav-link--featured:hover {
  background: rgba(94, 234, 255, .12) !important;
  border-color: rgba(94, 234, 255, .55) !important;
  color: var(--ice) !important;
  box-shadow: 0 0 22px rgba(94, 234, 255, .22);
}
/* Active (only when actually on /aio/) — keep cyan but no underline */
.site-header .nav-link.nav-link--featured.is-active {
  color: var(--ice) !important;
  border-color: rgba(94, 234, 255, .55) !important;
  background: rgba(94, 234, 255, .12) !important;
}
.site-header .nav-link.nav-link--featured.is-active::after { display: none !important; }

/* AI badge */
.site-header .nav-link__badge,
.mobile-drawer .nav-link__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  margin-inline-end: 4px;
  flex-shrink: 0;
}
.mobile-drawer .drawer-link--featured .nav-link__badge { margin-inline-end: 8px; }
.site-header .nav-list { flex-wrap: nowrap !important; }
.site-header .nav-list > li { flex-shrink: 0; }
.chev { transition: transform .25s; opacity: .6; }
.nav-item.has-mega:hover .chev,
.nav-item.has-mega:focus-within .chev { transform: rotate(180deg); }

.nav-item.has-mega { position: static; }
.mega {
  position: absolute; inset-inline: 0; top: 100%;
  background:
    radial-gradient(800px 280px at 30% 0%, rgba(94,234,255,0.06), transparent 70%),
    rgba(7,10,18,0.96);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(94,234,255,0.10);
  border-bottom: 1px solid rgba(94,234,255,0.10);
  box-shadow: 0 30px 80px -28px rgba(0,0,0,0.7);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .22s, transform .22s, visibility .22s;
  z-index: 60;
}
.nav-item.has-mega:hover .mega,
.nav-item.has-mega:focus-within .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-inner {
  max-width: var(--container); margin: 0 auto;
  padding: 40px 40px 44px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.1fr;
  gap: 48px;
}
.mega-inner.mega-inner--3 { grid-template-columns: 1fr 1fr 1fr 1.1fr; }

/* Blog mega: card-style 3 cards + aside */
.mega-inner.mega-inner--blog {
  grid-template-columns: 1fr 1fr 1fr 1.1fr;
}
.mega-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px;
  border-radius: 14px;
  background: rgba(10, 18, 32, .55);
  border: 1px solid rgba(94, 234, 255, .14);
  color: var(--on-dark);
  text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
  min-height: 200px;
}
.mega-card:hover {
  border-color: rgba(94, 234, 255, .42);
  background: rgba(12, 22, 38, .82);
  transform: translateY(-2px);
}
.mega-card__title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 19px;
  color: #F4F7FB;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.mega-card__desc {
  margin: 0 0 18px;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--on-dark-muted);
  flex-grow: 1;
}
.mega-card__link {
  margin-top: auto;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ice);
  border-bottom: 1px solid rgba(94, 234, 255, .4);
  padding-bottom: 2px;
  align-self: flex-start;
  transition: color .18s, border-color .18s;
}
.mega-card:hover .mega-card__link {
  color: #fff;
  border-color: #fff;
}
.mega-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ice); margin-bottom: 16px;
}
.mega-col-desc {
  margin: 12px 0 0;
  font-family: var(--font-body);
  font-size: 13.5px; line-height: 1.6;
  color: var(--on-dark-muted);
}
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.mega-col a {
  display: block; padding: 10px 0;
  font-family: var(--font-head); font-weight: 500; font-size: 15.5px;
  color: var(--on-dark);
  transition: color .18s, transform .18s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mega-col a:hover { color: var(--ice); transform: translateX(-3px); }
.mega-col a.lead-link {
  color: var(--ice);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  text-shadow: 0 0 16px rgba(94, 234, 255, 0.25);
}
.mega-col a.lead-link:hover { color: #A8F2FF; }
.mega-aside {
  background: linear-gradient(160deg, #0E1525 0%, #1A2440 100%);
  color: var(--on-dark);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.mega-aside::before {
  content: ""; position: absolute; inset: -40% -20% auto auto;
  width: 280px; height: 280px;
  background: radial-gradient(closest-side, var(--ice-glow), transparent 70%);
  filter: blur(4px); pointer-events: none;
}
.mega-aside-kicker {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ice); margin-bottom: 12px; position: relative;
}
.mega-aside p {
  font-family: var(--font-head); font-weight: 500;
  font-size: 17px; line-height: 1.5; margin: 0 0 18px;
  color: #fff; position: relative;
}
.mega-aside-cta {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  color: var(--ice);
  align-self: flex-start;
  border-bottom: 1px solid rgba(94,234,255,0.4);
  padding-bottom: 2px;
  transition: color .18s, border-color .18s;
  position: relative;
}
.mega-aside-cta:hover { color: #fff; border-color: #fff; }

.header-cta { display: flex; justify-content: end; }
.header-cta svg,
.header-cta .phone-icon { width: 20px; height: 20px; flex: 0 0 20px; }

/* === Phone CTA button === */
.btn-header {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s, box-shadow .25s;
  white-space: nowrap;
  background: linear-gradient(180deg, #16E3FF 0%, #36D8F2 100%);
  color: var(--ink);
  box-shadow: 0 10px 28px -12px rgba(94,234,255,0.55);
}
.btn-header:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -10px rgba(94,234,255,0.7); }
.btn-header svg { transform: scaleX(-1); opacity: 0.7; }
.btn-header svg { opacity: 0.9; }
.btn-header .phone-num {
  font-family: var(--font-mono); font-weight: 600;
  letter-spacing: 0.02em; font-size: 15px;
}

/* === Mobile quick-action icons === */
.mobile-actions { display: none; }
.mobile-actions .icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--on-dark);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  transition: color .18s, border-color .18s, background .18s, transform .18s;
}
.mobile-actions .icon-btn:hover,
.mobile-actions .icon-btn:focus-visible {
  color: var(--ice); border-color: var(--ice);
  background: rgba(94, 234, 255, 0.08);
}

/* === Hamburger === */
.hamburger {
  display: none;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  transition: border-color .18s, background .18s;
  position: relative; z-index: 110;
}
body.menu-open .site-header {
  z-index: 120;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.hamburger:hover { border-color: var(--ice); background: rgba(94,234,255,0.06); }
.hamburger span {
  display: block;
  width: 20px; height: 1.6px;
  background: var(--on-dark);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger span:nth-child(2) { width: 14px; }
body.menu-open .hamburger span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
body.menu-open .hamburger span:nth-child(2) { opacity: 0; }
body.menu-open .hamburger span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); width: 20px; }

/* === Mobile drawer === */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(900px 600px at 70% 0%, rgba(94,234,255,0.10), transparent 65%),
    linear-gradient(180deg, #060912 0%, #0A1224 60%, #050810 100%);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .25s ease, transform .3s ease, visibility .25s;
  display: flex;
  flex-direction: column;
  padding: 92px 22px 24px;
  overflow-y: auto;
  direction: rtl;
}
body.menu-open .mobile-drawer { opacity: 1; visibility: visible; transform: translateY(0); }

.drawer-group { margin-bottom: 22px; }
.drawer-group + .drawer-group { border-top: 1px solid var(--border-dark); padding-top: 18px; }
.drawer-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ice); margin-bottom: 10px;
}
.drawer-list { list-style: none; margin: 0; padding: 0; }
.drawer-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px;
  font-family: var(--font-head);
  font-weight: 500; font-size: 16.5px;
  color: var(--on-dark);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-align: right;
}
.drawer-list a:hover { color: var(--ice); }
.drawer-list a.lead-link {
  color: var(--ice);
  font-weight: 700;
  text-shadow: 0 0 14px rgba(94, 234, 255, 0.22);
}
.drawer-cta {
  margin-top: auto;
  display: block;
  padding: 16px 22px;
  font-family: var(--font-head);
  font-weight: 700; font-size: 16px;
  background: linear-gradient(180deg, #16E3FF 0%, #36D8F2 100%);
  color: var(--ink);
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 14px 32px -10px rgba(94,234,255,0.55);
}

/* === Responsive === */
@media (max-width: 1400px) {
  .site-header .header-inner { padding: 16px 28px; gap: 20px; }
  .site-header .nav-list { gap: 2px; }
  .site-header .nav-link { font-size: 14px; padding: 8px 10px; }
}
/* v6 fix: at narrow desktop (1024-1200px) the phone-num text pushed the
   header CTA button ~178px wide and caused document-level horizontal overflow
   because the header grid couldn't fit nav + brand + full CTA. Hide the
   phone-num text at ≤1200px; the icon stays and the button still works.
   Below 860 the whole CTA already hides via the mobile rule. */
@media (max-width: 1200px) {
  .btn-header .phone-num { display: none; }
  .btn-header {
    padding: 12px 14px;
    min-width: 44px;
    gap: 0;
  }
  .btn-header svg { opacity: 1; }
}
@media (max-width: 1180px) {
  .site-header .header-inner { padding: 14px 22px; gap: 14px; }
  .site-header .nav-link { font-size: 13.5px; padding: 7px 8px; }
  .mega-inner { padding: 32px 28px 36px; }
}
@media (max-width: 1024px) {
  .nav-link { font-size: 14px; padding: 8px 10px; }
  .mega-inner { grid-template-columns: 1fr 1fr; gap: 32px; padding: 28px 22px; }
  .mega-aside { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  /* Drawer must clear the sticky header + WP admin bar (when logged-in) */
  .mobile-drawer { padding-top: 120px !important; }
  body.admin-bar .mobile-drawer { padding-top: 156px !important; }

  .header-inner {
    padding: 14px 16px;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }
  .primary-nav { display: none; }
  .header-cta  { display: none; }
  .hamburger {
    display: inline-flex;
    grid-column: 1; grid-row: 1;
    justify-self: start;
  }
  .brand {
    grid-column: 2; grid-row: 1;
    justify-self: center;
    gap: 10px;
  }
  .mobile-actions {
    display: inline-flex;
    grid-column: 3; grid-row: 1;
    justify-self: end;
    gap: 8px; align-items: center;
  }
  .mobile-actions .icon-btn { width: 38px; height: 38px; border-radius: 9px; }
  .brand-icon { width: 44px; height: 44px; }
  .brand-word { font-size: 20px; }
  .brand-tag { font-size: 9px; letter-spacing: 0.26em; }

  .mobile-drawer {
    padding: 92px 22px 28px;
    align-items: center;
    text-align: center;
  }
  .drawer-group {
    width: 100%; max-width: 320px;
    margin-inline: auto;
  }
  .drawer-eyebrow { text-align: center; }
  .drawer-list a {
    justify-content: center;
    text-align: center;
    font-size: 17px;
  }
  .drawer-cta {
    width: 100%; max-width: 320px;
    margin-inline: auto;
  }
}
@media (max-width: 380px) {
  .brand-icon { width: 40px; height: 40px; }
  .brand-word { font-size: 18px; }
}

/* Lock body scroll when drawer is open */
body.menu-open { overflow: hidden; }


/* ============================================================
 *  Header phone CTA — restore navy text + icon on cyan bg.
 *  Hello Elementor / theme injected white anchor colors that
 *  bled into .btn-header — force navy with !important.
 * ============================================================ */
.site-header a.btn-header,
.site-header a.btn-header:link,
.site-header a.btn-header:visited,
.site-header a.btn-header:hover,
.site-header a.btn-header:focus,
.site-header a.btn-header:active {
  color: #07111F !important;
  -webkit-text-fill-color: #07111F !important;
  text-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
}
.site-header a.btn-header * {
  color: inherit !important;
  -webkit-text-fill-color: #07111F !important;
  text-shadow: none !important;
}
.site-header a.btn-header .phone-num { color: #07111F !important; }
.site-header a.btn-header svg {
  color: #07111F !important;
  fill: #07111F !important;
  opacity: 1 !important;
  filter: none !important;
}
.site-header a.btn-header svg path,
.site-header a.btn-header svg circle,
.site-header a.btn-header svg rect {
  fill: #07111F !important;
  stroke: #07111F !important;
}

