/* Blog Styles for HB Honey Bubble */

/* Blog Header - Hero section */
.blog-hero {
  background: linear-gradient(135deg, var(--color-honey) 0%, var(--color-olive) 100%);
  padding: 160px 0 80px; /* Aumentado a 160px para despegarlo bien del header fijo */
  text-align: center;
  color: var(--color-cream);
  position: relative;
  overflow: hidden;
}

.blog-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
}

.blog-hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.blog-hero h1 {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff; /* Cambiado el color a blanco puro (puedes ajustarlo) */
}

.blog-hero p {
  font-family: var(--font-text);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto 60px;
}

/* Blog Article Card */
.blog-card {
  background: var(--color-cream);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(249, 168, 89, 0.15);
}

.blog-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--color-olive);
}

.blog-card-content {
  padding: 25px;
}

.blog-card-category {
  display: inline-block;
  background: var(--color-honey);
  color: var(--color-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.blog-card h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 15px;
  line-height: 1.3;
}

.blog-card-excerpt {
  font-family: var(--font-text);
  font-size: 1rem;
  color: var(--color-brown);
  line-height: 1.7;
  margin-bottom: 20px;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid rgba(144, 119, 91, 0.2);
}

.blog-card-date {
  font-family: var(--font-text);
  font-size: 0.875rem;
  color: var(--color-brown);
}

.blog-card-read-more {
  color: var(--color-honey);
  font-family: var(--font-text);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-card-read-more:hover {
  color: var(--color-olive);
}

/* Blog Single Article Hero */
.article-hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 550px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Alineado arriba para que el meta no se corte */
  text-align: center;
  padding: 200px 20px 180px; /* Padding-bottom aumentado para que el meta tenga espacio antes del overlap */
}

.article-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25); /* Overlay oscuro semi-transparente */
  z-index: 1;
}

.article-hero-content {
  position: relative;
  z-index: 15; /* Mayor que z-index: 10 del blog-article para que el meta no se tape */
  max-width: 900px;
  color: #fff;
  padding-bottom: 40px; /* Espacio extra para asegurar visibilidad del meta */
}

.article-hero-content .blog-article-category {
  display: inline-block;
  margin-bottom: 20px;
}

.article-hero-content h1 {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 25px;
  text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.article-hero-meta {
  display: inline-flex; /* Para que el fondo se ajuste al contenido */
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-family: var(--font-text);
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff; /* Blanco puro */
  background: rgba(0, 0, 0, 0.35); /* Fondo semi-transparente oscuro */
  backdrop-filter: blur(8px); /* Efecto blur moderno */
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 24px; /* Espacio interior */
  border-radius: 30px; /* Bordes redondeados tipo pill */
  border: 1px solid rgba(255, 255, 255, 0.15); /* Borde sutil */
}

.article-hero-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-hero-author img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-honey);
}

/* Blog Single Article */
.blog-article {
  max-width: 800px;
  margin: -40px auto 60px; /* Overlap ajustado - meta visible, contenido no tapado */
  background: var(--color-cream);
  padding: 50px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.blog-article-header {
  display: none; /* Se oculta porque ahora está en el hero */
}

.blog-article h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 25px;
  line-height: 1.2;
}

.blog-article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.blog-article-category {
  background: var(--color-honey);
  color: var(--color-dark);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-article-date {
  color: var(--color-brown);
  font-size: 0.95rem;
  font-weight: 500;
}

.blog-article-content {
  font-family: var(--font-text);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--color-dark);
}

/* Letra capitular para el primer párrafo */
.blog-article-content > p:first-of-type::first-letter {
  font-family: var(--font-title);
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-honey);
  float: left;
  line-height: 1;
  margin-right: 12px;
  margin-top: 5px;
}

.blog-article-content h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-olive);
  margin: 50px 0 20px;
  padding-bottom: 10px;
  position: relative;
}

/* Línea decorativa debajo de los H2 */
.blog-article-content h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 3px;
  background-color: var(--color-honey);
  border-radius: 2px;
}

.blog-article-content h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 35px 0 15px;
}

.blog-article-content p {
  margin-bottom: 24px;
}

.blog-article-content ul {
  margin: 20px 0 30px;
  padding-left: 25px;
}

.blog-article-content li {
  margin-bottom: 12px;
  line-height: 1.7;
}

/* Custom bullet points */
.blog-article-content ul li {
  list-style-type: none;
  position: relative;
}

