/* ============================================================
   Believe (FSE) — theme.css
   Component & layout styles. Consumes tokens defined in tokens.css.
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

/* ----------------------------------------------------------
   PAGE FRAME
   The outer paper-300 frame that holds every page. Inner shell
   constrains to layout-page-max.
   ---------------------------------------------------------- */

.wp-site-blocks {
  background: var(--color-paper-300);
  min-height: 100vh;
}

.bb-shell {
  max-width: var(--layout-page-max);
  margin: 0 auto;
  padding: 16px;
}

/* ----------------------------------------------------------
   SITE HEADER + PRIMARY NAVIGATION
   The custom nav has manual hierarchy: any menu item with
   children renders an accessible dropdown. Hover OR keyboard
   focus opens it; Escape closes; click-outside closes.
   ---------------------------------------------------------- */

.bb-header {
  background: var(--color-paper-100);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 1px;
}

.bb-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.bb-brand {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  color: var(--color-text-primary);
}

.bb-nav { display: flex; align-items: center; }

.bb-nav__menu,
.bb-nav__menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bb-nav__menu {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: var(--type-ui-size);
  font-family: var(--font-sans);
}

.bb-nav__item {
  position: relative;
}

.bb-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 400;
  transition: color 120ms ease;
}

.bb-nav__link:hover,
.bb-nav__link:focus-visible,
.bb-nav__item.current-menu-item > .bb-nav__link,
.bb-nav__item.current-menu-ancestor > .bb-nav__link {
  color: var(--color-text-primary);
}

.bb-nav__link[aria-haspopup="true"]::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 150ms ease;
}

.bb-nav__item--has-children[aria-expanded="true"] > .bb-nav__link::after {
  transform: rotate(-135deg) translate(-1px, -1px);
}

/* Dropdowns ---------------------------------------------------- */

.bb-nav__submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin-top: 8px;
  background: var(--color-paper-100);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 8px 24px -12px rgba(20, 24, 42, 0.18);
  display: none;
  z-index: 50;
}

/* Invisible 8px bridge above the submenu so the cursor never leaves
   the descendant tree on its way from parent link → submenu. Without
   this the visual gap also becomes a hit-test gap and hover drops. */
.bb-nav__submenu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.bb-nav__item--has-children:hover > .bb-nav__submenu,
.bb-nav__item--has-children:focus-within > .bb-nav__submenu,
.bb-nav__item--has-children[aria-expanded="true"] > .bb-nav__submenu {
  display: block;
}

.bb-nav__submenu .bb-nav__link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-body);
}

.bb-nav__submenu .bb-nav__link:hover,
.bb-nav__submenu .bb-nav__link:focus-visible {
  background: var(--color-paper-200);
  color: var(--color-text-primary);
}

/* CTA pill in nav (book-a-call) ------------------------------- */

.bb-nav__cta {
  background: var(--color-accent);
  color: var(--color-text-inverse-primary);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
}

.bb-nav__cta:hover { background: var(--color-accent-hover); color: var(--color-text-inverse-primary); }

/* Mobile toggle (progressive enhancement via nav.js) ---------- */

.bb-nav__toggle {
  display: none;
  background: transparent;
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: var(--type-ui-size);
  cursor: pointer;
}

@media (max-width: 720px) {
  .bb-nav__toggle { display: inline-flex; }
  .bb-nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-paper-100);
    border: var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 240px;
    box-shadow: 0 8px 24px -12px rgba(20, 24, 42, 0.2);
    z-index: 40;
  }
  .bb-nav__menu[data-open="true"] { display: flex; }
  .bb-nav__submenu { position: static; box-shadow: none; border: none; padding-left: 12px; }
  .bb-nav__item--has-children > .bb-nav__submenu { display: none; }
  .bb-nav__item--has-children[aria-expanded="true"] > .bb-nav__submenu { display: block; }
}

/* ----------------------------------------------------------
   SECTION SCAFFOLD
   Most patterns wrap their root group in .bb-section to get
   uniform vertical rhythm and the rounded card treatment.
   ---------------------------------------------------------- */

