@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600&family=Crimson+Pro:wght@300;400&family=Playfair+Display:wght@600&family=Cinzel:wght@400;600&display=swap');

/* ============================================
   RESET Y BASE GENERAL
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  color: #e0e0e0;
  line-height: 1.8;
  background: linear-gradient(-45deg, #0b0b0c, #121317, #1a1b1f, #0b0c10);
  background-size: 400% 400%;
  animation: noche 30s ease-in-out infinite;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: 'Cinzel', serif;
  color: #d4af37;
  letter-spacing: 2px;
  font-weight: 600;
}

p { margin-bottom: 1rem; }

/* ============================================
   EFECTOS DE FONDO
   ============================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02), transparent 100%),
              radial-gradient(circle at 100% 100%, rgba(255,255,255,0.02), transparent 100%);
  animation: movimientoNiebla 20s infinite alternate;
  z-index: -1;
  pointer-events: none;
}

.halo {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0.25), transparent 70%);
  transform: translate(-50%, -50%);
  animation: respirar 8s infinite ease-in-out;
  z-index: -2;
  pointer-events: none;
  will-change: transform, opacity;
}
/* ============================================
   
/* ============================================

/* ============================================
   SECCIONES
   ============================================ */
section {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 1.5rem;
  text-align: justify;
  animation: aparecer 1.2s ease forwards;
}

.intro {
  background: rgba(255,255,255,0.03);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(212,175,55,0.08);
}

.intro h2 {
  color: #d4af37;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: clamp(1.5rem, 3.5vw, 1.8rem);
}

h2 {
  color: #d4af37;
  margin: 2rem 0 1.5rem;
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
}

.intro h3 {
  color: #F0F8FF; /* FIX: color válido */
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: clamp(0.6rem, 2.5vw, 0.9rem); /* FIX: clamp min<=max */
}

/* ============================================
   CITAS
   ============================================ */
.cita,
blockquote {
  border-right: 5px solid #d4af37;
  padding: 4rem 1.5rem;
  font-style: italic;
  color: #fff;
  text-align: center;
  max-width: 600px;
  margin: 1.5rem auto;
  background: rgba(212,175,55,0.05);
  border-radius: 0 5px 5px 0;
  font-size: 1.05rem;
  line-height: 2;
}

/* ============================================
   REFLEXIONES
   ============================================ */
.reflexiones {
  max-width: 850px;
  margin: 3rem auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.reflexion-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.8rem 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  text-align: center;
  font-size: 1.1rem;
  color: #ddd;
  box-shadow: 0 0 20px rgba(212,175,55,0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
}

.reflexion-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.reflexion-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 30px rgba(212,175,55,0.25);
}

.enlace-reflexion {
  display: block;
  color: #d4af37;
  font-weight: bold;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.enlace-reflexion:hover {
  color: #fff5cc;
  text-shadow: 0 0 12px #d4af37;
}

/* ============================================
   REFLEXIÓN COMPLETA
   ============================================ */
.reflexion-completa {
  max-width: 850px;
  margin: 2rem auto;
  padding: 1.5rem;
}

.contenido-reflexion {
  max-width: 850px;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
}

.contenido-reflexion p {
  font-size: 1.1rem;
  line-height: 1.9;
  color: #ddd;
  text-align: justify;
  margin-bottom: 1.5rem;
}

.texto-reflexion {
  font-size: 1.1rem;
  line-height: 1.9;
  color: #ddd;
  text-align: justify;
  max-width: 850px;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
}

.texto-reflexion p {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: aparecer 1s ease forwards;
}

.mensaje-final {
  text-align: center;
  margin: 3rem 0 2rem;
  font-style: italic;
  color: #d4af23;
  font-size: 0.8rem;
  opacity: 0.7;
  animation: respirarMensaje 5s infinite ease-in-out;
}

/* ============================================

   NOTAS ESPECIALES
   ============================================ */
.nota {
  display: inline-block;
  color: #d4af37;
  font-weight: bold;
  margin-right: 0.5rem;
  font-size: 1.05rem;
}

.nota.especial {
  display: block;
  text-align: center;
  margin: 2rem auto;
  padding: 1rem;
  background: rgba(212,175,55,0.1);
  border-radius: 8px;
  max-width: 600px;
}

/* ============================================
   GALERÍA
   ============================================ */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1100px;
  margin: 2rem auto;
}

.galeria img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 4px 15px rgba(212,175,55,0.15);
}

.galeria img:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 8px 30px rgba(212,175,55,0.35);
}

/* ============================================
   SECCIÓN INTERACTIVA
   ============================================ */
.interactivo {
  text-align: center;
  margin: 3rem auto;
  padding: 2rem 1.5rem;
  max-width: 700px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
}

