/**
 * AGRICOL TERRANOVA - BASE & RESET
 * Estilos base, reseteo moderno y accesibilidad
 */

/* Reseteo Box-Sizing */
*, *::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) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-neutral-900);
  background-color: var(--color-neutral-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link para lectores de pantalla y navegación por teclado */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background-color: var(--color-primary-900);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  font-weight: var(--font-weight-bold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 9999;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-accent-500);
  outline-offset: 2px;
}

/* Indicador de foco accesible */
:focus-visible {
  outline: 3px solid var(--color-primary-600);
  outline-offset: 3px;
}

/* Elementos de tipografía */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  color: var(--color-primary-900);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, var(--font-size-5xl)); margin-bottom: var(--space-4); }
h2 { font-size: clamp(1.75rem, 4vw, var(--font-size-3xl)); margin-bottom: var(--space-3); }
h3 { font-size: clamp(1.35rem, 3vw, var(--font-size-2xl)); margin-bottom: var(--space-3); }
h4 { font-size: var(--font-size-xl); margin-bottom: var(--space-2); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); text-transform: uppercase; letter-spacing: 0.05em; }

p {
  margin-bottom: var(--space-4);
  color: var(--color-neutral-700);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary-700);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-900);
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* Clases de utilidad */
.container {
  width: 100%;
  max-width: var(--container-max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section-py {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .section-py {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }
}

.section-title-wrap {
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-12);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-primary-100);
  color: var(--color-primary-800);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-neutral-600);
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.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;
}

.bg-surface { background-color: var(--color-surface); }
.bg-subtle  { background-color: var(--color-neutral-50); }
.bg-primary-dark {
  background-color: var(--color-primary-900);
  color: #ffffff;
}
.bg-primary-dark h1,
.bg-primary-dark h2,
.bg-primary-dark h3,
.bg-primary-dark p {
  color: #ffffff;
}

.divider {
  height: 1px;
  background-color: var(--color-neutral-200);
  margin: var(--space-8) 0;
  border: none;
}