/* Non-cover sections stay centered at the page-max width (the constraint
   used to live on <main> as .bb-shell; it now lives on the section
   itself so cover/full-bleed siblings can break free). */
.bb-section {
  max-width: var(--layout-page-max);
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-md);
  padding: clamp(32px, 4vw, 48px);
  margin-bottom: 1px;
}

.bb-section--paper { background: var(--color-paper-100); border: var(--border-hairline); }
.bb-section--paper-recessed { background: var(--color-paper-200); border: var(--border-hairline); }
.bb-section--ink { background: var(--color-ink-200); color: var(--color-text-inverse-primary); }
.bb-section--ink-deep { background: var(--color-ink-100); color: var(--color-text-inverse-primary); }

/* Section card carries its own background; same centering treatment. */
.bb-section-card {
  max-width: var(--layout-page-max);
  margin-left: auto;
  margin-right: auto;
}

/* ----------------------------------------------------------
   PATTERN 02 — COVER
   ---------------------------------------------------------- */

/* The cover is edge-to-edge. <main> no longer constrains its children,
   so the cover naturally fills 100% of the viewport. !important is
   defensive against WordPress's .alignfull max-width override. The
   internal grid lives in .bb-cover__inner so the ink background spans
   100% but the content stays within the page-max reading rhythm. */
.bb-cover {
  background: var(--color-ink-200);
  color: var(--color-text-inverse-primary);
  border-radius: 0 !important;
  padding: clamp(48px, 6vw, 96px) clamp(28px, 4vw, 56px);
  --color-accent: var(--color-accent-ember);
  --color-accent-hover: var(--color-accent-ember-hover);
  max-width: none !important;
  width: 100%;
}

.bb-cover__inner {
  max-width: var(--layout-page-max);
  margin: 0 auto;
  display: grid;
  /* Right column widened from 180px → 280px to comfortably fit the CTA
     buttons + portrait + marginalia stack. */
  grid-template-columns: 1fr 280px;
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.bb-cover__head .bb-eyebrow { color: var(--color-accent-ember); }
.bb-cover__title {
  font-family: var(--font-serif);
  font-size: var(--type-display-size);
  line-height: var(--type-display-line);
  letter-spacing: var(--type-display-tracking);
  font-weight: var(--type-display-weight);
  margin: 8px 0 16px;
  /* No artificial character cap — the column width does the wrapping.
     overflow-wrap keeps any unusually long word from breaking the layout. */
  max-width: none;
  overflow-wrap: break-word;
  hyphens: auto;
  color: var(--color-text-inverse-primary);
}

.bb-cover__deck {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--type-deck-size);
  line-height: var(--type-deck-line);
  color: var(--color-text-inverse-secondary);
  max-width: 42ch;
  margin: 0;
}

/* The right column. Vertical stack: portrait → CTA → marginalia.
   gap controls the rhythm between the three sub-blocks. */
.bb-cover__side {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: stretch;
}

/* Defensive reset against is-layout-flow's automatic block-gap margin
   on every wrapper this theme uses for structural composition.
   Whenever a wp:group is used to satisfy the editor's "real blocks
   only" requirement, WP adds is-layout-flow + injects child-margin
   rules (margin-block-start: var(--wp--style--block-gap)) between
   siblings. The theme manages its own internal spacing on these
   wrappers via grid/flex gaps and explicit margins, so the block-gap
   would compound into doubled vertical rhythm. List every theme-managed
   wrapper here. */
