/* SHIELD/ATLAS PHASE 3 — Role-Adaptive UI overlay
 * UX audit item 13. global-nav.js already maintains <html data-sa-role="...">
 * with values STRATEGIC, OPERATIONAL, TACTICAL_SENIOR, TACTICAL_JUNIOR, EDGE,
 * OVERSIGHT (and aliases OPERATOR, WATCH, COMMANDER, BRIEFER). This file
 * adds declarative show/hide rules so host pages can tag content with
 * role classes without writing JS.
 *
 * Drop-in: pages opt in by adding any of the .sa-role-* classes below to
 * elements. Default (no class) = always visible. Reversible by removing
 * this file.
 */

/* ============================================================
 * EXACT-MATCH role visibility
 * Show only when current role exactly matches.
 * ============================================================ */

:root:not([data-sa-role="EDGE"]) .sa-role-edge-only            { display: none !important; }
:root:not([data-sa-role="TACTICAL_JUNIOR"]) .sa-role-tjunior-only  { display: none !important; }
:root:not([data-sa-role="TACTICAL_SENIOR"]) .sa-role-tsenior-only  { display: none !important; }
:root:not([data-sa-role="OPERATIONAL"]) .sa-role-operational-only  { display: none !important; }
:root:not([data-sa-role="STRATEGIC"]) .sa-role-strategic-only      { display: none !important; }
:root:not([data-sa-role="OVERSIGHT"]) .sa-role-oversight-only      { display: none !important; }

/* ============================================================
 * RANK-BAND visibility (escalating echelon)
 * "min-watch" = TACTICAL_JUNIOR or higher (commander/strategic see it)
 * "min-commander" = OPERATIONAL or higher (commander/strategic see it)
 * "min-strategic" = STRATEGIC only
 * Lower-rank operators see clean view; higher echelons see more context.
 * ============================================================ */

:root[data-sa-role="EDGE"] .sa-role-min-watch,
:root[data-sa-role="OVERSIGHT"] .sa-role-min-watch {
  display: none !important;
}

:root[data-sa-role="EDGE"] .sa-role-min-commander,
:root[data-sa-role="TACTICAL_JUNIOR"] .sa-role-min-commander,
:root[data-sa-role="TACTICAL_SENIOR"] .sa-role-min-commander,
:root[data-sa-role="OVERSIGHT"] .sa-role-min-commander {
  display: none !important;
}

:root:not([data-sa-role="STRATEGIC"]) .sa-role-min-strategic { display: none !important; }

/* ============================================================
 * HIDE-WHEN-EDGE — for content that confuses or distracts EDGE
 * operators (squad-level field responders should not see, e.g.,
 * J8 budget figures or COCOM-tier strategic forecasts).
 * ============================================================ */

:root[data-sa-role="EDGE"] .sa-role-hide-edge { display: none !important; }

/* ============================================================
 * ROLE BADGE — small label that shows current role context where
 * useful (commander dashboard, briefing hand-offs).
 * ============================================================ */

.sa-role-badge {
  display: inline-block;
  font-family: var(--sa-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: var(--sa-radius-sm, 4px);
  background: rgba(6, 182, 212, 0.12);
  color: var(--sa-cyan, #06b6d4);
  border: 1px solid rgba(6, 182, 212, 0.3);
  text-transform: uppercase;
}

.sa-role-badge::before {
  content: attr(data-sa-role-label);
}
