/* Shared layout and interaction fixes. The original theme palette is unchanged. */
body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
}

.bw-skip-link {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 0px));
  left: max(8px, env(safe-area-inset-left, 0px));
  z-index: 1060;
  padding: 12px 16px;
  color: var(--bw-ui-navy);
  background: #fff;
  transform: translateY(-200%);
}

.bw-skip-link:focus {
  transform: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--bw-ui-navy);
  outline-offset: 2px;
}

ul.footer_menu li.active :is(a, .bi, .bi-house, .footer_menu__name) {
  color: var(--bw-ui-navy);
}

ul.footer_menu a[aria-current] {
  box-shadow: inset 0 3px 0 var(--bw-ui-gold);
  font-weight: 700;
}

ul.footer_menu a:focus-visible {
  outline-offset: -3px;
}

.pagetop {
  z-index: 1031;
}

.pagetop span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.bw-zip-modal-close,
.modal-header .close,
.bd-search-docs-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* Light gold text on beige and white on green were hard to read. */
.u-bg-gold .u-gold-color {
  color: var(--bw-ui-navy);
}

#content .bg-success.text-white {
  color: var(--bw-ui-navy) !important;
  background-color: var(--bw-ui-gold) !important;
}

/* Retain category colors while giving small badge labels sufficient contrast. */
:root:not([data-bs-theme="dark"]) #content .badge.text-bg-success {
  color: #003367 !important;
}

/* Inline links must remain identifiable without relying on color alone. */
.rd-company-intro p.text-justify > a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@media (max-width: 767.98px) {
  :root {
    --bw-bottom-nav-height: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  html:has(body.bw-site-chrome) {
    scroll-padding-bottom: calc(var(--bw-bottom-nav-height) + 12px);
  }

  body.bw-site-chrome {
    padding-bottom: var(--bw-bottom-nav-height);
  }

  ul.footer_menu {
    display: flex;
    align-items: stretch;
    bottom: 0;
    z-index: 1030;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }

  ul.footer_menu li {
    display: block;
    flex: 1;
    min-width: 0;
    font-size: 0.6875rem;
  }

  ul.footer_menu li a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 64px;
    height: 100%;
    white-space: normal;
  }

  .pagetop {
    bottom: calc(var(--bw-bottom-nav-height) + 12px);
    right: max(8px, env(safe-area-inset-right, 0px));
  }

  .main-footer .copyright {
    padding-right: 56px;
  }
}

@media (min-width: 768px) {
  html:has(body.bw-site-chrome) {
    scroll-padding-top: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}
