/**
 * Shared public marketing site header (checklist-style).
 * Opt in per page: <body data-use-public-header data-active-nav="home">
 * Include: css/public-site-header.css + js/public-site-header.js
 */

:root {
  --psh-bg-page: #f8f7f4;
  --psh-bg: #f8f7f4;
  --psh-bg-hover: #f3f2ee;
  --psh-border: rgba(30, 35, 40, 0.08);
  --psh-border-strong: rgba(30, 35, 40, 0.14);
  --psh-text: #1a1d21;
  --psh-text-secondary: #5c6370;
  --psh-accent: #0d9488;
  --psh-accent-dark: #0f766e;
  --psh-accent-soft: rgba(13, 148, 136, 0.1);
}

body[data-use-public-header] {
  background-color: var(--psh-bg-page);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--psh-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-sizing: border-box;
}

.site-logo {
  text-decoration: none;
  color: var(--psh-text);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-logo .brand-accent {
  color: #15803d;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--psh-text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-nav a:hover {
  color: var(--psh-text);
  background: var(--psh-bg-hover);
}

.site-nav a.active {
  color: var(--psh-accent-dark);
  background: var(--psh-accent-soft);
}

.site-nav .nav-cta {
  background: #15803d;
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 100px;
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.35);
}

.site-nav .nav-cta:hover {
  background: #166534;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--psh-border-strong);
  border-radius: 10px;
  background: var(--psh-bg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--psh-text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-tagline {
  background: #15803d;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  letter-spacing: 0.01em;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-tagline strong {
  font-weight: 700;
}

.site-tagline .nowrap {
  white-space: nowrap;
}

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

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 16px;
    background: var(--psh-bg);
    border-bottom: 1px solid var(--psh-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-header-inner {
    position: relative;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .site-nav a {
    padding: 12px 14px;
    font-size: 15px;
  }

  .site-nav .nav-cta {
    margin-left: 0;
    text-align: center;
    margin-top: 4px;
  }
}