.bb-cover__inner.is-layout-flow         > * + *,
.bb-cover__head.is-layout-flow          > * + *,
.bb-cover__side.is-layout-flow          > * + *,
.bb-section-card__copy.is-layout-flow   > * + *,
.bb-prose.is-layout-flow                > * + *,
.bb-cta-bar.is-layout-flow              > * + *,
.bb-cta-bar__copy.is-layout-flow        > * + *,
.bb-cta-bar__action.is-layout-flow      > * + *,
.bb-about-teaser.is-layout-flow         > * + *,
.bb-about-teaser__copy.is-layout-flow   > * + *,
.bb-about-hero.is-layout-flow           > * + *,
.bb-about-hero__copy.is-layout-flow     > * + *,
.bb-narrative.is-layout-flow            > * + *,
.bb-narrative__body.is-layout-flow      > * + *,
.bb-project-body.is-layout-flow         > * + *,
.bb-project-meta.is-layout-flow         > * + *,
.bb-phase-strip.is-layout-flow          > * + *,
.bb-phase-card.is-layout-flow           > * + *,
.bb-phase-detail.is-layout-flow         > * + *,
.bb-phase-detail__cell.is-layout-flow   > * + *,
.bb-phase-price.is-layout-flow          > * + * {
  margin-block-start: 0;
}

/* ----------------------------------------------------------
   IMAGE COMPONENTS
   Three styled wrappers around wp:image blocks. Each masks the
   uploaded image with object-fit: cover and shows a paper/ink
   background as a placeholder until the user uploads.
   ---------------------------------------------------------- */

/* Round portrait — three sizes mirror the three placements:
   sm 80px (homepage about teaser),
   md 96px (CTA primary bar),
   lg 200px (about page hero). */
.bb-portrait {
  margin: 0;
  background: var(--color-paper-200);
  border: 0.5px solid var(--color-border-paper);
  border-radius: 50%;
  overflow: hidden;
  aspect-ratio: 1;
  flex-shrink: 0;
}
.bb-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bb-portrait--sm { width: 80px;  }
.bb-portrait--md { width: 96px;  }
.bb-portrait--lg { width: 200px; }

/* 16:9 dark frame — used for project hero media (full-width slot)
   and inline secondary media (mid-prose). The dark ink-300 background
   is the placeholder; uploaded photos crop with object-fit. */
.bb-hero-media,
.bb-inline-media {
  margin: 0;
  background: var(--color-ink-300);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.bb-hero-media img,
.bb-inline-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bb-inline-media { margin: 24px 0; }

/* Narrative section media — column-bound frame for the section-image
   slot in the three-column numbered narrative pattern. The figure
   width is constrained by the 280px grid column; the image's
   intrinsic aspect ratio drives height (no aspect-ratio cap, no
   object-fit cropping — vertical scales to whatever was uploaded). */
.bb-narrative__media {
  margin: 0;
  background: var(--color-paper-200);
  border: 0.5px solid var(--color-border-paper);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
}
.bb-narrative__media img {
  width: 100%;
  height: auto;
  display: block;
}

/* ----------------------------------------------------------
   LAYOUT COMPONENTS
   Named CSS classes that replace the inline-styled grids
   previously locked inside wp:html blocks. Now every grid
   cell can host real Gutenberg blocks (including wp:image).
   ---------------------------------------------------------- */

/* CTA primary bar — portrait + copy + action stack. */
.bb-cta-bar {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 24px;
  align-items: center;
}
.bb-cta-bar__action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* About teaser — homepage closing strip. */
.bb-about-teaser {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: center;
}

/* About hero — about page opener. */
.bb-about-hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: center;
}

/* Project body — prose left, sticky meta sidebar right. */
.bb-project-body {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 48px;
  align-items: start;
}
.bb-project-meta {
  background: var(--color-paper-200);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 0.5px solid var(--color-border-paper);
  position: sticky;
  top: 24px;
}
.bb-project-meta__list {
  margin: 16px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
}
.bb-project-meta__list dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.bb-project-meta__list dd {
  margin: 0 0 12px;
  color: var(--color-text-body);
}

@media (max-width: 720px) {
  .bb-cta-bar      { grid-template-columns: 80px 1fr; }
  .bb-cta-bar__action { grid-column: 1 / -1; align-items: flex-start; }
  .bb-about-teaser { grid-template-columns: 1fr; }
  .bb-about-hero   { grid-template-columns: 1fr; }
  .bb-project-body { grid-template-columns: 1fr; }
  .bb-project-meta { position: static; }
}

