/*
 * Modern CSS Reset
 * Combines Josh Comeau's Custom CSS Reset and Andy Bell's Modern CSS Reset
 * 
 * Based on:
 * - https://www.joshwcomeau.com/css/custom-css-reset/
 * - https://piccalil.li/blog/a-more-modern-css-reset/
 */

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

/* 4. Add accessible line-height and improve text rendering */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* 6. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 7. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
  text-wrap: pretty;
}

/* 9. Create a root stacking context */
#root, #__next {
  isolation: isolate;
}

/* 10. Remove list styles on ul, ol elements with a list role */
ul,
ol {
  list-style: none;
  padding: 0;
}

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

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

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

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

/* 15. 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;
  }
}

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

/* 17. Focus styles */
:focus {
  outline: 2px solid var(--focus-color, currentColor);
  outline-offset: 2px;
}

/* 18. Remove focus styles for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* 19. Ensure consistent sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 20. Remove default fieldset styles */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* 21. Allow percentage-based heights */
html,
body {
  height: 100%;
}

p {
  text-wrap: pretty;
}

/* 23. Improve readability of focused elements */
:focus-visible {
  outline: 2px solid var(--focus-color, currentColor);
  outline-offset: 2px;
}

/* 24. Ensure consistent cursor for interactive elements */
[role="button"],
button,
[type="button"],
[type="submit"],
[type="reset"] {
  cursor: pointer;
}

/* 25. Improve contrast for disabled elements */
:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

/* 27. Remove default quote styles */
blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: '';
  content: none;
}

/* 28. Remove default address styles */
address {
  font-style: normal;
}

/* 29. Improve form element consistency */
input[type="search"] {
  -webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* 30. Remove default details marker */
details {
  display: block;
}

summary {
  display: list-item;
  cursor: pointer;
}

/* 31. Improve dialog defaults */
dialog {
  border: none;
  padding: 0;
  background: transparent;
}

/* 32. Remove default meter and progress styles */
meter,
progress {
  -webkit-appearance: none;
  appearance: none;
}

/* 33. Improve select element styling */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
}

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

/* 35. Improve link accessibility */
a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: none;
}

/* 36. Remove default mark styles */
mark {
  background: transparent;
  color: inherit;
}

/* 37. Improve small text readability */
small {
  font-size: 0.875em;
}

/* 38. Remove default sub and sup positioning */
sub,
sup {
  position: static;
  font-size: 0.75em;
  line-height: 0;
  vertical-align: baseline;
}

/* 39. Improve code element styling */
code,
kbd,
samp {
  font-family: monospace;
  font-size: 1em;
}

/* 40. Remove default pre formatting */
pre {
  overflow: auto;
  white-space: pre;
}

/* 41. Improve hr styling */
hr {
  border: none;
  border-top: 1px solid currentColor;
  margin: 1em 0;
}

/* 42. Remove default legend styles */
legend {
  padding: 0;
  border: none;
}

/* 43. Improve fieldset styling */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* 44. Remove default optgroup styling */
optgroup {
  font-weight: normal;
}

/* 45. Improve option styling */
option {
  background: transparent;
  color: inherit;
}

/* 46. Remove default datalist styling */
datalist {
  display: none;
}

/* 47. Improve output element styling */
output {
  display: inline;
}

/* 48. Remove default ruby styling */
ruby {
  ruby-align: start;
}

/* 49. Improve rt element styling */
rt {
  font-size: 0.5em;
  line-height: 1;
}

/* 50. Remove default rp styling */
rp {
  display: none;
}
