/**handles:navigation-header-style**/
/* General */
body.no-scroll {
  position: fixed;
  left: 0;
  right: 0;
}

/* Search scroll lock — position:fixed on body is the most reliable cross-browser
   method. The JS saves scrollY into --scroll-y before adding this class, so the
   page doesn't jump to top. On close JS restores window.scrollTo(). */
html.search-open {
  overflow: hidden !important;
}
body.search-open {
  position: fixed !important;
  top: calc(var(--scroll-y, 0) * -1px) !important;
  left: 0 !important;
  right: 0 !important;
  overflow: hidden !important;
}

/* ── Search-bar overlay ───────────────────────────────────────────────────────
   Both .search-bar and .overlay are on the SAME element.
   overflow-y: auto makes the overlay itself the scroll container.
   overflow-x: hidden prevents horizontal bleed. */
.wp-block-group.search-bar.overlay {
  position: fixed !important;
  top: 110px !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100vh - 110px) !important;
  z-index: 99998 !important;
  overflow: hidden !important;
}

body.admin-bar .wp-block-group.search-bar.overlay {
  top: 142px !important;
  height: calc(100vh - 142px) !important;
}

/* ── Relevanssi results holder ───────────────────────────────────────────────
   Plugin JS injects inline left/top/width on this element.
   position:static ignores left/top; width:100%!important beats the non-!important
   inline width value the plugin sets. */
.relevanssi-live-search-results-holder {
  position: static !important;
  width: 100% !important;
  overflow: visible !important;
  max-height: none !important;
}

/* ── Results scroll area ─────────────────────────────────────────────────────
   The overlay is a flex column (wp-block-group default), so overflow-y:auto on
   the overlay itself never triggers — flex distributes height among children
   instead of letting them overflow. Scrolling must be on #rlvlive_1 directly.
   270px = 110px header + ~160px search form / close button area. */
#rlvlive_1 {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 270px) !important;
}

body.admin-bar #rlvlive_1 {
  max-height: calc(100vh - 302px) !important;
}

/* ── Relevanssi results div ──────────────────────────────────────────────────
   The DB block's inline <style> (injected into <body>) sets:
     display:contents!important  → destroys the layout box entirely
     position:absolute!important → takes it out of flow
   Using #rlvlive_1 ID gives specificity 1,1,0 which beats the inline block's
   0,1,0 selector even with !important. */
#rlvlive_1 .relevanssi-live-search-results,
#rlvlive_1 .relevanssi-live-search-results-showing {
  display: block !important;
  position: static !important;
  width: 100% !important;
  box-sizing: border-box !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  opacity: 1 !important;
}

#rlvlive_1 .relevanssi-live-search-results:not(.relevanssi-live-search-results-showing) {
  display: none !important;
  opacity: 0 !important;
}

/* ── 3-column results layout ─────────────────────────────────────────────────
   The results template outputs a .wp-block-columns.alignwide with 3 columns.
   alignwide would try to overflow the constrained layout, causing right-overflow.
   align-items: flex-start prevents flex stretch from forcing equal column heights. */
#rlvlive_1 .wp-block-columns {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  align-items: flex-start !important;
}

/* Columns grow to full content height — overlay is the scroll container. */
.search-bar .post-container,
.search-bar .page-container,
.search-bar .lmsomeco_cases-container {
  overflow: visible !important;
  max-height: none !important;
  min-height: 0 !important;
}

/* "Load more" link — normal flow, visible at the bottom of each column. */
.search-bar .relevanssi-see-all-link {
  margin: 0.5em 0 !important;
  padding: 0.25em 0 !important;
}

body.admin-bar header.wp-block-template-part > .logo-link,
body.admin-bar header.wp-block-template-part > .navbar.sticky_top.sticky {
  top: 32px !important;
}

header.wp-block-template-part {
  position: relative;
}

header.wp-block-template-part .navbar.sticky_top {
  position: fixed;
  width: 100%;
  height: 0;
  top: 0;
  background: var(--wp--preset--color--dark-purple);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
}

header.wp-block-template-part > .navbar.sticky_top.sticky {
  opacity: 1;
  height: 110px;
  visibility: visible;
}

