/* Excellence Realty design tokens. Source of truth: active Novamira design "Excellence Realty - Coastal Editorial",
   captured from https://excellencernc.lovable.app/. Colours authored in OKLCH to match the reference exactly.
   Prefix: --er-. Names mirror the reference's semantic roles (primary = teal, gold = highlight, accent = warm sand tint). */

:root {
  /* ---- Light theme (default) ---- */
  --er-white: oklch(1 0 0);
  --er-bg: oklch(0.985 0.006 95);            /* ~#FCFBF6 warm near-white page */
  --er-fg: oklch(0.235 0.045 220);           /* ~#1E2E37 hued charcoal ink */
  --er-cream: oklch(0.962 0.014 92);         /* ~#F7F4EC tinted panel ground */
  --er-card: oklch(1 0 0);
  --er-card-fg: oklch(0.235 0.045 220);
  --er-popover: oklch(1 0 0);
  --er-popover-fg: oklch(0.235 0.045 220);
  --er-primary: oklch(0.42 0.075 208);       /* ~#1D4C5C deep teal - structural brand colour */
  --er-primary-fg: oklch(0.985 0.008 95);
  --er-secondary: oklch(0.945 0.016 92);
  --er-secondary-fg: oklch(0.3 0.06 212);
  --er-muted: oklch(0.95 0.01 92);
  --er-muted-fg: oklch(0.47 0.025 220);      /* ~#5B6D76 secondary text */
  --er-accent: oklch(0.93 0.032 92);         /* warm sand tint (subtle fills) */
  --er-accent-fg: oklch(0.3 0.06 212);
  --er-gold: oklch(0.7 0.095 88);            /* ~#C2A25E single highlight */
  --er-gold-fg: oklch(0.21 0.04 220);
  --er-destructive: oklch(0.55 0.2 27);
  --er-destructive-fg: oklch(0.98 0.008 95);
  --er-whatsapp: oklch(0.72 0.17 150);
  --er-whatsapp-fg: oklch(0.16 0.03 150);
  --er-border: oklch(0.895 0.012 92);        /* ~#E3DED3 warm hairline */
  --er-input: oklch(0.885 0.012 92);
  --er-ring: oklch(0.52 0.09 205);
  --er-on-dark: oklch(0.98 0.01 85);
  --er-on-dark-muted: oklch(0.9 0.012 85);
  --er-on-dark-faint: oklch(0.84 0.012 85);
  --er-scrim: oklch(0.2 0.035 258 / 0.92);
  --er-glass-fill: oklch(0.2 0.035 258 / 0.06);
  --er-glass-border: oklch(0.2 0.035 258 / 0.12);

  /* ---- Type ---- */
  --er-font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --er-font-sans: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --er-leading-display: 1.03;
  --er-leading-snug: 1.3;
  --er-leading-normal: 1.5;
  --er-leading-relaxed: 1.625;
  --er-tracking-display: -0.01em;
  --er-tracking-eyebrow: 0.22em;

  /* ---- Radius ---- */
  --er-radius: 0.875rem;                     /* 14px */
  --er-radius-sm: calc(var(--er-radius) - 4px);
  --er-radius-md: calc(var(--er-radius) - 2px);
  --er-radius-lg: var(--er-radius);
  --er-radius-xl: calc(var(--er-radius) + 4px);
  --er-radius-full: 9999px;

  /* ---- Elevation (tinted blue, never black) ---- */
  --er-shadow-soft: 0 1px 2px oklch(0.2 0.03 250 / 0.04), 0 12px 32px -12px oklch(0.2 0.03 250 / 0.10);
  --er-shadow-lift: 0 2px 4px oklch(0.2 0.03 250 / 0.06), 0 28px 60px -24px oklch(0.2 0.03 250 / 0.20);

  /* ---- Layout / spacing ---- */
  --er-container: 1280px;
  --er-gutter: clamp(1rem, 4vw, 2rem);
  --er-space-xs: 0.25rem;
  --er-space-sm: 0.5rem;
  --er-space-md: 1rem;
  --er-space-lg: 2rem;
  --er-space-xl: 4rem;
  --er-section-y: 6rem;                      /* 96px */
  --er-section-y-lg: 8rem;                   /* 128px */
}

