/**
 * PORTOCARRERO WEB - BLOG CSS
 * Estilos para el sistema de blog
 * Estilo: Editorial Industrial Premium
 */

@layer blog {

/* Custom properties para el blog */
.page-blog,
.page-blog-single {
  --blog-primary: #e8b931;
  --blog-dark: #0a0a0a;
  --blog-surface: #f5f5f0;
  --blog-border: rgba(0, 0, 0, 0.06);
  --blog-text: #3a3a38;
  --blog-text-muted: #666;
  --blog-heading: #111110;
  --blog-light-bg: #f5f5f0;
  overflow-x: hidden;
}

/* Evitar scroll horizontal global */
.page-blog-single main,
.page-blog-single .article-layout,
.page-blog-single .article-content {
  overflow-x: hidden;
}

/* Botones consistentes en el blog — dark on light bg */
.page-blog .btn-industrial,
.page-blog-single .btn-industrial {
  padding: 12px 40px;
  background: #111110;
  color: #ffffff;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background 0.2s ease;
}

.page-blog .btn-industrial:hover,
.page-blog-single .btn-industrial:hover {
  background: #2a2a2a;
  color: #ffffff;
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reading-progress.visible {
  opacity: 1;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #e8b931, #d4a72a);
  width: 0%;
  transition: width 0.1s linear;
}

/* ============================================
   BLOG HERO
   ============================================ */
.blog-hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(0, 5, 15, 0.92) 0%, rgba(0, 20, 45, 0.95) 50%, rgba(0, 10, 25, 0.93) 100%);
  text-align: center;
  position: relative;
}

/* Imagen hero desde HTML */
.blog-hero .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -1;
}

/* Grid tecnológico sutil (como en index) */
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 185, 49, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 185, 49, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: -1px -1px;
  z-index: 0;
  pointer-events: none;
}

.blog-hero .container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.blog-hero .hero-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #e8b931;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(232, 185, 49, 0.3);
}

.blog-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.blog-hero .hero-lead {
  font-size: clamp(1.125rem, 1.5vw, 1.25rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  max-width: 700px;
  margin: 0 auto;
}

/* Hero de categoría */
.blog-hero-category {
  position: relative;
}

.blog-hero-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--cat-color, #e8b931);
}

.blog-hero-category h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.blog-hero-category h1::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--cat-color, #e8b931);
  border-radius: 0;
}

/* Hero de tag */
.blog-hero-tag .tag-hash {
  color: #e8b931;
}

/* Hero de búsqueda */
.blog-hero-search .search-term {
  color: #e8b931;
}

.search-form-hero {
  display: flex;
  gap: 1rem;
  max-width: 600px;
  margin: 2rem auto 0;
}

.search-input-hero {
  flex: 1;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  font-size: 1rem;
  font-family: inherit;
  color: #ffffff;
  transition: all 0.3s ease;
}

.search-input-hero::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-input-hero:focus {
  outline: none;
  border-color: #e8b931;
  background: rgba(255, 255, 255, 0.15);
}

/* Breadcrumbs en hero */
.hero-breadcrumbs {
  font-size: 0.875rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.6);
}

.hero-breadcrumbs a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-breadcrumbs a:hover {
  color: #e8b931;
}

.hero-breadcrumbs .separator {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.3);
}

.hero-breadcrumbs .current {
  color: #ffffff;
}

/* Stats de categoría */
.category-stats {
  margin-top: 2rem;
}

.stat-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(232, 185, 49, 0.15);
  border: 1px solid rgba(232, 185, 49, 0.3);
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
}

/* ============================================
   FILTROS
   ============================================ */
.blog-filters {
  padding: 1.5rem 2rem;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 72px; /* Altura del header premium */
  z-index: 100;
}