header.wp-block-template-part > .logo-link {
  position: fixed;
  top: 0;
  display: block;
  padding: 0;
  margin: 0;
  line-height: 1;
  cursor: pointer;
  z-index: 99998;
}

header.wp-block-template-part > .logo-link > img {
  height: 110px;
  width: 100%;
  transition: all 0.3s ease-in-out;
}

/* Mobile */
header.wp-block-template-part > .navbar {
  position: absolute;
  display: flex;
  justify-content: space-between;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99997;
  transition: all 0.15s ease-out;
}

header.wp-block-template-part > .navbar > .logo-spaceholder {
  width: 100px;
}

header.wp-block-template-part > .navbar > .mobile-logo-link,
header.wp-block-template-part > .navbar > .items,
header.wp-block-template-part > .navbar > .lang-switcher {
  display: none;
}

header.wp-block-template-part > .navbar > .nav-menu-button {
  position: relative;
  margin-right: var(--wp--preset--spacing--20);
  cursor: pointer;
  fill: var(--wp--preset--color--white);
  background: var(--wp--preset--color--dark-purple);
  border-radius: 3rem;
  z-index: 9999;
  padding: var(--wp--preset--spacing--10);
  width: 24px;
  height: 24px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none" /><path fill="white" d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /></svg>');
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.1s ease-in-out;
}

header.wp-block-template-part > .navbar > .nav-menu-button.show {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="white"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" /></svg>');
}

header.wp-block-template-part > .navbar > .nav-menu-button a {
  height: 24px;
  width: 24px;
}

header.wp-block-template-part > .navbar > .mobile-menu {
  display: none;
}

header.wp-block-template-part > .navbar > .mobile-menu > .mobile-wrapper {
  width: 100%;
}

header.wp-block-template-part > .navbar > .mobile-menu.show {
  display: flex;
  position: absolute;
  top: 0px;
  left: 0;
  width: 100%;
  background: var(--wp--preset--color--purple);
  min-height: 100vh;
  z-index: 9998;
}

header.wp-block-template-part > .navbar > .mobile-menu .menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  list-style: none;
  height: 80vh;
  margin: 8em auto;
  padding-right: var(--wp--style--root--padding-right);
  padding-left: var(--wp--style--root--padding-left);
  overflow-y: auto;
}

header.wp-block-template-part > .navbar > .mobile-menu .menu li {
  cursor: pointer;
  margin: 0 0 var(--wp--preset--spacing--10) 0;
}

header.wp-block-template-part > .navbar > .mobile-menu .menu li .sub-menu,
header.wp-block-template-part > .navbar > .mobile-menu .menu li .sub-menu .sub-sub-menu {
  list-style: none;
  padding: var(--wp--preset--spacing--10) 0 0 var(--wp--preset--spacing--20);
}

header.wp-block-template-part > .navbar > .mobile-menu .menu li a {
  font-size: var(--wp--preset--font-size--base);
  color: var(--wp--preset--color--white);
  text-decoration: none;
}

header.wp-block-template-part > .navbar > .mobile-menu .menu li.lang-switcher-mobile {
  margin-top: var(--wp--preset--spacing--20);
  margin-bottom: var(--wp--preset--spacing--80);
}

header.wp-block-template-part > .navbar > .mobile-menu .sub-sub-menu > li > a {
  font-size: var(--wp--preset--font-size--sm);
}

@media screen and (max-width: 768px) {
  header.wp-block-template-part > .logo-link > img {
    height: 72px;
  }

  header.wp-block-template-part > .logo-link.sticky_top > img {
    display: none;
  }

  header.wp-block-template-part > .navbar > .mobile-logo-link {
    display: flex;
  }

  header.wp-block-template-part > .navbar > .mobile-logo-link > img {
    height: 0;
  }

  header.wp-block-template-part > .navbar.sticky_top.sticky,
  header.wp-block-template-part.sticky_top.sticky > .navbar,
  header.wp-block-template-part > .navbar,
  header.wp-block-template-part > .navbar.sticky_top.sticky > .mobile-logo-link > img {
    height: 72px;
  }
}

