/*
 * WB1 Layout System 2.0.0
 * One shell. One reading measure. One wide-content measure.
 * This file loads LAST and intentionally overrides historical container rules.
 */

:root{
  --wb1-shell-max:1440px;
  --wb1-reading-max:1180px;
  --wb1-desktop-gutter:32px;
  --wb1-mobile-gutter:18px;
  --wb1-page-top:64px;
  --wb1-page-bottom:64px;
  --wb1-dock-max:620px;
  --wb1-dock-gap-bottom:50px;
  --wb1-dock-height-reserve:126px;
}

/* Global horizontal system */
.site-shell,
.content-shell,
.home-shell,
.article-shell,
.project-shell,
.epr-page,
.wb1-page-frame,
.wb1-wide-frame{
  box-sizing:border-box!important;
  width:min(calc(100% - (var(--wb1-desktop-gutter) * 2)),var(--wb1-shell-max))!important;
  max-width:var(--wb1-shell-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Page frames own only vertical rhythm. */
.wb1-page-frame,
.epr-page.wb1-page-frame{
  padding:var(--wb1-page-top) 0 var(--wb1-page-bottom)!important;
}

/* One reading measure for ALL normal page copy. */
.wb1-reading-frame{
  box-sizing:border-box;
  width:min(100%,var(--wb1-reading-max));
  max-width:var(--wb1-reading-max);
  margin-left:auto;
  margin-right:auto;
}

/* Historical inner-width rules are neutralized inside the new frame. */
.wb1-reading-frame > .entry-header,
.wb1-reading-frame > .entry-content,
.wb1-reading-frame > .epr-page-entry-header,
.wb1-reading-frame > .epr-page-content,
.wb1-reading-frame .entry-content > p,
.wb1-reading-frame .entry-content > ul,
.wb1-reading-frame .entry-content > ol,
.wb1-reading-frame .entry-content > blockquote,
.wb1-reading-frame .entry-content > h2,
.wb1-reading-frame .entry-content > h3,
.wb1-reading-frame .epr-page-content > p,
.wb1-reading-frame .epr-page-content > ul,
.wb1-reading-frame .epr-page-content > ol,
.wb1-reading-frame .epr-page-content > blockquote,
.wb1-reading-frame .epr-page-content > h2,
.wb1-reading-frame .epr-page-content > h3{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* Galleries/discovery always receive the full outer shell. */
.wb1-wide-frame{
  margin-top:46px!important;
}
.wb1-wide-frame > .wb1-structured-discovery,
.wb1-wide-frame > .epr-project-discovery,
.wb1-wide-frame .wb1-structured-discovery,
.wb1-wide-frame .epr-project-discovery,
.wb1-project-gallery-frame .project-gallery{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* ExtendedPR width controls still work, but they do not invent new container systems. */
.wb1-page-frame.epr-page-width--wide .wb1-reading-frame{
  --wb1-reading-max:1320px;
}
.wb1-page-frame.epr-page-width--full{
  width:100%!important;
  max-width:none!important;
}
.wb1-page-frame.epr-page-width--full .wb1-reading-frame{
  width:min(calc(100% - (var(--wb1-desktop-gutter) * 2)),var(--wb1-shell-max))!important;
  max-width:var(--wb1-shell-max)!important;
}
.wb1-page-frame.epr-page-no-top-spacing{padding-top:0!important}
.wb1-page-frame.epr-page-no-bottom-spacing{padding-bottom:0!important}

/* Footer: eliminate accumulated historical padding. */
.site-footer,
.wb1-contact-footer{
  box-sizing:border-box!important;
  padding:46px 0 48px!important;
  margin:0!important;
  min-height:0!important;
}
.site-footer .footer-inner{
  width:min(calc(100% - (var(--wb1-desktop-gutter) * 2)),var(--wb1-shell-max))!important;
  max-width:var(--wb1-shell-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/*
 * Fixed contact dock.
 * One authoritative position. 50px above viewport bottom on desktop AND mobile.
 * No footer-relative positioning, no transforms, no duplicate bottom rules.
 */
.wb1-contact-dock,
.mobile-action-bar.wb1-contact-dock{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:calc(var(--wb1-dock-gap-bottom) + env(safe-area-inset-bottom,0px))!important;
  transform:translateX(-50%)!important;
  z-index:9999!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:5px!important;
  box-sizing:border-box!important;
  width:min(calc(100vw - 32px),var(--wb1-dock-max))!important;
  max-width:var(--wb1-dock-max)!important;
  margin:0!important;
  padding:6px!important;
  background:#101010!important;
  border:1px solid #5b5b5b!important;
  border-radius:16px!important;
  box-shadow:0 12px 32px rgba(0,0,0,.34)!important;
}

/* Reserve space in the document independently of footer padding. */
body{
  padding-bottom:calc(var(--wb1-dock-height-reserve) + env(safe-area-inset-bottom,0px))!important;
  background:#171717;
}
.site-main{
  background:#fff;
}

/* Header shares the same outer shell but keeps its own vertical design. */
.header-inner{
  width:min(calc(100% - (var(--wb1-desktop-gutter) * 2)),var(--wb1-shell-max))!important;
  max-width:var(--wb1-shell-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Remove old discovery-only shell special cases. */
.article-shell.epr-page-has-discovery,
.epr-page.epr-page-has-discovery{
  width:min(calc(100% - (var(--wb1-desktop-gutter) * 2)),var(--wb1-shell-max))!important;
  max-width:var(--wb1-shell-max)!important;
}
.article-shell.epr-page-has-discovery > .entry-header,
.article-shell.epr-page-has-discovery > .entry-content,
.epr-page.epr-page-has-discovery > .epr-page-entry-header,
.epr-page.epr-page-has-discovery > .epr-page-content{
  width:100%!important;
  max-width:none!important;
}

/* Responsive */
@media(max-width:760px){
  :root{
    --wb1-page-top:40px;
    --wb1-page-bottom:48px;
    --wb1-dock-max:620px;
    --wb1-dock-gap-bottom:50px;
    --wb1-dock-height-reserve:120px;
  }

  .site-shell,
  .content-shell,
  .home-shell,
  .article-shell,
  .project-shell,
  .epr-page,
  .wb1-page-frame,
  .wb1-wide-frame,
  .header-inner,
  .site-footer .footer-inner{
    width:calc(100% - (var(--wb1-mobile-gutter) * 2))!important;
    max-width:none!important;
  }

  .wb1-contact-dock,
  .mobile-action-bar.wb1-contact-dock{
    width:calc(100vw - 24px)!important;
  }
}


/* WB1 2.4.1 responsive dock/footer correction */
@media(max-width:1024px){
  :root{
    --wb1-dock-gap-bottom:10px;
    --wb1-dock-height-reserve:92px;
  }

  .wb1-contact-dock,
  .mobile-action-bar.wb1-contact-dock{
    bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
  }

  body{
    padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))!important;
  }

  .site-footer,
  .wb1-contact-footer{
    padding:32px 0 34px!important;
  }

  .footer-inner{
    gap:20px!important;
  }

  .footer-secondary{
    margin-top:3px!important;
  }

  .wb1-contact-dock .wb1-contact-dock__quote{
    background:var(--accent)!important;
    border-color:var(--accent)!important;
    color:#fff!important;
  }
}

@media(max-width:760px){
  :root{
    --wb1-mobile-gutter:16px;
    --wb1-page-top:36px;
    --wb1-page-bottom:40px;
    --wb1-dock-gap-bottom:8px;
    --wb1-dock-height-reserve:88px;
  }

  .wb1-contact-dock,
  .mobile-action-bar.wb1-contact-dock{
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    width:calc(100vw - 20px)!important;
  }

  body{
    padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important;
  }

  .site-footer,
  .wb1-contact-footer{
    padding:28px 0 30px!important;
  }

  .footer-inner{
    gap:18px!important;
  }
}
