/* V21: keep the site header visible without covering the WordPress toolbar. */
:root {
  --doplock-admin-offset-v21:0px;
  --doplock-header-height-v21:72px;
  --doplock-menu-top-v21:14px;
}
body.admin-bar { --doplock-admin-offset-v21:32px; }
@media(max-width:782px) { body.admin-bar { --doplock-admin-offset-v21:46px; } }

/* Sticky fallback until the measured fixed-header enhancement is ready. */
body:not(.wp-admin) #header {
  position:sticky !important;
  top:var(--doplock-admin-offset-v21) !important;
  z-index:1000 !important;
  background:#fff !important;
}
body.doplock-header-v21-ready #header {
  position:fixed !important;
  top:var(--doplock-admin-offset-v21) !important;
  left:0 !important; right:0 !important;
  width:auto !important; margin:0 !important;
  transform:none !important;
}
.doplock-header-spacer-v21 {
  display:block; flex:none; height:var(--doplock-header-height-v21);
  padding:0; margin:0; border:0; pointer-events:none;
}
/* A configured Blocksy sticky/transparent inner row must not stick a second time. */
body.doplock-header-v21-ready #header [data-sticky],
body.doplock-header-v21-ready #header [data-device][data-transparent] {
  position:relative !important; inset:auto !important; transform:none !important;
  opacity:1 !important; visibility:visible !important;
}
body.doplock-header-v21-ready #header .ct-sticky-container { height:auto !important; }
html.doplock-header-v21-ready {
  scroll-padding-top:calc(var(--doplock-header-height-v21) + var(--doplock-scroll-admin-v21, 0px) + 12px) !important;
}

/* The existing footer-rendered mobile button stays aligned with the header. */
body:not(.wp-admin) .doplock-mobile-menu-button {
  z-index:1001 !important;
  top:calc(var(--doplock-admin-offset-v21) + 14px) !important;
}
body.doplock-header-v21-ready .doplock-mobile-menu-button { top:var(--doplock-menu-top-v21) !important; }
body:not(.wp-admin) .doplock-mobile-menu-overlay {
  z-index:1002 !important;
  top:var(--doplock-admin-offset-v21) !important;
}
body:not(.wp-admin) .doplock-mobile-menu-panel {
  min-height:calc(100dvh - var(--doplock-admin-offset-v21)) !important;
  max-height:calc(100dvh - var(--doplock-admin-offset-v21)) !important;
}

/* Dopi remains a normal part of the landing page, outside the fixed header. */
body .doplock-landing > .doplock-dopi-stage-v18 { position:relative; top:auto; }
@media(max-width:782px) {
  body .doplock-landing > .doplock-dopi-stage-v18 { height:68px; }
  body .doplock-dopi-shell-v18 { width:64px; height:62px; right:8px; }
  body .doplock-dopi-rig-v18 { top:-12px; }
  body .doplock-dopi-shell-v18 .doplock-dopi-greeting-v18 {
    width:min(254px, calc(100vw - 118px));
  }
  body .doplock-landing > .doplock-hero { padding-top:8px !important; margin-top:0 !important; }
}
