﻿/* ==========================================================================
   DBIM v3 theme - Commercial Taxes Department, Government of Karnataka
   Colour group: Blue (DBIM 2.1 - ONE group only)
   Adapted for this site's markup (s3-* classes, ctd-a11y.js).
   Load AFTER dbim-typography.css (see MasterPage.master), before print.css.
   Fonts: Noto Sans + Noto Sans Kannada are already loaded by MasterPage.master.
   ========================================================================== */

:root {
  /* DBIM 2.1 primary palette - Blue */
  --dbim-key: #162F6A;
  --dbim-1:   #214AAB;
  --dbim-2:   #5279D7;
  --dbim-3:   #A3BBF3;
  --dbim-4:   #D2DFFF;

  /* DBIM 2.2 functional palette */
  --dbim-linen: #EBEAEA;
  --dbim-white: #FFFFFF;
  --dbim-text: #150202;
  --dbim-black: #000000;
  --dbim-success: #198754;
  --dbim-warning: #FFC107;
  --dbim-error: #DC3545;
  --dbim-info: #0D6EFD;
  --dbim-grey-1: #C6C6C6;
  --dbim-grey-2: #8E8E8E;
  --dbim-grey-3: #606060;

  /* DBIM 4.3.1 type scale (desktop). rem, not px, so the A- / A / A+ buttons in
     ctd-a11y.js (which set the html font-size %) keep resizing all text - GIGW 5.2.15 */
  --fs-h1: 2.25rem;  --fs-h2: 1.5rem;  --fs-h3: 1.25rem;
  --fs-p1: 1rem;     --fs-p2: .875rem; --fs-small: .75rem;
}

/* DBIM 4.3.2 type scale (mobile) */
@media (max-width: 767px) {
  :root { --fs-h1: 1.5rem; --fs-h2: 1.25rem; --fs-h3: 1rem; --fs-p1: .875rem; --fs-p2: .75rem; --fs-small: .625rem; }
}

/* Colour rules are skipped while a high-contrast / invert mode is on, so they
   cannot fight the site's own contrast styles. :where() keeps specificity low,
   so component classes (footer headings, buttons...) still win. */

body {
  font-family: "Noto Sans", "Noto Sans Kannada", system-ui, sans-serif;
  font-size: var(--fs-p1);
  line-height: 1.5;                 /* DBIM 4.5 iii: 1.2 - 1.5 */
  text-align: left;                 /* DBIM 4.1.1 */
}
html:where(:not(.hc, .a11y-contrast, .a11y-invert)) body { color: var(--dbim-text); background: var(--dbim-white); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; }
html:where(:not(.hc, .a11y-contrast, .a11y-invert)) :is(h1, h2, h3, h4) { color: var(--dbim-key); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
small, .text-small { font-size: var(--fs-small); }

/* Links: colour + underline so colour is not the only cue (GIGW 5.2.12) */
a { text-decoration: underline; text-underline-offset: 2px; }
html:where(:not(.hc, .a11y-contrast, .a11y-invert)) a { color: var(--dbim-1); }   /* #214AAB: 8:1 on white, 6+:1 on striped rows (was #0D6EFD = 4.5:1 on white, 3.4-3.8:1 on table tints) */
html:where(:not(.hc, .a11y-contrast, .a11y-invert)) a:where(:hover) { color: var(--dbim-key); }   /* :where() keeps this weaker than any component rule, so white menu / footer links stay white on hover */
a:hover { text-decoration-thickness: 2px; }                         /* DBIM 4.5 iv */
nav a, .s3-footer a, .s3-topbar a, .btn { text-decoration: none; }

/* Visible focus indicator - GIGW 5.2.33 (never remove outlines) */
:focus-visible { outline: 3px solid var(--dbim-info); outline-offset: 2px; }
.s3-footer :focus-visible, .s3-topbar :focus-visible, .s3-nav :focus-visible, .topnav :focus-visible { outline-color: #FFFFFF; }

/* CTA buttons - DBIM 4.5 i (for new pages; existing buttons keep their own styles) */
.btn, button.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  font-family: inherit; font-weight: 600; font-size: var(--fs-p2); line-height: 1.2; border-radius: 6px; border: 2px solid var(--dbim-key); cursor: pointer; }
.btn-primary { background: var(--dbim-key); color: #fff; }
.btn-primary:hover { background: var(--dbim-1); border-color: var(--dbim-1); }
.btn-secondary { background: #fff; color: var(--dbim-key); }
.btn-secondary:hover { background: var(--dbim-4); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--dbim-grey-1); border-color: var(--dbim-grey-1); color: var(--dbim-grey-3); cursor: not-allowed; }

/* Status colours */
.alert-success { border-left: 4px solid var(--dbim-success); }
.alert-warning { border-left: 4px solid var(--dbim-warning); }
.alert-error   { border-left: 4px solid var(--dbim-error); }
.alert-info    { border-left: 4px solid var(--dbim-info); }

/* Data tables - DBIM 4.1.1 / GIGW 5.1.19 */
table { border-collapse: collapse; width: 100%; }
th { text-align: center; }
html:where(:not(.hc, .a11y-contrast, .a11y-invert)) th { background: var(--dbim-4); color: var(--dbim-text); }
td { text-align: left; }
td.num, td[data-type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
th, td { border: 1px solid var(--dbim-grey-1); padding: 8px 12px; }
.table-scroll { overflow-x: auto; }                                 /* reflow at 320px - GIGW 5.2.17 */

/* Media never forces horizontal scrolling - GIGW 5.2.17.
   (height:auto only on img/video: on iframe/svg it would override their height attributes) */
img, video, iframe, svg { max-width: 100%; }
img, video { height: auto; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Top-level menu items always carry their own dark background, so contrast checks
   (axe) never measure the white label against the light page when an item wraps
   or overflows the bar. :where() = zero specificity, so hover/active colours still win. */
:where(.topnav #navList > li > a, .s3-nav .nav-list > li > a) { background-color: var(--dbim-key); }