/* Modern browser View Transitions API — same-origin navigations get a
   smooth automatic cross-fade transition instead of the browser's
   default white-flash unload. Chrome 126+, Edge 126+. Older browsers
   ignore this rule (graceful degradation). Combined with the inline
   <head> script that pre-sets [data-theme] from localStorage, this
   eliminates both theme flash AND navigation flash. */
@view-transition {
  navigation: auto;
}

/* Root background. The inline <head> script sets [data-theme] BEFORE
   first paint so the right background applies immediately — no flash.
   prefers-color-scheme fallback for first-ever visit with empty
   localStorage. */
html, body {
  margin: 0;
  padding: 0;
  background: #0A0A0A;
}
@media (prefers-color-scheme: light) {
  html, body { background: #f7f4ef; }
}
html[data-theme="light"],
html[data-theme="light"] body,
body[data-theme="light"],
[data-theme="light"] html,
[data-theme="light"] body { background: #f7f4ef; }
html[data-theme="dark"],
html[data-theme="dark"] body,
body[data-theme="dark"],
[data-theme="dark"] html,
[data-theme="dark"] body { background: #0A0A0A; }

/* BaZi cosmological-wheel backdrop — port of the SPA's `.mf-info-metaphysics-bg`
   rule from WhatIsMonthlyForecastPage.tsx (lines 30-31). Fixed-centered SVG at
   12% opacity in dark mode; in light mode, opacity 0.2 plus sepia/saturation
   filter so the gold becomes a warm copper tone on the cream background.
   Scoped to `.seo-metaphysics-bg` — does not affect any SPA page. */
.seo-metaphysics-bg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vmin;
  height: 80vmin;
  max-width: 900px;
  max-height: 900px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.seo-metaphysics-bg img {
  width: 100%;
  height: 100%;
  display: block;
}
[data-theme="light"] .seo-metaphysics-bg {
  opacity: 0.2;
  filter: invert(0.5) sepia(0.3) saturate(2) hue-rotate(5deg);
}

/* Article-typography only. The SPA chrome CSS (header/footer/nav)
   ships inside SeoLayout's inline <style> block. These rules cover
   the markdown-rendered body content inside .seo-article. */
.seo-article {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  /* Stack above the .seo-metaphysics-bg backdrop (z-index 0). */
  position: relative;
  z-index: 1;
}
.seo-article h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.005em;
  margin: 24px 0 18px;
  /* Gold-gradient shimmer — matches the homepage hero treatment
     (NewHomePage.tsx .line2). background-clip:text + transparent fill
     paints the gradient onto the glyphs. */
  background: linear-gradient(135deg, #F4E4BA 0%, #D4AF37 50%, #B8860B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Hero block — centered eyebrow + gold-gradient title + italic subtitle.
   Verbatim port of the canonical .mf-info-hero pattern from
   frontend/src/pages/newflow/WhatIsMonthlyForecastPage.tsx (lines 38-41).
   Used at the top of an SEO page when frontmatter sets pageTitle. */
.seo-hero {
  text-align: center;
  margin-bottom: 56px;
  padding-top: 20px;
}
.seo-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #C8A45A;
  opacity: 0.7;
  margin-bottom: 18px;
}
.seo-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  background: linear-gradient(135deg, #D4AF37, #F4E4BA);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  line-height: 1.25;
  margin: 0 0 20px;
}
.seo-hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(16px, 2.5vw, 20px);
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
  line-height: 1.5;
  max-width: 540px;
  margin: 0 auto;
}
[data-theme="light"] .seo-hero-subtitle {
  color: rgba(44, 36, 23, 0.6);
}
.seo-article h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.3rem, 3.2vw, 1.7rem);
  font-weight: 600;
  line-height: 1.2;
  color: #D4AF37;
  margin: 36px 0 14px;
}
.seo-article h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #FAF3E0;
  margin: 28px 0 10px;
}
.seo-article p { margin: 14px 0; }
.seo-article ul,
.seo-article ol { margin: 14px 0 14px 24px; }
.seo-article li { margin: 6px 0; }
.seo-article strong { color: #C9A96E; font-weight: 600; }
.seo-article a { color: #D4AF37; text-decoration: underline; text-underline-offset: 3px; }
.seo-article blockquote {
  border-left: 2px solid rgba(212, 175, 55, 0.6);
  padding: 4px 0 4px 20px;
  margin: 22px 0;
  font-style: italic;
  color: #C9A96E;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
}
/* Light mode — match SPA's data-theme="light" content area scheme */
[data-theme="light"] .seo-article h1 {
  /* Light-mode hero gradient — darker stops so the shimmer reads on
     the warm parchment background without washing out. */
  background: linear-gradient(135deg, #b8860b 0%, #7a6118 50%, #5a4012 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
[data-theme="light"] .seo-article h2 { color: #6b5515; }
[data-theme="light"] .seo-article h3 { color: #1a1408; }
[data-theme="light"] .seo-article p,
[data-theme="light"] .seo-article li { color: #4a3d2c; }
[data-theme="light"] .seo-article strong { color: #6b5518; }
[data-theme="light"] .seo-article a { color: #6b5518; }
[data-theme="light"] .seo-article blockquote { color: #6b5518; border-color: rgba(122, 97, 24, 0.55); }
.answer-block {
  background: rgba(212, 175, 55, 0.06);
  border-left: 3px solid var(--gold-primary, #D4AF37);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 6px;
}
.seo-disclaimer {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.15);
  padding: 24px;
  margin: 32px 0 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  opacity: 0.85;
}
/* Canonical brand CTA — TWO MODES, different treatments.
   Dark mode  = homepage hero treatment (bright 2-stop gradient + black text)
   Light mode = theme.css token treatment (refined 5-stop gradient + cream text)
   This is the actual visual pattern across the app, NOT a single shared style. */
.cta-button {
  display: inline-block;
  padding: 16px 48px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* Dark mode (default): homepage hero hardcoded values */
  background: linear-gradient(135deg, #D4AF37, #F4E4BA) !important;
  color: #000000 !important;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  /* !important on text-decoration overrides the .seo-article a underline
     rule which leaks onto buttons inside the article container. */
  text-decoration: none !important;
  transition: all 0.3s ease;
}
[data-theme="light"] .cta-button {
  /* Light mode: refined 5-stop theme.css gradient + warm cream text.
     Matches the canonical .form-submit / .bazi-cta-btn pattern from
     frontend/src/styles/theme.css (--theme-btn-gold-bg / -text). */
  background: linear-gradient(135deg, #7A6230 0%, #B8963E 30%, #C9A96E 50%, #A88B4A 70%, #7A6230 100%) !important;
  color: #FFFCF7 !important;
}
.cta-button:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 35px rgba(212, 175, 55, 0.35);
}
[data-theme="light"] .seo-disclaimer {
  background: rgba(255, 255, 255, 0.7);
  color: #2c2417;
}
[data-theme="light"] .seo-article blockquote {
  color: rgba(44, 36, 23, 0.75);
}
