/* ═══════════════════════════════════════════════════════════════════
   SOJ Analytics / OperArch Platform — Base & A11y
   Reset, body defaults, focus management, print styles.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Body ── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Links ── */
a { color: var(--total); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Focus management (keyboard only) ── */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

button:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus-ring);
}

/* ── Touch targets (WCAG 2.5.8) ── */
button,
[role="button"],
[role="tab"] {
  min-height: 44px;
}

/* ── Skip link (a11y) ── */
.oa-skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--confirmed);
  color: var(--text-on-accent);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.oa-skip-link:focus {
  top: var(--space-4);
}

/* ── ARIA tab support ── */
[role="tablist"] {
  display: flex;
  gap: var(--space-2);
}

[role="tab"] {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

[role="tabpanel"][hidden] {
  display: none;
}

/* ── Scrollbar (dark theme) ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--surface3); }

/* ── Print ── */
@media print {
  body { background: #fff; color: #000; }
  button, [role="button"], [role="tablist"], .main-nav, .oa-skip-link { display: none !important; }
  .oa-card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
}
