/*
 * NAMKC Youth Website - CSS Reset
 * Modern CSS Reset based on normalize.css and modern best practices
 * Ensures consistent rendering across all browsers
 */

/* ============================
   Box Sizing & Universal Reset
   ============================ */

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

/* ============================
   HTML & Body Reset
   ============================ */

html {
  /* Prevent font size adjustment after orientation changes in iOS */
  -webkit-text-size-adjust: 100%;
  /* Smooth scrolling for better UX */
  scroll-behavior: smooth;
  /* Set base font size for rem calculations */
  font-size: 16px;
}

body {
  /* Remove default margin */
  margin: 0;
  /* Set minimum height to fill viewport */
  min-height: 100vh;
  /* Enable better font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Improve text rendering */
  text-rendering: optimizeLegibility;
}

/* ============================
   Typography Reset
   ============================ */

h1, h2, h3, h4, h5, h6 {
  /* Remove default margins */
  margin: 0;
  /* Inherit font weight (will be set in main.css) */
  font-weight: inherit;
  /* Prevent text overflow */
  overflow-wrap: break-word;
}

p, ul, ol, dl, blockquote, pre, address {
  /* Remove default margins */
  margin: 0;
}

/* ============================
   Link Reset
   ============================ */

a {
  /* Remove default link styling */
  text-decoration: none;
  color: inherit;
  /* Remove tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;
}

/* ============================
   List Reset
   ============================ */

ul, ol {
  /* Remove default list styling */
  list-style: none;
}

/* ============================
   Image & Media Reset
   ============================ */

img, picture, video, canvas, svg {
  /* Make media responsive by default */
  display: block;
  max-width: 100%;
  height: auto;
}

/* ============================
   Form Element Reset
   ============================ */

button, input, select, textarea {
  /* Inherit font properties from parent */
  font: inherit;
  color: inherit;
  /* Remove default styling */
  border: none;
  background: none;
  /* Remove focus outline (will add custom in components.css) */
  outline: none;
}

button {
  /* Make buttons clickable by default */
  cursor: pointer;
  /* Remove default button padding */
  padding: 0;
}

input, textarea, select {
  /* Prevent zoom on iOS when focusing */
  font-size: 16px;
}

/* Remove default number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ============================
   Table Reset
   ============================ */

table {
  /* Remove default spacing */
  border-collapse: collapse;
  border-spacing: 0;
}

/* ============================
   Embedded Content Reset
   ============================ */

iframe {
  /* Remove default border */
  border: 0;
}

/* ============================
   Accessibility Helpers
   ============================ */

/* Screen reader only content */
.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;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ============================
   Print Styles
   ============================ */

@media print {
  /* Optimize for printing */
  *,
  *::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;
  }

  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }

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