/* Terra Vita Hub v409.20 — header/nav spacing stabilisation
   Scope: visual spacing and hit-area stability for the institutional header/nav.
   Does not alter SQL, auth, receiver, protected workspace logic, or Stewardship copy. */

@media (min-width:1181px){
  html body.v389-institutional-nav header#tvh-header,
  html body.v389-institutional-nav #tvh-header{
    position:sticky !important;
    top:0 !important;
    z-index:9000 !important;
    overflow:visible !important;
    background:#fffaf0 !important;
    border-bottom:1px solid rgba(8,42,67,.12) !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-container.tvh-header-inner,
  html body.v389-institutional-nav #tvh-header .tvh-container.tvh-header-inner{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    min-height:86px !important;
    padding:0 clamp(28px,3.2vw,72px) !important;
    display:grid !important;
    grid-template-columns:minmax(188px,max-content) minmax(0,1fr) 46px max-content !important;
    align-items:center !important;
    column-gap:clamp(22px,1.8vw,40px) !important;
    box-sizing:border-box !important;
    overflow:visible !important;
  }

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

  html body.v389-institutional-nav header#tvh-header .tvh-logo-tag,
  html body.v389-institutional-nav #tvh-header .tvh-logo-tag{
    display:none !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav header#tvh-header .tvh-nav-primary.v389-nav-groups,
  html body.v389-institutional-nav #tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav #tvh-header .tvh-nav-primary.v389-nav-groups{
    grid-column:2 !important;
    min-width:0 !important;
    width:100% !important;
    max-width:none !important;
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    justify-content:center !important;
    gap:clamp(26px,2.1vw,48px) !important;
    padding:0 clamp(8px,.7vw,18px) !important;
    overflow:visible !important;
    white-space:nowrap !important;
    box-sizing:border-box !important;
  }

  html body.v389-institutional-nav header#tvh-header .v389-nav-group,
  html body.v389-institutional-nav header#tvh-header .v40918-nav-group,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-group,
  html body.v389-institutional-nav #tvh-header .v389-nav-group,
  html body.v389-institutional-nav #tvh-header .v40918-nav-group,
  html body.v389-institutional-nav #tvh-header .v40919-nav-group{
    position:relative !important;
    display:inline-flex !important;
    align-items:center !important;
    flex:0 0 auto !important;
    min-width:max-content !important;
    max-width:max-content !important;
    margin:0 !important;
    overflow:visible !important;
  }

  html body.v389-institutional-nav header#tvh-header .v40918-nav-head,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-head,
  html body.v389-institutional-nav #tvh-header .v40918-nav-head,
  html body.v389-institutional-nav #tvh-header .v40919-nav-head{
    display:inline-flex !important;
    align-items:center !important;
    gap:10px !important;
    min-height:44px !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    white-space:nowrap !important;
    overflow:visible !important;
  }

  html body.v389-institutional-nav header#tvh-header .v40918-nav-label,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-label,
  html body.v389-institutional-nav #tvh-header .v40918-nav-label,
  html body.v389-institutional-nav #tvh-header .v40919-nav-label{
    display:inline-flex !important;
    align-items:center !important;
    min-height:44px !important;
    padding:0 !important;
    margin:0 !important;
    color:#082a43 !important;
    text-decoration:none !important;
    font-size:clamp(14px,.92vw,16px) !important;
    font-weight:800 !important;
    line-height:1.1 !important;
    letter-spacing:0 !important;
    white-space:nowrap !important;
    overflow:visible !important;
    max-width:none !important;
    cursor:pointer !important;
    pointer-events:auto !important;
  }

  html body.v389-institutional-nav header#tvh-header .v40918-nav-toggle,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-toggle,
  html body.v389-institutional-nav #tvh-header .v40918-nav-toggle,
  html body.v389-institutional-nav #tvh-header .v40919-nav-toggle{
    width:18px !important;
    min-width:18px !important;
    max-width:18px !important;
    height:24px !important;
    min-height:24px !important;
    max-height:24px !important;
    display:inline-grid !important;
    place-items:center !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    background:transparent !important;
    color:rgba(8,42,67,.58) !important;
    line-height:1 !important;
    font-size:12px !important;
    border-radius:999px !important;
    cursor:pointer !important;
    pointer-events:auto !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-search-trigger,
  html body.v389-institutional-nav #tvh-header .tvh-search-trigger{
    grid-column:3 !important;
    justify-self:center !important;
    align-self:center !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    inline-size:46px !important;
    width:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    block-size:46px !important;
    height:46px !important;
    min-height:46px !important;
    max-height:46px !important;
    flex:0 0 46px !important;
    padding:0 !important;
    margin:0 !important;
    border:1px solid rgba(8,42,67,.18) !important;
    border-radius:0 !important;
    background:#fffdf7 !important;
    color:#082a43 !important;
    overflow:hidden !important;
    box-sizing:border-box !important;
    text-decoration:none !important;
    pointer-events:auto !important;
    cursor:pointer !important;
    z-index:5 !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-search-trigger svg,
  html body.v389-institutional-nav #tvh-header .tvh-search-trigger svg{
    width:19px !important;
    height:19px !important;
    min-width:19px !important;
    flex:0 0 19px !important;
    display:block !important;
    pointer-events:none !important;
  }

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

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

  html body.v389-institutional-nav header#tvh-header .tvh-cta-primary,
  html body.v389-institutional-nav #tvh-header .tvh-cta-primary{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:44px !important;
    height:44px !important;
    padding:0 clamp(20px,1.45vw,30px) !important;
    border-radius:999px !important;
    white-space:nowrap !important;
    line-height:1 !important;
    letter-spacing:.10em !important;
    font-size:clamp(11px,.72vw,13px) !important;
    box-sizing:border-box !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-link-text,
  html body.v389-institutional-nav #tvh-header .tvh-link-text{
    white-space:nowrap !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-burger,
  html body.v389-institutional-nav header#tvh-header .tvh-mobile-nav,
  html body.v389-institutional-nav #tvh-header .tvh-burger,
  html body.v389-institutional-nav #tvh-header .tvh-mobile-nav{
    display:none !important;
  }
}

