/* Custom Properties para un diseño premium y de alto contraste */
:root {
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --transition-speed: 0.3s;
  
  /* Ligh Mode Palette */
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  
  --brand-primary: #00772B; /* Verde logo corporativo */
  --brand-primary-hover: #008833;
  --brand-accent: #0b933a;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #111827;
    --surface-color: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #374151;
    
    --brand-primary: #10b981;
    --brand-primary-hover: #34d399;
    --brand-accent: #059669;
    
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  }
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
  overflow-x: hidden;
}

/* Typography Fluid (Scalable) */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 { font-size: clamp(1.5rem, 6vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 5vw, 1.8rem); }

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

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

/* Layout Responsivo */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background-color: color-mix(in srgb, var(--surface-color) 80%, transparent);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand-logo {
  height: 60px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  transition: all 0.3s ease;
}

@media (max-width: 600px) {
  .brand-logo {
    height: 30px;
    max-width: 220px;
  }
}

/* Menú Navegación */
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-weight: 600;
}

.nav-links a {
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Hamburger UI */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 30px;
  height: 3px;
  background-color: var(--brand-primary);
  border-radius: 4px;
  transition: all 0.3s ease;
}

/* Responsive Mobile Navigation */
@media (max-width: 1150px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none; /* Ocultación total por defecto */
    position: fixed;
    top: 80px; /* Debajo del header */
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: #ffffff !important; /* Blanco sólido según petición usuario */
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 999;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
  }

  .nav-links.active {
    display: flex; /* Mostrar solo cuando esté activo */
    animation: slideDown 0.3s ease forwards;
  }

  @keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    font-size: 1rem;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-links a:last-child {
    border-bottom: none;
    margin-top: 1rem;
  }

  /* Animación hamburguesa activa: Transformación a X */
  .menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .menu-toggle.active span:nth-child(2) { opacity: 0; }
  .menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}

main {
  flex: 1;
  padding: clamp(2rem, 8vw, 4rem) 0;
}

/* Seguridad para formularios y elementos anchos */
input, textarea, select {
  max-width: 100%;
  width: 100%;
}

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

/* Grillas Adaptativas */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

@media (max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Cards & Surfaces */
.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: clamp(1rem, 5vw, 2rem);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-speed) ease;
  text-align: center;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}

@media (max-width: 600px) {
  .btn {
    width: 100%;
    padding: 1rem;
  }
}

/* Footer Profesional */
footer {
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 5rem 0 2rem 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-logo {
  height: 50px;
  width: auto;
  margin-bottom: 1.5rem;
  filter: grayscale(0.2);
  transition: filter 0.3s ease;
}

.footer-logo:hover {
  filter: grayscale(0);
}

.association-name {
  color: var(--brand-primary) !important;
  font-size: 1.1rem;
  margin-bottom: 1rem !important;
}

.legal-text, .address, .contact-invitation {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.footer-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 24px;
  height: 2px;
  background-color: var(--brand-primary);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.9rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--brand-primary);
  transform: translateX(5px);
}

.contact-invitation {
  margin-bottom: 1.5rem;
}

.footer-btn {
  width: 100%;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  padding: 0.8rem;
  border: 1px solid var(--brand-primary);
}

.social-links-footer {
  display: flex;
  gap: 1rem;
}

.social-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.location {
  font-weight: 700;
  color: var(--brand-primary);
}

.footer-legal a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Responsive Footer */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

@media (max-width: 650px) {
  footer {
    padding: 4rem 0 2rem 0;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .footer-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
  .footer-links a:hover {
    transform: translateY(-2px);
  }
  .social-links-footer {
    justify-content: center;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

/* Cookie Banner Styles */
#cookie-banner {
  @media (max-width: 600px) {
    bottom: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    border-radius: 12px 12px 0 0 !important;
    flex-direction: column !important;
    padding: 2rem 1.5rem !important;
  }
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Timeline Component (Unified for multiple pages) */
.timeline-container {
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--brand-primary), var(--brand-accent), var(--border-color));
  transform: translateX(-50%);
  border-radius: 4px;
  z-index: 0;
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5rem;
  position: relative;
  width: 100%;
  z-index: 1;
}

.timeline-content {
  width: 42%;
  padding: 2rem;
  background: var(--surface-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--border-color);
  position: relative;
}

.timeline-item.left .timeline-content { text-align: right; border-top-color: var(--brand-primary); }
.timeline-item.right .timeline-content { text-align: left; border-top-color: var(--brand-accent); }

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  background: white;
  border: 6px solid var(--brand-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 0 0 4px var(--surface-color);
}

.timeline-dot.special {
  width: 34px;
  height: 34px;
  border-color: var(--brand-accent);
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.timeline-empty {
  width: 42%;
}

.year-label {
  font-size: 3rem;
  font-weight: 800;
  color: color-mix(in srgb, var(--brand-primary) 20%, transparent);
  display: block;
  line-height: 1;
  margin-bottom: 1rem;
}

.year-label.primary {
  color: var(--brand-primary);
}

/* Responsividad Crítica para Timelines */
@media (max-width: 850px) {
  .timeline-line {
    left: 20px;
    transform: none;
  }
  
  .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 50px;
    margin-bottom: 4rem;
  }
  
  .timeline-content {
    width: 100%;
    text-align: left !important;
    padding: 1.5rem;
  }
  
  .timeline-dot {
    left: 20px;
    top: 0;
    transform: translateX(-50%);
  }
  
  .timeline-empty {
    display: none;
  }
  
  .year-label {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
}

/* Quote Card Utility */
.quote-card {
  padding: clamp(2rem, 10vw, 4rem);
  font-size: clamp(1.1rem, 5vw, 1.8rem);
  font-style: italic;
}

/* Estilos para el Mapa de Veneración */
.map-container {
  transition: all 0.3s ease;
}

/* Efectos Hover Globales para Tarjetas de Recursos */
.card[style*="transition"]:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg) !important;
}

/* Efecto Hover para botón de mapa */
.map-section .btn:hover {
  background: var(--brand-primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

@media (max-width: 768px) {
  .map-section {
    margin-top: 2rem !important;
  }
  .map-container {
    height: 350px !important;
    border-radius: 15px !important;
  }
}

/* Estilos para el Acordeón de FAQ */
.faq-accordion {
  border-top: 1px solid var(--border-color);
}

.faq-item {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.faq-question {
  padding: 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:hover {
  background-color: color-mix(in srgb, var(--brand-accent) 5%, transparent);
}

.faq-icon {
  width: 20px;
  height: 20px;
  position: relative;
  transition: transform 0.3s ease;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background-color: var(--brand-accent);
}

/* Línea horizontal */
.faq-icon::before {
  top: 9px;
  left: 0;
  width: 20px;
  height: 2px;
}

/* Línea vertical */
.faq-icon::after {
  top: 0;
  left: 9px;
  width: 2px;
  height: 20px;
}

/* Estado abierto */
.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

/* Transición de la respuesta */
.faq-answer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
  animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .faq-question {
    font-size: 1rem;
    padding: 1.2rem;
  }
}

/* Estilos para el Calendario de Efemérides */
@media (max-width: 768px) {
  .calendar-container {
    height: 300px !important;
    border-radius: 15px !important;
  }
}

/* Estilo para el botón de reproducción personalizado (Vista Previa) */
.play-button-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  z-index: 10;
  pointer-events: none; /* Permite que el clic pase al contenedor padre */
}

.video-preview-container:hover .play-button-overlay {
  transform: scale(1.1);
}

.video-preview-container:hover img {
  opacity: 1 !important;
  transition: opacity 0.3s ease;
}