/* Desktop */
@media screen and (min-width: 768px) {
  header.wp-block-template-part > .navbar > .nav-menu-button {
    display: none;
  }

  header.wp-block-template-part > .navbar {
    position: absolute;
    display: flex;
    justify-content: space-between;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99997;
    height: 110px;
    transition: all 0.15s ease-out;
  }

  header.wp-block-template-part > .navbar > .items {
    display: block;
    background: transparent;
  }

  header.wp-block-template-part > .navbar > .items > .nav-menu {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    align-content: center;
    z-index: 9999;
  }

  header.wp-block-template-part > .navbar > .items > .nav-menu li {
    font-size: var(--wp--preset--font-size--base);
    color: #fff;
    cursor: pointer;
    display: block;
    margin: var(--wp--preset--spacing--10) 0;
    z-index: 9998;
  }

  header.wp-block-template-part > .navbar > .items > .nav-menu li a {
    color: inherit;
    text-decoration: none;
    padding: 1em 0.75em;
    position: relative;
    z-index: 9999;
  }

  header.wp-block-template-part
    > .navbar
    > .items
    > .nav-menu
    li
    > .sub-menu-wrapper
    > .sub-menu
    > li
    > a {
    font-size: 1.2em;
  }

  header.wp-block-template-part > .navbar > .items > .nav-menu li a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #fff;
    transition: width 0.15s ease-out;
  }

  header.wp-block-template-part > .navbar > .items > .nav-menu li ul.sub-menu li a::after {
    left: 0em;
    transform: translateX(0);
  }

  header.wp-block-template-part > .navbar > .items > .nav-menu li a:hover::after {
    width: 2rem;
  }

  /* Submenu */

  header.wp-block-template-part
    > .navbar
    > .items
    > .nav-menu
    li.menu-item-has-children
    .sub-menu-wrapper {
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--wp--preset--color--purple);
    z-index: 9998;
    transition: height 0.15s ease-in-out;
    opacity: 0;
    height: 0;
    user-select: none;
  }

  header.wp-block-template-part
    > .navbar
    > .items
    > .nav-menu
    li.menu-item-has-children
    .sub-menu-wrapper.show {
    visibility: visible;
    opacity: 1;
    height: auto;
    min-height: 100vh;
    user-select: auto;
    display: flex;
    align-items: center;
    cursor: auto;
  }

  header.wp-block-template-part
    > .navbar
    > .items
    > .nav-menu
    li.menu-item-has-children
    .sub-menu-wrapper
    > ul.sub-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    list-style: none;
    width: 100%;
    max-width: var(--wp--style--global--content-size);
    gap: var(--wp--preset--spacing--20);
    padding: 0 1em;
    margin: 10vh auto;
    /* text-align: center;*/
  }

  header.wp-block-template-part
    > .navbar
    > .items
    > .nav-menu
    li.menu-item-has-children
    .sub-menu-wrapper
    > ul.sub-menu
    > li {
    padding: var(--wp--preset--spacing--10) 0;
  }

  header.wp-block-template-part
    > .navbar
    > .items
    > .nav-menu
    li.menu-item-has-children
    .sub-menu-wrapper
    ul.sub-menu
    li
    a {
    padding: 0.5em 0;
  }

  /* Language switcher */

  header.wp-block-template-part > .navbar > .lang-switcher {
    position: static;
    display: block;
    right: initial;
    top: initial;
    padding: 0 var(--wp--preset--spacing--10) 0 0;
  }

  header.wp-block-template-part > .navbar > .lang-switcher a {
    font-size: var(--wp--preset--font-size--sm);
    color: var(--wp--preset--color--white);
    cursor: pointer;
    padding: var(--wp--preset--spacing--20) 0;
    position: relative;
    z-index: 9998;
  }
  header.wp-block-template-part > .navbar > .lang-switcher a::after {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0rem;
    height: 2px;
    background: #fff;
    content: "";
    transition: width 0.15s ease-out;
  }

  header.wp-block-template-part > .navbar > .lang-switcher a:hover::after {
    width: 2rem;
  }

  header.wp-block-template-part > .navbar .lang-switcher-mobile {
    display: none !important;
  }

  .dark {
    color: var(--wp--preset--color--dark-purple);
  }

  .navbar.dark:not(.headroom):not(.children-open) .items .nav-menu li a {
    color: var(--wp--preset--color--dark-purple);
  }
}