/* ============================================
   agenticemployee — industrial editorial (dark-dominant)
   Default = ink surface, cream text, ember accents.
   Toggle → "paper" reader mode (light fallback).
   ============================================ */

html, body { transition: background-color .25s ease, color .25s ease; }

/* ============================================
   DEFAULT (dark-dominant) — applies when data-theme is absent OR "ink"
   ============================================ */

html { background-color: #1E232B; color: #F5F2EC; }
html body { background-color: #1E232B; color: #F5F2EC; }

/* Block class swaps — header/footer/grouped sections */
.has-paper-background-color { background-color: #1E232B !important; }
.has-paper-2-background-color { background-color: #26231f !important; }
.has-ink-color { color: #F5F2EC !important; }
.has-ink-background-color { background-color: #F5F2EC !important; }
.has-ink-background-color, .has-ink-background-color * { color: #1E232B !important; }

/* Hardcoded cream backgrounds → ink */
[style*="background-color:#f7f5ee"],
[style*="background-color:#F7F5EE"],
[style*="background-color:#f5f2ec"],
[style*="background-color:#F5F2EC"],
[style*="background-color:#efece4"],
[style*="background-color:#EFECE4"] {
  background-color: #1E232B !important;
}

/* Hardcoded dark CTA bands → deeper charcoal with ember edge */
[style*="background-color:#1a1a17"],
[style*="background-color:#1A1A17"] {
  background-color: #14171d !important;
  border-top: 1px solid rgba(232, 119, 34, 0.35) !important;
  border-bottom: 1px solid rgba(232, 119, 34, 0.35) !important;
}

/* Body text (near-black) → cream */
[style*="color:#2e2c28"],
[style*="color:#2E2C28"],
[style*="color:#1a1a17"],
[style*="color:#1A1A17"] {
  color: #F5F2EC !important;
}

/* Muted text → lighter muted */
[style*="color:#5a5a56"],
[style*="color:#5A5A56"] {
  color: #b8b5ad !important;
}

/* Cream-on-dark band text stays cream — no override needed */

/* Borders (paper-era) → dark-mode-appropriate */
[style*="border-color:#c9ccc6"],
[style*="border-color:#C9CCC6"] {
  border-color: #3a362f !important;
}

/* Cream buttons → ember (this is the signature orange accent) */
.wp-block-button__link[style*="background-color:#f7f5ee"],
.wp-block-button__link[style*="background-color:#F7F5EE"],
.wp-block-button__link[style*="background-color:#f5f2ec"],
.wp-block-button__link[style*="background-color:#F5F2EC"] {
  background-color: #E87722 !important;
  color: #1E232B !important;
}
.wp-block-button__link[style*="background-color:#f7f5ee"]:hover,
.wp-block-button__link[style*="background-color:#F7F5EE"]:hover,
.wp-block-button__link[style*="background-color:#f5f2ec"]:hover,
.wp-block-button__link[style*="background-color:#F5F2EC"]:hover {
  background-color: #F4A052 !important;
}

/* Links — ember underline */
.entry-content a, main a, .wp-block-post-content a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(232, 119, 34, 0.6);
  text-underline-offset: 2px;
  transition: text-decoration-color .15s, color .15s;
}
.entry-content a:hover, main a:hover, .wp-block-post-content a:hover {
  color: #E87722;
  text-decoration-color: #E87722;
}

/* Navigation — ember hover */
.wp-block-navigation a { color: #F5F2EC !important; }
.wp-block-navigation a:hover { color: #E87722 !important; }

/* Site title */
.wp-block-site-title a { color: #F5F2EC !important; }
.wp-block-site-title a:hover { color: #E87722 !important; }

/* Toggle button — floats in header next to nav */
.aee-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: transparent;
  border: 1px solid rgba(245, 242, 236, 0.35);
  color: #F5F2EC;
  padding: .45rem .85rem;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
  line-height: 1;
  margin-left: .75rem;
}
.aee-theme-toggle:hover {
  border-color: #E87722;
  color: #F4A052;
}

/* ============================================
   READER MODE ("paper") — light fallback for long-reads / a11y
   ============================================ */

html[data-theme="paper"] { background-color: #F5F2EC; color: #1E232B; }
html[data-theme="paper"] body { background-color: #F5F2EC; color: #1E232B; }

html[data-theme="paper"] .has-paper-background-color { background-color: #F5F2EC !important; }
html[data-theme="paper"] .has-paper-2-background-color { background-color: #EEE9DE !important; }
html[data-theme="paper"] .has-ink-color { color: #1E232B !important; }
html[data-theme="paper"] .has-ink-background-color { background-color: #1E232B !important; }
html[data-theme="paper"] .has-ink-background-color,
html[data-theme="paper"] .has-ink-background-color * { color: #F5F2EC !important; }

html[data-theme="paper"] [style*="background-color:#f7f5ee"],
html[data-theme="paper"] [style*="background-color:#F7F5EE"],
html[data-theme="paper"] [style*="background-color:#f5f2ec"],
html[data-theme="paper"] [style*="background-color:#F5F2EC"],
html[data-theme="paper"] [style*="background-color:#efece4"],
html[data-theme="paper"] [style*="background-color:#EFECE4"] {
  background-color: #F5F2EC !important;
}

html[data-theme="paper"] [style*="background-color:#1a1a17"],
html[data-theme="paper"] [style*="background-color:#1A1A17"] {
  background-color: #1a1a17 !important;
  border-top: none !important;
  border-bottom: none !important;
}

html[data-theme="paper"] [style*="color:#2e2c28"],
html[data-theme="paper"] [style*="color:#2E2C28"],
html[data-theme="paper"] [style*="color:#1a1a17"],
html[data-theme="paper"] [style*="color:#1A1A17"] {
  color: #1E232B !important;
}

html[data-theme="paper"] [style*="color:#5a5a56"],
html[data-theme="paper"] [style*="color:#5A5A56"] {
  color: #5a5a56 !important;
}

html[data-theme="paper"] [style*="border-color:#c9ccc6"],
html[data-theme="paper"] [style*="border-color:#C9CCC6"] {
  border-color: #c9ccc6 !important;
}

/* Cream buttons in paper mode stay cream-ish? No — promote to ember so the brand signal survives */
html[data-theme="paper"] .wp-block-button__link[style*="background-color:#f7f5ee"],
html[data-theme="paper"] .wp-block-button__link[style*="background-color:#F7F5EE"],
html[data-theme="paper"] .wp-block-button__link[style*="background-color:#f5f2ec"],
html[data-theme="paper"] .wp-block-button__link[style*="background-color:#F5F2EC"] {
  background-color: #E87722 !important;
  color: #1E232B !important;
}

html[data-theme="paper"] .wp-block-navigation a { color: #1E232B !important; }
html[data-theme="paper"] .wp-block-navigation a:hover { color: #E87722 !important; }
html[data-theme="paper"] .wp-block-site-title a { color: #1E232B !important; }
html[data-theme="paper"] .wp-block-site-title a:hover { color: #E87722 !important; }

html[data-theme="paper"] .aee-theme-toggle {
  border-color: rgba(30, 35, 43, 0.4);
  color: #1E232B;
}
html[data-theme="paper"] .aee-theme-toggle:hover {
  border-color: #E87722;
  color: #E87722;
}

/* Calculator page is CSS-var-scoped — let it manage itself */
.aee-calc-scope { color-scheme: light dark; }
