/* ==========================================================================
   Base — reset, element defaults, accessibility. Component-level styles
   (buttons, cards, nav, etc.) live in components.css once Phase 3/4 add
   them; this file only styles bare HTML elements.
   ========================================================================== */

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

* {
  margin: 0;
}

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

body {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  color: var(--color-heading);
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--transition-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-link-hover);
}

ul,
ol {
  padding-left: var(--space-5);
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Focus visibility — never remove focus outlines outright (docs/BRIEF.md §50). */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

::selection {
  background-color: var(--color-turquoise-tint-50);
  color: var(--color-ink);
}

/* Respect reduced-motion preference site-wide (docs/BRIEF.md §50, §67). */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Visually hidden but screen-reader-accessible — matches WordPress core's
   own .screen-reader-text convention (used by skip links, etc.). */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  width: auto;
  height: auto;
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-bg);
  color: var(--color-heading);
  z-index: var(--z-toast);
  clip: auto;
}
