/*
 * Orion Live Sessions — base.css
 * Resets, typography, links, focus states, screen-reader utilities, reduced motion.
 * Pattern lifted from CNIB AATech-Summit (wcag-aaa-theme.css) and trimmed to what Orion uses.
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--base-font-size);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--text);
  background: var(--background);
  min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 0.75em;
  color: var(--text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p { margin-bottom: 1.5em; }

strong, b { font-weight: 700; color: inherit; }

/* Links — text links carry an underline by default; nav suppresses it */
a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}
a:visited { color: var(--text); }
a:hover   { color: var(--text); }

/* Universal focus ring (3px, AAA) — applies to every focusable element */
:focus-visible {
  outline: 3px solid var(--focus-outline);
  outline-offset: 2px;
}

/* Fallback for browsers without :focus-visible */
:focus { outline: 3px solid var(--focus-outline); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Screen-reader-only utility (visible on focus for skip links) */
.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;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--cnib-yellow);
  color: var(--cnib-black);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  font-weight: 700;
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--cnib-black);
  outline-offset: -3px;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--max-content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

/* Visually-hidden form labels still carry meaning to screen readers */
label.hidden-label {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Reduced motion — disable transitions, animations, smooth scroll, particles */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Particle canvas honours this via JS too, but hide as belt-and-braces */
  canvas[data-orion-particles] { display: none !important; }
}

/* Print: prefer black on white, hide non-essential UI */
@media print {
  body { background: #FFFFFF; color: #000000; }
  canvas[data-orion-particles],
  .skip-link,
  nav,
  .no-print { display: none !important; }
}
