/* =========================================================
   Header — Homepage 2026

   Extracted from homepage-2026.css. Loaded site-wide, since the 2026 header
   is used on every page (see functions.php).
   ========================================================= */

:root {
  --hdr-height: 42px;
  --hdr-vpad: 12px;
  --hdr-total-height: calc(var(--hdr-height) + (var(--hdr-vpad) * 2) + 1px);

  /* Lives here rather than in homepage-2026.css because footer-2026.css needs
     it on every page, and the homepage stylesheet only loads on the homepage. */
  --container-width: 1120px;
}

/* Bootstrap supplies .d-none and is loaded globally, but the networks/main
   menu swap depends on it, so this guarantees it even if that CDN call fails. */
.header-2026 .navigation.d-none {
  display: none !important;
}

/* ─── Header 2026 ──────────────────────────────────────────────── */
.header-2026 {
  --hdr-fg: #191919;
  --hdr-muted: #87868e;
  --hdr-pill-bg: #f2f2f5;
  --hdr-pill-active-bg: #c5c9ff;
  --hdr-border: #eaeaea;

  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--hdr-border);
  font-family:
    "Heebo",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: var(--hdr-fg);
  position: fixed;
  top: var(--wp-admin--admin-bar--height, 0px);
  inset-inline: 0;
  z-index: 9995;
}

/* Fallback definition of the WP admin-bar height variable. Modern WordPress
   sets this on :root when the admin bar renders, but older versions don't.
   Defining it here makes the header's `top` calc work regardless. */
html.admin-bar {
  --wp-admin--admin-bar--height: 32px;
}
@media screen and (max-width: 782px) {
  html.admin-bar {
    --wp-admin--admin-bar--height: 46px;
  }
}

/* Spacer div rendered right after the fixed header so page content isn't
   pulled up under it. Matches the header's rendered height. */
.header-2026__spacer {
  /* JS in home-page-2026.js reconciles this to the actual rendered header
     height on load / resize / ResizeObserver. The CSS fallback below is
     intentionally generous so pre-JS renders don't get pulled under the
     fixed header. */
  height: var(--hdr-total-height, 100px);
  min-height: var(--hdr-total-height, 100px);
  width: 100%;
  display: block;
}
.header-2026 * {
  box-sizing: border-box;
}

