/* ═══════════════════════════════════════════
   TARJETAS DE ANÉCDOTAS
   ═══════════════════════════════════════════ */

#anecdotas h2 {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  color: #c70000;  /* ← Se mantiene este color */
  margin-bottom: 0.4rem;
  font-weight: 800;
}

.anecdotas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.anecdota-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.8rem;
  transition: all 0.3s ease;
  border: 1px solid #f0e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.anecdota-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  border-color: #c70000;
}

.anecdota-card-icon {
  margin-bottom: 1.2rem;
  display: inline-block;
}

.anecdota-card-icon svg {
  transition: transform 0.3s ease;
}

.anecdota-card:hover .anecdota-card-icon svg {
  transform: scale(1.05);
}

.anecdota-card-titulo {
  color: #c70000;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  font-family: 'Open Sans', sans-serif;
}

.anecdota-card-resumen {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  font-family: 'Open Sans', sans-serif;
}

.anecdota-card-btn {
  background: transparent;
  color: #153a8a;
  border: 2px solid #153a8a;
  padding: 0.6rem 1.2rem;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Open Sans', sans-serif;
}

.anecdota-card-btn svg {
  transition: transform 0.3s ease;
}

.anecdota-card-btn:hover {
  background: #153a8a;
  color: white;
  transform: translateX(4px);
}

.anecdota-card-btn:hover svg {
  transform: translateX(2px);
}

/* ═══════════════════════════════════════════
   MODAL / POPUP
   ═══════════════════════════════════════════ */

.anecdota-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.anecdota-modal.active {
  display: block;
}

.anecdota-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.anecdota-modal-container {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  margin: 50px auto;
  background: #faf7f2;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.anecdota-modal-content {
  padding: 2.5rem 3rem;
  overflow-y: auto;
  max-height: calc(85vh - 60px);
}

.anecdota-modal-titulo {
  color: #c70000;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0e8e8;
  font-family: 'Open Sans', sans-serif;
}

.anecdota-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #fff;
  border: none;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  color: #c70000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.anecdota-modal-close:hover {
  background: #c70000;
  color: white;
  transform: rotate(90deg);
}

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

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

/* Scroll personalizado para el modal */
.anecdota-modal-content::-webkit-scrollbar {
  width: 8px;
}

.anecdota-modal-content::-webkit-scrollbar-track {
  background: #f0e8e8;
  border-radius: 10px;
}

.anecdota-modal-content::-webkit-scrollbar-thumb {
  background: #c70000;
  border-radius: 10px;
}

.anecdota-modal-content::-webkit-scrollbar-thumb:hover {
  background: #a00000;
}

/* ════════════════════════════════
   RESPONSIVO PARA TARJETAS Y MODAL
   ════════════════════════════════ */
@media (max-width: 768px) {
  .anecdotas-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .anecdota-card {
    padding: 1.5rem;
  }
  
  .anecdota-modal-container {
    width: 95%;
    margin: 30px auto;
  }
  
  .anecdota-modal-content {
    padding: 1.8rem 1.5rem;
  }
  
  .anecdota-modal-titulo {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .anecdota-card {
    padding: 1.2rem;
  }
  
  .anecdota-card-titulo {
    font-size: 1.1rem;
  }
  
  .anecdota-card-resumen {
    font-size: 0.85rem;
  }
  
  .anecdota-modal-content {
    padding: 1.5rem 1rem;
  }
  
  .anecdota-modal-titulo {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .anecdota-modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 35px;
    height: 35px;
    font-size: 1.5rem;
  }
}

/* Estilos para imágenes en tarjetas de anécdotas */
.anecdota-card-imagen {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.anecdota-card-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.anecdota-card:hover .anecdota-card-imagen img {
  transform: scale(1.05);
}

.anecdota-card-contenido {
  padding: 1.5rem;
}

/* Estilos para imagen dentro del modal */
.anecdota-modal-imagen {
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  margin-bottom: 1.5rem;
}

.anecdota-modal-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ajustes responsive */
@media (max-width: 768px) {
  .anecdota-card-imagen {
    height: 150px;
  }
  
  .anecdota-modal-imagen {
    height: 200px;
  }
}