/* ==========================================
   Blog — estilos específicos de artículos
   Siempre se carga junto con /css/home.css
   ========================================== */

/* ---- Table of Contents (collapsible <details>) ---- */
.toc {
  background: var(--color-neutral-light, #F5F7FA);
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--color-primary, #11a643);
  border-radius: 0 8px 8px 0;
  padding: 0;
  margin: 1.75rem 0 2.25rem;
  overflow: hidden;
}

.toc__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary, #11a643);
  padding: 1.25rem 1.5rem;
  margin: 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

.toc__title:hover {
  background: rgba(17, 166, 67, 0.06);
}

/* Remove native disclosure triangle */
.toc__title::-webkit-details-marker { display: none; }
.toc__title::marker { content: none; }

/* Chevron icon */
.toc__title::after {
  content: '▾';
  font-size: 1.1rem;
  font-weight: 400;
  color: #9ca3af;
  transition: transform 0.2s ease;
  display: inline-block;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

details.toc:not([open]) > .toc__title::after {
  transform: rotate(-90deg);
}

.toc__list {
  list-style: none;
  padding: 0 1.5rem 1.25rem;
  margin: 0;
  counter-reset: toc-counter;
}

/* Only direct children get the counter — avoids conflict with nested sublists */
.toc__list > li {
  counter-increment: toc-counter;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Counter lives inside the anchor so a nested <ol> can sit below without breaking flex */
.toc__list > li > a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--color-neutral-dark, #2C3E50);
  text-decoration: none;
  transition: color 0.15s;
}

.toc__list > li > a::before {
  content: counter(toc-counter, decimal-leading-zero);
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  flex-shrink: 0;
  min-width: 1.6rem;
}

.toc__list > li > a:hover {
  color: var(--color-primary, #11a643);
  text-decoration: underline;
}

/* ---- Nested H3 sublist ---- */
.toc__sublist {
  list-style: none;
  padding: 0.35rem 0 0.1rem 2.2rem;
  margin: 0;
}

.toc__sublist li {
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
  line-height: 1.4;
  padding-left: 0.65rem;
  border-left: 2px solid #e5e7eb;
}

.toc__sublist a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s;
}

.toc__sublist a:hover {
  color: var(--color-primary, #11a643);
  text-decoration: underline;
}

/* ---- Breadcrumb ---- */
.article-breadcrumb {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.article-breadcrumb a {
  color: var(--color-secondary, #2980B9);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-breadcrumb .sep {
  color: #9ca3af;
  margin: 0 0.2rem;
}

/* ---- Layout principal del artículo ---- */
.blog-article-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ---- Cabecera del artículo ---- */
.blog-article-page > article > header h1 {
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  line-height: 1.25;
  margin-bottom: 1.25rem;
  color: var(--color-neutral-dark, #2C3E50);
}

.intro {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #4a5568;
  margin-bottom: 1rem;
  font-weight: 400;
}

.article-meta {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

/* ---- Cuerpo del artículo ---- */
.blog-article-page h2 {
  font-size: 1.45rem;
  margin-top: 2.75rem;
  margin-bottom: 0.875rem;
  color: var(--color-neutral-dark, #2C3E50);
  padding-left: 0.875rem;
  border-left: 4px solid var(--color-primary, #11a643);
  line-height: 1.3;
}

.blog-article-page h3 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  color: var(--color-neutral-dark, #2C3E50);
}

.blog-article-page p {
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--font-color, #34495E);
}

.blog-article-page ul,
.blog-article-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.8;
  color: var(--font-color, #34495E);
}

.blog-article-page li {
  margin-bottom: 0.5rem;
}

.blog-article-page strong {
  color: var(--color-neutral-dark, #2C3E50);
  font-weight: 600;
}

/* ---- Blockquote ---- */
.blog-article-page blockquote {
  border-left: 4px solid var(--color-accent, #F1C40F);
  background: #fffbeb;
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
  border-radius: 0 6px 6px 0;
  color: #6b7280;
}

.blog-article-page blockquote p {
  margin-bottom: 0;
  font-style: italic;
}

/* ---- Imágenes ---- */
.article-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.75rem 0;
  display: block;
  background: #f0f4f8;
  min-height: 240px;
}

/* ---- Tablas ---- */
.blog-article-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.88rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}

.blog-article-page caption {
  caption-side: top;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  padding: 0.75rem 1rem 0.4rem;
}

.blog-article-page th {
  background-color: var(--color-primary, #11a643);
  color: #fff;
  padding: 0.8rem 1rem;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.blog-article-page td {
  padding: 0.72rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  color: var(--font-color, #34495E);
  vertical-align: top;
}

.blog-article-page tr:last-child td {
  border-bottom: none;
}

.blog-article-page tbody tr:nth-child(even) td {
  background-color: #f9fafb;
}

/* ---- CTA box — anula el borde del h2 heredado ---- */
.cta-box h2 {
  border-left: none !important;
  padding-left: 0 !important;
  margin-top: 0 !important;
}

/* ---- FAQ section ---- */
.faq {
  margin-top: 3.5rem;
}

.faq > div {
  border-bottom: 1px solid #e5e7eb;
  padding: 1.25rem 0;
}

.faq > div:last-child {
  border-bottom: none;
}

.faq h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1rem;
  color: var(--color-neutral-dark, #2C3E50);
}

.faq p {
  margin-bottom: 0;
  color: #4a5568;
  font-size: 0.93rem;
}

/* ---- Blog index — grid de artículos ---- */
.blog_page {
  padding: 3rem 1.5rem;
  min-height: 60vh;
}

.blog_container {
  max-width: 1100px;
  margin: 0 auto;
}

.blog_header {
  text-align: center;
  margin-bottom: 3rem;
}

.blog_title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.875rem;
}

.blog_lead {
  font-size: 1.05rem;
  color: #6b7280;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Cards */
.blog_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.blog_card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog_card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.11);
}

.blog_card_img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: linear-gradient(135deg, #e8f5e9, #e3f2fd);
  display: block;
}

.blog_card_body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog_card_tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary, #11a643);
  background: #e8f5e9;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.blog_card_title {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--color-neutral-dark, #2C3E50);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  text-decoration: none;
  display: block;
}

.blog_card_title:hover {
  color: var(--color-primary, #11a643);
}

.blog_card_excerpt {
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}

.blog_card_meta {
  display: flex;
  gap: 0.875rem;
  font-size: 0.78rem;
  color: #9ca3af;
  margin-bottom: 1.1rem;
}

.blog_card_link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary, #11a643);
  text-decoration: none;
  margin-top: auto;
}

.blog_card_link:hover {
  text-decoration: underline;
}

/* Subscribe block */
.blog_cta_wrap {
  background: #fff;
  border-radius: 14px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-width: 580px;
  margin: 0 auto 3rem;
}

.blog_section_title {
  font-size: 1.35rem;
  margin-bottom: 0.875rem;
  color: var(--color-neutral-dark, #2C3E50);
}

.blog_cta_text {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

.blog_form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.blog_input {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.93rem;
  flex: 1;
  min-width: 210px;
  outline: none;
  transition: border-color 0.2s;
}

.blog_input:focus {
  border-color: var(--color-primary, #11a643);
}

.blog_microcopy {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.75rem;
}

.blog_footer_text {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  padding-bottom: 1rem;
}

.blog_footer_text a {
  color: var(--color-primary, #11a643);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .blog-article-page {
    padding: 1.5rem 1rem 3.5rem;
  }

  .blog-article-page table {
    font-size: 0.78rem;
  }

  .blog-article-page th,
  .blog-article-page td {
    padding: 0.6rem 0.65rem;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .blog_page {
    padding: 2rem 1rem;
  }

  .blog_cta_wrap {
    padding: 1.5rem 1.25rem;
  }
}
