/*!
 * gov-tokens.css  -  Design tokens for GIGW 3.0 / DBIM 3.0 (Jan 2025)
 * DBIM 2.1 (primary palette: pick ONE group), 2.2 (functional palette), 4.3 (type scale)
 *
 * HOW TO USE: set data-theme on <html> to one of
 *   burgundy | purple | blue | green | yellow | red
 * Everything else in the kit reads --gov-key / --gov-2 .. --gov-5.
 */
:root,
:root[data-theme="blue"] {
  --gov-key: #162f6a;   /* darkest shade: footer, icons, headings, PM quote */
  --gov-2:   #214aab;
  --gov-3:   #5279d7;
  --gov-4:   #a3bbf3;
  --gov-5:   #d2dfff;   /* lightest tint */
  --gov-accent: var(--gov-2);   /* background behind WHITE text (needs >= 4.5:1); green overrides it */
}
:root[data-theme="burgundy"] { --gov-key:#6c1340; --gov-2:#a32966; --gov-3:#db70a6; --gov-4:#ebadcc; --gov-5:#faebf2; }
:root[data-theme="purple"]   { --gov-key:#29136c; --gov-2:#4729a3; --gov-3:#8b70db; --gov-4:#bdadeb; --gov-5:#eeebfa; }
:root[data-theme="green"]    { --gov-key:#0f5757; --gov-2:#2d8686; --gov-3:#75bdbd; --gov-4:#a6d9d9; --gov-5:#d9f2f2;
  --gov-accent: var(--gov-key);   /* white on #2d8686 is only 4.3:1, so the accent falls back to the key colour */ }
:root[data-theme="yellow"]   { --gov-key:#5d3e00; --gov-2:#916100; --gov-3:#dda73a; --gov-4:#f4d390; --gov-5:#ffeecc; }
:root[data-theme="red"]      { --gov-key:#771d1d; --gov-2:#a72626; --gov-3:#d75151; --gov-4:#faaaaa; --gov-5:#fcdada; }

:root {
  /* DBIM 2.2 functional palette */
  --gov-linen:   #ebeaea;   /* outlines, quote / highlight backgrounds */
  --gov-white:   #ffffff;   /* "Inclusive white": page background, text on dark */
  --gov-text:    #150202;   /* "Deep earthy brown": text on light */
  --gov-black:   #000000;   /* State emblem on light background */
  --gov-deepblue:#1d0a69;   /* gov.in root site only */
  --gov-success: #198754;
  --gov-warning: #ffc107;   /* NEVER put white text on this; use --gov-text */
  --gov-error:   #dc3545;
  --gov-info:    #dc3545;   /* DBIM Table 1 lists #DC3545 for info as well */
  --gov-link:    #0d6efd;   /* DBIM hyperlink colour (4.50:1 on white, but only 3.7:1 on linen: kit text links use --gov-link-text instead) */
  --gov-grey-1:  #c6c6c6;
  --gov-grey-2:  #8e8e8e;
  --gov-grey-3:  #606060;   /* 6.2:1 on white: safe for secondary text */

  /* Semantic aliases used by components (override these for high-contrast mode) */
  --gov-bg:      var(--gov-white);
  --gov-fg:      var(--gov-text);
  --gov-fg-muted:var(--gov-grey-3);
  --gov-border:  var(--gov-linen);
  --gov-surface: var(--gov-linen);
  --gov-link-text: var(--gov-key);      /* accessible link colour (>= 4.5:1) */
  --gov-focus:   #ffbf47;               /* visible focus ring (5.2.33) */
  --gov-focus-ink: #150202;

  /* DBIM 4.3.1 desktop type scale (px expressed in rem; 1rem = 16px) */
  --gov-font: "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --gov-fs-h1: 2.25rem;   /* 36 */
  --gov-fs-h2: 1.5rem;    /* 24 */
  --gov-fs-h3: 1.25rem;   /* 20 */
  --gov-fs-p1: 1rem;      /* 16 */
  --gov-fs-p2: 0.875rem;  /* 14 */
  --gov-fs-sm: 0.75rem;   /* 12 */
  --gov-lh: 1.5;          /* DBIM 4.5: line-height 1.2 to 1.5 x size */
  --gov-lh-head: 1.25;

  /* Spacing + shape */
  --gov-s1: .25rem; --gov-s2: .5rem; --gov-s3: .75rem; --gov-s4: 1rem;
  --gov-s5: 1.5rem; --gov-s6: 2rem; --gov-s7: 3rem;
  --gov-radius: 6px;
  --gov-container: 1200px;
  --gov-shadow: 0 1px 3px rgba(0,0,0,.15);
  --gov-header-h: 72px;

  /* Text-size control (gov-a11y.js multiplies the root font size) */
  --gov-scale: 100%;
}

/* DBIM 4.3.2 mobile type scale */
@media (max-width: 767px) {
  :root {
    --gov-fs-h1: 1.5rem;   /* 24 */
    --gov-fs-h2: 1.25rem;  /* 20 */
    --gov-fs-h3: 1rem;     /* 16 */
    --gov-fs-p1: .875rem;  /* 14 */
    --gov-fs-p2: .75rem;   /* 12 */
    --gov-fs-sm: .625rem;  /* 10 */
  }
}

/* High-contrast mode (toggled by gov-a11y.js on <html data-contrast="high">) */
:root[data-contrast="high"] {
  --gov-bg: #000; --gov-fg: #fff; --gov-fg-muted: #e6e6e6;
  --gov-border: #fff; --gov-surface: #000; --gov-link-text: #ffff00;
  --gov-focus: #00ffff; --gov-focus-ink: #000;
}
