/* ==========================================================================
   ESTILOS DEL BLOG Y NOTICIAS
   ========================================================================== */

/* --- 1. SECCIÓN HERO (PORTADA BLOG) --- */
.blog-hero {
  text-align: center;
  padding: 160px 0 60px;
  background: #f8fafc; /* Fondo gris claro */
}
.blog-hero h1 {
  font-size: 3.5rem;
  color: var(--text-dark);
  margin-bottom: 20px;
}
.blog-hero p {
  color: #64748b;
  font-size: 1.2rem;
}

/* --- 2. LISTADO DE NOTICIAS (GRILLA) --- */
.blog-grid-full {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 Columnas */
  gap: 40px;
  padding-bottom: 100px;
}

.blog-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transicion);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.blog-item:hover {
  transform: translateY(-8px);
  border-color: var(--accent-cyan);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.blog-thumb {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.blog-content {
  padding: 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.85rem;
}

.blog-tag {
  background: rgba(56, 189, 248, 0.1);
  color: #0284c7;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 800;
}
.blog-date {
  color: #64748b;
}

.blog-content h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  line-height: 1.3;
  color: var(--text-dark);
  flex: 1;
}

.read-btn {
  display: inline-block;
  color: #64748b;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid var(--accent-cyan);
  padding-bottom: 2px;
  align-self: flex-start;
  transition: 0.3s;
}
.read-btn:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   ESTILOS DE LA PÁGINA DE DETALLE (LECTURA)
   ========================================================================== */

/* Contenedor principal de 3 columnas */
.blog-layout-wrapper {
  display: flex;
  gap: 80px; /* Separación amplia entre columnas */
  margin-top: 140px;
  margin-bottom: 100px;
  align-items: flex-start;
  position: relative;
  justify-content: center;
}

/* --- COLUMNA 1: BARRA SOCIAL (Sticky) --- */
.sidebar-social {
  width: 60px;
  flex-shrink: 0;
  position: sticky;
  top: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.social-circle {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  text-decoration: none;
  transition: 0.3s;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.social-circle:hover {
  transform: scale(1.15);
  border-color: transparent;
}

/* Colores específicos de redes sociales al hacer hover */
.social-circle.facebook:hover {
  background: #1877f2;
}
.social-circle.whatsapp:hover {
  background: #25d366;
}
.social-circle.linkedin:hover {
  background: #0a66c2;
}
.social-circle.twitter:hover {
  background: #000000;
  border-color: white;
}
.social-circle.copy-link:hover {
  background: var(--accent-cyan);
  color: #020617;
}
.social-circle.instagram:hover {
  background: radial-gradient(
    circle at 30% 107%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285aeb 90%
  );
  border: none;
}
.social-circle.tiktok:hover {
  background: #000000;
  border-color: #25f4ee;
  box-shadow: 2px 2px 0 #fe2c55;
}
.social-circle.youtube:hover {
  background: #ff0000;
}

/* --- COLUMNA 2: LECTOR DEL ARTÍCULO --- */
.article-reader {
  flex: 1;
  margin: 0 !important;
  max-width: 100%;
  background: #ffffff;
  padding: 50px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

.article-header {
  margin-bottom: 30px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 30px;
}
.article-tag {
  color: var(--accent-cyan);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.article-title {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin: 15px 0;
  line-height: 1.2;
}
.article-date {
  color: #64748b;
  font-size: 0.9rem;
}

.article-img-full {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 40px;
}

.article-body {
  color: #475569;
  font-size: 1.15rem;
  line-height: 1.8;
}
.article-body h3 {
  color: var(--text-dark);
  margin: 30px 0 15px;
  font-size: 1.5rem;
}
.article-body ul {
  margin-bottom: 20px;
  padding-left: 20px;
}
.article-body li {
  margin-bottom: 10px;
}

/* Botón Volver */
.article-footer {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}
.btn-return {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 14px 35px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  transition: 0.3s;
}
.btn-return:hover {
  background: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

/* --- COLUMNA 3: SIDEBAR CURSOS --- */
.sidebar-courses {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 150px;
}

.sidebar-widget {
  background: transparent;
  border: none;
  padding: 0;
}
.sidebar-widget h3 {
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 10px;
  font-weight: 800;
}
.promo-text {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 25px;
}

/* Tarjetas mini de cursos */
.mini-courses-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mini-course-card {
  display: flex;
  gap: 15px;
  text-decoration: none;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  align-items: center;
}
.mini-course-card:last-child {
  border-bottom: none;
}
.mini-course-card:hover {
  transform: translateX(5px);
  opacity: 1;
}

.mini-course-img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.mini-course-info h4 {
  font-size: 1rem;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 5px;
  font-weight: 600;
}
.mini-course-price {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  font-weight: 800;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.btn-all-courses {
  display: block;
  text-align: center;
  margin-top: 30px;
  font-size: 0.9rem;
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 8px;
  transition: 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-all-courses:hover {
  background: var(--accent-cyan);
  color: #020617;
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   RESPONSIVE DESIGN (CORREGIDO)
   ========================================================================== */

@media (max-width: 1200px) {
  .blog-layout-wrapper {
    gap: 40px;
  }
  .blog-wide-container {
    padding: 0 20px;
  }
}

/* PUNTOS DE QUIEBRE PARA MÓVIL/TABLET */
@media (max-width: 1100px) {
  /* 1. Ocultar la barra lateral izquierda (Sociales) */
  .sidebar-social {
    display: none;
  }

  /* 2. MOSTRAR la barra derecha (Cursos) pero adaptada abajo */
  .sidebar-courses {
    display: block;
    width: 100%;
    max-width: 600px;
    position: static;
    margin: 60px auto 0;
    padding: 0 20px;
  }

  /* El layout principal pasa a bloque (uno debajo del otro) */
  .blog-layout-wrapper {
    display: block;
  }
  .article-reader {
    padding: 30px 20px;
  }
  .blog-grid-full {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .article-title {
    font-size: 1.8rem;
  }
  .article-img-full {
    height: 250px;
  }
  .article-reader {
    margin-top: 120px;
  }
  .btn-return {
    width: 100%;
    justify-content: center;
  }
}
