/* ==================================================
   BASE STYLES — RESET + TYPOGRAPHY + ACCESSIBILITY
   WCAG 2.1 AA COMPLIANT
================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ================================
   BODY FOUNDATION
================================ */

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-green-dark);
  background: linear-gradient(
    135deg,
    #fef3cd 0%,
    #fdebc2 50%,
    #fcf0c8 100%
  );
  background-attachment: fixed;
}


/* ================================
   SKIP LINK (ACCESSIBILITY)
================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--color-green-dark);
  color: var(--color-lemon);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 6px 6px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: var(--focus-outline-width) solid var(--color-focus);
  outline-offset: var(--focus-outline-offset);
}

@media (prefers-reduced-motion: reduce) {
  .skip-link:focus {
    transition: none;
  }
}

/* ================================
   GLOBAL FOCUS (WCAG SAFE)
================================ */

:focus {
  outline: none;
}

:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-green-dark);
  outline-offset: var(--focus-outline-offset);
}

/* ================================
   TYPOGRAPHY
================================ */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem;      /* ✅ Smaller gap everywhere */
  line-height: var(--line-height-tight);
  font-weight: 700;
  color: var(--color-green-dark);
}


h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.4rem; }
h4, h5, h6 { font-size: 1.2rem; }

p {
  margin: 0 0 1rem;
}

/* ================================
   LINKS
================================ */

a {
  color: var(--color-green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

a:hover {
  color: var(--color-lemon);
}

a:visited {
  color: var(--color-green-dark);
}

/* ================================
   MEDIA
================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

/* ================================
   FORM & BUTTON NORMALIZATION
================================ */

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  min-height: var(--tap-target-min);
}

button {
  min-width: var(--tap-target-min);
}

/* ================================
   VISUALLY HIDDEN (SCREEN READERS)
================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ================================
   REDUCED MOTION GLOBAL SAFETY
================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