/* Likewise neutralize the wp-block-group default block padding inheritance
   so the cover's own padding token wins. */
.bb-cover.has-global-padding,
.bb-cover__inner.has-global-padding,
.bb-cover__head.has-global-padding,
.bb-cover__side.has-global-padding {
  padding-left: 0;
  padding-right: 0;
}
.bb-cover.has-global-padding { padding: clamp(48px, 6vw, 96px) clamp(28px, 4vw, 56px); }

/* CTAs stack vertically in the side column rather than wrapping
   side-by-side; full-width buttons read as a clear action stack. */
.bb-cover__cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bb-cover__cta .bb-btn { justify-content: center; text-align: center; }

/* In the INK cover, the secondary CTA flips from transparent-bordered to
   paper-filled — a transparent button on ink reads as a missing button.
   Uses paper-100 / ink-200 tokens (same as the user-specified hexes).
   Scoped so the paper cover variant keeps its own treatment. */
.bb-cover:not(.bb-cover--paper) .bb-btn--secondary {
  background: var(--color-paper-100);
  color: var(--color-ink-200);
  border-color: var(--color-paper-100);
}
.bb-cover:not(.bb-cover--paper) .bb-btn--secondary:hover {
  background: var(--color-paper-200);
  border-color: var(--color-paper-200);
  color: var(--color-ink-200);
}

/* On the paper cover, secondary uses the standard paper-context treatment
   but with a slightly stronger border for visibility against paper-100. */
.bb-cover--paper .bb-btn--secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-text-primary);
}
.bb-cover--paper .bb-btn--secondary:hover {
  background: var(--color-text-primary);
  color: var(--color-paper-100);
  border-color: var(--color-text-primary);
}

/* Portrait. Constrained to the marginalia text width on the upper end so
   it never exceeds the column width, and styled to handle the empty
   pre-upload state gracefully (dark square placeholder until the user
   uploads a real portrait). */
.bb-cover__portrait {
  margin: 0;
  max-width: 100%;
  background: var(--color-ink-300);
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.bb-cover__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bb-cover__marginalia {
  font-family: var(--font-mono);
  font-size: var(--type-meta-size);
  letter-spacing: var(--type-meta-tracking);
  color: var(--color-text-inverse-tertiary);
  border-left: 1px solid var(--color-border-ink-strong);
  padding-left: 16px;
  text-transform: uppercase;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .bb-cover__inner { grid-template-columns: 1fr; }
  .bb-cover__side { max-width: 360px; }
  .bb-cover__marginalia { border-left: none; border-top: 1px solid var(--color-border-ink-strong); padding: 16px 0 0; }
}

/* ----------------------------------------------------------
   FULL-BLEED RULE
   Any block marked alignfull spans the viewport — corner
   radius would create visible gaps at the edges. Force 0
   regardless of what the block's own styles try to set.
   ---------------------------------------------------------- */

.alignfull,
.wp-block-group.alignfull {
  border-radius: 0 !important;
}

/* Cover paper variant (services landing, about hero) ---------- */

.bb-cover--paper {
  background: var(--color-paper-100);
  color: var(--color-text-primary);
  border: none;
  border-top: var(--border-hairline);
  border-bottom: var(--border-hairline);
  --color-accent: var(--color-accent-sienna);
}
.bb-cover--paper .bb-cover__title { color: var(--color-text-primary); }
.bb-cover--paper .bb-cover__deck { color: var(--color-text-secondary); }
.bb-cover--paper .bb-cover__head .bb-eyebrow { color: var(--color-accent-sienna); }

/* ----------------------------------------------------------
   PATTERN 01 — NUMBERED NARRATIVE (three-column + variants)
   ---------------------------------------------------------- */

/* Three-column narrative grid. Two rows so the eyebrow can span
   columns 2–3 in row 1, leaving the H2 (top of __body in row 2) to
   align with the image's top edge in row 2 col 3. This is more
   resilient than padding-tweaking the image — wider eyebrow text
   wraps the eyebrow row taller without ever pushing the image
   alignment out of register with the H2.

   The two-col variant overrides to 80px / 1fr; eyebrow stays inside
   __body there since there's no third column to span into. */
.bb-narrative {
  display: grid;
  grid-template-columns: 80px 1fr 280px;
  column-gap: 32px;
  row-gap: 8px;
  align-items: start;
  padding: clamp(32px, 4vw, 48px) 0;
}

.bb-narrative--two-col { grid-template-columns: 80px 1fr; }
.bb-narrative--inline { display: block; max-width: var(--layout-content-max); }

.bb-narrative__num {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.04em;
  padding-top: 6px;
  margin: 0;
}

/* Eyebrow as a direct child of .bb-narrative spans cols 2–3 of row 1.
   This sits above both the body and the image, so the image's top
   aligns with the H2's top in row 2 — not with the eyebrow's top. */
.bb-narrative__eyebrow {
  grid-column: 2 / -1;
  margin: 0;
}

.bb-narrative__body {
  grid-column: 2;
  max-width: var(--layout-reading-max);
}
/* Two-col variant keeps eyebrow inside __body, so the legacy
   nested-eyebrow margin still applies there. */
.bb-narrative__body .bb-eyebrow { margin-bottom: 8px; }
.bb-narrative__body h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.18;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--color-text-primary);
}

