/* ==========================================================================
   IEEB Theme - Sistema de Diseño
   ========================================================================== */

/* Import Component Styles */
@import url('header-footer.css');
@import url('homepage.css');
@import url('blocks.css');
@import url('responsive.css');
@import url('search.css');

/* Variables CSS
   ========================================================================== */
:root {
  /* Colores principales */
  --color-primary: #6B9F3F;
  --color-primary-dark: #5A8835;
  --color-primary-light: #8AB55C;
  --color-secondary: #2C5F41;
  --color-accent: #F4A261;
  
  /* Colores neutros */
  --color-white: #FFFFFF;
  --color-black: #1A1A1A;
  --color-gray-100: #F8F9FA;
  --color-gray-200: #E9ECEF;
  --color-gray-300: #DEE2E6;
  --color-gray-400: #CED4DA;
  --color-gray-500: #ADB5BD;
  --color-gray-600: #6C757D;
  --color-gray-700: #495057;
  --color-gray-800: #343A40;
  --color-gray-900: #212529;
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #6B9F3F 0%, #8AB55C 100%);
  --gradient-hero: linear-gradient(180deg, rgba(107, 159, 63, 0.9) 0%, rgba(44, 95, 65, 0.9) 100%);
  
  /* Tipografía */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-secondary: Georgia, "Times New Roman", serif;
  
  /* Tamaños de fuente - Mobile first */
  --fs-xs: 0.75rem;     /* 12px */
  --fs-sm: 0.875rem;    /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-lg: 1.125rem;    /* 18px */
  --fs-xl: 1.25rem;     /* 20px */
  --fs-2xl: 1.5rem;     /* 24px */
  --fs-3xl: 1.875rem;   /* 30px */
  --fs-4xl: 2.25rem;    /* 36px */
  --fs-5xl: 3rem;       /* 48px */
  
  /* Line heights */
  --lh-tight: 1.2;
  --lh-base: 1.5;
  --lh-relaxed: 1.75;
  
  /* Espaciado */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */
  
  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Transiciones */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* 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 Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--color-gray-900);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

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

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

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

button {
  cursor: pointer;
  font-family: inherit;
}

/* Utility Classes
   ========================================================================== */
.container {
  width: 100%;
  padding-right: var(--space-md);
  padding-left: var(--space-md);
  margin-right: auto;
  margin-left: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 2px solid transparent;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  color: var(--color-white);
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  text-decoration: none;
}

.btn-secondary {
  color: var(--color-primary);
  background-color: var(--color-white);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  color: var(--color-white);
  background-color: var(--color-primary);
  text-decoration: none;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-lg);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--fs-sm);
}

.btn-full {
  width: 100%;
}

/* Grid System
   ========================================================================== */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 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); }

/* Flexbox Utilities
   ========================================================================== */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Text Utilities
   ========================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-muted { color: var(--color-gray-600); }
.text-white { color: var(--color-white); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

/* Spacing Utilities
   ========================================================================== */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mb-sm { margin-bottom: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.py-3xl { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }

/* Background Utilities
   ========================================================================== */
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-light { background-color: var(--color-gray-100); }
.bg-white { background-color: var(--color-white); }
.bg-gradient { background: var(--gradient-primary); }

/* Media Queries - Tablet
   ========================================================================== */
@media (min-width: 768px) {
  :root {
    --fs-base: 1.0625rem;  /* 17px */
    --fs-lg: 1.25rem;      /* 20px */
    --fs-xl: 1.5rem;       /* 24px */
    --fs-2xl: 1.875rem;    /* 30px */
    --fs-3xl: 2.25rem;     /* 36px */
    --fs-4xl: 3rem;        /* 48px */
    --fs-5xl: 3.75rem;     /* 60px */
  }
  
  .container {
    padding-right: var(--space-xl);
    padding-left: var(--space-xl);
  }
  
  /* Tablet grid */
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  
  /* Tablet display */
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:flex { display: flex; }
}

/* Media Queries - Desktop
   ========================================================================== */
@media (min-width: 1024px) {
  :root {
    --fs-base: 1.125rem;   /* 18px */
    --fs-lg: 1.375rem;     /* 22px */
    --fs-xl: 1.625rem;     /* 26px */
    --fs-2xl: 2rem;        /* 32px */
    --fs-3xl: 2.5rem;      /* 40px */
    --fs-4xl: 3.5rem;      /* 56px */
    --fs-5xl: 4rem;        /* 64px */
  }
  
  .container {
    max-width: 1200px;
  }
  
  /* Desktop grid */
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
  
  /* Desktop display */
  .lg\:block { display: block; }
  .lg\:hidden { display: none; }
  .lg\:flex { display: flex; }
}

/* Wide Desktop
   ========================================================================== */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* Animations
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-fadeIn {
  animation: fadeIn var(--transition-base) ease-in-out;
}

.animate-slideInUp {
  animation: slideInUp var(--transition-slow) ease-out;
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Card Component
   ========================================================================== */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card__image {
  position: relative;
  padding-top: 66.67%; /* 3:2 Aspect Ratio */
  overflow: hidden;
  background-color: var(--color-gray-200);
}

.card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card__image img {
  transform: scale(1.05);
}

.card__content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  color: var(--color-gray-600);
  font-size: var(--fs-sm);
}

.card__date,
.card__year {
  font-weight: 500;
  color: var(--color-primary);
}

.card__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-md);
  line-height: var(--lh-tight);
}