.header-2026__nav {
  padding: 12px 24px;
}
.header-2026__container {
  max-width: 90%;
  width: 100%;
  margin-inline: auto;
  min-height: var(--hdr-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

/* Center cell: holds the pill + menu, centered within its column.
   position: relative so that .submenu (position: absolute) anchors to the
   full center width instead of just one menu item. */
.header-2026__center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-width: 0;
  position: relative;
}

/* Logo (visually right in RTL) */
.header-2026__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.header-2026__logo:hover {
  text-decoration: none;
  color: inherit;
}
.header-2026__logo-img {
  display: block;
  width: 200px;
  height: 20px;
}
.header-2026__logo-text {
  font-size: 16px;
  font-weight: 400;
  color: var(--hdr-fg);
  white-space: nowrap;
}
.header-2026__logo-text strong {
  font-weight: 700;
}

/* Pill switcher: עולם התוכן / פלטפורמת החיבורים */
.header-2026__switcher {
  display: inline-flex;
  background: var(--hdr-pill-bg);
  border-radius: 999px;
  padding: 4px;
  flex-shrink: 0;
}
.header-2026__switcher-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 999px;
  color: var(--hdr-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 150ms ease,
    color 150ms ease;
  white-space: nowrap;
}
.header-2026__switcher-link:hover {
  color: var(--hdr-fg);
  text-decoration: none;
}
.header-2026__switcher-link.is-active {
  background: var(--hdr-pill-active-bg);
  color: var(--hdr-fg);
}

/* Nav menu */
.header-2026__nav-menu {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

/* Tools group (visually left in RTL) */
.header-2026__tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Neutralize Bootstrap .navbar / .navbar-expand-md defaults inside our header so
   they only contribute the collapse show/hide behavior, not layout/padding. */
.header-2026 .navbar,
.header-2026 .navbar-collapse {
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  min-height: 0;
}

/* Nav uses the same markup/classes as header-rich-menu.php so header.js drives
   the mobile accordion. These rules restyle it for the 2026 desktop header. */
.header-2026 .navigation {
  min-width: 0;
  display: flex;
  align-items: center;
}
.header-2026 .navigation__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.header-2026 .navigation__item {
  list-style: none;
  /* No position: relative — submenus anchor to .header-2026__center instead so
     they can span its full width. */
}
.header-2026 .navigation__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  color: var(--hdr-fg);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
}
.header-2026 .navigation__link:hover {
  text-decoration: underline;
  color: var(--hdr-fg);
}
/* Chevron on items that have children (same asset as the live header). */
.header-2026 .navigation__item.menu-item-has-children .navigation__link::after {
  flex-shrink: 0;
  content: "";
  display: block;
  width: 9px;
  height: 6px;
  transition: transform 0.3s ease;
  background: url("data:image/svg+xml,%3Csvg width='9' height='6' viewBox='0 0 9 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.13281 1L4.66835 4.53553L8.20388 1' stroke='black' stroke-width='2'/%3E%3C/svg%3E%0A")
    no-repeat center/contain;
}
.header-2026 .navigation__link--active::after {
  transform: scale(1, -1);
}

/* Desktop: submenu is a mega-menu panel, capped and centred in the header. */
.header-2026 .submenu {
  display: none;
  position: absolute;
  top: 100%;
  inset-inline: 0;
  max-width: 1100px;
  margin-inline: auto;
  padding: 24px 32px;
  background: #ffffff;
  border: 1px solid var(--hdr-border);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  z-index: 1001;
}
/* Invisible hover bridge — extends the submenu's hoverable area upward so
   the mouse can travel from the menu-item to the dropdown without crossing
   an empty gap that would drop the :hover state. */
.header-2026 .submenu::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -24px;
  height: 24px;
}
.header-2026 .navigation__item.menu-item-has-children:hover > .submenu,
.header-2026 .navigation__item.menu-item-has-children:focus-within > .submenu {
  display: block;
}
.header-2026 .submenu__wrapper {
  display: flex;
  gap: 40px;
  justify-content: space-around;
}
.header-2026 .submenu__block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 180px;
}
.header-2026 .submenu__head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-2026 .submenu__arrow {
  display: none;
}
.header-2026 .submenu__title {
  color: #009aff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.header-2026 .submenu__title:hover {
  color: #009aff;
  text-decoration: underline;
}
.header-2026 .submenu__block--alone .submenu__title {
  color: var(--hdr-fg);
  font-weight: 400;
}
.header-2026 .submenu-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.header-2026 .submenu-modal__item {
  list-style: none;
}
.header-2026 .submenu-modal__link {
  display: block;
  color: var(--hdr-fg);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.header-2026 .submenu-modal__link:hover {
  color: var(--hdr-fg);
  text-decoration: underline;
}
.header-2026 .submenu-modal__top {
  display: none;
}

/* Language switcher: hide any WPML default toggle-switch markup, expose only
   the plain language links (as text). */
/* .header-2026__lang .wpml-ls-legacy-dropdown,
.header-2026__lang .wpml-ls-legacy-dropdown-click,
.header-2026__lang .wpml-ls-flag {
  display: none !important;
} */
.header-2026__lang ul,
.header-2026__lang li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.header-2026__lang ul {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-2026__lang a {
  color: var(--hdr-fg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
}
.header-2026__lang a:hover {
  background: var(--hdr-pill-bg);
  text-decoration: none;
}
.header-2026__icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--hdr-fg);
  cursor: pointer;
}
.header-2026__icon-btn:hover {
  background: var(--hdr-pill-bg);
}

.header-2026__lang {
  display: inline-flex;
  align-items: center;
}
.header-2026__lang a {
  color: var(--hdr-fg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.header-2026__lang a:hover {
  text-decoration: underline;
}

.header-2026__user {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--hdr-border);
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  color: var(--hdr-fg);
  cursor: pointer;
  position: relative;
}
.header-2026__user-avatar {
  width: 100%;
  height: 100%;
  max-width: 32px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.signup-btn.signup-btn-desktop.dropdown-toggle {
  background-color: transparent;
  border: none;
  width: auto;
}

.header-2026__user .dropdown-content {
  display: none;
}
.header-2026__user:hover .dropdown-content,
.header-2026__user:focus .dropdown-content,
.header-2026__user.open .dropdown-content {
  display: block;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--hdr-border);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  z-index: 1001;
  text-align: right;
}
.header-2026__user .dropdown-content a {
  display: block;
  padding: 8px 16px;
  color: var(--hdr-fg);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.header-2026__user .dropdown-content a:hover {
  background: var(--hdr-pill-bg);
  text-decoration: none;
}

/* Burger — mirrors .header.rich .burger from header-rich-menu.css so the
   shared header.js (which binds the unscoped `.burger` selector) drives the
   exact same open/close behaviour as the live header. */
.header-2026 .burger {
  width: 22px;
  height: 16px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.3s ease;
  background-color: transparent;
  border: none;
  display: none;
}
.header-2026 .burger__line {
  width: 100%;
  height: 2px;
  background-color: black;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}
.header-2026 .burger--open .burger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-2026 .burger--open .burger__line:nth-child(2) {
  opacity: 0;
}
.header-2026 .burger--open .burger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1550px) {
  .header-2026__container {
    max-width: 100%;
    padding-inline: 16px;
    gap: 12px;
  }
  .header-2026__logo-img {
    width: 160px;
  }

  .header-2026 .navigation__list {
    gap: 12px;
  }

  .header-2026 .navigation__link {
    font-size: 16px;
    letter-spacing: -0.5px;
  }
}

@media (max-width: 1367px) {
  .header-2026 .navigation__link {
    font-size: 14px;
  }
}

@media (max-width: 991px) {
  .header-2026 .navbar {
    padding: 3px 10px 3px 10px !important;
  }
  .header-2026 .burger {
    display: flex;
    order: 1;
  }

  /* .header-2026__center doubles as the slide-in mobile panel (it carries
     .header__right, which header.js toggles). Mirrors the rich header's
     panel behaviour: fixed, off-canvas to the right, slides in on open. */
  .header-2026__center {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--hdr-height, 67px);
    height: calc(var(--app-height, 100vh) - var(--hdr-height, 67px));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 24px;
    padding: 32px;
    overflow: hidden auto;
    background-color: #fff;
    transform: translateX(100%);
    visibility: hidden;
    z-index: 9;
  }
  .admin-bar .header-2026__center {
    top: calc(
      var(--hdr-total-height, 67px) + var(--wp-admin--admin-bar--height, 0px)
    );
  }
  .header-2026__center.header__right--open {
    animation: slide-right 0.5s ease forwards;
    visibility: visible;
  }
  .header-2026__center.header__right--close {
    animation: slide-left 0.5s ease forwards;
    visibility: visible;
  }

  /* The switcher pill is mobile-hidden on the live header — match that. */
  .header-2026__center .header-2026__switcher {
    display: none;
  }

  /* Accordion nav — mirrors the ≤1200px rules in header-rich-menu.css so the
     panel behaves exactly like the live mobile menu: top-level rows separated
     by hairlines, each collapsing/expanding via header.js's submenu--active. */
  .header-2026 .navigation {
    width: 100%;
    display: block;
  }
  .header-2026 .navigation__list {
    display: block;
  }
  .header-2026 .navigation__item:not(:last-child) {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e1e1e1;
  }
  .header-2026 .navigation__link {
    font-size: 14px;
    font-weight: 400;
    padding: 0;
    width: 100%;
    justify-content: space-between;
  }
  .header-2026 .navigation__link--active {
    font-weight: 500;
  }
  .header-2026
    .navigation__item.menu-item-has-children:hover
    .navigation__link {
    cursor: pointer;
  }

  /* Collapsed by default via a 0fr grid row; header.js adds submenu--active. */
  .header-2026 .submenu {
    position: static;
    visibility: visible;
    pointer-events: all;
    box-shadow: unset;
    overflow: hidden;
    padding: 0;
    margin: 0;
    max-width: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    transition: grid-template-rows 0.8s ease;
    display: grid;
    grid-template-rows: 0fr;
  }
  .header-2026 .submenu::before {
    content: none;
  }
  .header-2026 .navigation__item.menu-item-has-children:hover > .submenu,
  .header-2026
    .navigation__item.menu-item-has-children:focus-within
    > .submenu {
    /* Hover must not expand on touch — only submenu--active does. */
    display: grid;
  }
  .header-2026 .submenu--active {
    grid-template-rows: 1fr;
  }
  .header-2026 .submenu__wrapper {
    padding: 0;
    overflow: unset;
    display: block;
    min-height: 0;
    margin: 0;
    transition: padding 0.8s ease;
  }
  .header-2026 .submenu--active .submenu__wrapper {
    padding-top: 20px;
  }
  .header-2026 .submenu__block {
    min-width: 0;
    gap: 12px;
  }
  .header-2026 .submenu__block:not(:last-child) {
    margin-bottom: 12px;
  }
  .header-2026 .submenu__title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.28;
    margin: 0;
  }
  .header-2026__container {
    gap: 12px;
    grid-template-columns: auto 1fr auto;
    padding-inline: 0;
    display: flex;
    flex-direction: row-reverse;
  }
  .header-2026__logo-text {
    display: none;
  }

  .header-2026__logo {
    order: 4;
  }

  .header-2026__tools {
    gap: 4px;
    flex-grow: 1;
    justify-content: flex-end;
    order: 2;
  }

  .header-2026__user {
    width: 30px;
    height: 30px;
    margin-top: -5px;
  }

  .header-2026__user svg {
    width: 18px;
    height: 18px;
  }

  .header-2026__search.search_wrap {
    position: static;
    margin-top: -2px;
  }

  .header-2026__spacer {
    display: none;
  }
}
