/**
 * BAC Gate 1 — Global shell v1.2.0
 * IMP-1.2.0-B
 *
 * Owns only the global frame, environment offsets, containers, anchor
 * compensation, skip navigation and overflow diagnostics. Header/footer
 * content and interaction remain in their dedicated microgates.
 */

:root {
  --bac-admin-bar-height: 0px;
  --bac-stage-bar-height: 0px;
  --bac-header-height: 76px;
  --bac-anchor-extra-offset: 16px;
  --bac-total-top-offset: calc(
    var(--bac-admin-bar-height)
    + var(--bac-stage-bar-height)
    + var(--bac-header-height)
  );

  --bac-gutter-inline: 20px;
  --bac-container-wide: 100%;
  --bac-container-standard: 100%;
  --bac-container-reading: 100%;

  --bac-safe-left: max(var(--bac-gutter-inline), env(safe-area-inset-left, 0px));
  --bac-safe-right: max(var(--bac-gutter-inline), env(safe-area-inset-right, 0px));
}

@media (max-width: 349px) {
  :root {
    --bac-header-height: 72px;
    --bac-gutter-inline: 16px;
  }
}

@media (min-width: 768px) and (max-width: 959px) {
  :root {
    --bac-header-height: 82px;
    --bac-anchor-extra-offset: 18px;
    --bac-gutter-inline: 32px;
    --bac-container-wide: 880px;
    --bac-container-standard: 800px;
    --bac-container-reading: 680px;
  }
}

@media (min-width: 960px) and (max-width: 1279px) {
  :root {
    --bac-header-height: 86px;
    --bac-anchor-extra-offset: 20px;
    --bac-gutter-inline: 48px;
    --bac-container-wide: 1120px;
    --bac-container-standard: 960px;
    --bac-container-reading: 760px;
  }
}

@media (min-width: 1280px) {
  :root {
    --bac-header-height: 96px;
    --bac-anchor-extra-offset: 20px;
    --bac-gutter-inline: 48px;
    --bac-container-wide: 1280px;
    --bac-container-standard: 1120px;
    --bac-container-reading: 760px;
  }
}

html {
  min-width: 320px;
  scroll-padding-top: calc(var(--bac-total-top-offset) + var(--bac-anchor-extra-offset));
}

body {
  min-width: 320px;
  overflow-x: visible;
}

body.menu-open {
  overflow: hidden;
}

