/**
 * CSS Reset
 * Modern reset with sensible defaults
 * Based on Josh Comeau's CSS Reset with additions
 */

/* ==========================================================================
   BOX SIZING
   ========================================================================== */

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

/* ==========================================================================
   MARGIN RESET
   ========================================================================== */

* {
  margin: 0;
}

/* ==========================================================================
   BODY DEFAULTS
   ========================================================================== */

html {
  /* Smooth scrolling for anchor links */
  scroll-behavior: smooth;
  /* Prevent font size inflation on mobile */
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  /* Full viewport height at minimum */
  min-height: 100vh;
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal scroll */
  overflow-x: hidden;
}

/* ==========================================================================
   TYPOGRAPHY RESET
   ========================================================================== */

/* Remove built-in form typography styles */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Heading balance for better wrapping */
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* Paragraph text wrapping */
p {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* ==========================================================================
   MEDIA RESET
   ========================================================================== */

/* Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Responsive images */
img {
  height: auto;
}

/* ==========================================================================
   FORM RESET
   ========================================================================== */

/* Reset fieldset */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Reset legend */
legend {
  padding: 0;
}

/* Remove default textarea resize */
textarea {
  resize: vertical;
}

/* Remove default appearance on form elements */
input,
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ==========================================================================
   LIST RESET
   ========================================================================== */

/* Remove list styles on ul, ol with class */
ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

/* ==========================================================================
   LINK RESET
   ========================================================================== */

/* Remove default link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   TABLE RESET
   ========================================================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Respect user preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Hidden but accessible to screen readers */
.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;
}

/* Skip link - hidden until focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: var(--color-accent);
  color: var(--color-white);
  padding: var(--space-4) var(--space-5);
  z-index: var(--z-skip-link);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
}

.skip-link:focus {
  left: var(--space-4);
  top: 0;
  outline: var(--focus-ring-width) solid var(--color-white);
  outline-offset: var(--focus-ring-offset);
}

/* ==========================================================================
   FOCUS VISIBLE
   Remove default outline, we'll add our own
   ========================================================================== */

:focus {
  outline: none;
}

/* Add focus-visible for keyboard users only */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* ==========================================================================
   SELECTION
   ========================================================================== */

::selection {
  background-color: var(--color-accent-light);
  color: var(--color-primary);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }
}