@media (min-width:1181px) and (max-width:1640px){
  html body.v389-institutional-nav header#tvh-header .tvh-container.tvh-header-inner,
  html body.v389-institutional-nav #tvh-header .tvh-container.tvh-header-inner{
    padding-left:clamp(20px,2vw,40px) !important;
    padding-right:clamp(20px,2vw,40px) !important;
    grid-template-columns:minmax(176px,max-content) minmax(0,1fr) 44px max-content !important;
    column-gap:clamp(18px,1.35vw,28px) !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav #tvh-header .tvh-nav-primary{
    justify-content:flex-end !important;
    gap:clamp(20px,1.55vw,34px) !important;
    padding-left:0 !important;
    padding-right:0 !important;
  }
  html body.v389-institutional-nav header#tvh-header .v40918-nav-label,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-label,
  html body.v389-institutional-nav #tvh-header .v40918-nav-label,
  html body.v389-institutional-nav #tvh-header .v40919-nav-label{
    font-size:clamp(13px,.9vw,15px) !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-search-trigger,
  html body.v389-institutional-nav #tvh-header .tvh-search-trigger{
    inline-size:44px !important;
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    block-size:44px !important;
    height:44px !important;
    min-height:44px !important;
    max-height:44px !important;
    flex-basis:44px !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions{
    gap:14px !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-link-text,
  html body.v389-institutional-nav #tvh-header .tvh-link-text{
    display:none !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-cta-primary,
  html body.v389-institutional-nav #tvh-header .tvh-cta-primary{
    min-height:42px !important;
    height:42px !important;
    padding-left:18px !important;
    padding-right:18px !important;
    font-size:11px !important;
    letter-spacing:.09em !important;
  }
}

@media (min-width:1181px) and (max-width:1400px){
  html body.v389-institutional-nav header#tvh-header .tvh-container.tvh-header-inner,
  html body.v389-institutional-nav #tvh-header .tvh-container.tvh-header-inner{
    grid-template-columns:minmax(168px,max-content) minmax(0,1fr) 44px !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav #tvh-header .tvh-nav-primary{
    gap:clamp(16px,1.25vw,24px) !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions{
    display:none !important;
  }
}

@media (max-width:1180px){
  html body.v389-institutional-nav header#tvh-header .tvh-container.tvh-header-inner,
  html body.v389-institutional-nav #tvh-header .tvh-container.tvh-header-inner{
    display:grid !important;
    grid-template-columns:max-content minmax(0,1fr) 48px !important;
    min-height:76px !important;
    gap:0 16px !important;
    padding:0 22px !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav header#tvh-header .tvh-search-trigger,
  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions,
  html body.v389-institutional-nav #tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav #tvh-header .tvh-search-trigger,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions{
    display:none !important;
  }
  html body.v389-institutional-nav header#tvh-header .tvh-burger,
  html body.v389-institutional-nav #tvh-header .tvh-burger{
    grid-column:3 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:48px !important;
    height:48px !important;
    justify-self:end !important;
    pointer-events:auto !important;
    visibility:visible !important;
    opacity:1 !important;
  }
}


