/**
 * COOPCRECER JUNTOS - Hoja de Estilos Principal
 * Sistema de Diseño: Territorio Sostenible & Cooperativo
 * Paleta Oficial:
 *   - Verde Profundo Selva Chocó: #164A3A
 *   - Verde Natural / Ecológico: #2F6B4F
 *   - Oro Cooperativo: #C9A227
 *   - Acento Tierra / Territorio: #7A5C3E
 *   - Fondo Marfil Base: #F7F5EF
 *   - Blanco Puro: #FFFFFF
 *   - Texto Primario: #1F2933
 *   - Texto Secundario: #5B6470
 *   - Bordes Estructurales: #E5E1D8
 */

:root {
  /* Colores Principales */
  --color-primary: #755B00;
  --color-primary-gold: #C9A227;
  --color-primary-gold-hover: #B5911F;
  --color-primary-gold-light: #FFF9E6;
  --color-primary-gold-border: #E4C868;
  --color-primary-fixed: #FFE08E;
  --color-on-primary: #FFFFFF;
  --color-on-primary-dark: #1F2933;

  /* Verdes Institucionales */
  --color-secondary-green: #164A3A;
  --color-secondary-green-hover: #205E4B;
  --color-secondary-green-dark: #0F3328;
  --color-secondary-green-light: #EBF4F0;
  --color-tertiary-green: #2F6B4F;
  --color-tertiary-green-light: #EDF7ED;
  --color-tertiary-green-border: #A5D6A7;

  /* Tonos Tierra y Neutrales */
  --color-earth: #7A5C3E;
  --color-earth-light: #F4EFEB;
  --color-bg-base: #F7F5EF;
  --color-bg-white: #FFFFFF;
  --color-surface-container: #F6EAE0;
  --color-surface-container-low: #FFF1E7;
  --color-surface-container-high: #FFE3CB;

  /* Texto y Bordes */
  --color-text-main: #1F2933;
  --color-text-muted: #5B6470;
  --color-text-light: #F7F5EF;
  --color-border: #E5E1D8;
  --color-border-gold: rgba(201, 162, 39, 0.35);

  /* Estados y Alertas */
  --color-success: #2F6B4F;
  --color-success-bg: #EDF7ED;
  --color-error: #BA1A1A;
  --color-error-bg: #FFDAD6;

  /* Tipografías */
  --font-heading: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Espaciado */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2.5rem;    /* 40px */
  --space-2xl: 4rem;     /* 64px */
  --space-3xl: 6rem;     /* 96px */

  /* Contenedores */
  --container-max: 1280px;
  --container-narrow: 960px;
  --header-height: 76px;
  --topbar-height: 38px;

  /* Radios */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px 0 rgba(22, 74, 58, 0.06), 0 1px 2px -1px rgba(22, 74, 58, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(22, 74, 58, 0.08), 0 2px 4px -2px rgba(22, 74, 58, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(22, 74, 58, 0.12), 0 4px 6px -4px rgba(22, 74, 58, 0.08);
  --shadow-gold: 0 4px 14px 0 rgba(201, 162, 39, 0.25);

  /* Transiciones */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-main);
  background-color: var(--color-bg-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accesibilidad: Enlace de salto */
.skip-link {
  position: absolute;
  top: -999px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary-gold);
  color: var(--color-on-primary-dark);
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  z-index: 10000;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--color-secondary-green);
}

/* Focus Ring Global */
:focus-visible {
  outline: 2px solid var(--color-secondary-green);
  outline-offset: 2px;
}

/* Tipografía Base */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-secondary-green);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.25rem); }
h3 { font-size: clamp(1.25rem, 1.5vw + 0.25rem, 1.5rem); }
h4 { font-size: 1.125rem; font-weight: 600; }

p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

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

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

a:hover {
  color: var(--color-secondary-green);
}

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

ul, ol {
  list-style: none;
}

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

/* Contenedores y Secciones */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

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

.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

@media (min-width: 1024px) {
  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }
}

.section-bg-white {
  background-color: var(--color-bg-white);
}

.section-bg-alt {
  background-color: #F1ECE3;
}

.section-bg-green {
  background-color: var(--color-secondary-green);
  color: #FFFFFF;
}

.section-bg-green h1,
.section-bg-green h2,
.section-bg-green h3,
.section-bg-green h4 {
  color: #FFFFFF;
}

.section-bg-green p {
  color: rgba(255, 255, 255, 0.88);
}

/* Cabeceras de Sección */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-header.text-center {
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary-gold);
  margin-bottom: var(--space-xs);
}

.section-bg-green .section-eyebrow {
  color: var(--color-primary-fixed);
}

.section-title {
  margin-bottom: var(--space-sm);
}

.section-lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.section-bg-green .section-lead {
  color: rgba(255, 255, 255, 0.9);
}

/* Grillas del Sistema */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Alineación y Flexbox Utilitarios */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

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

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-heading { font-family: var(--font-heading); }

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