/**
 * CSS Reset & Normalize
 * Ensures consistent rendering across browsers
 */

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

/* Remove default margins and padding */
* {
  margin: 0;
  padding: 0;
}

/* HTML & Body */
html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 50px);
}

body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  /* Prevent font size adjustment on iOS */
  -webkit-text-size-adjust: 100%;
  /* Smooth scrolling */
  scroll-behavior: smooth;
}

body {
  line-height: var(--line-height-normal);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

p, ul, ol {
  margin-bottom: var(--spacing-md);
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Lists */
ul, ol {
  list-style: none;
}

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

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

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

input:focus, textarea:focus, select:focus, button:focus {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* Disable default input styles */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

/* Number input - hide 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;
}

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

/* Remove built-in form typography */
button, input, optgroup, select, textarea {
  margin: 0;
}

/* Prevent textarea resize horizontally */
textarea {
  resize: vertical;
}

/* Misc */
hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-lg) 0;
}
