/* Modern CSS Reset - 2024 Best Practices */

/* 1. Use a more reasonable reset - only reset what's necessary */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin and padding from common elements */
body,
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
dl, dd, ol, ul, figure,
hr, fieldset, legend {
  margin: 0;
  padding: 0;
}

/* 3. Set up the document */
html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
}

body {
  font-size: clamp(1.2rem, 4vw, 1.4rem);
  line-height: 1.6;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 4. Remove list styles on ul, ol elements with a list role */
ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding-inline-start: 0;
}

:is(ul[role='list'], ol[role='list']) a {
  color: inherit;
  text-decoration: none;
}



/* 5. Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
}

/* 6. A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* 7. Make images easier to work with */
img,
picture,
svg {
  max-width: 100%;
  display: block;
}

/* 8. Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* 9. Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

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

/* 10. Focus management */
:focus-visible {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* 11. Button reset */
button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* 12. Remove webkit search input styling */
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;
}

/* 13. Autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  box-shadow: 0 0 0px 1000px var(--extra-light-gray, #f8f9fa) inset !important;
  -webkit-text-fill-color: #000 !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* 14. Textarea styling */
textarea {
  max-width: 100%;
  resize: vertical;
}

/* 15. Utility classes */
.d-none {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 16. Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}
