/* ============================================================
   theme.css — TOKEN PLUMBING
   ============================================================
   This file does ONE thing: it routes Blocksy + Elementor's
   internal CSS variables to the brand tokens defined in
   tokens.css. You shouldn't need to edit this file when you
   redesign — edit tokens.css instead.
   ============================================================ */

/* ---------- Blocksy palette → brand ---------- */
:root {
  --theme-palette-color-1: var(--brand-primary);
  --theme-palette-color-2: var(--brand-primary-hover);
  --theme-palette-color-3: var(--brand-body);
  --theme-palette-color-4: var(--brand-ink);
  --theme-palette-color-5: var(--brand-border);
  --theme-palette-color-6: var(--brand-surface);
  --theme-palette-color-7: var(--brand-surface-2);
  --theme-palette-color-8: var(--brand-bg);

  --theme-text-color:               var(--brand-body);
  --theme-link-initial-color:       var(--brand-primary);
  --theme-link-hover-color:         var(--brand-primary-hover);
  --theme-headings-color:           var(--brand-ink);
  --theme-border-color:             var(--brand-border);

  /* Symmetric invert-on-hover pattern (mirrors components.css):
     Default: navy bg + white text  →  Hover: white bg + navy text. */
  --theme-button-background-initial-color: var(--brand-primary);
  --theme-button-background-hover-color:   #ffffff;
  --theme-button-text-initial-color:       var(--brand-primary-ink);
  --theme-button-text-hover-color:         var(--brand-primary);
  --theme-button-border-hover-color:       var(--brand-primary);
  --theme-button-border-radius:            var(--brand-radius-pill);   /* fully pill */
  --theme-button-min-height:               var(--brand-button-h);
  --theme-button-padding:                  12px 24px;

  --theme-form-field-border-radius:        var(--brand-radius);
  --theme-form-field-border-focus-color:   var(--brand-primary);

  --theme-content-vertical-spacing: var(--brand-rhythm);
  --theme-normal-container-max-width: var(--brand-container);
  --theme-narrow-container-max-width: var(--brand-container-narrow);
}

/* ---------- Elementor globals → brand ---------- */
.elementor-kit-1441,
:root {
  --e-global-color-primary:   var(--brand-primary);
  --e-global-color-secondary: var(--brand-ink);
  --e-global-color-text:      var(--brand-body);
  --e-global-color-accent:    var(--brand-primary-hover);

  --e-global-color-blocksy_palette_1: var(--brand-primary);
  --e-global-color-blocksy_palette_2: var(--brand-primary-hover);
  --e-global-color-blocksy_palette_3: var(--brand-body);
  --e-global-color-blocksy_palette_4: var(--brand-ink);
  --e-global-color-blocksy_palette_5: var(--brand-border);
  --e-global-color-blocksy_palette_6: var(--brand-surface);
  --e-global-color-blocksy_palette_7: var(--brand-surface-2);
  --e-global-color-blocksy_palette_8: var(--brand-bg);

  --e-global-typography-primary-font-family:   var(--brand-font-head);
  --e-global-typography-primary-font-weight:   var(--brand-weight-heavy);
  --e-global-typography-secondary-font-family: var(--brand-font-accent);
  --e-global-typography-secondary-font-weight: var(--brand-weight-body);
  --e-global-typography-text-font-family:      var(--brand-font-body);
  --e-global-typography-text-font-weight:      var(--brand-weight-body);
  --e-global-typography-accent-font-family:    var(--brand-font-body);
  --e-global-typography-accent-font-weight:    var(--brand-weight-medium);
}

/* ---------- Base typography (applies to non-Elementor content too) ---------- */
body {
  font-family: var(--brand-font-body);
  font-size: var(--brand-fs-body);
  line-height: var(--brand-lh-body);
  color: var(--brand-body);
  background-color: var(--brand-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--brand-font-head);
  color: var(--brand-ink);
  line-height: var(--brand-lh-head);
  font-weight: var(--brand-weight-heavy);
}

h1 { font-size: var(--brand-fs-h1); }
h2 { font-size: var(--brand-fs-h2); }
h3 { font-size: var(--brand-fs-h3); }
h4 { font-size: var(--brand-fs-h4); }
h5 { font-size: var(--brand-fs-h5); font-weight: var(--brand-weight-bold); }
h6 { font-size: var(--brand-fs-h6); font-weight: var(--brand-weight-bold); }

a {
  color: var(--brand-primary-hover);
  text-decoration: none;
  transition: color var(--brand-dur) var(--brand-ease);
}
a:hover, a:focus-visible { color: var(--brand-ink); text-decoration: underline; }

::selection { background: var(--brand-primary); color: var(--brand-primary-ink); }

/* Focus ring — accessibility */
:where(a, button, [role="button"], input, textarea, select):focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--brand-radius-sm);
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
