/*
 * base.css - reset, typography and small utilities for bsm-theme.
 *
 * Source: ../obsidian/10_Projects/bsm_website/theme/theme-spec.md (section 2, 7).
 * Phase 6 (CSS foundation).
 *
 * What is here:
 *   - minimal modern-normalize (box-sizing, body reset, text-size-adjust).
 *   - body typography wired to tokens.css variables.
 *   - heading scale (h1-h4) wired to --font-size-hN.
 *   - links use --accent; underline on hover.
 *   - images / svg / video are responsive by default.
 *   - focus-visible outline (a11y) using --accent.
 *   - small utilities: .container, .visually-hidden.
 *
 * What is NOT here (later phases):
 *   - topnav, breadcrumbs, subnav (Phases 8 / 18b).
 *   - components (cards, hero, forms) - Phases 9-11.
 *   - dark theme - not supported yet.
 */

/* ============================================================
 * Minimal reset
 * ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
 * Headings
 * ============================================================ */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4) 0;
  line-height: var(--line-height-heading);
  font-weight: var(--font-weight-semibold);
  color: var(--navy);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); font-weight: var(--font-weight-medium); }
h5, h6 { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); }

/* ============================================================
 * Body copy
 * ============================================================ */

p {
  margin: 0 0 var(--space-4) 0;
  font-size: var(--font-size-body);
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: var(--font-weight-semibold);
}

ul, ol {
  margin: 0 0 var(--space-4) 0;
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

li:last-child {
  margin-bottom: 0;
}

/* ============================================================
 * Links
 * ============================================================ */

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* ============================================================
 * Media
 * ============================================================ */

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
 * Utilities
 * ============================================================ */

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* visually hidden - for screen readers only */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
 * Focus state (a11y)
 * ============================================================ */

:focus {
  outline: none;
}

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