/* Terra Vita Hub v409.21 — restore visible Request Access CTA on medium desktop.
   Keeps header CTA visible while preserving compact search and active nav hardlinks. */
@media (min-width:1181px) and (max-width:1480px){
  html body.v389-institutional-nav header#tvh-header .tvh-container.tvh-header-inner,
  html body.v389-institutional-nav #tvh-header .tvh-container.tvh-header-inner{
    grid-template-columns:minmax(0,1fr) 44px max-content !important;
    column-gap:clamp(12px,1vw,18px) !important;
    padding-left:clamp(18px,1.8vw,28px) !important;
    padding-right:clamp(18px,1.8vw,28px) !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-logo,
  html body.v389-institutional-nav #tvh-header .tvh-logo{
    display:none !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav header#tvh-header .tvh-nav-primary.v389-nav-groups,
  html body.v389-institutional-nav #tvh-header .tvh-nav-primary,
  html body.v389-institutional-nav #tvh-header .tvh-nav-primary.v389-nav-groups{
    grid-column:1 !important;
    justify-content:flex-start !important;
    gap:clamp(14px,1.05vw,22px) !important;
    padding-left:0 !important;
    padding-right:0 !important;
    min-width:0 !important;
    overflow:visible !important;
  }

  html body.v389-institutional-nav header#tvh-header .v40918-nav-head,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-head,
  html body.v389-institutional-nav #tvh-header .v40918-nav-head,
  html body.v389-institutional-nav #tvh-header .v40919-nav-head{
    gap:7px !important;
  }

  html body.v389-institutional-nav header#tvh-header .v40918-nav-label,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-label,
  html body.v389-institutional-nav #tvh-header .v40918-nav-label,
  html body.v389-institutional-nav #tvh-header .v40919-nav-label{
    font-size:clamp(13px,.82vw,14px) !important;
    letter-spacing:-.01em !important;
  }

  html body.v389-institutional-nav header#tvh-header .v40918-nav-toggle,
  html body.v389-institutional-nav header#tvh-header .v40919-nav-toggle,
  html body.v389-institutional-nav #tvh-header .v40918-nav-toggle,
  html body.v389-institutional-nav #tvh-header .v40919-nav-toggle{
    width:16px !important;
    min-width:16px !important;
    max-width:16px !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-search-trigger,
  html body.v389-institutional-nav #tvh-header .tvh-search-trigger{
    grid-column:2 !important;
    justify-self:end !important;
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    height:44px !important;
    min-height:44px !important;
    max-height:44px !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions{
    grid-column:3 !important;
    display:inline-flex !important;
    visibility:visible !important;
    opacity:1 !important;
    align-items:center !important;
    justify-content:flex-end !important;
    min-width:max-content !important;
    max-width:max-content !important;
    gap:0 !important;
    overflow:visible !important;
    white-space:nowrap !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions .tvh-link-text,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions .tvh-link-text{
    display:none !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions .tvh-cta-primary,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions .tvh-cta-primary{
    display:inline-flex !important;
    visibility:visible !important;
    opacity:1 !important;
    height:42px !important;
    min-height:42px !important;
    min-width:148px !important;
    padding-left:18px !important;
    padding-right:18px !important;
    font-size:0 !important;
    letter-spacing:0 !important;
    line-height:1 !important;
    overflow:visible !important;
    white-space:nowrap !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions .tvh-cta-primary::before,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions .tvh-cta-primary::before{
    content:"Request access" !important;
    font-size:11px !important;
    line-height:1 !important;
    font-weight:900 !important;
    letter-spacing:.08em !important;
    text-transform:uppercase !important;
    white-space:nowrap !important;
  }

  html body.v389-institutional-nav header#tvh-header .tvh-nav-actions .tvh-cta-primary span,
  html body.v389-institutional-nav #tvh-header .tvh-nav-actions .tvh-cta-primary span{
    display:inline !important;
    font-size:12px !important;
    margin-left:8px !important;
  }
}