.filters-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.filter-categories {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.filter-btn.active {
  background: transparent;
  border-color: transparent;
  border-bottom: 2px solid #e8b931;
  color: #e8b931;
}

.filter-search {
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
  font-family: inherit;
  color: #ffffff;
  width: 200px;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
  outline: none;
  border-color: #e8b931;
  background: rgba(255, 255, 255, 0.08);
}

.search-btn {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-btn:hover {
  background: #e8b931;
  border-color: #e8b931;
  color: #111110;
}

.search-btn svg {
  display: block;
}

/* ============================================
   ARTÍCULO DESTACADO
   ============================================ */
.blog-featured {
  padding: 4rem 2rem;
  background: #ffffff;
}

.featured-card {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.featured-image {
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
}

.featured-image img,
.featured-image video {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.featured-image:hover img,
.featured-image:hover video {
  transform: scale(1.03);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(10, 10, 10, 0.85);
  color: #e8b931;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0;
}

.featured-content {
  padding: 2rem 0;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.category-badge {
  padding: 0.375rem 0.75rem;
  background: transparent;
  border-left: 3px solid #e8b931;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e8b931;
  text-decoration: none;
  transition: all 0.2s ease;
}

.category-badge:hover {
  background: rgba(232, 185, 49, 0.08);
}

.read-time {
  color: #666;
}

.featured-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

.featured-title a {
  color: #111110;
  text-decoration: none;
  transition: color 0.2s ease;
}

.featured-title a:hover {
  color: #e8b931;
}

.featured-excerpt {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #505050;
  margin-bottom: 2rem;
}

.featured-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.author-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-weight: 500;
  color: #111110;
}

.post-date {
  font-size: 0.875rem;
  color: #666;
}

/* ============================================
   GRID DE ARTÍCULOS
   ============================================ */
.blog-grid-section {
  padding: 4rem 2rem;
  background: #ffffff;
}

.blog-grid-section .section-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  color: #111110;
  margin-bottom: 3rem;
  text-align: left;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ============================================
   CARD DE ARTÍCULO
   ============================================ */
.blog-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  transition: border-color 0.2s ease;
}

.blog-card:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.blog-card-image {
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
}

.blog-card-image img,
.blog-card-image video {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.blog-card:hover .blog-card-image img,
.blog-card:hover .blog-card-image video {
  transform: scale(1.02);
}

.blog-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
}

.blog-card-title a {
  color: #111110;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card-title a:hover {
  color: #e8b931;
}

.blog-card-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #666;
  font-weight: 400;
  margin-bottom: 1.5rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.8125rem;
  color: #666;
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  font-weight: 500;
  color: #111110;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
  border-color: #e8b931;
  color: #e8b931;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-numbers {
  display: flex;
  gap: 0.5rem;
}

.pagination-num {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  font-weight: 500;
  color: #505050;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination-num:hover:not(.active) {
  border-color: #e8b931;
  color: #e8b931;
}

.pagination-num.active {
  background: #e8b931;
  border-color: #e8b931;
  color: #111110;
}

/* ============================================
   TAGS POPULARES
   ============================================ */
.blog-tags-section {
  padding: 4rem 2rem;
  background: #f5f5f0;
}

.blog-tags-section .section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111110;
  text-align: center;
  margin-bottom: 2rem;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 800px;
  margin: 0 auto;
}

.tag-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #3a3a38;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-link:hover,
.tag-link.active {
  border-bottom-color: #e8b931;
  color: #e8b931;
}

.tag-count {
  font-size: 0.75rem;
  color: #999;
}

/* ============================================
   NEWSLETTER
   ============================================ */
.blog-newsletter {
  padding: 6rem 2rem;
  background: #0a0a0a;
}

.newsletter-box {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.newsletter-content h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
}

.newsletter-content p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.newsletter-form {
  display: flex;
  gap: 1rem;
}

.newsletter-input {
  flex: 1;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  font-size: 1rem;
  font-family: inherit;
  color: #ffffff;
  transition: all 0.2s ease;
}

.newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.newsletter-input:focus {
  outline: none;
  border-color: #e8b931;
  background: rgba(255, 255, 255, 0.15);
}

.newsletter-form .btn-industrial {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.newsletter-form .btn-industrial:hover {
  border-color: #ffffff;
  color: #ffffff;
  background: transparent;
}

/* ============================================
   ESTADO VACÍO
   ============================================ */
.blog-empty {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.blog-empty .empty-icon {
  margin-bottom: 2rem;
  color: #ccc;
}

.blog-empty h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111110;
  margin-bottom: 1rem;
}

.blog-empty p {
  color: #666;
  margin-bottom: 1.5rem;
}

.empty-suggestions {
  text-align: left;
  background: #f5f5f0;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.empty-suggestions ul {
  margin: 0.5rem 0 0 1.5rem;
  color: #666;
}

.empty-suggestions li {
  margin-bottom: 0.5rem;
}

/* ============================================
   ARTÍCULO INDIVIDUAL - HERO
   ============================================ */
.article-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(80px + 1rem) 2rem 2rem;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.4)),
    var(--hero-image) center/cover no-repeat;
  color: #ffffff;
  overflow: hidden;
}

/* Video de fondo para el hero */
.article-hero .hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

/* Degradado sobre el video */
.article-hero:has(.hero-video)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.4));
  z-index: 0;
}

.article-hero:has(.hero-video) .container-narrow {
  position: relative;
  z-index: 1;
}

.article-hero .container-narrow {
  max-width: 950px;
  margin: 0 auto;
}

