/* Previene desbordamiento global por el truco del breakout */
html, body {
  overflow-x: hidden;
}

#ca-blog-page {
  background: #ffffff;
  color: #111111;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  box-sizing: border-box;
}

/* AMPLIADO: max-width a 1600px para que las cards dejen de ser delgadas */
.ca-blog-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding-left: 4%;
  padding-right: 4%;
  box-sizing: border-box;
}

/* ==========================================
    Hero (Optimizado para Logos Gigantes)
========================================== */

.ca-blog-hero {
  /* Empuja el contenido radicalmente hacia abajo salvando el logo de image_e1c966.jpg */
  padding: 380px 0 130px; 
  background:
    linear-gradient(135deg, rgba(31, 49, 96, 0.96), rgba(18, 27, 58, 0.94)),
    url('https://cacarpentry.biz/wp-content/uploads/2025/07/IMG_8428_compressed-scaled.jpg');
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.ca-blog-hero .ca-blog-container {
  max-width: 1600px;
}

.ca-blog-eyebrow {
  display: inline-block;
  margin-bottom: 22px;
  color: #d9b35f;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.ca-blog-hero h1 {
  max-width: 1100px;
  margin: 0 0 26px;
  color: #ffffff;
  font-size: clamp(42px, 5.5vw, 76px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -1.5px;
}

.ca-blog-hero p {
  max-width: 850px;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 20px;
  line-height: 1.7;
}

/* ==========================================
    Blog Listing 
========================================== */

.ca-blog-listing {
  padding: 120px 0 150px; 
}

.ca-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px; /* Espacio elegante entre columnas anchas */
  align-items: stretch;
}

/* ==========================================
    Blog Cards (Robustas y Espaciosas)
========================================== */

.ca-blog-card {
  background: #ffffff;
  border: 1px solid rgba(31, 49, 96, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 55px rgba(12, 27, 60, 0.05);
  transition:
    transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.3s ease;
}

.ca-blog-card:hover {
  transform: translateY(-8px);
  border-color: rgba(31, 49, 96, 0.2);
  box-shadow: 0 35px 75px rgba(12, 27, 60, 0.12);
}

.ca-blog-card-image {
  display: block;
  height: 270px; /* Más altura para equilibrar el nuevo ancho */
  overflow: hidden;
  background: #f3f3f3;
  text-decoration: none;
}

.ca-blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.ca-blog-card:hover .ca-blog-card-image img {
  transform: scale(1.04);
}

.ca-blog-card-body {
  padding: 40px 36px 42px; /* Más padding para que respire el texto */
}

.ca-blog-card-meta {
  margin-bottom: 16px;
  color: #1f3160;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.ca-blog-card-title {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 900;
}

.ca-blog-card-title a {
  color: #111111;
  text-decoration: none;
}

.ca-blog-card-title a:hover {
  color: #1f3160;
}

.ca-blog-card-excerpt {
  margin: 0 0 32px;
  color: #555555;
  font-size: 16px;
  line-height: 1.65;
}

/* BOTÓN DE CARD MÁS ANCHO Y FIRME */
.ca-blog-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px; /* Más ancho interno */
  min-width: 160px;    /* Ancho mínimo garantizado */
  background: #1f3160;
  color: #ffffff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.ca-blog-card-button:hover {
  background: #111111;
  transform: translateX(4px);
  color: white;
  box-shadow: 0 5px 15px rgba(31, 49, 96, 0.2);
}

/* ==========================================
    Pagination (Estilo Botón Global "Ver más")
========================================== */

.ca-blog-pagination {
  margin-top: 90px;
  text-align: center;
}

.ca-blog-pagination .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Esconde los números de página si solo quieres el concepto de "Ver más" */
.ca-blog-pagination .page-numbers {
  display: none;
}

/* Muestra únicamente el botón de "Next" (Siguiente) transformado en un botón gigante */
.ca-blog-pagination .next {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  background: #ffffff;
  border: 2px solid #1f3160;
  color: #1f3160;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px rgba(31, 49, 96, 0.05);
}

.ca-blog-pagination .next:hover {
  background: #1f3160;
  color: #ffffff;
  box-shadow: 0 15px 35px rgba(31, 49, 96, 0.15);
  transform: translateY(-2px);
}

/* ==========================================
    Responsive
========================================== */

@media (max-width: 1200px) {
  .ca-blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Pasa a 2 columnas antes si la pantalla reduce */
    gap: 40px;
  }
}