.card__title a {
  color: var(--color-gray-900);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.card__excerpt {
  color: var(--color-gray-700);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-lg);
  flex: 1;
}

.card__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: auto;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
  font-size: var(--fs-xs);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.tag:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Card Variations */
.card--evento .card__date {
  color: var(--color-accent);
  font-size: var(--fs-base);
  font-weight: 600;
}

.card--noticia .card__image {
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

/* Hero Component
   ========================================================================== */
.hero {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-color: var(--color-gray-100);
  padding: var(--space-3xl) 0;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-hero);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero__content {
  max-width: 800px;
}

.hero--centered {
  text-align: center;
  min-height: 500px;
}

.hero--centered .hero__content {
  margin: 0 auto;
}

.hero__title {
  color: var(--color-white);
  font-size: var(--fs-4xl);
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero__subtitle {
  color: var(--color-white);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-xl);
  opacity: 0.95;
}

.hero__actions {
  margin-top: var(--space-xl);
}

/* Breadcrumbs
   ========================================================================== */
.breadcrumbs {
  margin-bottom: var(--space-lg);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-sm);
}

.breadcrumbs__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.breadcrumbs__item:not(:last-child)::after {
  content: "›";
  color: var(--color-gray-400);
}

.breadcrumbs__item a {
  color: var(--color-white);
  opacity: 0.8;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.breadcrumbs__item a:hover {
  opacity: 1;
  text-decoration: underline;
}

.breadcrumbs__item [aria-current="page"] {
  color: var(--color-white);
  font-weight: 500;
}

/* Section Component
   ========================================================================== */
.section {
  position: relative;
  overflow: hidden;
}

.section--sm { padding: var(--space-xl) 0; }
.section--md { padding: var(--space-2xl) 0; }
.section--lg { padding: var(--space-3xl) 0; }
.section--xl { padding: var(--space-4xl) 0; }
.section--2xl { padding: calc(var(--space-4xl) * 1.5) 0; }
.section--3xl { padding: calc(var(--space-4xl) * 2) 0; }

.section__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.section .container {
  position: relative;
  z-index: 2;
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section__title {
  font-size: var(--fs-3xl);
  color: var(--color-gray-900);
  margin-bottom: var(--space-md);
}

.section__subtitle {
  font-size: var(--fs-lg);
  color: var(--color-gray-600);
  max-width: 600px;
  margin: 0 auto;
  line-height: var(--lh-relaxed);
}

/* Background Variations */
.section[style*="background-image"] {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.section.bg-light {
  background-color: var(--color-gray-100);
}

.section.bg-primary .section__title,
.section.bg-primary .section__subtitle {
  color: var(--color-white);
}

/* Responsive Adjustments
   ========================================================================== */
@media (min-width: 768px) {
  .hero {
    min-height: 500px;
    padding: var(--space-4xl) 0;
  }
  
  .hero--centered {
    min-height: 600px;
  }
  
  .card__content {
    padding: var(--space-xl);
  }
  
  .section__header {
    margin-bottom: var(--space-3xl);
  }
}

@media (min-width: 1024px) {
  .hero {
    min-height: 600px;
  }
  
  .hero--centered {
    min-height: 700px;
  }
  
  .hero__title {
    font-size: var(--fs-5xl);
  }
  
  .section__title {
    font-size: var(--fs-4xl);
  }
}