.article-breadcrumbs {
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.article-breadcrumbs a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-breadcrumbs a:hover {
  color: #ffffff;
}

.article-breadcrumbs .separator {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.4);
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.article-meta-top .category-badge {
  background: rgba(255, 255, 255, 0.15);
  border-left-color: var(--cat-color, #e8b931);
  color: #ffffff;
}

.article-meta-top .read-time {
  color: rgba(255, 255, 255, 0.8);
}

.meta-separator {
  color: rgba(255, 255, 255, 0.4);
}

.expertise-badge {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0;
}

.expertise-beginner {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.expertise-intermediate {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.expertise-advanced {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
}

.expertise-expert {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.article-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.article-excerpt {
  font-size: clamp(1.125rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.article-meta-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.author-info {
  display: flex;
  align-items: center;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-details .author-name {
  font-weight: 600;
  color: #ffffff;
}

.author-details .author-role {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.date-info {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.updated-date {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   ARTÍCULO - LAYOUT
   ============================================ */
.article-layout {
  padding: 4rem 2rem;
  background: #ffffff;
}

.article-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* ============================================
   ARTÍCULO - CONTENIDO
   ============================================ */
.article-content {
  max-width: 720px;
}

.article-content h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 700;
  color: #111110;
  margin: 3rem 0 1.25rem;
  padding-left: 1.25rem;
  border-left: 4px solid #e8b931;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.article-content > section:first-child h2:first-child,
.article-content h2:first-child {
  margin-top: 0;
}

/* Asegurar margen en h2 dentro de secciones */
.article-content section + section h2 {
  margin-top: 3rem;
}

.article-content h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
  color: #1a1a1a;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.015em;
}

.article-content p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #3a3a38;
  margin-bottom: 1.5rem;
  text-align: justify;
  hyphens: auto;
}

.article-content > p:first-of-type {
  font-size: 1.1875rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.7;
}

.article-content a {
  color: #e8b931;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: #d4a72a;
}

/* Quitar underline de botones y tags */
.article-content .btn-industrial,
.article-content .tag-link,
.article-content .share-btn {
  text-decoration: none;
}

/* Listas */
.article-list {
  margin: 1.5rem 0 2rem 1.5rem;
}

.article-list li {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #3a3a38;
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.article-list li::marker {
  color: #e8b931;
}

/* Blockquotes */
.article-quote {
  margin: 2.5rem 0;
  padding: 2rem 2.5rem;
  background: linear-gradient(90deg, rgba(232, 185, 49, 0.08) 0%, transparent 100%);
  border-left: 4px solid #e8b931;
}

.article-quote p {
  font-size: 1.25rem;
  font-weight: 500;
  font-style: normal;
  color: #1a1a1a;
  line-height: 1.6;
  margin: 0;
}

/* Código */
.article-content pre {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #0a0a0a;
  border: 1px solid rgba(232, 185, 49, 0.2);
  border-radius: 0;
  overflow-x: auto;
}

.article-content pre code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e6e6e6;
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
}

.article-content p code {
  padding: 0.2rem 0.5rem;
  background: rgba(232, 185, 49, 0.1);
  border-radius: 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  color: #111110;
}

/* Callouts */
.article-callout {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 0;
}

.callout-icon {
  flex-shrink: 0;
}

.callout-content strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.callout-content p {
  margin: 0;
  font-size: 0.9375rem;
}

.callout-info {
  background: rgba(232, 185, 49, 0.08);
  border-left: 4px solid #e8b931;
}

.callout-info .callout-icon {
  color: #e8b931;
}

.callout-info strong {
  color: #e8b931;
}

.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid #10b981;
}

.callout-tip .callout-icon {
  color: #10b981;
}

.callout-tip strong {
  color: #10b981;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid #f59e0b;
}

.callout-warning .callout-icon {
  color: #f59e0b;
}

.callout-warning strong {
  color: #f59e0b;
}

/* Figuras */
.article-figure {
  margin: 2.5rem 0;
}

.article-figure img {
  width: 100%;
  height: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.article-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #666;
  text-align: center;
}

/* Tags del artículo */
.article-tags {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.tags-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
}

.tags-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tags-list .tag-link {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* Compartir inline */
.article-share {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.share-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #505050;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  border-color: #e8b931;
  color: #e8b931;
}

/* ============================================
   SIDEBAR
   ============================================ */
.article-sidebar {
  position: relative;
}

.sidebar-sticky {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Tabla de contenidos */
.toc-desktop {
  padding: 1.5rem;
  background: #f5f5f0;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.toc-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  display: block;
  padding: 0.5rem 0;
  padding-left: 1rem;
  font-size: 0.875rem;
  color: #505050;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.toc-list a:hover,
.toc-list a.active {
  color: #e8b931;
  border-left-color: #e8b931;
}

/* ToC móvil */
.toc-mobile {
  display: none;
  margin-bottom: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.toc-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem;
  background: #f5f5f0;
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111110;
  cursor: pointer;
}

.toc-toggle svg {
  transition: transform 0.2s ease;
}

.toc-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.toc-mobile-content {
  padding: 1rem;
  display: none;
}

.toc-mobile-content[aria-hidden="false"] {
  display: block;
}

/* Sidebar compartir */
.share-buttons-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-buttons-vertical .share-btn {
  width: 100%;
  height: auto;
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  justify-content: flex-start;
  font-size: 0.875rem;
}

/* Sidebar relacionados */
.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.related-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.related-list a {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #505050;
  text-decoration: none;
  transition: color 0.2s ease;
}

.related-list a:hover {
  color: #e8b931;
}

/* ============================================
   AUTHOR BOX
   ============================================ */
.author-box-section {
  padding: 4rem 2rem;
  background: #f5f5f0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.author-box {
  padding: 2rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.author-box-content {
  flex: 1;
}

.author-box-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111110;
  margin-bottom: 0.25rem;
}

.author-box-role {
  font-size: 0.875rem;
  color: #e8b931;
  font-weight: 500;
  margin-bottom: 1rem;
}

.author-box-bio {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #505050;
  margin-bottom: 1rem;
}

.author-box-social {
  display: flex;
  gap: 0.75rem;
}

.author-box-social .social-link {
  color: #666;
  transition: color 0.2s ease;
}

.author-box-social .social-link:hover {
  color: #e8b931;
}

/* ============================================
   NAVEGACIÓN ENTRE ARTÍCULOS
   ============================================ */
.article-navigation {
  padding: 0 2rem;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 2rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.nav-link:hover:not(.disabled) {
  background: #f5f5f0;
}

.nav-link.disabled {
  opacity: 0;
  pointer-events: none;
}

.nav-prev {
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-next {
  text-align: right;
}

.nav-label {
  font-size: 0.8125rem;
  color: #666;
}

.nav-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111110;
  line-height: 1.4;
}

/* ============================================
   MÁS ARTÍCULOS
   ============================================ */
.more-articles {
  padding: 4rem 2rem;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.more-articles .section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111110;
  text-align: center;
  margin-bottom: 3rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .article-sidebar {
    display: none;
  }

  .toc-mobile {
    display: block;
  }

  .featured-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .newsletter-box {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .newsletter-form {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .blog-hero {
    min-height: 100svh;
    padding: 1.5rem;
  }

  .blog-filters {
    padding: 1rem 1.5rem;
    top: 70px;
  }

  .filters-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .filter-categories {
    justify-content: center;
  }

  .search-input {
    width: 100%;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-featured {
    padding: 3rem 1.5rem;
  }

  .blog-grid-section {
    padding: 3rem 1.5rem;
  }

  .article-hero {
    min-height: 100svh;
    padding: calc(70px + 1.5rem) 1.25rem 1.5rem;
  }

  .article-hero .container-narrow {
    max-width: 100%;
  }

  .article-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .article-excerpt {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }

  .article-meta-top {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .article-meta-top .category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .article-meta-top .read-time {
    font-size: 0.8125rem;
  }

  .article-meta-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: 1rem;
  }

  .author-details .author-name {
    font-size: 0.9375rem;
  }

  .author-details .author-role {
    font-size: 0.8125rem;
  }

  .date-info {
    font-size: 0.8125rem;
  }

  .article-layout {
    padding: 2rem 1.25rem;
  }

  .article-content h2 {
    padding-left: 1rem;
  }

  .author-box {
    text-align: center;
  }

  .nav-grid {
    grid-template-columns: 1fr;
  }

  .nav-prev {
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .nav-next {
    text-align: left;
  }

  .pagination-numbers {
    display: none;
  }

  .article-share {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 375px) {
  .blog-hero h1 {
    font-size: 2rem;
  }

  .filter-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }

  .featured-title {
    font-size: 1.5rem;
  }

  .blog-card-title {
    font-size: 1.125rem;
  }

  /* Artículo single - pantallas muy pequeñas */
  .article-hero {
    padding: calc(60px + 1rem) 1rem 1rem;
  }

  .article-title {
    font-size: 1.375rem;
  }

  .article-excerpt {
    font-size: 0.9375rem;
  }

  .article-layout {
    padding: 1.5rem 1rem;
  }

  .article-content p {
    font-size: 0.9375rem;
    line-height: 1.7;
  }

  .article-content h2 {
    font-size: 1.25rem;
    padding-left: 0.75rem;
  }

  .article-content h3 {
    font-size: 1.0625rem;
  }

  /* Tablas cards más compactas */
  .results-table td,
  .metrics-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Métricas en 1 columna */
  .narrative-metrics {
    grid-template-columns: 1fr;
  }

  /* CTA botón a ancho completo */
  .cta-box .btn-industrial,
  .page-blog .btn-industrial,
  .page-blog-single .btn-industrial {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 14px 32px;
    font-size: 12px;
  }
}

/* ============================================
   CONTENIDO DINÁMICO POR CATEGORÍA
   ============================================ */

/* Problem conclusion */
.problem-conclusion {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(239, 68, 68, 0.05);
  border-left: 3px solid #ef4444;
}

/* Secciones de artículo con separación */
.article-content section#introduccion,
.article-content section#el-problema,
.article-content section#conclusion,
.article-content section#resultados-tabla,
.article-content section#cta,
.article-content section[id^="seccion-"],
.article-content section[id^="principio-"],
.article-content section[id^="tendencia-"],
.article-content section[id^="situacion-"],
.article-content section[id^="proceso"],
.article-content section[id^="resultados"] {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Primera sección sin borde superior */
.article-content > section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Code block con header */
.code-block {
  margin: 2rem 0;
  border: 1px solid rgba(232, 185, 49, 0.2);
  border-radius: 0;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(232, 185, 49, 0.2);
}

.code-block-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
}

.code-block-lang {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: rgba(232, 185, 49, 0.2);
  color: #e8b931;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* Section result */
.section-result {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid #10b981;
  font-size: 0.9375rem;
}

.section-result strong {
  color: #10b981;
}

/* Metric callout */
.metric-callout {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(90deg, rgba(232, 185, 49, 0.08) 0%, transparent 100%);
  border-left: 3px solid #e8b931;
}

.metric-project {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: #e8b931;
  color: #111110;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-callout p {
  margin: 0;
  font-size: 0.9375rem;
  color: #3a3a38;
}

/* Metrics table inline */
.metrics-table {
  margin: 1.5rem 0;
}

.metrics-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.metrics-table th,
.metrics-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.metrics-table th {
  background: #f5f5f0;
  font-weight: 600;
  color: #111110;
}

.metrics-table td {
  color: #3a3a38;
}

/* Metrics table - Mobile: formato de cards apiladas */
@media (max-width: 640px) {
  .metrics-table table,
  .metrics-table thead,
  .metrics-table tbody,
  .metrics-table th,
  .metrics-table td,
  .metrics-table tr {
    display: block;
  }

  .metrics-table thead {
    display: none;
  }

  .metrics-table tr {
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
  }

  .metrics-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.875rem;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.8125rem;
    text-align: right;
  }

  .metrics-table td:last-child {
    border-bottom: none;
  }

  .metrics-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #111110;
    text-align: left;
    flex-shrink: 0;
    margin-right: 1rem;
  }
}

/* Results table (full) */
.results-section {
  margin-top: 3rem;
}

.results-table {
  margin-top: 1.5rem;
}

.results-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.results-table th,
.results-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.results-table th {
  background: #0a0a0a;
  font-weight: 600;
  color: #ffffff;
}

.results-table td {
  color: #3a3a38;
}

.results-table tr:nth-child(even) td {
  background: #f5f5f0;
}

.results-table .cell-highlight {
  font-weight: 600;
  color: #10b981;
}

/* Results table - Mobile: formato de cards apiladas */
@media (max-width: 640px) {
  .results-table table,
  .results-table thead,
  .results-table tbody,
  .results-table th,
  .results-table td,
  .results-table tr {
    display: block;
  }

  .results-table thead {
    display: none;
  }

  .results-table tr {
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
  }

  .results-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.875rem;
    text-align: right;
  }

  .results-table td:last-child {
    border-bottom: none;
  }

  .results-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #111110;
    text-align: left;
    flex-shrink: 0;
    margin-right: 1rem;
  }

  .results-table tr:nth-child(even) td {
    background: transparent;
  }

  .results-table tr:nth-child(even) {
    background: #f5f5f0;
  }
}

/* ============================================
   NARRATIVE SECTIONS (Casos de Estudio)
   ============================================ */
.narrative-section {
  /* Heredan estilos de la regla general de secciones */
}

.narrative-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.metric-badge {
  padding: 1.25rem;
  background: #f5f5f0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111110;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.8125rem;
  color: #666;
}

/* Project phases */
.project-phases {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.phase-card {
  padding: 1.5rem;
  background: #f5f5f0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 4px solid #e8b931;
}

.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.phase-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111110;
}

.phase-duration {
  padding: 0.25rem 0.75rem;
  background: rgba(232, 185, 49, 0.15);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #111110;
}

.phase-tasks {
  margin: 0;
  padding-left: 1.25rem;
}

.phase-tasks li {
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: #505050;
}

.phase-tasks li::marker {
  color: #e8b931;
}

/* ============================================
   REFACTORING SECTIONS (Código Limpio)
   ============================================ */
.refactoring-section {
  /* Heredan estilos de la regla general de secciones */
  position: relative;
}

.principle-badge {
  position: absolute;
  top: 2rem;
  left: -3rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8b931;
  color: #111110;
  font-size: 1rem;
  font-weight: 700;
}

.article-content > section:first-of-type.refactoring-section .principle-badge {
  top: 0;
}

.principle-subtitle {
  font-size: 1.125rem;
  font-style: italic;
  color: #666;
  margin-bottom: 1rem;
}

.principle-explanation {
  padding: 1rem 1.5rem;
  background: rgba(232, 185, 49, 0.08);
  border-left: 3px solid #e8b931;
  margin-bottom: 2rem;
}

.code-comparison {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin: 2.5rem 0;
}

.code-before,
.code-after {
  /* wrapper transparente, el pre tiene su propio fondo oscuro */
}

.comparison-label {
  display: block;
  margin: 0 0 0.75rem 0;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}

.comparison-after .comparison-label {
  color: #e8b931;
}

.code-before pre,
.code-after pre {
  margin: 0;
  border: none;
  border-radius: 0;
  border-left: 3px solid #333;
}

.code-after pre {
  border-left-color: #e8b931;
}

.code-problems,
.code-benefits {
  margin: 1rem 0 0 0;
  padding: 0;
  background: transparent;
  list-style: none;
}

.code-problems li,
.code-benefits li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 0;
  font-size: 0.875rem;
  position: relative;
  color: #666;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.code-problems li:last-child,
.code-benefits li:last-child {
  border-bottom: none;
}

.code-problems li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: #999;
}

.code-benefits li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #e8b931;
  font-weight: 600;
}

/* ============================================
   TREND SECTIONS (Tendencias B2B)
   ============================================ */
.trend-section {
  /* Heredan estilos de la regla general de secciones */
}

.trend-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.trend-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: #e8b931;
  color: #111110;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.trend-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}

.trend-insight {
  margin-top: 1.5rem;
}

.trend-insight blockquote {
  margin: 0;
  padding: 1.5rem 2rem;
  background: linear-gradient(90deg, rgba(232, 185, 49, 0.08) 0%, transparent 100%);
  border-left: 4px solid #e8b931;
}

.trend-insight p {
  font-size: 1.125rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0 0 0.5rem 0;
}

.trend-insight cite {
  font-size: 0.875rem;
  font-style: normal;
  color: #666;
}

/* ============================================
   ARTICLE CTA
   ============================================ */
.article-cta {
  margin-top: 3rem;
}

.cta-box {
  padding: 2rem;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  text-align: right;
}

.cta-box p {
  text-align: left;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  font-size: 1.0625rem;
}

.cta-box .btn-industrial {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  padding: 0.875rem 1.5rem;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.cta-box .btn-industrial:hover {
  background: transparent;
  border-color: #ffffff;
  color: #ffffff;
}

/* ============================================
   RESPONSIVE PARA NUEVOS ELEMENTOS
   ============================================ */
@media (max-width: 768px) {
  /* Contenido del artículo - ajustes móvil */
  .article-content {
    max-width: 100%;
  }

  .article-content p {
    font-size: 1rem;
    line-height: 1.75;
  }

  .article-content h2 {
    font-size: 1.375rem;
    padding-left: 1rem;
    margin: 2rem 0 1rem;
  }

  .article-content h3 {
    font-size: 1.125rem;
    margin: 1.5rem 0 0.75rem;
  }

  /* Listas más compactas */
  .article-list {
    margin: 1rem 0 1.5rem 1rem;
  }

  .article-list li {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
  }

  /* Código responsive */
  .article-content pre {
    padding: 1rem;
    border-radius: 0;
    margin: 1.5rem 0;
    width: 100%;
    overflow-x: hidden;
  }

  .article-content pre code {
    font-size: 0.8125rem;
    line-height: 1.6;
  }

  .code-block {
    margin: 1.5rem 0;
    width: 100%;
    border-radius: 0;
  }

  .code-block-header {
    padding: 0.75rem 1rem;
  }

  .code-block-title {
    font-size: 0.8125rem;
  }

  .code-block-lang {
    font-size: 0.75rem;
  }

  .code-block pre code {
    font-size: 0.8125rem;
  }

  .code-comparison {
    gap: 2rem;
    margin: 2rem 0;
  }

  .comparison-label {
    font-size: 0.6875rem;
    margin-bottom: 0.5rem;
  }

  .code-problems li,
  .code-benefits li {
    font-size: 0.8125rem;
    padding: 0.375rem 0 0.375rem 1.25rem;
  }

  .principle-badge {
    position: static;
    margin-bottom: 1rem;
  }

  .narrative-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .metric-badge {
    padding: 1rem;
  }

  .metric-value {
    font-size: 1.25rem;
  }

  .metric-label {
    font-size: 0.75rem;
  }

  .phase-card {
    padding: 1rem;
  }

  .phase-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .phase-header h3 {
    font-size: 1rem;
    margin: 0;
  }

  .phase-tasks li {
    font-size: 0.875rem;
  }

  .trend-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .trend-number {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .trend-insight blockquote {
    padding: 1rem 1.25rem;
  }

  .trend-insight p {
    font-size: 1rem;
  }

  /* CTA box móvil */
  .cta-box {
    padding: 1.5rem;
    text-align: center;
  }

  .cta-box p {
    font-size: 0.9375rem;
    text-align: left;
  }

  .cta-box .btn-industrial {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    width: 100%;
    justify-content: center;
  }

  /* Problem conclusion */
  .problem-conclusion {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  /* Section result */
  .section-result {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }

  /* Metric callout */
  .metric-callout {
    padding: 1rem;
  }

  .metric-callout p {
    font-size: 0.875rem;
  }
}

/* ============================================
   FOCUS STATES & ACCESIBILIDAD
   ============================================ */
.filter-btn:focus-visible,
.search-btn:focus-visible,
.pagination-btn:focus-visible,
.pagination-num:focus-visible,
.tag-link:focus-visible,
.share-btn:focus-visible,
.blog-card:focus-within {
  outline: 2px solid #e8b931;
  outline-offset: 2px;
}

/* Reducir movimiento para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
  .reading-progress-bar,
  .blog-card,
  .featured-image img,
  .featured-image video,
  .blog-card-image img,
  .blog-card-image video,
  .toc-toggle svg {
    transition: none;
  }

  .blog-card:hover {
    transform: none;
  }

  .featured-image:hover img,
  .featured-image:hover video,
  .blog-card:hover .blog-card-image img,
  .blog-card:hover .blog-card-image video {
    transform: none;
  }
}

/* Stat badge update */

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .reading-progress,
  .blog-filters,
  .article-sidebar,
  .toc-mobile,
  .article-share,
  .article-navigation,
  .blog-newsletter,
  .share-buttons {
    display: none !important;
  }

  .blog-hero,
  .article-hero {
    min-height: auto;
    padding: 2rem;
    background: #fff !important;
    color: #000 !important;
  }

  .article-content {
    max-width: 100%;
  }

  .article-content a {
    color: #000;
    text-decoration: underline;
  }

  .article-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* ab-block styles (used by old full-width template, kept for reference) */

/* ============================================
   ARTICLE BLOCKS — Full-width section system
   ============================================ */

/* Base block */
.ab-block {
    padding: 100px 80px;
    width: 100%;
}

.ab-container {
    max-width: 780px;
    margin: 0 auto;
}

/* White block */
.ab-block--white {
    background: #ffffff;
}

.ab-block--white h2 {
    font-size: clamp(24px, 2.8vw, 36px);
    font-weight: 300;
    line-height: 1.3;
    color: #111110;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}

.ab-block--white p {
    font-size: 17px;
    line-height: 1.85;
    color: #3a3a38;
    margin-bottom: 20px;
}

/* Gray block */
.ab-block--gray {
    background: #f5f5f0;
}

.ab-block--gray h2 {
    font-size: clamp(24px, 2.8vw, 36px);
    font-weight: 300;
    line-height: 1.3;
    color: #111110;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}

.ab-block--gray p {
    font-size: 17px;
    line-height: 1.85;
    color: #3a3a38;
    margin-bottom: 20px;
}

/* Dark block */
.ab-block--dark {
    background: #111110;
    color: #ffffff;
}

.ab-block--dark h2 {
    font-size: clamp(24px, 2.8vw, 36px);
    font-weight: 300;
    line-height: 1.3;
    color: #ffffff;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}

.ab-block--dark h3 {
    color: #ffffff;
}

.ab-block--dark p {
    font-size: 17px;
    line-height: 1.85;
    color: rgba(255,255,255,0.75);
    margin-bottom: 20px;
}

.ab-block--dark .article-list li {
    color: rgba(255,255,255,0.7);
}

.ab-block--dark .article-list li::marker {
    color: #e8b931;
}

.ab-block--dark .problem-conclusion {
    color: #ffffff;
}

/* Dark block code/pre keep their existing dark styling */
.ab-block--dark pre {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.1);
}

/* Green block (conclusion) */
.ab-block--green {
    background: #1a3a2a;
    color: #ffffff;
}

.ab-block--green h2 {
    font-size: clamp(24px, 2.8vw, 36px);
    font-weight: 300;
    line-height: 1.3;
    color: #ffffff;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}

.ab-block--green p {
    font-size: 17px;
    line-height: 1.85;
    color: rgba(255,255,255,0.75);
    margin-bottom: 20px;
}

/* CTA block */
.ab-block--cta {
    background: #0a0a0a;
    color: #ffffff;
    text-align: center;
    padding: 100px 80px;
}

.ab-block--cta .ab-container {
    max-width: 680px;
}

.ab-block--cta h2,
.ab-block--cta p {
    color: #ffffff;
}

.ab-block--cta p {
    color: rgba(255,255,255,0.65);
    font-size: 17px;
    line-height: 1.85;
    margin-bottom: 32px;
}

.ab-block--cta .cta-box {
    background: none;
    border: none;
    padding: 0;
}

.ab-block--cta .btn-industrial {
    display: inline-flex;
    padding: 18px 48px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ab-block--cta .btn-industrial:hover {
    border-color: #ffffff;
    background: rgba(255,255,255,0.05);
}

/* TOC inline (always visible, collapsible) */
.ab-toc {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 80px;
    background: #ffffff;
}

.ab-toc .toc-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #666;
    cursor: pointer;
}

.ab-toc .toc-toggle svg {
    transition: transform 0.2s ease;
}

.ab-toc .toc-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.ab-toc .toc-content {
    padding: 20px 0 0;
    display: none;
}

.ab-toc .toc-content[aria-hidden="false"] {
    display: block;
}

.ab-toc .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ab-toc .toc-list li {
    margin-bottom: 4px;
}

.ab-toc .toc-list a {
    display: block;
    padding: 8px 0 8px 16px;
    font-size: 14px;
    color: #505050;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.ab-toc .toc-list a:hover,
.ab-toc .toc-list a.active {
    color: #e8b931;
    border-left-color: #e8b931;
}

/* Tags & share inside block */
.ab-block--white .article-tags {
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 32px;
    margin-top: 20px;
}

.ab-block--white .article-share {
    margin-top: 24px;
}

/* Override old h2 border-left inside blocks */
.ab-block h2 {
    padding-left: 0 !important;
    border-left: none !important;
}

/* Lists inside blocks */
.ab-block .article-list {
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
}

.ab-block .article-list li {
    font-size: 16px;
    line-height: 1.8;
    color: #3a3a38;
    margin-bottom: 0.5rem;
}

/* Code blocks inside blocks */
.ab-block .code-block {
    margin: 2rem 0;
}

/* Metric callout inside blocks */
.ab-block .metric-callout {
    margin: 2rem 0;
    padding: 24px 32px;
    border-left: 3px solid #e8b931;
    background: rgba(232, 185, 49, 0.05);
}

.ab-block--dark .metric-callout {
    background: rgba(232, 185, 49, 0.08);
}

/* Section result inside blocks */
.ab-block .section-result {
    margin: 1.5rem 0;
    padding: 20px 24px;
    background: rgba(232, 185, 49, 0.05);
    border-left: 3px solid #e8b931;
}

.ab-block--dark .section-result {
    background: rgba(232, 185, 49, 0.08);
    color: rgba(255,255,255,0.85);
}

/* Narrative sections */
.ab-block .narrative-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    margin: 2rem 0;
}

.ab-block .metric-badge {
    text-align: center;
    padding: 24px;
    border: 1px solid rgba(0,0,0,0.08);
}

.ab-block--dark .metric-badge {
    border-color: rgba(255,255,255,0.12);
}

.ab-block .metric-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #e8b931;
    line-height: 1;
    margin-bottom: 8px;
}

.ab-block .metric-label {
    font-size: 13px;
    color: #666;
}

.ab-block--dark .metric-label {
    color: rgba(255,255,255,0.5);
}

/* Project phases (narrative during) */
.ab-block .project-phases {
    display: grid;
    gap: 24px;
    margin: 2rem 0;
}

.ab-block .phase-card {
    padding: 28px 32px;
    border-top: 2px solid #e8b931;
    background: rgba(0,0,0,0.03);
}

.ab-block--dark .phase-card {
    background: rgba(255,255,255,0.04);
}

.ab-block .phase-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.ab-block .phase-header h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.ab-block .phase-duration {
    font-size: 13px;
    font-weight: 600;
    color: #e8b931;
    letter-spacing: 0.5px;
}

.ab-block .phase-tasks {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ab-block .phase-tasks li {
    font-size: 15px;
    line-height: 1.7;
    color: #505050;
    padding: 6px 0 6px 16px;
    position: relative;
}

.ab-block--dark .phase-tasks li {
    color: rgba(255,255,255,0.65);
}

.ab-block .phase-tasks li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 6px;
    background: #e8b931;
}

/* Refactoring sections */
.ab-block .principle-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e8b931;
    margin-bottom: 12px;
}

.ab-block .code-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 2rem 0;
}

.ab-block .comparison-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.ab-block .comparison-before {
    color: #cc4444;
}

.ab-block .comparison-after {
    color: #44aa66;
}

.ab-block .code-problems li {
    font-size: 14px;
    color: #cc4444;
}

.ab-block .code-benefits li {
    font-size: 14px;
    color: #44aa66;
}

/* Trend insight (analysis) */
.ab-block .trend-insight {
    margin: 2rem 0;
    padding: 32px;
    border-left: 3px solid #e8b931;
    background: rgba(232, 185, 49, 0.04);
}

.ab-block .trend-insight blockquote {
    margin: 0;
}

.ab-block .trend-insight p {
    font-size: 18px;
    font-style: italic;
    line-height: 1.7;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.ab-block--gray .trend-insight {
    background: rgba(232, 185, 49, 0.06);
}

.ab-block .trend-insight cite {
    font-size: 14px;
    font-style: normal;
    color: #666;
}

/* Results/metrics table in blocks */
.ab-block .results-table,
.ab-block .metrics-table {
    overflow-x: auto;
    margin: 2rem 0;
}

.ab-block table {
    width: 100%;
    border-collapse: collapse;
}

.ab-block th {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    padding: 12px 16px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    text-align: left;
}

.ab-block td {
    font-size: 15px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    color: #3a3a38;
}

.ab-block--gray th {
    border-bottom-color: rgba(0,0,0,0.12);
}

.ab-block--gray td {
    border-bottom-color: rgba(0,0,0,0.08);
}

.ab-block .cell-highlight {
    font-weight: 600;
    color: #e8b931;
}

/* ============================================
   ARTICLE BLOCKS — Responsive
   ============================================ */
@media (max-width: 1024px) {
    .ab-block {
        padding: 80px 40px;
    }

    .ab-toc {
        padding: 0 40px;
    }

    .ab-block .code-comparison {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ab-block {
        padding: 64px 24px;
    }

    .ab-toc {
        padding: 0 24px;
    }

    .ab-block .narrative-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .ab-block {
        padding: 48px 20px;
    }

    .ab-toc {
        padding: 0 20px;
    }

    .ab-block .narrative-metrics {
        grid-template-columns: 1fr;
    }
}

} /* end @layer blog */
