/* base.css — reset, tokens, typography */

:root {
  --color-bg-primary: #1B3A2E;   /* header, footer, hero */
  --color-surface: #234A3A;      /* cards */
  --color-accent: #D98E3E;       /* buttons, active elements */
  --color-bg-light: #F6F4EC;     /* text pages */
  --color-text-light: #171E1A;   /* body text on light bg */
  --color-text-dark: #EAF1EC;    /* body text on dark bg */
  --color-warning: #B4531F;      /* excede presupuesto */
  --color-success: #2C6E5B;      /* dentro del presupuesto */

  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --radius-md: 10px;
  --radius-sm: 6px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg-light);
  color: var(--color-text-light);
  line-height: 1.6;
  font-size: 1rem;
}

/* Hide main until the age gate decides, to avoid a flash of content */
html.js-pending main,
html.js-pending .site-footer,
html.js-pending #cookie-banner {
  visibility: hidden;
}
html.age-ok main,
html.age-ok .site-footer {
  visibility: visible;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text-light);
  margin-top: 0;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: var(--space-4); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 var(--space-2) 0; }

a {
  color: var(--color-success);
  text-decoration-thickness: 1px;
}
a:hover { color: var(--color-warning); }

ul, ol {
  padding-left: 1.4rem;
}

code {
  background: rgba(27, 58, 46, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: var(--color-text-light);
  padding: 0.5rem 1rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Visible focus for every interactive element (WCAG 2.1 AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
