/* Terra Vita Hub v385 — authoritative header mode fix
   Fixes mixed desktop/mobile header state: desktop nav, search, actions and burger can no
   longer render together. Search/sign-in are hidden at constrained widths before overlap.
   Loads after v383/v384 and deliberately uses high specificity. */

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

html body header#tvh-header .tvh-container.tvh-header-inner,
html body #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) 42px max-content !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 0 clamp(16px, 1.2vw, 24px) !important;
  padding-left: clamp(22px, 3vw, 64px) !important;
  padding-right: clamp(22px, 3vw, 64px) !important;
  min-height: 76px !important;
  height: auto !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

html body header#tvh-header .tvh-logo,
html body #tvh-header .tvh-logo{
  grid-column: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  min-width: max-content !important;
  max-width: max-content !important;
  white-space: nowrap !important;
  overflow: visible !important;
  flex: 0 0 auto !important;
}

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

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

html body header#tvh-header .tvh-nav-primary a,
html body #tvh-header .tvh-nav-primary a{
  display: inline-flex !important;
  align-items: center !important;
  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(12px, .72vw, 14px) !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
}

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

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

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

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

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,
html body #tvh-header .tvh-nav-actions a,
html body #tvh-header .tvh-cta-primary,
html body #tvh-header .tvh-link-text{
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

/* Desktop hard stop: the burger must not appear while desktop header is visible. */
@media (min-width: 1421px){
  html body header#tvh-header .tvh-burger,
  html body #tvh-header .tvh-burger{
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    right: auto !important;
    bottom: auto !important;
  }
}

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

/* Constrained desktop: keep the spine and access CTA, remove search/sign-in before collision. */
@media (max-width: 1600px) and (min-width: 1421px){
  html body header#tvh-header .tvh-container.tvh-header-inner,
  html body #tvh-header .tvh-container.tvh-header-inner{
    grid-template-columns: max-content minmax(0, 1fr) max-content !important;
    gap: 0 clamp(14px, 1vw, 20px) !important;
  }
  html body header#tvh-header .tvh-search-trigger,
  html body #tvh-header .tvh-search-trigger{
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  html body header#tvh-header .tvh-nav-actions,
  html body #tvh-header .tvh-nav-actions{ grid-column: 3 !important; }
  html body header#tvh-header .tvh-nav-actions .tvh-link-text,
  html body #tvh-header .tvh-nav-actions .tvh-link-text{ display: none !important; }
  html body header#tvh-header .tvh-nav-primary,
  html body #tvh-header .tvh-nav-primary{ gap: clamp(9px, .55vw, 12px) !important; }
  html body header#tvh-header .tvh-nav-primary a,
  html body #tvh-header .tvh-nav-primary a{ font-size: clamp(11px, .67vw, 13px) !important; }
}

/* Mobile/tablet hard stop: one mode only. Hide desktop nav, search and actions; show burger. */
@media (max-width: 1420px){
  html body header#tvh-header .tvh-container.tvh-header-inner,
  html body #tvh-header .tvh-container.tvh-header-inner{
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) 46px !important;
    gap: 0 16px !important;
    min-height: 72px !important;
    padding-left: clamp(18px, 4vw, 40px) !important;
    padding-right: clamp(18px, 4vw, 40px) !important;
  }
  html body header#tvh-header .tvh-nav-primary,
  html body header#tvh-header .tvh-search-trigger,
  html body header#tvh-header .tvh-nav-actions,
  html body #tvh-header .tvh-nav-primary,
  html body #tvh-header .tvh-search-trigger,
  html body #tvh-header .tvh-nav-actions{
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  html body header#tvh-header .tvh-burger,
  html body #tvh-header .tvh-burger{
    grid-column: 3 !important;
    justify-self: end !important;
    align-self: center !important;
    position: static !important;
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 1px !important;
    box-sizing: border-box !important;
  }
}

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