/* ==========================================================================
   GovSolutions Corp (govsolutionscorp.com)
   Institutional Public Sector IT & Infrastructure Consulting Design System
   Modeled after Excella, Steampunk, Skylight & Booz Allen Hamilton
   ========================================================================== */

:root {
  /* Light Theme Base Palette (Crisp Corporate White, Slate & Institutional Navy/Blue) */
  --bg-canvas-light: #FFFFFF;
  --bg-subtle-light: #F8FAFC;
  --bg-muted-light: #F1F5F9;
  --bg-surface-light: #FFFFFF;
  --text-primary-light: #0F172A;
  --text-secondary-light: #334155;
  --text-muted-light: #64748B;
  --border-subtle-light: #E2E8F0;
  --border-strong-light: #CBD5E1;
  --brand-primary-light: #1E40AF;
  --brand-primary-hover-light: #1E3A8A;
  --brand-accent-light: #2563EB;
  --brand-badge-bg-light: #EFF6FF;
  --brand-badge-text-light: #1D4ED8;

  /* Dark Theme Base Palette (Deep Executive Navy & Slate) */
  --bg-canvas-dark: #090D16;
  --bg-subtle-dark: #0F172A;
  --bg-muted-dark: #1E293B;
  --bg-surface-dark: #111827;
  --text-primary-dark: #F8FAFC;
  --text-secondary-dark: #CBD5E1;
  --text-muted-dark: #94A3B8;
  --border-subtle-dark: #1E293B;
  --border-strong-dark: #334155;
  --brand-primary-dark: #3B82F6;
  --brand-primary-hover-dark: #60A5FA;
  --brand-accent-dark: #60A5FA;
  --brand-badge-bg-dark: rgba(59, 130, 246, 0.14);
  --brand-badge-text-dark: #93C5FD;

  /* Mandatory color-scheme declaration */
  color-scheme: light dark;
  scrollbar-width: thin;

  /* Default (Light) fallback assignments */
  --bg-canvas: var(--bg-canvas-light);
  --bg-subtle: var(--bg-subtle-light);
  --bg-muted: var(--bg-muted-light);
  --bg-surface: var(--bg-surface-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --text-muted: var(--text-muted-light);
  --border-subtle: var(--border-subtle-light);
  --border-strong: var(--border-strong-light);
  --brand-primary: var(--brand-primary-light);
  --brand-primary-hover: var(--brand-primary-hover-light);
  --brand-accent: var(--brand-accent-light);
  --brand-badge-bg: var(--brand-badge-bg-light);
  --brand-badge-text: var(--brand-badge-text-light);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-canvas: var(--bg-canvas-dark);
    --bg-subtle: var(--bg-subtle-dark);
    --bg-muted: var(--bg-muted-dark);
    --bg-surface: var(--bg-surface-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --text-muted: var(--text-muted-dark);
    --border-subtle: var(--border-subtle-dark);
    --border-strong: var(--border-strong-dark);
    --brand-primary: var(--brand-primary-dark);
    --brand-primary-hover: var(--brand-primary-hover-dark);
    --brand-accent: var(--brand-accent-dark);
    --brand-badge-bg: var(--brand-badge-bg-dark);
    --brand-badge-text: var(--brand-badge-text-dark);
  }
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg-canvas: light-dark(var(--bg-canvas-light), var(--bg-canvas-dark));
    --bg-subtle: light-dark(var(--bg-subtle-light), var(--bg-subtle-dark));
    --bg-muted: light-dark(var(--bg-muted-light), var(--bg-muted-dark));
    --bg-surface: light-dark(var(--bg-surface-light), var(--bg-surface-dark));
    --text-primary: light-dark(var(--text-primary-light), var(--text-primary-dark));
    --text-secondary: light-dark(var(--text-secondary-light), var(--text-secondary-dark));
    --text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
    --border-subtle: light-dark(var(--border-subtle-light), var(--border-subtle-dark));
    --border-strong: light-dark(var(--border-strong-light), var(--border-strong-dark));
    --brand-primary: light-dark(var(--brand-primary-light), var(--brand-primary-dark));
    --brand-primary-hover: light-dark(var(--brand-primary-hover-light), var(--brand-primary-hover-dark));
    --brand-accent: light-dark(var(--brand-accent-light), var(--brand-accent-dark));
    --brand-badge-bg: light-dark(var(--brand-badge-bg-light), var(--brand-badge-bg-dark));
    --brand-badge-text: light-dark(var(--brand-badge-text-light), var(--brand-badge-text-dark));
  }
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  line-height: 1.6;
}

/* Semantic helper classes */
.bg-canvas { background-color: var(--bg-canvas); }
.bg-subtle { background-color: var(--bg-subtle); }
.bg-muted-surface { background-color: var(--bg-muted); }
.bg-surface { background-color: var(--bg-surface); }
.text-ink { color: var(--text-primary); }
.text-body { color: var(--text-secondary); }
.text-muted-ink { color: var(--text-muted); }
.border-subtle { border-color: var(--border-subtle); }
.border-strong { border-color: var(--border-strong); }

.badge-brand {
  background-color: var(--brand-badge-bg);
  color: var(--brand-badge-text);
}

/* Executive Hero Dark Navy Canvas */
.hero-navy {
  background: radial-gradient(circle at 80% 20%, #172554 0%, #0B132B 55%, #070C1C 100%);
  color: #F8FAFC;
}

.hero-grid-overlay {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ==========================================================================
   2. RESPONSIVE PROCUREMENT TABLE (@container queries)
   ========================================================================== */
.table-region {
  container-type: inline-size;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  background-color: var(--bg-surface);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.table-region:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.gov-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.gov-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.gov-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.gov-table tbody td {
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.gov-table tbody tr:last-child th,
.gov-table tbody tr:last-child td {
  border-bottom: none;
}

.gov-table tbody tr:hover th,
.gov-table tbody tr:hover td {
  background-color: var(--bg-subtle);
}

@container (width < 680px) {
  .gov-table thead {
    display: none;
  }
  .gov-table,
  .gov-table tbody,
  .gov-table tr,
  .gov-table th,
  .gov-table td {
    display: block;
    width: 100%;
  }
  .gov-table tbody tr {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-strong);
  }
  .gov-table tbody th {
    position: static;
    padding: 0 0 0.5rem 0;
    border-bottom: none;
    font-size: 1rem;
  }
  .gov-table tbody td {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 0.75rem;
    padding: 0.375rem 0;
    border-bottom: none;
  }
  .gov-table tbody td::before {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }
  .gov-table--vehicles tbody td:nth-child(2)::before { content: var(--col-2, "Threshold / Scope"); }
  .gov-table--vehicles tbody td:nth-child(3)::before { content: var(--col-3, "Mechanism"); }
  .gov-table--vehicles tbody td:nth-child(4)::before { content: var(--col-4, "Timeline"); }

  .gov-table--naics tbody td:nth-child(2)::before { content: "Classification"; }
  .gov-table--naics tbody td:nth-child(3)::before { content: "Primary Scope & Deliverables"; }
  .gov-table--naics tbody td:nth-child(4)::before { content: "SBA Standard"; }
}

/* ==========================================================================
   3. NATIVE MODAL DIALOGS (dialog + light-dismiss-a-dialog)
   ========================================================================== */
dialog:modal {
  overscroll-behavior: contain;
  max-width: min(92vw, 56rem);
  max-height: 88vh;
  width: 100%;
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(9, 13, 22, 0.72);
  backdrop-filter: blur(4px);
}

/* Card & Link Micro-interactions */
.exec-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.exec-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-accent);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12);
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
}
