/* =================================================================
   Pickleheart — Site Header
   -----------------------------------------------------------------
   Hand-coded replacement for the (empty) Bricks "Header" template —
   loads on every front-end request via pickleheart_site_header_assets()
   in functions.php, rendered by header.php via pickleheart_site_header().

   Scoped under `.site-header` — deliberately its own local `--sh-*`
   palette (aliased to the shared tokens, not the .pkl-page component
   layer) rather than `.pkl-*` classes, since pickleheart-components.css
   is documented as page-template-only and explicitly not meant to
   reach the header. Same alias-not-redeclare pattern as .cb-shell /
   .community-admin-wrap / .community-request's own local blocks.
   ================================================================= */

.site-header {
  --sh-primary: var(--foreground-primary);
  --sh-primary-hover: var(--foreground-primary-hover);
  --sh-pink: var(--pkl-pink-200);
  --sh-border: var(--border-neutral-weak);
  --sh-text: var(--text-neutral-strong);
  --sh-text-muted: var(--text-neutral-weak);
  --sh-height: 76px;

  position: static;
  z-index: 500;
  background: var(--background-neutral);
  border-bottom: 1px solid var(--sh-border);
  font-family: var(--font-body);
}

.site-header,
.site-header *,
.site-header *::before,
.site-header *::after { box-sizing: border-box; }
.site-header a { text-decoration: none; color: inherit; }
.site-header ul { margin: 0; padding: 0; list-style: none; }
.site-header button { font: inherit; }

/* Same 1100px column + 24px side padding as .community-public-subheader-inner
   (communities-public-style.css) and its park/event/capital-campaign
   equivalents, so the logo/nav edges line up with the subheader bar
   directly underneath on those pages instead of running wider/narrower.
   Shared with .site-header-mobile-list below so the mobile menu's edges
   always line up with the bar above it, by construction rather than by
   two rules happening to repeat the same numbers. */
.site-header-inner,
.site-header .site-header-mobile-list {
  width: min(1100px, 100%);
  margin-inline: auto;
  padding-inline: 24px;
}
.site-header-inner {
  height: var(--sh-height);
  display: flex;
  align-items: center;
  gap: 32px;
}
@media (max-width: 620px) {
  .site-header { --sh-height: 64px; }
  .site-header-inner,
  .site-header .site-header-mobile-list { padding-inline: 20px; }
  .site-header-inner { gap: 16px; }
}

/* -----------------------------------------------------------------
   LOGO
   ----------------------------------------------------------------- */
.site-header-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
/* Two independent logo sources — Customizer → Main Header → Mobile logo,
   falling back to the desktop logo/mark when unset (see
   pickleheart_render_header_logo_mobile() in site-header.php) — swapped
   at the same 620px breakpoint the rest of the header compacts at. */
.site-header-logo-variant--mobile { display: none; }
@media (max-width: 620px) {
  .site-header-logo-variant--desktop { display: none; }
  .site-header-logo-variant--mobile { display: flex; align-items: center; }
}
.site-header-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-header-logo img { display: block; max-height: 44px; max-width: 200px; width: auto; }

.site-header-logo-mark { width: 34px; height: auto; flex: 0 0 auto; overflow: visible; }
.site-header-logo-mark-fill { fill: var(--sh-pink); stroke: none; }
.site-header-logo-mark-stroke {
  fill: none;
  stroke: var(--sh-text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-header-logo-mark-stroke--sketch { stroke-width: 1.1; opacity: 0.7; }

.site-header-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--sh-text);
  white-space: nowrap;
}
@media (max-width: 620px) {
  .site-header-logo-mark { width: 28px; }
  .site-header-logo-text { font-size: 24px; }
}

/* -----------------------------------------------------------------
   PRIMARY NAV — desktop only, hidden under the breakpoint where the
   mobile toggle takes over
   ----------------------------------------------------------------- */
.site-header-nav { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.site-header-nav-list {
  display: flex;
  align-items: center;
  gap: 40px;
}
.site-header-nav-list a {
  font-weight: 400;
  font-size: 17px;
  color: var(--sh-text);
  padding: 6px 2px;
  transition: color 130ms ease;
}
.site-header-nav-list a:hover {
  color: var(--pkl-coral-300);
}
.site-header-nav-list .current-menu-item > a {
  color: var(--pkl-coral-300);
  text-decoration: underline;
  text-underline-offset: 6px;
}
@media (max-width: 900px) {
  .site-header-nav { display: none; }
}

/* -----------------------------------------------------------------
   ACTIONS — account + cart icons, mobile toggle
   ----------------------------------------------------------------- */
.site-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.site-header-icon-btn {
  --sh-icon-size: 22px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max(40px, calc(var(--sh-icon-size) + 18px));
  height: max(40px, calc(var(--sh-icon-size) + 18px));
  border-radius: var(--radius-full, 999px);
  color: var(--sh-text);
}
/* Icon + visible title — grows into a pill instead of staying a fixed circle. */
.site-header-icon-btn.has-title {
  width: auto;
  height: auto;
  min-height: max(40px, calc(var(--sh-icon-size) + 18px));
  padding: 8px 16px 8px 12px;
  border-radius: var(--radius-pill, 999px);
}
.site-header-custom-icon { width: var(--sh-icon-size); height: var(--sh-icon-size); display: block; flex: 0 0 auto; object-fit: contain; }
.site-header-icon-title { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* Hamburger — three bars that morph into an X while the panel is open. */
.site-header-toggle {
  display: none;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--sh-text);
}
.site-header-toggle-bars {
  position: relative;
  width: 20px;
  height: 14px;
}
.site-header-toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease, top 180ms ease;
}
.site-header-toggle-bars span:nth-child(1) { top: 0; }
.site-header-toggle-bars span:nth-child(2) { top: 6px; }
.site-header-toggle-bars span:nth-child(3) { top: 12px; }
.site-header-toggle[aria-expanded="true"] .site-header-toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.site-header-toggle[aria-expanded="true"] .site-header-toggle-bars span:nth-child(2) { opacity: 0; }
.site-header-toggle[aria-expanded="true"] .site-header-toggle-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .site-header-toggle { display: inline-flex; }
}

/* -----------------------------------------------------------------
   MOBILE PANEL — [hidden] must win over the flex display below, same
   convention used across the site's other dropdown/menu panels (see
   community-style.css's .cb-row-menu-panel).
   ----------------------------------------------------------------- */
.site-header-mobile {
  border-top: 1px solid var(--sh-border);
  background: var(--background-neutral);
}
.site-header-mobile:not([hidden]) { display: block; }
.site-header-mobile[hidden] { display: none; }
.site-header .site-header-mobile-list {
  padding-block: 8px 20px;
  display: flex;
  flex-direction: column;
}
.site-header-mobile-list a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--sh-border);
  font-weight: 700;
  font-size: 16px;
  color: var(--sh-text);
}
.site-header-mobile-list li:last-child a { border-bottom: 0; }
.site-header-mobile-list .current-menu-item > a { color: var(--sh-primary); }

@media (min-width: 901px) {
  /* The mobile panel only ever renders when JS has wired up the toggle
     (see site-header-script.js) — belt-and-braces against a flash of
     the panel on desktop if [hidden] were ever dropped from the markup. */
  .site-header-mobile { display: none !important; }
}