.blog-article-content ul li::before {
  content: "✦";
  color: var(--color-honey);
  position: absolute;
  left: -25px;
  font-size: 1.2rem;
}

.blog-article-content a {
  color: var(--color-honey);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  border-bottom: 1px dotted var(--color-honey);
}

.blog-article-content a:hover {
  color: var(--color-olive);
  border-bottom: 1px solid var(--color-olive);
}

/* Resaltados en negrita con el color de la marca */
.blog-article-content strong {
  color: var(--color-brown);
  font-weight: 700;
}

/* Blog E-E-A-T Experience Box Mejorada */
.blog-experience-box {
  background-color: var(--color-cream);
  border: 2px solid var(--color-olive);
  padding: 35px 40px;
  margin: 45px 0;
  border-radius: 12px;
  position: relative;
  box-shadow: 5px 5px 0px rgba(106, 124, 79, 0.2);
}

/* Icono decorativo en la caja de experiencia */
.blog-experience-box::before {
  content: '🐝';
  font-size: 2rem;
  position: absolute;
  top: -20px;
  left: 30px;
  background-color: var(--color-cream);
  padding: 0 10px;
}

.blog-experience-box h3 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-olive);
  margin-top: 0;
  margin-bottom: 15px;
}

/* Cajas de preguntas frecuentes (FAQs) */
.blog-article-content h3 + p {
  padding-left: 15px;
  border-left: 3px solid rgba(249, 168, 89, 0.4); /* Línea miel semi-transparente */
}

/* Blog CTA Section */
.blog-cta {
  background: var(--color-olive);
  padding: 40px;
  text-align: center;
  border-radius: 12px;
  margin: 60px 0;
}

.blog-cta h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-cream);
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 992px) {
  .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }

  .blog-hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card-image {
    height: 180px;
  }
}

/* =============================================
   TABLE OF CONTENTS (TOC) — ÍNDICE LATERAL
   Desktop: sticky lateral | Mobile: accordeon
   ============================================= */

/* Wrapper que posiciona el artículo y el TOC lado a lado */
.article-with-toc {
  display: flex;
  flex-direction: row; /* artículo primero, TOC a la derecha */
  align-items: flex-start;
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Columna del artículo — ORDER 1 para aparecer a la izquierda */
.article-with-toc .blog-article {
  flex: 1;
  order: 1;
  min-width: 0;
  margin: 20px 0 0 0; /* Margen positivo para separación clara del hero */
  max-width: 800px;
}

/* Sidebar TOC — Solo en escritorio, ORDER 2 para aparecer a la derecha */
.toc-sidebar {
  width: 220px;
  flex-shrink: 0;
  order: 2; /* Siempre a la derecha del artículo */
  position: sticky;
  top: 100px;
  align-self: flex-start;
  padding-top: 15px;
}

.toc-sidebar-title {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-brown);
  margin-bottom: 16px;
}

.toc-sidebar nav {
  border-left: 2px solid rgba(144, 119, 91, 0.2);
  padding-left: 16px;
  display: flex;
  flex-direction: column; /* Links en columna vertical */
  gap: 2px;
}

.toc-sidebar nav a {
  display: block;
  font-family: var(--font-text);
  font-size: 0.875rem;
  color: var(--color-brown);
  text-decoration: none;
  padding: 4px 0;
  line-height: 1.4;
  transition: color 0.25s ease;
  position: relative;
}

.toc-sidebar nav a:hover {
  color: var(--color-honey);
}

/* Elemento activo en el TOC sidebar (lo gestiona JS) */
.toc-sidebar nav a.toc-active {
  color: var(--color-honey);
  font-weight: 600;
}

.toc-sidebar nav a.toc-active::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background-color: var(--color-honey);
  border-radius: 2px;
}

/* TOC Mobile — Acordeón nativo (oculto en desktop) */
.toc-mobile {
  display: none;
  background-color: rgba(249, 168, 89, 0.08);
  border: 1px solid rgba(249, 168, 89, 0.3);
  border-radius: 10px;
  margin-bottom: 35px;
  overflow: hidden;
}

.toc-mobile summary {
  font-family: var(--font-text);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-brown);
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.toc-mobile summary::after {
  content: '▾';
  color: var(--color-honey);
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}

.toc-mobile[open] summary::after {
  transform: rotate(180deg);
}

.toc-mobile nav {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column; /* Links del acordeón en vertical */
}

