/**
 * Site chrome.
 *
 * Header/footer markup + styles now live in the location-aware ACF blocks:
 * - acf-blocks/acf-site-header/ (render.php, style.css, view.js)
 * - acf-blocks/acf-site-footer/ (render.php, style.css)
 * parts/header.html + parts/footer.html only reference those blocks.
 * See .vscode/location-cookie-header-footer.md (Part 2).
 */

/*
 * Pacific fixed header — always top: 0 (full-width opaque shell).
 * With WP admin bar, use padding-top — NOT top: 46px. Offsetting the whole
 * shell left a strip above it where scrolled page content showed through on mobile.
 */
.acf-site-header-fixed {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--color-light);
}

.admin-bar .acf-site-header-fixed {
  box-sizing: border-box;
  padding-top: 32px;
}

.admin-bar .acf-site-header-fixed::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  block-size: 46px;
  background-color: var(--color-light);
  pointer-events: none;
  z-index: 0;
}

@media screen and (min-width: 783px) {
  .admin-bar .acf-site-header-fixed::before {
    block-size: 32px;
  }
}

.admin-bar .acf-site-header-fixed > * {
  position: relative;
  z-index: 1;
}

@media screen and (max-width: 782px) {
  .admin-bar .acf-site-header-fixed {
    padding-top: 46px;
  }
}

.acf-site-header-fixed:has(.acf-site-header--static) {
  position: static;
}

/* In-flow spacer — full stack (announcement + nav + location banner). */
.acf-site-header-fixed-spacer {
  block-size: var(--stack-header-height);
  pointer-events: none;
}

.acf-site-header-fixed:has(.acf-site-header--static) + .acf-site-header-fixed-spacer {
  display: none;
}

.acf-site-header-fixed.is-dropdown-open {
  overflow: visible; /* Allow desktop dropdown layer to extend below the shell */
  box-shadow: 0 8px 24px rgb(3 64 15 / 0.1);
}

/*
 * Admin-bar paints every shell child at z-index:1 so the opaque strip
 * sits behind the chrome. The yellow location banner is a later sibling,
 * so it covered the mega-menu and the panel looked like it sat under
 * the bar. Raise the nav while a desktop dropdown is open.
 */
.acf-site-header-fixed.is-dropdown-open > .acf-site-header {
  z-index: 2;
}

/* view.js adds .is-collapsed once scrolled past — zero layout height (not visibility:hidden). */
.acf-site-header-fixed .acf-announcement-bar.is-collapsed {
  display: none !important;
  block-size: 0;
  min-block-size: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  visibility: hidden;
}

html.is-nav-open {
  overflow: hidden;
}

/* Mobile drawer must paint above page content and escape shell clipping. */
html.is-nav-open .acf-site-header-fixed {
  overflow: visible;
  z-index: 10000;
}

html.is-nav-open .acf-site-header {
  overflow: visible;
}

/* Visually hidden — available to blocks (e.g. section labels for a11y audits). */
.screen-reader-text,
.visually-hidden {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Inline SVGs printed by bpa_theme_src_inline_svg() fill their wrapper. */
.bpa-inline-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/**
 * Blog category label — Figma Frame 1707478514 (114×44, radius 80px, pad 8×16).
 * Used on acf-blog-section cards + acf-featured-blog-section split layout.
 */
.bpa-blog-category-pill,
.acf-blog-section__category-pill,
.acf-featured-blog-section__category-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  box-sizing: border-box;
  gap: var(--blog-category-pill-gap, 10px);
  inline-size: fit-content;
  max-inline-size: 100%;
  block-size: var(--blog-category-pill-height, 44px);
  min-block-size: var(--blog-category-pill-height, 44px);
  padding-block: var(--blog-category-pill-pad-block, 8px);
  padding-inline: var(--blog-category-pill-pad-inline, 16px);
  border: 1px solid var(--color-franchise-green-bright, #30b454);
  border-radius: var(--radius-category-pill, 80px);
  background-color: var(--color-light);
  font-family: var(--font-family-base);
  font-size: var(--font-size-h5);
  font-weight: var(--font-weight-bold);
  line-height: 1.75rem; /* Figma 28px on 20px type */
  color: var(--color-brand-forest);
  white-space: nowrap;
  text-decoration: none;
}

/* Green blog band sets text-light — keep pill forest on white cards. */
.acf-blog-section.text-light .acf-blog-section__card .bpa-blog-category-pill,
.acf-blog-section.text-light .acf-blog-section__card .acf-blog-section__category-pill,
.entry-content .bpa-blog-category-pill,
.entry-content .acf-blog-section__category-pill,
.entry-content .acf-featured-blog-section__category-pill,
.wp-block-post-content .bpa-blog-category-pill,
.wp-block-post-content .acf-blog-section__category-pill,
.wp-block-post-content .acf-featured-blog-section__category-pill {
  block-size: var(--blog-category-pill-height, 44px);
  min-block-size: var(--blog-category-pill-height, 44px);
  padding-block: var(--blog-category-pill-pad-block, 8px);
  padding-inline: var(--blog-category-pill-pad-inline, 16px);
  border: 1px solid var(--color-franchise-green-bright, #30b454);
  border-radius: var(--radius-category-pill, 80px);
  background-color: var(--color-light);
  color: var(--color-brand-forest);
}
