/* ============================================
   CSS Reset & Normalize
   Dependable Auto Repair Website
   ============================================ */

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

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

/* Set core root defaults */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

html:focus-within {
  scroll-behavior: smooth;
}

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

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

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

/* 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: inherit;
  color: inherit;
}

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

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

/* Remove default anchor styles */
a {
  text-decoration: none;
  color: inherit;
}

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

/* Remove default fieldset styles */
fieldset {
  border: none;
}

/* Remove default legend styles */
legend {
  padding: 0;
}

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

/* Remove default input number spinners */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}

/* Remove default search input styles */
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Improve consistency of default fonts */
code,
kbd,
samp,
pre {
  font-family: monospace, monospace;
  font-size: 1em;
}

/* Prevent sub and sup affecting line-height */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

/* Remove default hr styles */
hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
  border: 0;
  border-top: 1px solid;
  margin: 1em 0;
}

/* Improve readability of pre-formatted text */
pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Make sure disabled elements are not clickable */
[disabled] {
  cursor: not-allowed;
}

/* Remove default focus outline and add custom one */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary, #1a365d);
  outline-offset: 2px;
}

/* Improve consistency of cursor styles */
button,
[role='button'],
input[type='submit'],
input[type='button'],
input[type='reset'] {
  cursor: pointer;
}

button:disabled,
[role='button']:disabled,
input[type='submit']:disabled,
input[type='button']:disabled,
input[type='reset']:disabled {
  cursor: not-allowed;
}

/* Hidden attribute */
[hidden] {
  display: none !important;
}

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary, #1a365d);
  color: var(--color-white, #ffffff);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}
