/* ==========================================================================
   css/base.css - Base typography, resets, accessibility, and focus rules
   ========================================================================== */

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

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

html[data-font-size="small"] {
  font-size: 14px;
}

html[data-font-size="medium"] {
  font-size: 16px;
}

html[data-font-size="large"] {
  font-size: 18px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* Skip link (Section 3.5, 10, WCAG 2.1 AA) */
.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: 1rem;
  z-index: 10000;
  background: var(--brand-primary);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  border-radius: var(--btn-radius);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: top 0.15s ease-in-out;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 1rem;
  outline: 3px solid var(--text-primary);
  outline-offset: 2px;
}

/* Focus Indicator (Section 2.4 & 7.8) */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.875rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* Monospace utilities */
.font-mono {
  font-family: var(--font-mono) !important;
}

/* Media and Images */
img, svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Reduced Motion (Section 7.8 & Section 25) */
@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;
  }
}

/* RTL Support (Section 6.4) */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

