/**
 * Creative Financing Mastery — global color system
 * Load after style.css / custom_style.css so tokens win site-wide.
 */
:root {
  --color-ivory: #F8F5EE;
  --color-white: #FFFFFF;
  --color-greige: #C9BFB2;
  --color-espresso: #3A2A1C;
  --color-cream-on-espresso: #F1E9DE;
  --color-greige-on-espresso: #C9BFB2;
  --color-espresso-hover: #4A3726;

  /* Bridge legacy LMS tokens → CFM palette */
  --color-black: var(--color-espresso);
  --blackColor: var(--color-espresso);
  --at-black: var(--color-espresso);
  --at-black-2: #2F2218;
  --at-ink: var(--color-espresso);
  --at-cream: var(--color-ivory);
  --at-paper: var(--color-ivory);
  --at-white: var(--color-white);
  --at-greige: var(--color-greige);
  --at-espresso: var(--color-espresso);
  --at-espresso-hover: var(--color-espresso-hover);
  --at-on-espresso: var(--color-cream-on-espresso);
  --at-muted-on-espresso: var(--color-greige-on-espresso);
  --at-gold: var(--color-espresso);
  --at-gold-light: var(--color-espresso-hover);
  --at-card-radius: 18px;
  --at-chip-radius: 14px;
}

/* Shared chrome: footer / sticky CTAs / primary buttons */
.footer-area,
.footer-section {
  background: var(--color-espresso) !important;
  color: var(--color-cream-on-espresso) !important;
}

.footer-area .footer-content p,
.footer-area .description,
.footer-area .footer-widget ul a,
.footer-area .copyright,
.footer-area .footer-bottom a,
.footer-section .info,
.footer-bottom-nav a,
.footer-bottom-wrap .copyright {
  color: var(--color-greige-on-espresso) !important;
}

.footer-area .footer-widget h4,
.footer-area .newslater-bottom h4,
.footer-area .gradient-border-btn,
.footer-section .title {
  color: var(--color-cream-on-espresso) !important;
}

.footer-area .footer-widget ul a:hover,
.footer-area .footer-bottom a:hover,
.footer-bottom-nav a:hover {
  color: var(--color-cream-on-espresso) !important;
}

/* Kill yellow/gold gradient CTAs → espresso fill + cream text */
.eBtn.gradient,
a.eBtn.gradient,
button.eBtn.gradient,
.header-cta.eBtn.gradient,
.gradient-border-btn,
.learn-btn.eBtn,
a.learn-more {
  color: var(--color-cream-on-espresso) !important;
  background: var(--color-espresso) !important;
  background-image: none !important;
  border-color: var(--color-espresso) !important;
  box-shadow: none !important;
}

.eBtn.gradient:hover,
a.eBtn.gradient:hover,
button.eBtn.gradient:hover,
.gradient-border-btn:hover,
.learn-btn.eBtn:hover,
a.learn-more:hover {
  color: var(--color-cream-on-espresso) !important;
  background: var(--color-espresso-hover) !important;
  background-image: none !important;
}

.at-btn-gold,
.cfm-header-cta {
  color: var(--color-cream-on-espresso) !important;
  background: var(--color-espresso) !important;
  border-color: var(--color-espresso) !important;
}

.at-btn-gold:hover,
.cfm-header-cta:hover {
  color: var(--color-cream-on-espresso) !important;
  background: var(--color-espresso-hover) !important;
}

/* Decorative near-black panels → espresso */
.bg-black,
.text-black {
  background-color: var(--color-espresso) !important;
  color: var(--color-cream-on-espresso) !important;
}

/* Page body default light surface */
body:not(.at-player):not(.auth-studio) {
  background-color: var(--color-ivory);
}

/* Alternating section rhythm for funnel content pages (not homepage — homepage uses explicit IDs) */
body.at-funnel-page > section:nth-of-type(4n + 1) {
  background-color: var(--color-ivory);
  color: var(--color-espresso);
}

body.at-funnel-page > section:nth-of-type(4n + 2) {
  background-color: var(--color-white);
  color: var(--color-espresso);
}

body.at-funnel-page > section:nth-of-type(4n + 3) {
  background-color: var(--color-greige);
  color: var(--color-espresso);
}

body.at-funnel-page > section:nth-of-type(4n + 4) {
  background-color: var(--color-ivory);
  color: var(--color-espresso);
}

/* Explicit homepage IDs keep intentional rhythm (override nth rules) */
body.home-template-authority .at-hero {
  background: var(--color-ivory) !important;
}
body.home-template-authority #promise.at-funnel {
  background: var(--color-white) !important;
}
body.home-template-authority #five-ways.at-funnel,
body.home-template-authority #five-ways.at-funnel-alt,
body.home-template-authority #cases.at-funnel {
  background: var(--color-greige) !important;
  color: var(--color-espresso) !important;
}
body.home-template-authority #who.at-funnel {
  background: var(--color-white) !important;
  color: var(--color-espresso) !important;
}
body.home-template-authority #mastery-system.at-funnel {
  background: var(--color-ivory) !important;
}
body.home-template-authority #shift.at-funnel-alt,
body.home-template-authority .at-final,
body.home-template-authority .footer-area {
  background: var(--color-espresso) !important;
  color: var(--color-cream-on-espresso) !important;
}

/* Deal Lab / Free Tools dark shells */
.dl-page {
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(201, 191, 178, 0.12), transparent 55%),
    linear-gradient(180deg, var(--color-espresso) 0%, #2F2218 55%, var(--color-espresso) 100%) !important;
  color: var(--color-cream-on-espresso);
}

/* Permanent-template / static marketing pages */
body[class*="home-template-"] .ps-hero,
body[class*="home-template-"] .page-banner,
body.home-template-authority .cfm-catalog-banner {
  background: var(--color-espresso) !important;
  color: var(--color-cream-on-espresso) !important;
}

body[class*="home-template-"] .ps-hero .at-kicker,
body[class*="home-template-"] .page-banner .at-kicker {
  color: var(--color-cream-on-espresso) !important;
}
