/**
 * Main CSS - Variables, Reset y Estilos Base
 * Sol de Otoño Theme
 */

/* ============================================
   CSS Variables (Custom Properties)
   ============================================ */
:root {
  /* Nueva Paleta de Colores - HSL */
  --background: 40 25% 97%;
  --foreground: 30 25% 20%;
  --card: 0 0% 100%;
  --card-foreground: 30 25% 20%;
  --popover: 0 0% 100%;
  --popover-foreground: 30 25% 20%;
  --primary: 42 45% 42%;
  --primary-foreground: 40 30% 98%;
  --secondary: 45 55% 85%;
  --secondary-foreground: 30 35% 25%;
  --muted: 40 20% 92%;
  --muted-foreground: 30 15% 50%;
  --accent: 120 35% 45%;
  --accent-foreground: 0 0% 100%;

  /* Colores Principales - Compatibilidad (Verde basado en accent) */
  --color-primary: hsl(120 35% 45%); /* Verde */
  --color-primary-dark: hsl(120 40% 35%);
  --color-primary-darker: hsl(120 45% 25%);
  --color-primary-light: hsl(120 30% 55%);

  --color-secondary: hsl(45 55% 85%);
  --color-secondary-dark: hsl(45 50% 75%);
  --color-secondary-light: hsl(45 60% 90%);

  /* Accent con transparencias */
  --color-accent: hsl(120 35% 45%);
  --color-accent-20: hsl(120 35% 45% / 0.2);
  --color-accent-30: hsl(120 35% 45% / 0.3);
  --color-accent-50: hsl(120 35% 45% / 0.5);

  /* Grises y Fondos */
  --color-dark: hsl(30 25% 20%);
  --color-gray: hsl(30 15% 50%);
  --color-gray-light: hsl(30 10% 60%);
  --color-gray-lighter: hsl(40 20% 92%);
  --color-gray-lightest: hsl(40 25% 97%);
  --color-white: hsl(0 0% 100%);

  /* Fondos según diseño */
  --bg-background: hsl(40 25% 97%);
  --bg-card: hsl(0 0% 100%);
  --border-border: hsl(40 15% 85%);

  /* Texto */
  --color-foreground: hsl(30 25% 20%);
  --color-muted-foreground: hsl(30 15% 50%);

  /* Colores de Estado */
  --color-success: #4caf50;
  --color-warning: #ff9800;
  --color-error: #f44336;
  --color-info: #2196f3;

  /* Tipografía */
  --font-primary: 'Playfair Display', Georgia, serif;
  --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;

  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-loose: 1.8;

  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 6rem;

  /* Bordes - Según guía (rounded-xl, rounded-2xl) */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px; /* rounded-lg */
  --border-radius-xl: 16px; /* rounded-xl */
  --border-radius-2xl: 24px; /* rounded-2xl */
  --border-radius-full: 9999px;

  /* Sombras - Según guía */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* Para hover de cards */

  /* Transiciones - Según guía (200-300ms) */
  --transition-fast: 200ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* Ancho Máximo - Según guía (max-w-6xl/7xl) */
  --container-max-width-6xl: 1152px; /* 72rem = max-w-6xl */
  --container-max-width-7xl: 1280px; /* 80rem = max-w-7xl */
  --container-max-width: var(--container-max-width-7xl);
  --container-padding: var(--spacing-md);

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================
   Reset y Normalización
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-secondary);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
  background-color: var(--color-white);
}

/* ============================================
   Tipografía Base
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-dark);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--spacing-md);
}

p.lead {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-loose);
}

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

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

strong,
b {
  font-weight: var(--font-weight-semibold);
}

em,
i {
  font-style: italic;
}

.font-playfair {
  font-family: var(--font-primary);
}

.font-sans {
  font-family: var(--font-secondary);
}

/* ============================================
   Listas
   ============================================ */
ul,
ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: var(--spacing-xs);
}

/* ============================================
   Imágenes
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.rounded-image {
  border-radius: var(--border-radius-lg);
}

/* ============================================
   Utilidades Generales
   ============================================ */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
}

.center {
  text-align: center;
}

/* ============================================
   Accesibilidad
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  :root {
    --container-padding: var(--spacing-lg);
    --spacing-xl: 2rem;
    --spacing-2xl: 2.5rem;
    --spacing-3xl: 3rem;
  }
}
