/*
  JADE Senior Care Services - CSS Reset
  A modern, accessible CSS reset for consistent cross-browser styling
*/

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

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

/* Root element styling */
html {
  font-size: 16px; /* Base font size */
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Body defaults */
body {
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Ubuntu', 'Cantarell', 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-weight: 400;
  color: var(--text-dark);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

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

/* Remove default list styling */
ul,
ol {
  list-style: none;
}

/* Set core body defaults for accessibility */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.6;
}

/* Make images responsive and prevent overflow */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

/* Remove default button styling */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove default styling for links */
a {
  color: inherit;
  text-decoration: none;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--jade-primary);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure focus styles for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--jade-primary);
  outline-offset: 2px;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Form elements */
fieldset {
  border: none;
}

/* Remove default styles for headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit;
  line-height: 1.2;
}

/* Remove default paragraph margins */
p {
  margin: 0;
}

/* Make sure text areas resize vertically only */
textarea {
  resize: vertical;
}

/* Prevent horizontal scroll on small screens */
html,
body {
  overflow-x: hidden;
}

/* Skip links for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--jade-primary);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  font-weight: 600;
  transition: top 0.3s ease;
}

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

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

/* Remove animations for users who prefer reduced motion */
@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;
  }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
  /* Ensure better contrast for interactive elements */
  button,
  a,
  input,
  select,
  textarea {
    border: 1px solid;
  }
}