/* ─── Pollara Consulting — shared static-site theme + header ──────────────────
 *
 * Linked from every static public/*.html page. Provides:
 *   1. Light-theme token overrides (activated by <html data-theme="light">)
 *   2. The sticky brand header (logo A, theme-swapped) + nav + theme toggle
 *
 * Each page keeps its own inline :root dark tokens (--bg-primary, --accent, …);
 * this file only adds the light overrides + header chrome + smooth transitions.
 * Theme persistence + toggle wiring live in site-header.js. The 1-line pre-paint
 * bootstrap is inlined in each <head> to avoid a flash before this file loads.
 * ───────────────────────────────────────────────────────────────────────────*/

:root {
  /* header chrome — dark default */
  --header-bg: rgba(20, 20, 20, 0.82);
  --header-border: rgba(255, 255, 255, 0.07);
}

/* Higher specificity than each page's inline :root dark tokens, so the light
 * overrides win regardless of stylesheet order. */
html[data-theme="light"] {
  /* mirrors app/globals.css light tokens, mapped to the static var names */
  --bg-primary: #f7f3ed;
  --bg-secondary: #efe9df;
  --bg-card: #ffffff;
  --text-primary: #1c1a17;
  --text-secondary: #6b6459;
  --accent: #a86838;
  --accent-hover: #8d5527;
  --accent-border: rgba(168, 104, 56, 0.28);
  --header-bg: rgba(247, 243, 237, 0.85);
  --header-border: rgba(0, 0, 0, 0.08);
}

/* Smooth dark↔light cross-fade on the surfaces that change color */
html,
body {
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ── Sticky brand header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--header-border);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
}

/* Brand logo — two <img>s, the correct one shown per theme */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-logo {
  display: block;
  height: 38px;
  width: auto;
}
.brand-logo--light { display: none; }
[data-theme="light"] .brand-logo--dark { display: none; }
[data-theme="light"] .brand-logo--light { display: block; }

/* Nav cluster (links + back-link + toggle) */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links a {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--accent); }

/* "Back to main site" link reused on share/services */
.nav-back {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
  white-space: nowrap;
}
.nav-back:hover { color: var(--accent); }
.nav-back span { display: inline-block; transition: transform 0.3s ease; }
.nav-back:hover span { transform: translateX(-4px); }

/* Share / services pages keep their own inline `.nav` bar — make it theme-aware.
 * `body .nav` outranks each page's inline `.nav` rule regardless of source order. */
body .nav {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

/* ── Theme toggle (sun / moon) ───────────────────────────────────────────── */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--header-border);
  color: var(--text-secondary);
  flex: 0 0 auto;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-border);
}
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun { display: none; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .site-header .container { min-height: 64px; }
  .brand-logo { height: 32px; }
}
