/* ============================================================
   base.css — Trail Monkeys Rosenheim
   Reset, typography defaults, global element styles.
   ============================================================ */

/* --- Box model reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Document --- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-white);
  min-height: 100vh;
}

/* --- Skip link (accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-weight: var(--fw-bold);
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: var(--space-2);
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* --- Body text --- */
p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-loose);
  color: var(--color-text);
}
p:last-child { margin-bottom: 0; }

/* --- Links --- */
a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
a:hover { color: var(--color-primary-hover); }
a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Lists --- */
ul, ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}
li { margin-bottom: var(--space-2); }

/* --- Images --- */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* --- Form elements --- */
input, button, textarea, select {
  font: inherit;
}

/* --- Tables --- */
table {
  border-collapse: collapse;
  width: 100%;
}

/* --- Horizontal rule --- */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* --- Focus ring (global, accessible) --- */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- Utility: visually hidden (screen-reader only) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Responsive images --- */
.img-responsive {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* --- Section spacing --- */
.section {
  padding: var(--space-16) var(--space-6);
}
.section--alt {
  background-color: var(--color-light);
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ---- RESPONSIVE GLOBALS ---- */

/* Scale down section padding and headings on smaller screens */
@media (max-width: 768px) {
  .section {
    padding: var(--space-10) var(--space-4);
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .container {
    padding: 0 var(--space-4);
  }
}

@media (max-width: 480px) {
  .section {
    padding: var(--space-8) var(--space-4);
  }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }

  .container {
    padding: 0 var(--space-3);
  }
}