.interactivo h2 {
  color: #d4af37;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}

.interactivo input {
  background: rgba(17,17,17,0.8);
  color: #e0e0e0;
  border: 1px solid #555;
  padding: 0.8rem 1rem;
  width: 80%;
  max-width: 400px;
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.interactivo input:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 10px rgba(212,175,55,0.3);
}

.interactivo button {
  background: transparent;
  color: #d4af37;
  border: 1px solid #d4af37;
  margin-top: 1rem;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.interactivo button:hover {
  background: #d4af37;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212,175,55,0.4);
}

.interactivo p {
  margin-top: 1.5rem;
  font-style: italic;
  color: #ccc;
  font-size: 1.1rem;
  min-height: 2rem;
  animation: aparecer 0.8s ease;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: rgba(10,10,10,0.95);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.95rem;
  border-top: 1px solid rgba(212,175,55,0.25);
  box-shadow: 0 -3px 12px rgba(212,175,55,0.1);
  color: #bfbfbf;
  margin-top: 4rem;
}

footer span { color: #d4af37; font-weight: bold; }

.autor {
  text-align: center;
  margin: 5rem 0;
  font-size: 1.3rem;
  color: #888;
  font-style: italic;
}

.fecha-auto {
  text-align: center;
  font-size: 0.9rem;
  color: #aaa;
  opacity: 0.8;
  margin: 1.5rem 0;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes noche {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes respirar {
  0%, 100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

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

@keyframes respirarMensaje {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes moverGradiente {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
  body { font-size: 15px; line-height: 1.7; }

  nav { gap: 1rem; padding: 0.8rem; }
  nav a { font-size: 0.9rem; }

  section,
  .reflexiones,
  .reflexion-completa,
  .contenido-reflexion,
  .texto-reflexion {
    padding: 1rem;
    margin: 2rem auto;
  }

  .reflexion-item { padding: 1.5rem; }

  .galeria { grid-template-columns: 1fr; gap: 1rem; }

  .interactivo input { width: 90%; }

  .navegacion-reflexiones {
    flex-direction: column;
    gap: 1rem;
  }

  .btn-volver,
  .btn-siguiente {
    width: 100%;
    text-align: center;
  }

  .halo { width: 400px; height: 400px; }

  /* Breadcrumb responsive */
  .breadcrumb {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Búsqueda */
  #search-input {
    font-size: 15px;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
  }

  /* Botones táctiles */
  .nav-actions button,
  .floating-nav button,
  .favorite-btn,
  .audio-reader-btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* Texto más legible */
  .texto-reflexion,
  .contenido-reflexion p {
    font-size: 1.05rem;
    line-height: 1.8;
  }
}

@media (max-width: 480px) {
  body { font-size: 14px; }

  .texto-reflexion,
  .contenido-reflexion p {
    font-size: 1rem;
    line-height: 1.7;
  }

  .cita,
  blockquote {
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
  }
}

/* ============================================
   OPTIMIZACIONES / ACCESIBILIDAD
   ============================================ */

/* Evitar CLS: reservar espacios coherentes */
.social-share { min-height: 90px; }

/* Mejorar contraste de botones */
.nav-actions button { background: rgba(212,175,55,0.15); }
.nav-actions button:hover { background: rgba(212,175,55,0.3); }

/* Mejorar legibilidad */
.breadcrumb { background: rgba(255,255,255,0.05); }

/* Soporte “reduce motion” – bloque único */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Modo claro (si lo usas con data-theme) */
body[data-theme="light"] .breadcrumb {
  background: rgba(0,0,0,0.05);
  border-color: rgba(139,115,85,0.2);
}
body[data-theme="light"] nav a { color: #6d5a45; }

/* Botones destacados */
.favorite-btn,
.audio-reader-btn,
.theme-toggle-btn {
  box-shadow: 0 2px 8px rgba(212,175,55,0.15);
}

/* Hover solo en dispositivos con hover */
@media (hover: hover) {
  .reflexion-item:hover,
  .related-card:hover,
  .search-result-item a:hover {
    box-shadow: 0 8px 24px rgba(212,175,55,0.25);
  }
}

/* Utilidad accesible */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Contenedor de imágenes responsivo */
.contenedor { width: 100%; max-width: 800px; margin: 0 auto; overflow: hidden; }
.contenedor img { width: 100%; height: auto; display: block; object-fit: cover; }

/* Reservas de espacio específicas */
.favorite-item { min-height: 100px; }
.rosa-container { aspect-ratio: 1 / 1; max-width: 700px; position: relative; margin: 0 auto; }
.rosa-imagen { width: 100%; height: auto; display: block; will-change: auto; }

/* Contenido pesado: solo para imágenes y números (no halo fijo) */
img { content-visibility: auto; }
@media (prefers-reduced-motion: reduce), (max-width: 500px) {
  body { animation: none; background-position: 50% 50%; }
}
/* === ESTILOS DEL SUMMARY (AL FINAL) === */
  summary {
  cursor: pointer;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.2);
  font-size: 1.1rem;
  color: #d4af37;
  font-weight: 600;
  outline: none;
  list-style: none;
  user-select: none;
}
summary::after {
  float: right;
  transition: transform 0.3s ease;
  color: #d4af37;
  font-size: 1.2rem;
}
details {
  margin: 1rem 0;
  padding: 0.5rem 0;
}

details > div {
  padding: 1rem 1.3rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid red;
  margin-top: 0.5rem;
  color: #ddd;
  line-height: 1.8;
  border-radius: 6px;
}