/* Pin the figure to col 3 so it lands beside __body in row 2. */
.bb-narrative__media { grid-column: 3; }

@media (max-width: 900px) {
  .bb-narrative { grid-template-columns: 60px 1fr; }
  .bb-narrative__media { display: none; }
}

/* ----------------------------------------------------------
   PATTERN 04 — SECTION CARD (1:2 asymmetric)
   ---------------------------------------------------------- */

.bb-section-card {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: center;
  background: var(--color-paper-100);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 3vw, 40px);
  /* max-width and centering live on the earlier rule near .bb-section */
}

.bb-section-card__copy h2 {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.018em;
  margin: 0 0 12px;
  color: var(--color-text-primary);
}

.bb-section-card__copy p {
  margin: 0 0 16px;
  color: var(--color-text-secondary);
}

@media (max-width: 720px) {
  .bb-section-card { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   PATTERN 03 — DARK ACCENT BLOCK
   ---------------------------------------------------------- */

.bb-accent {
  background: var(--color-ink-200);
  color: var(--color-text-inverse-primary);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 4vw, 48px);
  --color-accent: var(--color-accent-ember);
}
.bb-accent .bb-eyebrow { color: var(--color-accent-ember); }

/* ----------------------------------------------------------
   PATTERN 05 — FIELD CALLOUT
   ---------------------------------------------------------- */

.bb-field-callout {
  border-left: 2px solid var(--color-accent);
  background: var(--color-paper-200);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background 120ms ease;
}
.bb-field-callout:hover { background: #ECE6D5; }
.bb-field-callout .bb-eyebrow { color: var(--color-accent); }

/* ----------------------------------------------------------
   PATTERN 06 — PULL QUOTE ON INK
   ---------------------------------------------------------- */

.bb-pullquote {
  background: var(--color-ink-200);
  color: var(--color-text-inverse-primary);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 3vw, 40px);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
}

/* ----------------------------------------------------------
   PATTERN 07 — CODE BLOCK
   ---------------------------------------------------------- */

.bb-code {
  background: var(--color-ink-100);
  color: var(--color-text-inverse-primary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

/* ----------------------------------------------------------
   PATTERN 08 — CTA HIERARCHY (buttons)
   ---------------------------------------------------------- */

.bb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--type-ui-size);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.bb-btn--primary {
  background: var(--color-accent);
  color: var(--color-text-inverse-primary);
}
.bb-btn--primary:hover { background: var(--color-accent-hover); color: var(--color-text-inverse-primary); }

.bb-btn--secondary {
  background: transparent;
  color: var(--color-text-on-surface, var(--color-text-primary));
  border-color: var(--color-border-paper-strong);
}
.bb-btn--secondary:hover { border-color: var(--color-text-primary); }

.bb-btn--tertiary {
  background: transparent;
  color: var(--color-accent);
  padding: 8px 4px;
}
.bb-btn--tertiary:hover { color: var(--color-accent-hover); }

/* ----------------------------------------------------------
   PATTERN 09 — TOC SIDEBAR
   ---------------------------------------------------------- */

.bb-toc {
  position: sticky;
  top: 24px;
  width: var(--layout-toc-width);
  font-family: var(--font-sans);
  font-size: var(--type-body-sm-size);
}
.bb-toc__head {
  font-family: var(--font-mono);
  font-size: var(--type-eyebrow-size);
  letter-spacing: var(--type-eyebrow-tracking);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin: 0 0 12px;
}
.bb-toc ul { list-style: none; margin: 0; padding: 0; }
.bb-toc li { padding: 6px 0 6px 12px; border-left: 2px solid transparent; }
.bb-toc li.is-active { border-left-color: var(--color-accent); font-weight: 500; color: var(--color-text-primary); }
.bb-toc li.is-sub { padding-left: 24px; font-size: 12px; color: var(--color-text-secondary); }
.bb-toc a { text-decoration: none; color: inherit; }

@media (max-width: 900px) {
  .bb-toc { position: static; width: 100%; }
}

/* ----------------------------------------------------------
   PATTERN 10 — PATH NAVIGATION
   ---------------------------------------------------------- */

.bb-pathnav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--color-paper-100);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 32px 0;
}
.bb-pathnav__cell {
  background: var(--color-paper-200);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
}
.bb-pathnav__cell + .bb-pathnav__cell { text-align: right; }
.bb-pathnav .bb-eyebrow { color: var(--color-accent); }

