/**
 * Filename: public/stylesheets/landing-nav.css
 * Revision: 2026-09-18d - Carries the shared palette for every public page: index.pug's values, with darker --text-secondary and --text-muted in light mode.
 * Revision: 2026-09-18c - Header container spans the full width, overriding a page's own .container; the bar matches how the blog pages render it.
 * Revision: 2026-09-18b - Header container is 1280px centred here, so pages that define no .container render the bar the same as those that do.
 * Revision: 2026-09-18 - Initial: the shared landing header, extracted so every page that
 *   extends layout-landing renders the same bar from one place.
 * Description: Header, logo, nav links and theme toggle for the public pages.
 *
 * Every rule that changes with the theme keys on [data-theme], the attribute layout-landing
 * sets from localStorage — NOT on prefers-color-scheme. The footer used the OS setting and
 * rendered dark under a light page whenever the two disagreed; this file does not repeat it.
 *
 * The ☀️/🌙 swap and the logo swap are the same pattern as layout.css uses on the signed-in
 * side, duplicated here because layout.css is not loaded on landing pages.
 */

/* ===== SHARED PALETTE =====
 * Taken from index.pug, which was the canonical set; tutorial, reference, contact and
 * wix-to-quickbooks each carried their own near-copy, and the blog pages carried none at
 * all — which is why /blog referenced --text-primary and got nothing, and had no dark mode.
 * Stated once here so every public page reads the same values.
 *
 * Two light values are darker than the originals: --text-secondary was #64748b (~4.8:1 on
 * white) and --text-muted was #94a3b8 (~2.6:1, below the readable threshold). Dark mode is
 * unchanged.
 */
:root {
  --bg-primary: #f0f7ff;
  --bg-secondary: #ffffff;
  --bg-card: rgba(0,0,0,0.03);
  --bg-card-hover: rgba(0,0,0,0.05);
  --text-primary: #1e293b;
  --text-secondary: #334155;   /* was #64748b */
  --text-muted: #475569;       /* was #94a3b8 */
  --border-color: #e2e8f0;
  --separator-color: #cbd5e1;
  --pipe-color: rgba(37,99,235,0.3);
  --dot-color: rgba(37,99,235,0.4);
  --header-bg: #ffffff;
  --header-shadow: 0 2px 10px rgba(0,0,0,0.05);
  --accent-primary: #2563eb;
}

[data-theme="dark"] {
  --bg-primary: #1e293b;
  --bg-secondary: #1e293b;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.6);
  --text-muted: rgba(255,255,255,0.4);
  --border-color: rgba(255,255,255,0.1);
  --separator-color: rgba(255,255,255,0.3);
  --pipe-color: rgba(255,255,255,0.2);
  --dot-color: rgba(255,255,255,0.3);
  --header-bg: #0f172a;
  --header-shadow: 0 2px 10px rgba(0,0,0,0.3);
  --accent-primary: #2563eb;
}

/* The blog pages set no background of their own; without this they render on the browser
   default, which is white in both themes. */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.landing-header {
  padding: 16px 0;
  background: var(--header-bg, var(--bg-primary, #ffffff));
  box-shadow: var(--header-shadow, 0 1px 3px rgba(0, 0, 0, 0.06));
}

.landing-header .container {
  /* Pages define .container inconsistently — index.pug sets a 1280px centred box, the blog
     pages define nothing at all, so the same header rendered inset on one and edge-to-edge
     on the other. Stated here, scoped to the header, so the bar is identical everywhere:
     full width, as the blog pages already rendered it. max-width:none is what overrides a
     page's own .container rule. */
  max-width: none;
  margin: 0;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.landing-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* ===== LOGO SWAP ===== */
.landing-header .theme-logo-light {
  display: inline-block;
  height: 40px;
}

.landing-header .theme-logo-dark {
  display: none;
  height: 40px;
}

[data-theme="dark"] .landing-header .theme-logo-light {
  display: none;
}

[data-theme="dark"] .landing-header .theme-logo-dark {
  display: inline-block;
}

/* ===== NAV ===== */
.landing-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.landing-nav a {
  color: var(--text-secondary, #475569);
  text-decoration: none;
  font-weight: 500;
}

.landing-nav a:hover {
  color: #2563eb;
}

.landing-nav a.btn-primary,
.landing-nav a.btn-primary:hover {
  color: #ffffff;
}

.landing-nav a.btn-primary {
  background: #2563eb;
  padding: 10px 18px;
  border-radius: 8px;
}

/* ===== THEME TOGGLE ===== */
.landing-nav .theme-toggle {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.landing-nav .theme-toggle:hover {
  background: #f1f5f9;
}

[data-theme="dark"] .landing-nav .theme-toggle {
  border-color: #334155;
}

[data-theme="dark"] .landing-nav .theme-toggle:hover {
  background: #1e293b;
}

.landing-nav .theme-icon-light {
  display: inline;
}

.landing-nav .theme-icon-dark {
  display: none;
}

[data-theme="dark"] .landing-nav .theme-icon-light {
  display: none;
}

[data-theme="dark"] .landing-nav .theme-icon-dark {
  display: inline;
}

@media (max-width: 720px) {
  .landing-nav {
    gap: 14px;
    font-size: 14px;
  }
}
