/**
 * Sophia STARS — base styles (roadmap Phase 1, §1.1)
 *
 * Reset, body, typography, links, focus ring. Component classes and
 * !important belong in components.css/chrome.css, not here.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--sp-3);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-2xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}

p {
  margin: 0 0 var(--sp-3);
  max-width: 65ch;
}

a {
  color: var(--blue-500);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
  display: block;
}

table {
  border-collapse: collapse;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

/* One focus-visible treatment, applied everywhere, never suppressed. */
:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}

/* Skip link — visually hidden until focused, matches the accessible-
   drawer contract already used across the app. */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--sp-2);
  z-index: var(--z-critical);
  background: var(--navy-800);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-weight: 600;
}
.skip-link:focus {
  top: var(--sp-2);
}

/* Screen-reader-only utility — the correct way to hide something
   visually while keeping it in the accessibility tree; never conflate
   this with role="status"/aria-live, which must stay visible. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .page-header,
  .sidebar,
  .header-action-btn,
  .sidebar-mobile-toggle,
  .sidebar-mobile-close {
    display: none !important;
  }
  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
