/* =========================================================
   COMPREHENSIVE CSS RESET
   - Modern reset + sane defaults
   - Safe for Next.js global usage
   - Includes form/control normalization + media defaults
   ========================================================= */

/* 1) Box sizing: include padding/border in element size */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2) Remove default margin */
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* 3) Improve text rendering & base behaviors */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Better tab size in code blocks */
  tab-size: 2;
}

/* 4) Body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

/* 5) Remove list styles on ul/ol with role=list (recommended pattern) */
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 6) Default link styling (keeps inheritance; you can style later) */
a {
  color: inherit;
  text-decoration: inherit;
}

/* 7) Make images/media easier to work with */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* SVG overflow fix (esp. Safari) */
svg {
  overflow: visible;
}

/* 8) Inputs and buttons inherit font */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* 9) Remove default button styling issues */
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* 10) Normalize form controls */
textarea {
  resize: vertical; /* vertical only is usually best */
}

select {
  background: none;
}

/* Remove default fieldset styling */
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* 11) Tables: remove gaps and make predictable */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 12) Horizontal rule normalization */
hr {
  border: 0;
  border-top: 1px solid currentColor;
  opacity: 0.2;
  margin: 0;
}

/* 13) Monospace: normalize code-like elements */
pre,
code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 1em;
}

/* Prevent pre overflow surprises */
pre {
  white-space: pre;
  overflow: auto;
}

/* 14) Headings: prevent huge default sizes (you can define your own scale) */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/* 15) Strong/em emphasis normalization */
b,
strong {
  font-weight: bolder;
}

/* 16) Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 17) Focus styles: keep accessibility (don’t remove outlines) */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* 18) Prevent iOS tap highlight / improve touch behaviors */
a,
button,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

/* 19) Text selection: inherit (optional; easy to override) */
::selection {
  background: rgba(0, 0, 0, 0.2);
}

/* 20) Make root stacking context predictable */
#root,
#__next {
  isolation: isolate;
}

/* 21) Details/summary normalization */
summary {
  cursor: pointer;
}

/* 22) Address “hidden” attribute consistency */
[hidden] {
  display: none !important;
}
