/* ==========================================================================
   Modern CSS Reset — TCG Store
   Based on Josh Comeau's reset + custom additions
   ========================================================================== */

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

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

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

/* 4. Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

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

/* 9. List resets */
ul,
ol {
  list-style: none;
}

/* 10. Anchor resets */
a {
  color: inherit;
  text-decoration: none;
}

/* 11. Table resets */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 12. Button resets */
button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* 13. Fieldset resets */
fieldset {
  border: none;
}

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

/* 15. Select appearance */
select {
  -webkit-appearance: none;
  appearance: none;
}

/* 16. Remove inner border and padding in Firefox */
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/* 17. Correct cursor for clickable types */
[type="button"],
[type="reset"],
[type="submit"],
button {
  cursor: pointer;
}

/* 18. Make sure disabled elements clearly communicate their state */
[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* 19. Keyboard focus styles — only show for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* 20. Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 21. Remove search input styling */
[type="search"] {
  -webkit-appearance: none;
  outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* 22. Scrollbar styling (Webkit) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* 23. Selection colors */
::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* 24. Horizontal rule */
hr {
  height: 1px;
  background: var(--color-border);
  border: none;
}

/* 25. SVG default fill */
svg {
  fill: currentColor;
}

/* 26. Abbreviation */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* 27. Code elements */
code,
kbd,
samp,
pre {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
}

/* 28. Sub and sup positioning */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* 29. Details / summary */
details > summary {
  cursor: pointer;
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* 30. Dialog reset */
dialog {
  padding: 0;
  border: none;
  background: transparent;
}
