/* ============================================================================
   Buldhana District Forest — Design Tokens
   Single source of truth for colour, type, spacing, radius, elevation, motion.
   Everything downstream (base.css, components.css, pages) reads these variables.
   No component may hard-code a colour or size that belongs here.
   ========================================================================== */

:root {
  /* --------------------------------------------------------------------------
     1. RAW PALETTE  (not used directly by components — mapped to roles below)
     -------------------------------------------------------------------------- */

  /* Forest green — the brand core */
  --bf-green-900: #0b2e20;   /* top government bar, footer                     */
  --bf-green-800: #12402d;
  --bf-green-700: #1b4332;   /* primary brand surface                          */
  --bf-green-600: #245741;
  --bf-green-500: #2d6a4f;   /* primary action / buttons                       */
  --bf-green-400: #40916c;
  --bf-green-300: #74c69d;
  --bf-green-200: #b7e4c7;
  --bf-green-100: #d8f0e3;
  --bf-green-50:  #eef6f1;

  /* Clay / ochre — the single earthy accent, used sparingly                   */
  --bf-clay-700: #7c3306;
  --bf-clay-600: #b45309;    /* "New" badge, alert bar, highlight rule         */
  --bf-clay-100: #fdecd3;

  /* Institutional blue — inline text links only (recognisable, high contrast) */
  --bf-blue-800: #1e3a8a;
  --bf-blue-700: #1d4ed8;
  --bf-blue-100: #dbe6fe;

  /* Neutrals — warm grey with a faint green cast so it sits with the brand    */
  --bf-neutral-0:   #ffffff;
  --bf-neutral-50:  #f7f9f7;
  --bf-neutral-100: #eef1ec;
  --bf-neutral-200: #dce4dd;
  --bf-neutral-300: #c4d0c7;
  --bf-neutral-400: #9aa8a0;
  --bf-neutral-500: #6b7b71;
  --bf-neutral-600: #52605a;
  --bf-neutral-700: #3a463f;
  --bf-neutral-900: #17251f;

  /* Status hues */
  --bf-success-600: #15803d;  --bf-success-50: #e7f5ec;
  --bf-warning-600: #b45309;  --bf-warning-50: #fdf0dd;
  --bf-error-700:   #b3261e;  --bf-error-50:   #fbeae9;
  --bf-info-700:    #1d4ed8;  --bf-info-50:    #e8effd;

  /* GOV.UK-style focus colour — maximum visibility, theme-independent         */
  --bf-focus-yellow: #ffdd00;
  --bf-focus-ink:    #0b0c0c;

  /* --------------------------------------------------------------------------
     2. SEMANTIC ROLES  (components reference ONLY these)
     -------------------------------------------------------------------------- */

  --color-bg:              var(--bf-neutral-0);
  --color-surface:         var(--bf-neutral-0);
  --color-surface-raised:  var(--bf-neutral-0);
  --color-surface-sunken:  var(--bf-neutral-50);
  --color-surface-brand:   var(--bf-green-700);
  --color-surface-brand-dark: var(--bf-green-900);
  --color-surface-accent-soft: var(--bf-green-50);

  --color-border:          var(--bf-neutral-200);
  --color-border-strong:   var(--bf-neutral-300);
  --color-border-brand:    var(--bf-green-400);

  --color-text:            var(--bf-neutral-900);
  --color-text-muted:      var(--bf-neutral-600);
  --color-text-subtle:     var(--bf-neutral-500);
  --color-text-inverse:    var(--bf-neutral-0);
  --color-text-on-brand:   #eaf3ee;

  --color-brand:           var(--bf-green-700);
  --color-brand-strong:    var(--bf-green-800);
  --color-action:          var(--bf-green-500);
  --color-action-hover:    var(--bf-green-600);
  --color-action-active:   var(--bf-green-700);

  --color-accent:          var(--bf-clay-600);
  --color-accent-soft:     var(--bf-clay-100);

  --color-link:            var(--bf-blue-700);
  --color-link-hover:      var(--bf-blue-800);
  --color-link-visited:    #6b3fa0;

  --color-focus:           var(--bf-focus-yellow);
  --color-focus-ink:       var(--bf-focus-ink);

  --color-success:         var(--bf-success-600);
  --color-success-bg:      var(--bf-success-50);
  --color-warning:         var(--bf-warning-600);
  --color-warning-bg:      var(--bf-warning-50);
  --color-error:           var(--bf-error-700);
  --color-error-bg:        var(--bf-error-50);
  --color-info:            var(--bf-info-700);
  --color-info-bg:         var(--bf-info-50);

  /* CMS-managed region highlight (only shown when review mode is toggled on)  */
  --color-cms-outline:     #7c3aed;
  --color-cms-bg:          #f3ecfe;

  /* --------------------------------------------------------------------------
     3. TYPOGRAPHY
     Public Sans — a US-government open-source face — carries the institutional
     tone; Noto Sans Devanagari keeps Hindi in the same family; Lora gives
     long-form article text an editorial, credible feel.
     -------------------------------------------------------------------------- */

  --font-sans: "Public Sans", "Noto Sans Devanagari", system-ui, -apple-system,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Lora", "Noto Serif Devanagari", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-display:  clamp(2.25rem, 1.55rem + 3.1vw, 3.25rem);
  --text-h1:       clamp(1.875rem, 1.45rem + 1.9vw, 2.5rem);
  --text-h2:       clamp(1.5rem, 1.28rem + 0.95vw, 1.9rem);
  --text-h3:       1.25rem;
  --text-h4:       1.0625rem;
  --text-body-lg:  1.125rem;
  --text-body:     1rem;
  --text-small:    0.875rem;
  --text-caption:  0.75rem;
  --text-overline: 0.75rem;

  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-loose:  1.75;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --tracking-tight:   -0.01em;
  --tracking-normal:  0;
  --tracking-wide:    0.02em;
  --tracking-overline: 0.08em;

  --measure: 68ch;          /* ideal line length for body prose               */
  --measure-narrow: 54ch;

  /* --------------------------------------------------------------------------
     4. SPACING  — 4px base scale
     -------------------------------------------------------------------------- */

  --space-0:  0;
  --space-1:  0.25rem;   /*  4 */
  --space-2:  0.5rem;    /*  8 */
  --space-3:  0.75rem;   /* 12 */
  --space-4:  1rem;      /* 16 */
  --space-5:  1.5rem;    /* 24 */
  --space-6:  2rem;      /* 32 */
  --space-7:  2.5rem;    /* 40 */
  --space-8:  3rem;      /* 48 */
  --space-10: 4rem;      /* 64 */
  --space-12: 6rem;      /* 96 */

  --section-gap: clamp(3rem, 2rem + 5vw, 6rem);   /* vertical rhythm between page sections */

  /* --------------------------------------------------------------------------
     5. RADIUS / BORDER
     -------------------------------------------------------------------------- */

  --radius-xs:  2px;
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-pill: 999px;

  --border-width: 1px;
  --border-width-strong: 2px;

  /* --------------------------------------------------------------------------
     6. ELEVATION  — deliberately shallow (brief: no heavy shadows)
     -------------------------------------------------------------------------- */

  --shadow-xs: 0 1px 2px rgba(11, 46, 32, 0.06);
  --shadow-sm: 0 2px 6px rgba(11, 46, 32, 0.08);
  --shadow-md: 0 8px 24px rgba(11, 46, 32, 0.12);   /* menus, modals only     */

  /* --------------------------------------------------------------------------
     7. LAYOUT
     -------------------------------------------------------------------------- */

  --container-max: 1200px;
  --container-wide: 1320px;
  --container-pad: clamp(1rem, 0.4rem + 2.4vw, 2rem);

  /* --------------------------------------------------------------------------
     8. MOTION
     -------------------------------------------------------------------------- */

  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur:      200ms;
  --dur-slow: 320ms;

  /* --------------------------------------------------------------------------
     9. FOCUS
     -------------------------------------------------------------------------- */

  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* --------------------------------------------------------------------------
     10. Z-INDEX SCALE
     -------------------------------------------------------------------------- */

  --z-base: 1;
  --z-header: 100;
  --z-dropdown: 200;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-skiplink: 1100;
  --z-toast: 1200;
}

/* ============================================================================
   HIGH-CONTRAST THEME  — toggled from the accessibility controls.
   Only remaps semantic roles; components need no special cases.
   ========================================================================== */

:root[data-contrast="high"] {
  --color-bg:            #ffffff;
  --color-surface:       #ffffff;
  --color-surface-sunken:#ffffff;
  --color-text:          #000000;
  --color-text-muted:    #1a1a1a;
  --color-text-subtle:   #1a1a1a;
  --color-border:        #000000;
  --color-border-strong: #000000;
  --color-brand:         #05231a;
  --color-action:        #05231a;
  --color-action-hover:  #000000;
  --color-link:          #0b3bdb;
  --color-link-hover:    #001a8c;
  --color-surface-accent-soft: #ffffff;
  --color-surface-brand: #05231a;
  --shadow-xs: 0 0 0 1px #000;
  --shadow-sm: 0 0 0 2px #000;
  --shadow-md: 0 0 0 2px #000;
}

/* ============================================================================
   REDUCED MOTION  — honour the OS setting globally.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
}