/* ---- Bridge: remap Astra's global palette to our tokens ----
   tokens.css loads after Astra's dynamic CSS, so these win on equal :root specificity.
   Everything Astra and Elementor paint through the Astra palette now follows the design
   system and reacts to light/dark automatically (the --er-* values change, these point at them). */
:root {
  --ast-global-color-0: var(--er-primary);   /* accent: links, primary buttons */
  --ast-global-color-1: var(--er-primary);   /* accent hover (components refine) */
  --ast-global-color-2: var(--er-fg);        /* headings */
  --ast-global-color-3: var(--er-fg);        /* body text */
  --ast-global-color-4: var(--er-card);      /* content background */
  --ast-global-color-5: var(--er-bg);        /* site / outer background */
  --ast-global-color-6: var(--er-gold);      /* highlight */
  --ast-global-color-7: var(--er-border);    /* borders */
  --ast-global-color-8: var(--er-muted-fg);  /* subtle text */
}

/* ---- Dark theme ---- */
:root[data-theme="dark"] {
  --er-bg: oklch(0.185 0.032 220);          /* ~#122530 */
  --er-fg: oklch(0.955 0.008 95);           /* ~#F4F1E9 */
  --er-cream: oklch(0.235 0.035 218);       /* ~#1B2E39 */
  --er-card: oklch(0.235 0.035 218);
  --er-card-fg: oklch(0.955 0.008 95);
  --er-popover: oklch(0.235 0.035 218);
  --er-popover-fg: oklch(0.955 0.008 95);
  --er-primary: oklch(0.72 0.1 200);        /* ~#57AEC0 lifted teal */
  --er-primary-fg: oklch(0.17 0.03 220);
  --er-secondary: oklch(0.285 0.038 216);
  --er-secondary-fg: oklch(0.955 0.008 95);
  --er-muted: oklch(0.285 0.038 216);
  --er-muted-fg: oklch(0.8 0.015 92);
  --er-accent: oklch(0.315 0.045 212);
  --er-accent-fg: oklch(0.955 0.008 95);
  --er-gold: oklch(0.8 0.115 88);
  --er-gold-fg: oklch(0.18 0.03 220);
  --er-destructive: oklch(0.68 0.19 22);
  --er-destructive-fg: oklch(0.98 0.008 95);
  --er-border: oklch(1 0 0 / 0.14);
  --er-input: oklch(1 0 0 / 0.18);
  --er-ring: oklch(0.8 0.115 88);
  --er-glass-fill: oklch(1 0 0 / 0.07);
  --er-glass-border: oklch(1 0 0 / 0.16);
}

/* Follow the OS when the visitor has not chosen explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --er-bg: oklch(0.185 0.032 220);
    --er-fg: oklch(0.955 0.008 95);
    --er-cream: oklch(0.235 0.035 218);
    --er-card: oklch(0.235 0.035 218);
    --er-card-fg: oklch(0.955 0.008 95);
    --er-popover: oklch(0.235 0.035 218);
    --er-popover-fg: oklch(0.955 0.008 95);
    --er-primary: oklch(0.72 0.1 200);
    --er-primary-fg: oklch(0.17 0.03 220);
    --er-secondary: oklch(0.285 0.038 216);
    --er-secondary-fg: oklch(0.955 0.008 95);
    --er-muted: oklch(0.285 0.038 216);
    --er-muted-fg: oklch(0.8 0.015 92);
    --er-accent: oklch(0.315 0.045 212);
    --er-accent-fg: oklch(0.955 0.008 95);
    --er-gold: oklch(0.8 0.115 88);
    --er-gold-fg: oklch(0.18 0.03 220);
    --er-destructive: oklch(0.68 0.19 22);
    --er-destructive-fg: oklch(0.98 0.008 95);
    --er-border: oklch(1 0 0 / 0.14);
    --er-input: oklch(1 0 0 / 0.18);
    --er-ring: oklch(0.8 0.115 88);
    --er-glass-fill: oklch(1 0 0 / 0.07);
    --er-glass-border: oklch(1 0 0 / 0.16);
  }
}