.bac-site-frame {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: var(--canvas, #f4f1ea);
}

.bac-site-frame > * {
  min-width: 0;
}

.bac-site-frame > .site-main {
  min-height: 0;
}

.bac-stage-slot {
  position: sticky;
  top: var(--bac-admin-bar-height);
  z-index: 9990;
  min-height: var(--bac-stage-bar-height);
}

.bac-stage-slot:empty {
  min-height: 0;
  height: 0;
  overflow: hidden;
}

.bac-stage-bar {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px var(--bac-safe-right) 6px var(--bac-safe-left);
  background: #17242b;
  color: #fff;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: .02em;
  text-align: center;
}

.bac-stage-bar__long {
  display: none;
}

@media (min-width: 768px) {
  .bac-stage-bar__short {
    display: none;
  }

  .bac-stage-bar__long {
    display: inline;
  }
}

.site-header {
  position: sticky;
  top: calc(var(--bac-admin-bar-height) + var(--bac-stage-bar-height));
  z-index: 9980;
}

.site-header .header-shell {
  min-height: var(--bac-header-height);
  height: var(--bac-header-height);
}

/* The WP admin bar owns its own fixed positioning; shell.js measures it. */
body.admin-bar .site-header {
  top: calc(var(--bac-admin-bar-height) + var(--bac-stage-bar-height));
}

.bac-container,
.shell {
  width: min(
    var(--bac-container-wide),
    calc(100% - var(--bac-safe-left) - var(--bac-safe-right))
  );
  margin-inline: auto;
}

.bac-container--standard {
  width: min(
    var(--bac-container-standard),
    calc(100% - var(--bac-safe-left) - var(--bac-safe-right))
  );
  margin-inline: auto;
}

.bac-container--reading {
  width: min(
    var(--bac-container-reading),
    calc(100% - var(--bac-safe-left) - var(--bac-safe-right))
  );
  margin-inline: auto;
}

.bac-full-bleed {
  width: 100%;
}

.bac-full-bleed > .bac-container,
.bac-full-bleed > .shell {
  margin-inline: auto;
}

.site-main,
.site-main > *,
.shell,
.bac-container,
.bac-container--standard,
.bac-container--reading,
.grid,
[class*="grid"] {
  min-width: 0;
}

img,
video,
svg,
iframe {
  max-width: 100%;
}

pre,
table,
.bac-overflow-region {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

:where(.site-main [id], [id].bac-anchor-target) {
  scroll-margin-top: calc(var(--bac-total-top-offset) + var(--bac-anchor-extra-offset));
}

.bac-page-start {
  scroll-margin-top: calc(var(--bac-admin-bar-height) + 8px);
}

.bac-visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bac-skip-link {
  position: fixed;
  top: calc(var(--bac-admin-bar-height) + env(safe-area-inset-top, 0px) + 8px);
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 100100;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 12px 14px;
  border: 2px solid #072f49;
  border-radius: 4px;
  background: #fffcf6;
  color: #072f49;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transform: translateY(calc(-100% - 32px));
  transition: transform 140ms ease;
}

.bac-skip-link:focus,
.bac-skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid #072f49;
  outline-offset: 3px;
  box-shadow: none;
}

.site-main:focus,
.site-main:focus-visible {
  outline: none;
  box-shadow: none;
}

.bac-focus-target:focus,
.bac-focus-target:focus-visible {
  outline: 3px solid #072f49;
  outline-offset: 4px;
}

/* Diagnostic only: never hide overflow that must be fixed at source. */
html[data-bac-overflow-x="true"] .bac-stage-bar {
  box-shadow: inset 0 -3px 0 #9e2f2f;
}

@media (prefers-reduced-motion: reduce) {
  .bac-skip-link {
    transition: none;
  }
}

@media print {
  .bac-stage-slot,
  .bac-skip-link {
    display: none !important;
  }

  .bac-site-frame {
    display: block;
    min-height: auto;
  }
}

/* IMP-G — global template integration ------------------------------------ */
.bac-page-main {
  min-width: 0;
}

.bac-page {
  min-width: 0;
}

.bac-page__content {
  min-width: 0;
}

.bac-page-intro {
  padding-block: 32px 8px;
}

.bac-page--reading > .bac-page__content,
.bac-page-main--legal .bac-page__content {
  width: min(100%, var(--bac-container-reading));
  margin-inline: auto;
  padding-inline: var(--bac-gutter-inline);
  padding-block: 32px 72px;
}

.bac-page--reading .page-hero,
.bac-page-main--legal .page-hero {
  width: min(100%, var(--bac-container-reading));
  margin-inline: auto;
}

.bac-page--short .bac-page__content {
  min-height: 0;
}

@media (min-width: 768px) {
  .bac-page-intro {
    padding-block-start: 48px;
  }
  .bac-page--reading > .bac-page__content,
  .bac-page-main--legal .bac-page__content {
    padding-block: 48px 88px;
  }
}

@media (min-width: 960px) {
  .bac-page-intro {
    padding-block-start: 56px;
  }
  .bac-page--reading > .bac-page__content,
  .bac-page-main--legal .bac-page__content {
    padding-block: 56px 96px;
  }
}

@media (min-width: 1280px) {
  .bac-page-intro {
    padding-block-start: 64px;
  }
  .bac-page--reading > .bac-page__content,
  .bac-page-main--legal .bac-page__content {
    padding-block: 64px 112px;
  }
}

/* CHAT 05 — canonical breadcrumb contract. */
.bac-shell-breadcrumbs{padding-block:var(--bac-space-4);font-size:var(--bac-type-help);line-height:var(--bac-leading-compact)}
.bac-shell-breadcrumbs ol{display:flex;flex-wrap:wrap;gap:var(--bac-space-1);list-style:none;margin:0;padding:0}
.bac-shell-breadcrumbs li{display:inline-flex;align-items:center;min-width:0}
.bac-shell-breadcrumbs li:not(:last-child)::after{content:"/";margin-inline:var(--bac-space-1);color:var(--bac-color-muted)}
.bac-shell-breadcrumbs a{color:var(--bac-color-navy);text-underline-offset:3px}