@media (max-width: 767px) {
  .ca-blog-hero {
    padding: 280px 0 90px; /* Control de espacio en móviles */
  }

  .ca-blog-grid {
    grid-template-columns: 1fr;
  }
  
  .ca-blog-card-body {
    padding: 32px 24px;
  }
}


/* ==========================================
    ENTRADAS INDIVIDUALES (SIDEBAR LAYOUT)
========================================== */

#ca-single-post {
  background: #ffffff;
  color: #111111;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  box-sizing: border-box;
  /* SEPARACIÓN DEL HEADER: Incrementado para esquivar por completo el logo gigante */
  padding-top: 320px; 
  padding-bottom: 120px;
}

.ca-single-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding-left: 4%;
  padding-right: 4%;
  box-sizing: border-box;
}

/* Imagen de portada regular */
.ca-single-featured-image {
  width: 100%;
  margin-bottom: 25px;
}

.ca-single-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 12px;
}

/* Estilo de los metadatos idéntico a tu captura */
.ca-post-meta-block {
  font-size: 13px;
  color: #666666;
  line-height: 1.8;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ca-post-meta-block p {
  margin: 4px 0;
}

.ca-post-meta-block a {
  color: #3b7eff; /* Azul vibrante de los links de tags */
  text-decoration: none;
  font-weight: 700;
}

.ca-post-meta-block a:hover {
  text-decoration: underline;
}

/* Título */
.ca-single-main-title {
  font-size: clamp(32px, 4.5vw, 48px);
  color: #111111;
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 45px 0;
  letter-spacing: -1px;
}

/* Distribución de rejilla para integrar el Sidebar */
.ca-single-layout-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 60px;
  align-items: start;
}

/* Columna de lectura */
.ca-single-main-column {
  min-width: 0; /* Previene desbordamientos en grids */
}

.ca-single-content {
  font-size: 18px;
  line-height: 1.85;
  color: #333333;
}

.ca-single-content p {
  margin-bottom: 28px;
}

.ca-single-content h2, 
.ca-single-content h3 {
  color: #1f3160;
  font-weight: 900;
  margin: 50px 0 20px;
  line-height: 1.3;
}

.ca-single-content h2 { font-size: 30px; }
.ca-single-content h3 { font-size: 24px; }

/* ==========================================
    SIDEBAR & CARD CTA
========================================== */

.ca-single-sidebar {
  position: sticky;
  top: 140px; /* Se queda flotando elegantemente al hacer scroll */
}

.ca-sidebar-cta-card {
  background: #1f3160; /* Tu azul corporativo */
  color: #ffffff;
  padding: 45px 35px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 45px rgba(31, 49, 96, 0.15);
}

.ca-sidebar-cta-card .cta-subtitle {
  color: #d9b35f; /* Oro/Crema decorativo */
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 12px;
}

.ca-sidebar-cta-card h3 {
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0 0 18px 0;
}

.ca-sidebar-cta-card p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 30px 0;
}

.ca-sidebar-cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #1f3160;
  padding: 16px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.ca-sidebar-cta-button:hover {
  background: #d9b35f;
  color: #1f3160;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Footer */
.ca-single-footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.ca-back-to-blog {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  background: #ffffff;
  border: 2px solid #1f3160;
  color: #1f3160;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.ca-back-to-blog:hover {
  background: #1f3160;
  color: #ffffff;
  transform: translateX(-4px);
}

/* ==========================================
    RESPONSIVO MÓVIL
========================================== */

@media (max-width: 1024px) {
  .ca-single-layout-grid {
    grid-template-columns: 1fr; /* Sidebar pasa abajo en tablets y móviles */
    gap: 50px;
  }
  
  .ca-single-sidebar {
    position: static;
  }
}

@media (max-width: 767px) {
  #ca-single-post {
    padding-top: 220px; /* Ajuste para el menú compacto de móviles */
  }
  
  .ca-single-main-title {
    font-size: 28px;
    margin-bottom: 30px;
  }
  
  .ca-single-content {
    font-size: 16px;
  }
}