.toc-mobile nav a {
  display: block;
  font-family: var(--font-text);
  font-size: 0.9rem;
  color: var(--color-brown);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid rgba(144, 119, 91, 0.1);
  transition: color 0.2s ease;
}

.toc-mobile nav a:last-child {
  border-bottom: none;
}

.toc-mobile nav a:hover {
  color: var(--color-honey);
}

/* RESPONSIVE — Ocultar sidebar en tablet/mobile, mostrar acordeón */
@media (max-width: 1100px) {
  .article-with-toc {
    flex-direction: column;
    align-items: stretch;
    padding: 0 20px 60px;
  }

  .toc-sidebar {
    display: none; /* Sidebar desaparece */
  }

  .article-with-toc .blog-article {
    max-width: 800px;
    margin: 20px auto 0; /* Margen positivo para separación clara del hero */
  }

  .toc-mobile {
    display: block; /* Acordeón aparece dentro del artículo */
  }

  /* Ajustar el espacio del hero en tablet - evitar que se corte con header */
  .article-hero {
    padding: 140px 20px 80px;
    min-height: 400px;
  }

  .article-hero-content {
    margin-top: 0;
  }

  .article-hero-content h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
  }
}

@media (max-width: 576px) {
  .article-with-toc .blog-article {
    padding: 30px 20px;
    margin: 0 auto 0; /* Sin overlap en móvil */
  }

  /* Ajustar el espacio del hero en móvil - evitar que se corte con header */
  .article-hero {
    padding: 130px 15px 70px;
    min-height: 350px;
  }

  .article-hero-content {
    margin-top: 0;
  }

  .article-hero-content h1 {
    font-size: clamp(2.2rem, 8vw, 2.8rem);
  }
}


/* =============================================
   ARTÍCULOS RELACIONADOS — ARTISANAL WARM STYLE
   ============================================= */

.related-articles {
  max-width: 1180px;
  margin: 80px auto 40px;
  padding: 0 20px;
}

.related-articles-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.related-articles-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 8px 0;
  letter-spacing: 0.02em;
}

.related-articles-subtitle {
  font-family: var(--font-text);
  font-size: 0.9rem;
  color: var(--color-brown);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
}

/* Línea decorativa con pequeño hexágono */
.related-articles-header::after {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  margin: 20px auto 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f9a826' stroke-width='1.5'%3E%3Cpath d='M12 2L4 7v10l8 5 8-5V7l-8-5z'/%3E%3Cpath d='M12 22V12'/%3E%3Cpath d='M12 12L4 7'/%3E%3Cpath d='M12 12l8-5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.6;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.related-article-card {
  background: var(--color-cream);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 20px rgba(74, 62, 52, 0.08);
}

/* Borde superior honey estilo "sello artesanal" */
.related-article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-honey) 0%, var(--color-olive) 100%);
}

.related-article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(249, 168, 89, 0.2);
}

.related-article-card-image-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.related-article-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.related-article-card:hover .related-article-card-image {
  transform: scale(1.08);
}

/* Overlay sutil en hover */
.related-article-card-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(74, 62, 52, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.related-article-card:hover .related-article-card-image-wrapper::after {
  opacity: 1;
}

.related-article-card-content {
  padding: 28px;
}

.related-article-card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(249, 168, 89, 0.15) 0%, rgba(249, 168, 89, 0.08) 100%);
  color: var(--color-olive);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-text);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* Pequeño círculo decorativo en la categoría */
.related-article-card-category::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-honey);
  border-radius: 50%;
}

.related-article-card h3 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 14px 0;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.related-article-card:hover h3 {
  color: var(--color-olive);
}

.related-article-card-excerpt {
  font-family: var(--font-text);
  font-size: 0.95rem;
  color: var(--color-brown);
  line-height: 1.7;
  margin: 0;
}

/* Flecha "lee más" que aparece en hover */
.related-article-card-content::after {
  content: 'Lee más →';
  display: block;
  font-family: var(--font-text);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-honey);
  margin-top: 18px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.related-article-card:hover .related-article-card-content::after {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive para artículos relacionados */
@media (max-width: 768px) {
  .related-articles-grid {
    grid-template-columns: 1fr;
  }

  .related-articles {
    margin: 60px auto 30px;
  }

  .related-article-card-image-wrapper {
    height: 200px;
  }

  .related-article-card-content {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .related-article-card-content {
    padding: 20px;
  }

  .related-article-card h3 {
    font-size: 1.2rem;
  }
}
