/* ==========================================================================
   PhotoPixc Master v4 — LEGACY BRIDGE (Phase 4)
   Loaded LAST in <head> on pages that still use the old WordPress-era theme
   CSS (no html.pp-v4). It re-points the old theme variables to the Master v4
   tokens (styles/tokens.css) so every legacy page shows the v4 teal, Inter,
   1120px container and 740px prose without rewriting its content or URLs.
   Remove a page from the bridge by rebuilding it as html.pp-v4.
   ========================================================================== */

:root {
  /* old theme tokens -> v4 tokens */
  --color-canvas: var(--bg-primary);
  --color-surface: var(--bg-alt);
  --color-blog-surface: var(--bg-alt);
  --color-dark: var(--bg-dark);
  --color-dark-card: var(--bg-dark-card);
  --color-dark-border: var(--border-dark);
  --color-ink: var(--text-primary);
  --color-muted: var(--text-muted);
  --color-border: var(--border-subtle);
  --color-accent: var(--brand-primary);
  --color-accent-dark: var(--brand-dark);
  --color-accent-bright: #2DD4BF;
  --font-ui: var(--font-sans);
  --font: var(--font-sans);
  --font-blog-heading: var(--font-sans);
  --max-width-site: var(--container-max);
  --max: var(--container-max);
  --max-width-reading: var(--prose-max);

  /* old unified-nav tokens -> v4 tokens */
  --ppx-canvas: var(--bg-primary);
  --ppx-surface: var(--bg-alt);
  --ppx-dark: var(--bg-dark);
  --ppx-dark-card: var(--bg-dark-card);
  --ppx-ink: var(--text-primary);
  --ppx-muted: var(--text-muted);
  --ppx-border: var(--border-subtle);
  --ppx-accent: var(--brand-primary);
  --ppx-accent-dark: var(--brand-dark);
  --ppx-accent-bright: #2DD4BF;
  --ppx-accent-light: var(--brand-soft);
  --ppx-font: var(--font-sans);
}

/* Inter everywhere — the old theme forced Georgia serif on blog headings */
html body,
html body h1, html body h2, html body h3, html body h4, html body h5, html body h6,
html body .ppx-prose h2, html body .ppx-prose h3, html body .ppx-prose h4,
html body .pixc-blog-hero h1, html body .pixc-blog-content h1, html body .pixc-blog-content h2,
html body .pixc-blog-content h3, html body .pixc-blog-content h4,
html body button, html body input, html body select, html body textarea {
  font-family: var(--font-sans) !important;
}

html body .tabular-num,
html body .price,
html body [class*="price"] {
  font-variant-numeric: tabular-nums;
}

/* 1120px site container, 740px reading width */
html body .wrap {
  max-width: var(--container-max);
}

html body .ppx-prose,
html body .pixc-blog-content .ppx-prose {
  max-width: var(--prose-max) !important;
}

/* Primary buttons: v4 teal + dark-teal hover */
html body .btn-primary,
html body .btn-teal,
html body .button-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
}

html body .btn-primary:hover,
html body .btn-teal:hover,
html body .button-primary:hover,
html body .btn-gradient:hover,
html body .btn-white:hover,
html body .btn-secondary:hover,
html body .btn-outline:hover,
html body .pp-cta-box__btn:hover {
  background: #0B1120;
  background-color: #0B1120;
  border-color: #0B1120;
  color: #FFFFFF;
}

/* Never let a wide table push the page sideways */
html body .ppx-prose table,
html body .pixc-blog-content table {
  max-width: 100%;
}

/* ---- Contextual Free Audit CTA boxes inserted by scripts/apply_phase4.py ---- */
.pp-cta-box {
  font-family: var(--font-sans);
  margin: 40px auto;
  max-width: var(--prose-max);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  color: var(--text-primary);
  box-sizing: border-box;
}

.pp-cta-box--end {
  background: var(--bg-dark);
  border-color: var(--border-dark);
  color: var(--text-dark-body);
}

.pp-cta-box__eyebrow {
  display: block;
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.pp-cta-box--end .pp-cta-box__eyebrow { color: #2DD4BF; }

.pp-cta-box__title {
  margin: 0 0 8px !important;
  padding: 0 !important;
  border: 0 !important;
  font-family: var(--font-sans) !important;
  font-size: 1.25rem !important;
  line-height: 1.3 !important;
  font-weight: 700;
  color: var(--text-primary);
}

.pp-cta-box--end .pp-cta-box__title { color: var(--text-dark-primary); }

.pp-cta-box__text {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.pp-cta-box__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pp-cta-box__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: #FFFFFF !important;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
}

.pp-cta-box__btn:hover { background: var(--brand-dark); }

.pp-cta-box__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-dark) !important;
}

.pp-cta-box--end .pp-cta-box__link { color: #2DD4BF !important; }

.pp-cta-box__privacy {
  display: block;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-caption);
}

.pp-cta-box--end .pp-cta-box__privacy { color: var(--text-dark-muted); }

@media (max-width: 599px) {
  .pp-cta-box { padding: 20px; margin: 32px auto; }
  .pp-cta-box__btn { width: 100%; }
}

/* Win over legacy ".ppx-prose a { color … !important }" rules */
html body .pp-cta-box a.pp-cta-box__btn,
html body .pp-cta-box a.pp-cta-box__btn:visited {
  color: #FFFFFF !important;
  background: var(--brand-primary) !important;
  text-decoration: none !important;
  border: 0 !important;
}

html body .pp-cta-box a.pp-cta-box__btn:hover {
  background: var(--brand-dark) !important;
}

html body .pp-cta-box a.pp-cta-box__link { color: var(--brand-dark) !important; text-decoration: underline !important; }
html body .pp-cta-box--end a.pp-cta-box__link { color: #2DD4BF !important; }

/* ---- Proof flag on case-study pages (live vs concept), inserted by apply_phase4.py ---- */
.pp-proof-flag {
  font-family: var(--font-sans);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.pp-proof-flag__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.pp-proof-flag--live { background: var(--status-verified-bg); color: var(--status-verified-text); }
.pp-proof-flag--live .pp-proof-flag__badge { background: #FFFFFF; color: var(--status-verified-text); border-color: var(--status-verified-border); }
.pp-proof-flag--concept { background: var(--status-concept-bg); color: var(--status-concept-text); }
.pp-proof-flag--concept .pp-proof-flag__badge { background: #FFFFFF; color: var(--status-concept-text); border-color: var(--status-concept-border); font-weight: 600; }
