/* ============================================================
   BASE STYLES — Eco Landscape Care
   Reset, typography defaults, utility classes.
   ============================================================ */

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* ── Links ───────────────────────────────────────────────── */
a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary-hover);
}

/* ── Headings ────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--color-heading);
}

h1 { font-size: var(--text-h1); letter-spacing: var(--letter-spacing-display); }
h2 { font-size: var(--text-h2); letter-spacing: var(--letter-spacing-h2); font-weight: 600; }
h3 { font-size: var(--text-h3); letter-spacing: var(--letter-spacing-h3); font-weight: 600; }
h4 { font-size: var(--text-h4); font-family: var(--font-body); font-weight: 600; color: var(--color-heading); }
h5 { font-size: var(--text-h5); font-family: var(--font-body); font-weight: 500; color: var(--color-heading); }
h6 { font-size: var(--text-body-sm); font-family: var(--font-body); font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.1em; }

/* ── Focus ────────────────────────────────────────────────── */
:focus-visible {
  outline: var(--border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Container ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--space-container);
  margin-inline: auto;
  padding-inline: var(--space-gutter);
}

.container--narrow {
  max-width: var(--space-container-narrow);
}

.container--wide {
  max-width: var(--space-container-wide);
}

/* ── Section padding ─────────────────────────────────────── */
.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}

.section--bg        { background-color: var(--color-bg); }
.section--surface   { background-color: var(--color-surface); }
.section--sand      { background-color: var(--color-surface-sand); }
.section--dark      { background-color: var(--color-surface-dark); }
.section--olive     { background-color: var(--color-surface-olive); }

/* Dark section heading overrides — only for direct child headings, NOT for card elements */
.section--dark > .container > h2,
.section--dark > .container > h3,
.section--dark .section-header h2,
.section--dark .section-header h3 {
  color: var(--color-heading-inverse);
}

/* Dark section body text — ensures paragraphs and lists are readable on dark bg */
.section--dark .section-header p,
.section--dark > .container > p,
.section--dark > .container > ul,
.section--dark > .container > ol {
  color: var(--color-text-inverse-muted);
}

.section--olive > .container > h2,
.section--olive > .container > h3,
.section--olive .section-header h2,
.section--olive .section-header h3 {
  color: var(--color-heading-inverse);
}

/* ── Section Header pattern ──────────────────────────────── */
.section-header {
  margin-bottom: var(--space-7);
}

.section-header--center {
  text-align: center;
}

.section-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.section-eyebrow--inverse {
  color: var(--color-text-inverse-muted);
}

/* Signature hairline above headings */
.section-header__rule {
  display: block;
  width: 32px;
  height: 2px;
  background-color: var(--color-hairline);
  margin-bottom: var(--space-3);
}

.section-header--center .section-header__rule {
  margin-inline: auto;
}

/* ── Reveal on scroll ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Visually hidden (accessible) ───────────────────────── */
.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;
}

/* ── Image missing placeholder ───────────────────────────── */
.img-missing {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-surface-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: var(--text-body-sm);
  border-radius: var(--radius-lg);
}

/* ── Skip to main content ────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 999;
  background: var(--color-accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

/* ── Paragraph max-width ─────────────────────────────────── */
.reading-col p {
  max-width: 68ch;
}

/* ── List reset ──────────────────────────────────────────── */
.list-reset {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Flex helpers ────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* ── Text utilities ──────────────────────────────────────── */
.text-inverse         { color: var(--color-text-inverse); }
.text-inverse-muted   { color: var(--color-text-inverse-muted); }
.text-secondary       { color: var(--color-text-secondary); }
.text-accent          { color: var(--color-accent); }
.text-primary-color   { color: var(--color-primary); }
.font-heading         { font-family: var(--font-heading); }
.font-mono            { font-family: var(--font-mono); }