@media (max-width: 720px) {
  .bb-pathnav { grid-template-columns: 1fr; }
  .bb-pathnav__cell + .bb-pathnav__cell { text-align: left; }
}

/* ----------------------------------------------------------
   PATTERN 11 — TAG PILL
   ---------------------------------------------------------- */

.bb-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  background: var(--color-paper-200);
  color: var(--color-text-secondary);
  border: var(--border-hairline);
  text-decoration: none;
}
.bb-pill--accent { background: var(--color-accent); color: var(--color-text-inverse-primary); border-color: transparent; }
.bb-pill--ghost { background: transparent; }

/* ----------------------------------------------------------
   PATTERN 12 — FOOTER
   ---------------------------------------------------------- */

.bb-footer {
  background: var(--color-ink-100);
  color: var(--color-text-inverse-primary);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 5vw, 64px) clamp(28px, 4vw, 48px);
  margin-top: 1px;
}
.bb-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.bb-footer__col h4 {
  font-family: var(--font-mono);
  font-size: var(--type-eyebrow-size);
  letter-spacing: var(--type-eyebrow-tracking);
  text-transform: uppercase;
  color: var(--color-accent-ember);
  margin: 0 0 12px;
}
.bb-footer__col ul { list-style: none; margin: 0; padding: 0; }
.bb-footer__col li { margin: 0 0 8px; }
.bb-footer__col a { color: var(--color-text-inverse-secondary); text-decoration: none; font-size: var(--type-body-sm-size); }
.bb-footer__col a:hover { color: var(--color-text-inverse-primary); }
.bb-footer__sign {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-ink-strong);
  font-family: var(--font-mono);
  font-size: var(--type-meta-size);
  color: var(--color-text-inverse-tertiary);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (max-width: 720px) {
  .bb-footer__cols { grid-template-columns: 1fr 1fr; }
}

/* ----------------------------------------------------------
   PATTERN 13 — MANIFESTO PULL
   ---------------------------------------------------------- */

