/* ============================================================================
   Homeboss Theme — HEADER + base layout wrapper
   ----------------------------------------------------------------------------
   Consumes tokens.css. The header sits on --surface-base (white). The agent logo
   renders AS-IS: a max-width with height:auto preserves its native aspect ratio
   (Jerry's is 1288x739) — never cropped or recolored. Agent brand COLORS never
   enter the palette; only --action / --surface-* / --text-* tokens are used here,
   so nothing pairs --action over --footer-bg (tests/themeFooter.test.ts).
   ============================================================================ */

/* --- Sticky call/text bar: the ONLY sticky element. Top on desktop. --------- */
.hb-callbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  background-color: var(--action);
  color: var(--surface-base);
  font-family: var(--font-body);
  font-size: var(--fs-small);
}

.hb-callbar__label {
  font-weight: 600;
}

.hb-callbar__link {
  color: var(--surface-base);
  text-decoration: underline;
  font-weight: 600;
}

.hb-callbar__dismiss {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--surface-base);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

/* On mobile the bar sits at the BOTTOM of the viewport instead of the top. */
@media (max-width: 640px) {
  .hb-callbar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
  }
}

/* --- Header + logo lockup --------------------------------------------------- */
.hb-header {
  background-color: var(--surface-base);
}

.hb-header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

/* Stacked lockup: logo over an optional round headshot. */
.hb-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.hb-lockup__logo {
  display: block;
  width: auto;
  max-width: min(20rem, 80vw);
  height: auto; /* preserve native aspect ratio — logo is untouched */
}

.hb-lockup__wordmark {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-h2);
  color: var(--text-heading);
}

.hb-lockup__headshot {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
}

/* --- Contact actions: plain direct links, no forms ------------------------- */
.hb-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.hb-contact__action {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--action);
  border-radius: 4px;
  color: var(--action);
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
}

.hb-contact__action:hover {
  border-color: var(--action-hover);
  color: var(--action-hover);
}

.hb-contact__action--primary {
  background-color: var(--action);
  color: var(--surface-base);
}

.hb-contact__action--primary:hover {
  background-color: var(--action-hover);
  color: var(--surface-base);
}

/* --- Primary navigation (theme-rendered from WordPress pages) --------------- */
/* header.php now renders .hb-nav from the site's published pages (inc/nav.php):
   Home, About, area pages, Reviews, Podcast, Contact in a fixed order, Reviews/
   Podcast still gated on the /site-data flags. Links use the same token palette as
   the contact actions so agent brand colors never enter. On desktop the list is a
   centered inline row and the toggle is hidden; at <=640px the list collapses into a
   real disclosure behind the toggle (a stacked menu, not a squeezed row). */
.hb-nav {
  width: 100%;
  display: flex;
  justify-content: center;
}

.hb-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.hb-nav__item {
  margin: 0;
}

.hb-nav__link {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
}

.hb-nav__link:hover,
.hb-nav__link[aria-current="page"] {
  color: var(--action);
  text-decoration: underline;
}

/* Mobile toggle: hidden on desktop where the list shows inline. */
.hb-nav__toggle {
  display: none;
}

/* --- Mobile: a real disclosure for six+ items, not a squeeze --------------- */
@media (max-width: 640px) {
  .hb-nav {
    flex-direction: column;
    align-items: center;
  }

  .hb-nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    background: transparent;
    border: 1px solid var(--action);
    border-radius: 4px;
    color: var(--action);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-small);
    cursor: pointer;
  }

  .hb-nav__toggle-bar {
    width: 1rem;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  }

  /* With JS the list collapses behind the toggle; opening reveals a stacked menu.
     Without JS the data-collapsible flag is never set, so the list stays visible. */
  .hb-nav[data-collapsible] .hb-nav__list {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.85rem;
  }

  .hb-nav[data-collapsible].is-open .hb-nav__list {
    display: flex;
  }

  .hb-nav__link {
    display: block;
    padding: 0.35rem 0;
  }
}

/* --- Base content wrapper -------------------------------------------------- */
.hb-main {
  background-color: var(--surface-base);
}

/* Body measure capped near 70 characters (--measure) for long-form readability. */
.hb-prose {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 1.5rem 1.25rem;
}
