/* Terra Vita Hub v384 — final header hard-stop fix
   Purpose: stop Documents/Search collision everywhere by enforcing hard layout zones,
   icon-only search on wide desktop, and earlier burger fallback on constrained widths.
   This file intentionally loads after v383 and uses body/html specificity. */

html body #tvh-header,
html body header#tvh-header{
  position:sticky;
  top:0;
  z-index:1000;
  overflow:visible !important;
}

html body #tvh-header .tvh-container.tvh-header-inner,
html body header#tvh-header .tvh-container.tvh-header-inner{
  max-width:none !important;
  width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  display:grid !important;
  grid-template-columns:max-content minmax(0,1fr) 44px max-content 44px !important;
  align-items:center !important;
  justify-content:stretch !important;
  column-gap:14px !important;
  padding-left:clamp(20px,3vw,56px) !important;
  padding-right:clamp(20px,3vw,56px) !important;
}

html body #tvh-header .tvh-logo,
html body header#tvh-header .tvh-logo{
  grid-column:1 !important;
  min-width:max-content !important;
  max-width:max-content !important;
  white-space:nowrap !important;
  overflow:visible !important;
}

html body #tvh-header .tvh-logo-name,
html body #tvh-header .tvh-logo-tag,
html body header#tvh-header .tvh-logo-name,
html body header#tvh-header .tvh-logo-tag{
  white-space:nowrap !important;
}

html body #tvh-header .tvh-nav-primary,
html body header#tvh-header .tvh-nav-primary{
  grid-column:2 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:clamp(8px,.65vw,13px) !important;
  min-width:0 !important;
  max-width:100% !important;
  width:100% !important;
  overflow:hidden !important;
  flex-wrap:nowrap !important;
  margin:0 !important;
  padding:0 !important;
}

html body #tvh-header .tvh-nav-primary a,
html body header#tvh-header .tvh-nav-primary a{
  flex:0 1 auto !important;
  min-width:0 !important;
  max-width:max-content !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  font-size:clamp(11px,.68vw,13px) !important;
  letter-spacing:0 !important;
  line-height:1 !important;
}

html body #tvh-header .tvh-search-trigger,
html body header#tvh-header .tvh-search-trigger{
  grid-column:3 !important;
  position:static !important;
  inset:auto !important;
  z-index:auto !important;
  transform:none !important;
  box-sizing:border-box !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:44px !important;
  min-width:44px !important;
  max-width:44px !important;
  height:44px !important;
  margin:0 !important;
  padding:0 !important;
  gap:0 !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  flex:0 0 44px !important;
}

html body #tvh-header .tvh-search-trigger svg,
html body header#tvh-header .tvh-search-trigger svg{
  width:17px !important;
  height:17px !important;
  flex:0 0 17px !important;
}

html body #tvh-header .tvh-search-trigger .label,
html body #tvh-header .tvh-search-shortcut,
html body header#tvh-header .tvh-search-trigger .label,
html body header#tvh-header .tvh-search-shortcut{
  display:none !important;
  visibility:hidden !important;
  width:0 !important;
  max-width:0 !important;
  overflow:hidden !important;
}

html body #tvh-header .tvh-nav-actions,
html body header#tvh-header .tvh-nav-actions{
  grid-column:4 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:12px !important;
  min-width:max-content !important;
  max-width:max-content !important;
  margin:0 !important;
  padding:0 0 0 8px !important;
  white-space:nowrap !important;
  overflow:visible !important;
  flex:0 0 auto !important;
}

html body #tvh-header .tvh-nav-actions a,
html body #tvh-header .tvh-cta-primary,
html body #tvh-header .tvh-link-text,
html body header#tvh-header .tvh-nav-actions a,
html body header#tvh-header .tvh-cta-primary,
html body header#tvh-header .tvh-link-text{
  white-space:nowrap !important;
  flex:0 0 auto !important;
}

html body #tvh-header .tvh-burger,
html body header#tvh-header .tvh-burger{
  grid-column:5 !important;
  justify-self:end !important;
}

@media (max-width:1840px){
  html body #tvh-header .tvh-logo-tag,
  html body header#tvh-header .tvh-logo-tag{display:none !important;}
}

/* Hard stop: before nav can crowd search/actions, switch to controlled mobile header. */
@media (max-width:1700px){
  html body #tvh-header .tvh-nav-primary,
  html body #tvh-header .tvh-search-trigger,
  html body #tvh-header .tvh-nav-actions,
  html body header#tvh-header .tvh-nav-primary,
  html body header#tvh-header .tvh-search-trigger,
  html body header#tvh-header .tvh-nav-actions{
    display:none !important;
  }
  html body #tvh-header .tvh-container.tvh-header-inner,
  html body header#tvh-header .tvh-container.tvh-header-inner{
    grid-template-columns:max-content minmax(0,1fr) 44px !important;
  }
  html body #tvh-header .tvh-burger,
  html body header#tvh-header .tvh-burger{
    display:inline-flex !important;
    grid-column:3 !important;
  }
}

@media (min-width:1701px){
  html body #tvh-header .tvh-burger,
  html body header#tvh-header .tvh-burger{display:none !important;}
}

@media (max-width:520px){
  html body #tvh-header .tvh-container.tvh-header-inner,
  html body header#tvh-header .tvh-container.tvh-header-inner{
    padding-left:16px !important;
    padding-right:16px !important;
  }
  html body #tvh-header .tvh-logo-name,
  html body header#tvh-header .tvh-logo-name{
    font-size:18px !important;
  }
}