.bb-manifesto {
  background: var(--color-ink-200);
  color: var(--color-text-inverse-primary);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 5vw, 72px);
  text-align: left;
  --color-accent: var(--color-accent-ember);
}
.bb-manifesto blockquote,
.bb-manifesto p {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 28ch;
}
.bb-manifesto cite {
  display: block;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--type-meta-size);
  letter-spacing: var(--type-meta-tracking);
  color: var(--color-accent-ember);
  text-transform: uppercase;
}

/* ----------------------------------------------------------
   COMMON UTILITIES
   ---------------------------------------------------------- */

.bb-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--type-eyebrow-size);
  font-weight: 500;
  letter-spacing: var(--type-eyebrow-tracking);
  color: var(--color-accent);
  text-transform: uppercase;
  display: inline-block;
}

.bb-meta {
  font-family: var(--font-mono);
  font-size: var(--type-meta-size);
  color: var(--color-text-on-surface-meta, var(--color-text-tertiary));
  letter-spacing: var(--type-meta-tracking);
}

.bb-deck {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--type-deck-size);
  line-height: var(--type-deck-line);
  color: var(--color-text-on-surface-muted, var(--color-text-secondary));
  max-width: var(--layout-reading-max);
}

.bb-prose { max-width: var(--layout-reading-max); }
.bb-prose p { margin: 0 0 16px; }
.bb-prose h2 {
  font-family: var(--font-serif);
  font-size: var(--type-h2-size);
  line-height: var(--type-h2-line);
  font-weight: var(--type-h2-weight);
  margin: 32px 0 12px;
}
.bb-prose h3 {
  font-family: var(--font-sans);
  font-size: var(--type-h3-size);
  line-height: var(--type-h3-line);
  font-weight: var(--type-h3-weight);
  margin: 24px 0 8px;
}

/* ----------------------------------------------------------
   PHASE STRIP + PHASE CARD
   The 4-up TOC at the top of the process page, plus the
   smaller cells used inside the two-column phase narrative.
   ---------------------------------------------------------- */

.bb-phase-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.bb-phase-card {
  position: relative;
  background: var(--color-paper-200);
  border: 0.5px solid var(--color-border-paper);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 120ms ease, transform 120ms ease;
}
.bb-phase-card:hover {
  border-color: var(--color-text-primary);
}

.bb-phase-card__name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  margin: 8px 0 6px;
  color: var(--color-text-primary);
}

/* The card-wide click target. Inflates the link's hit area to
   cover the whole card via an absolute pseudo-element, so the
   content underneath stays semantic (h3, paragraphs) but a
   cursor anywhere inside the card activates the link. */
.bb-phase-card__link {
  text-decoration: none;
  color: inherit;
}
.bb-phase-card__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.bb-phase-card > * { position: relative; z-index: 0; }

@media (max-width: 720px) {
  .bb-phase-strip { grid-template-columns: 1fr 1fr; }
}

/* ----------------------------------------------------------
   PHASE DETAIL — the "you get / format" 2-up cells inside
   the two-column phase narrative.
   ---------------------------------------------------------- */

.bb-phase-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.bb-phase-detail__cell {
  background: var(--color-paper-200);
  border-radius: var(--radius-lg);
  padding: 16px;
}
/* Eyebrow inside a phase-detail cell is muted, not accent-coloured.
   Higher specificity wins over the global .bb-eyebrow accent rule. */
.bb-phase-detail__cell .bb-eyebrow {
  color: var(--color-text-tertiary);
}
.bb-phase-detail__cell p:not(.bb-eyebrow) {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-text-body);
}

@media (max-width: 720px) {
  .bb-phase-detail { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   PHASE PRICE — the fixed-price + start-CTA bar at the foot
   of each phase narrative.
   ---------------------------------------------------------- */

.bb-phase-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--color-paper-200);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  border: 0.5px solid var(--color-accent);
}

.bb-phase-price__amount {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-text-primary);
  margin-left: 8px;
}

/* ----------------------------------------------------------
   FOCUS RING — accent-tinted, visible everywhere
   ---------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
.bb-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
