/**
 * Kayla Kamm Studio - Modern CSS Reset
 *
 * A thoughtful CSS reset that removes browser inconsistencies while
 * preserving accessibility and usability.
 */

/* ===============================================
   BOX SIZING - Apply border-box universally
   =============================================== */

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

/* ===============================================
   REMOVE DEFAULT MARGINS & PADDING
   =============================================== */

* {
  margin: 0;
  padding: 0;
}

/* ===============================================
   HTML & BODY - Foundation
   =============================================== */

html {
  /* Smooth scrolling for anchor links (respects reduced-motion below) */
  scroll-behavior: smooth;

  /* Prevent font scaling in landscape on iOS */
  -webkit-text-size-adjust: 100%;

  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* Default line-height for readability */
  line-height: 1.5;

  /* Remove default body margin */
  margin: 0;

  /* Minimum body height */
  min-height: 100vh;

  /* Improve text rendering on mobile */
  text-rendering: optimizeSpeed;
}

/* ===============================================
   TYPOGRAPHY - Normalize defaults
   =============================================== */

/* Remove default margins on typography elements */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl,
figure, hr {
  margin: 0;
  padding: 0;
}

/* Improve heading line-height */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: normal; /* Will be set via design system */
}

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

/* Improve quote styling */
blockquote {
  quotes: none;
}

blockquote::before,
blockquote::after {
  content: '';
  content: none;
}

/* ===============================================
   MEDIA ELEMENTS - Images, Video, Canvas
   =============================================== */

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

/* Remove border on images inside links */
img {
  border-style: none;
}

/* SVG icons inherit parent color */
svg {
  fill: currentColor;
}

/* ===============================================
   FORM ELEMENTS - Normalize inputs
   =============================================== */

/* Remove default form element styling */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

/* Normalize button appearance */
button {
  cursor: pointer;
  border: none;
  background-color: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
}

/* Remove default button focus outline (we'll add custom focus styles) */
button:focus {
  outline: none;
}

/* Restore button functionality */
button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/* Remove spinner on number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Normalize textarea */
textarea {
  overflow: auto;
  resize: vertical;
}

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

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

/* ===============================================
   LINKS - Normalize anchor elements
   =============================================== */

a {
  color: inherit;
  text-decoration: none;
}

a:not([class]) {
  /* Restore underline for text links without classes (accessibility) */
  text-decoration-skip-ink: auto;
}

/* ===============================================
   TABLES - Basic normalization
   =============================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ===============================================
   ACCESSIBILITY - Focus & Reduced Motion
   =============================================== */

/* Remove all animations, transitions and smooth scroll 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;
  }
}

/* Ensure focus is visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Remove focus outline for mouse users (will be overridden by :focus-visible) */
*:focus:not(:focus-visible) {
  outline: none;
}

/* ===============================================
   UTILITY - Hidden elements
   =============================================== */

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

/* Make sr-only visible on focus (for skip links) */
.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ===============================================
   MISC - Additional normalizations
   =============================================== */

/* Ensure consistent line-box model */
::before,
::after {
  text-decoration: inherit;
  vertical-align: inherit;
}

/* Remove border on iframe */
iframe {
  border: 0;
}

/* Normalize horizontal rule */
hr {
  border: 0;
  border-top: 1px solid;
  color: inherit;
  height: 0;
  overflow: visible;
}

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

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

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Add cursor pointer to summary elements */
summary {
  cursor: pointer;
}

/* Ensure consistent display of template element */
template {
  display: none;
}

/* Remove tap highlight on mobile */
a,
button,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
