/**
 * PK TimberCraft - Complete Universal CSS Reset & Normalization
 *
 * Combines cross-browser normalization with a modern CSS reset.
 * Eliminates browser quirks, purple visited links, inconsistent box-sizing,
 * unexpected margins, and legacy form styles.
 *
 * @package pk
 * @version 1.0.0
 */

/* ==========================================================================
   1. Universal Box Sizing & Pseudo Elements
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   2. HTML & Document Setup
   ========================================================================== */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  line-height: 1.6;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   3. Universal Link Reset (No purple, no blue, clean inheritance)
   ========================================================================== */
a,
a:link,
a:visited {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a:hover,
a:active,
a:focus {
  color: inherit;
  text-decoration: none;
  outline: none;
}

/* ==========================================================================
   4. Typography & Headings Reset
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
  overflow-wrap: break-word;
}

p,
blockquote,
figure,
figcaption,
dl,
dd {
  margin: 0;
  overflow-wrap: break-word;
}

/* ==========================================================================
   5. Lists Reset
   ========================================================================== */
ul,
ol,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   6. Media Elements (Defensive Responsive Sizing)
   ========================================================================== */
img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

svg:not([fill="none"]) {
  fill: currentColor;
}

/* ==========================================================================
   7. Form Controls & Buttons
   ========================================================================== */
input,
button,
textarea,
select,
optgroup {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  border-radius: 0;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background-color: transparent;
  border: none;
  padding: 0;
}

[role="button"],
.button {
  -webkit-tap-highlight-color: transparent;
}

textarea {
  resize: vertical;
}

/* Clean accessible focus indicators */
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--color-timber-accent, #c4a574);
  outline-offset: 2px;
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible {
  outline: none;
  box-shadow: none;
}

/* ==========================================================================
   8. Tables
   ========================================================================== */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* ==========================================================================
   9. Accessibility (Respect User Motion 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;
  }
}
