/* ==========================================================================
   1. VARIABLES DE COLOR (Mi paleta maestra)
   ========================================================================== */
:root {
  --bg-body: #050b14;       /* El color de fondo de toda la página (Azul casi negro) */
  --bg-card: #0a1324;       /* El color principal de las cajas o tarjetas */
  --bg-card-light: #16243d; /* Un azul un poco más claro para botones o fondos internos */
  --accent: #3b82f6;        /* Mi color de resalte principal (Azul eléctrico brillante) */
  --text-main: #ffffff;     /* Color del texto principal (Blanco puro) */
  --text-muted: #94a3b8;    /* Color para textos secundarios o menos importantes (Gris azulado) */
  --border-radius: 24px;    /* Cuánto de redondeadas quiero mis tarjetas por defecto */
}

/* ==========================================================================
   2. RESETEO BÁSICO
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; 
}

/* ==========================================================================
   3. ESTILOS DEL CUERPO (Fondo y fuente)
   ========================================================================== */
body {
  background-color: var(--bg-body);
  /* Patrón de puntos tipo cómic */
  background-image: radial-gradient(rgba(59, 130, 246, 0.15) 2px, transparent 2px);
  background-size: 24px 24px;
  background-position: 0 0;
  
  font-family: 'Inter', sans-serif; 
  color: var(--text-main);
  line-height: 1.6; 
  padding: 20px; 
  
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   4. LA BARRA DE NAVEGACIÓN (Header)
   ========================================================================== */
.navbar-pildora {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 1000px;
  border-radius: 50px; 
  padding: 12px 30px; 
  display: flex;
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 30px; 
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); 
  border: 1px solid rgba(255, 255, 255, 0.05); 
}

.menu-enlaces { display: flex; gap: 20px; }

.menu-enlaces a {
  color: var(--text-main);
  text-decoration: none; 
  font-size: 0.9rem;
  font-weight: 600; 
  transition: color 0.3s; 
}

.menu-enlaces a:hover, .menu-enlaces a.activo {
  color: var(--accent); 
  text-decoration: underline; 
  text-underline-offset: 6px; 
}

.perfil-usuario {
  background-color: var(--bg-card-light);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px; 
  cursor: pointer; 
  transition: background 0.2s;
}

.perfil-usuario:hover { background-color: var(--accent); }

/* ==========================================================================
   5. TARJETAS OSCURAS (Contenedores principales)
   ========================================================================== */
.contenedor-principal {
  width: 100%;
  max-width: 1000px; 
  display: flex;
  flex-direction: column;
  gap: 25px; 
}

.tarjeta-oscura {
  background-color: var(--bg-card);
  border-radius: var(--border-radius); 
  padding: 30px; 
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  position: relative; 
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   6. SECCIÓN HERO (Index)
   ========================================================================== */
.tarjeta-hero {
  display: flex;
  justify-content: flex-end; 
  min-height: 250px;
  background: linear-gradient(135deg, var(--bg-card) 0%, #08101e 100%);
}

.tarjeta-flotante {
  background-color: var(--bg-card-light);
  padding: 25px;
  border-radius: 20px;
  width: 350px;
  position: absolute;
  right: 30px;
  top: 40px;
  box-shadow: -5px 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tarjeta-flotante h3 { font-size: 1.2rem; margin-bottom: 10px; }
.tarjeta-flotante p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; }

.btn-accion {
  background-color: var(--bg-body);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-accion:hover { background-color: var(--accent); color: var(--text-main); }

/* ==========================================================================
   7. MENÚ DE CATEGORÍAS (Index)
   ========================================================================== */
.menu-secundario { padding: 20px 30px; }

.navegacion-categorias {
  display: flex;
  gap: 15px; 
  flex-wrap: wrap; 
}

.navegacion-categorias a {
  background-color: var(--bg-card-light);
  color: var(--text-main);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.navegacion-categorias a:hover { background-color: var(--accent); color: var(--text-main); }
.navegacion-categorias a.destacado { border: 2px solid var(--accent); }

/* ==========================================================================
   8. SECCIÓN DE GALERÍA (Index)
   ========================================================================== */
.encabezado-galeria { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }

.etiqueta {
  background-color: var(--bg-card-light);
  color: var(--accent);
  padding: 5px 15px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 800;
}

.rejilla-imagenes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; 
}

.caja-imagen {
  background-color: var(--bg-card-light);
  border-radius: 16px;
  padding: 10px; 
  display: flex; justify-content: center; align-items: center;
}

.caja-imagen img {
  width: 100%; 
  height: 180px; 
  object-fit: cover; 
  border-radius: 12px;
  transition: transform 0.3s;
}

.caja-imagen img:hover { transform: scale(1.05); }

/* ==========================================================================
   9. PIE DE PÁGINA (Footer)
   ========================================================================== */
.footer-pildora {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 1000px;
  border-radius: 50px;
  padding: 15px 30px;
  display: flex; justify-content: center; align-items: center;
  margin-top: 40px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px; 
  color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   10. ESTILOS DE LA PLANTILLA / SUBPÁGINAS (¡NUEVO!)
   ========================================================================== */

.cabecera-subpagina {
  display: flex;
  align-items: center;
  gap: 20px; 
  margin-bottom: 5px; 
  padding: 0 10px;
}

.titulo-pagina {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  color: var(--accent);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 30px; 
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.2s;
}

.btn-volver:hover {
  background-color: var(--bg-card-light);
  transform: translateX(-3px); 
}

.contenido-articulo h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--accent); 
}

.contenido-articulo h3 {
  font-size: 1.3rem;
  margin-top: 30px;
  margin-bottom: 10px;
  color: var(--text-main);
}

.contenido-articulo p {
  color: var(--text-muted); 
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.7; 
}

.contenido-articulo ul {
  margin-left: 20px; 
  margin-bottom: 20px;
  color: var(--text-muted);
}

.contenido-articulo li {
  margin-bottom: 8px; 
}

.imagen-articulo {
  width: 100%;
  max-width: 600px; 
  border-radius: 12px;
  margin: 20px 0;
}

/* ==========================================================================
   11. ADAPTACIÓN PARA TELÉFONOS MÓVILES (Responsive)
   ========================================================================== */
@media (max-width: 768px) {
  .navbar-pildora { flex-direction: column; border-radius: 20px; gap: 15px; }
  .tarjeta-hero { flex-direction: column; min-height: auto; }
  .tarjeta-flotante { position: relative; right: 0; top: 0; width: 100%; }
  
  .cabecera-subpagina {
    flex-direction: column;
    align-items: flex-start;
  }
}