
/* ==========================================================================
   base.css
   MR. MA RENOVATION - Reset and basic element styling.
   Depends on: tokens.css (must be loaded first)
   ========================================================================== */

/* ---------- Simple reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-body);
  color: var(--color-slate);
  background-color: var(--color-warm-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Media ---------- */
img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Headings ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--color-charcoal);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

/* ---------- Text ---------- */
p {
  max-width: 65ch; /* keeps lines readable */
}

a {
  color: var(--color-copper);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-copper-dark);
}

ul,
ol {
  padding-left: 1.25rem;
}

/* Small uppercase label used above headings */
.label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-copper);
}

/* ---------- Form elements inherit fonts ---------- */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- Accessibility: focus ---------- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* Text selection colour */
::selection {
  background-color: var(--color-gold);
  color: var(--color-navy);
}

/* Visually hidden, but still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: appears when a keyboard user presses Tab */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-3);
  z-index: 1000;
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-navy);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
