/* ==========================================================================
   Modern CSS Reset — Rehab Website Factory (2025-2026)
   Based on Andy Bell's Modern Reset + Josh Comeau's Custom Reset
   Updated with modern standards: color-scheme, dialog, popover, text-wrap
   ========================================================================== */

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

/* Enable light/dark color scheme at the root level */
:root {
  color-scheme: light dark;
}

/* Allow animating to/from intrinsic sizing keywords (e.g., height: auto) */
@supports (interpolate-size: allow-keywords) {
  :root {
    interpolate-size: allow-keywords;
  }
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin/padding */
body, h1, h2, h3, h4, h5, h6, p,
figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

/* Remove list styles on ul, ol with role="list" */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
  line-height: 1.2;
}

/* Balance text wrapping on headings */
h1, h2, h3, h4 {
  text-wrap: balance;
}

/* Pretty text wrapping on paragraphs and long-form content */
p, li, dd, figcaption, blockquote {
  text-wrap: pretty;
}

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

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

/* Inherit fonts for inputs and buttons */
input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-top: 5ex;
}

/* --------------------------------------------------------------------------
   Modern element resets: dialog, popover, details/summary
   -------------------------------------------------------------------------- */

/* Reset dialog element */
dialog {
  border: none;
  padding: 0;
  margin: auto;
  background: none;
  max-width: unset;
  max-height: unset;
  overflow: visible;
  color: inherit;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

/* Reset popover elements */
[popover] {
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  overflow: visible;
  inset: unset;
}

/* Details/summary reset for consistent cross-browser behavior */
details > summary {
  list-style: none;
  cursor: pointer;
}

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

details > summary::marker {
  content: '';
}

/* --------------------------------------------------------------------------
   Reduced motion — respect user preferences
   -------------------------------------------------------------------------- */
@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;
  }
}
