/* ========================================== */
/* SECCIÓN BLOG DE NOTICIAS (#blog-home)      */
/* ========================================== */

#blog-home {
  width: 100%;
  background: var(--ICO-Blanco, #FFF);
  padding: 40px 0;
}

.blog-home-wrapper {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(32px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Cabecera --- */
.blog-home-header {
  text-align: center;
  max-width: 800px;
}

.blog-home-title {
  color: var(--ICO-Azul, #0B4460);
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 120%;
  margin: 0 0 16px 0;
}

.blog-home-subtitle {
  color: var(--ICO-texto-mate, #343737);
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  margin: 0 0 40px 0;
}

/* --- Carrusel Wrapper --- */
.blog-home-carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.blog-home-viewport {
  width: 100%;
  overflow: hidden;
}

.blog-home-track {
  display: flex;
  gap: 24px;
  cursor: grab;
  user-select: none;
}

.blog-home-track.active {
  cursor: grabbing;
}

/* ========================================== */
/* FLECHAS DEL SLIDER                         */
/* ========================================== */

.blog-home-slider-btn,
#blog-home-prev,
#blog-home-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  background: #0B4460 !important;
  border-radius: 50% !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  z-index: 50 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12) !important;
  transition: transform 0.2s ease, background-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.blog-home-slider-btn:hover,
#blog-home-prev:hover,
#blog-home-next:hover {
  transform: translateY(-50%) scale(1.05);
  background: #0B4460 !important;
}

/* Ocultamos imagen interna para evitar flecha pequeña/deformada */
.blog-home-slider-btn img,
#blog-home-prev img,
#blog-home-next img {
  display: none !important;
}

/* Flecha blanca limpia */
.blog-home-slider-btn::before,
#blog-home-prev::before,
#blog-home-next::before {
  content: "" !important;
  display: block !important;
  width: 9px !important;
  height: 9px !important;
  border-top: 3px solid #FFFFFF !important;
  border-left: 3px solid #FFFFFF !important;
  box-sizing: border-box !important;
}

.blog-home-slider-btn.prev,
#blog-home-prev {
  left: -20px;
}

.blog-home-slider-btn.next,
#blog-home-next {
  right: -20px;
}

.blog-home-slider-btn.prev::before,
#blog-home-prev::before {
  transform: rotate(-45deg) !important;
  margin-left: 4px !important;
}

.blog-home-slider-btn.next::before,
#blog-home-next::before {
  transform: rotate(135deg) !important;
  margin-right: 4px !important;
}

/* ========================================== */
/* TARJETAS DEL BLOG                          */
/* ========================================== */

.blog-card {
  display: flex;
  width: 362px;
  height: 190px;
  padding: 8px;
  align-items: center;
  gap: 24px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #F7F7F7;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.blog-card:hover {
  border-color: #0B4460;
}

.blog-card-img {
  width: 124px;
  height: 175px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.blog-card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.blog-card-tag {
  display: flex;
  padding: 6px 8px;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #459CD6;
  color: var(--ICO-Blanco, #FFF);
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  margin-bottom: 16px;
  white-space: nowrap;
}

.blog-card-title {
  color: var(--ICO-Azul, #0B4460);
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-card-link {
  color: var(--ICO-Celeste, #459CD6);
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 150%;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.blog-card-link:hover {
  color: #0B4460;
}

/* ========================================== */
/* DOTS INFERIORES                            */
/* ========================================== */

.blog-home-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.blog-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #0B4460;
  background-color: transparent;
  cursor: pointer;
  transition: background-color 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  margin: 0;
  line-height: 0;
  box-shadow: none;
}

.blog-dot.active {
  background-color: #0B4460;
}

/* ========================================== */
/* BOTÓN VER TODAS LAS ENTRADAS               */
/* NORMAL: VERDE + TEXTO BLANCO               */
/* HOVER: CELESTE + TEXTO BLANCO              */
/* ========================================== */

.blog-home-footer {
  display: flex;
  justify-content: center;
  width: 100%;
}

.blog-home-btn-all {
  display: inline-flex;
  padding: 16px 40px;
  justify-content: center;
  align-items: center;
  gap: 16px;
  border-radius: 43px;
  background: #8DBF3E !important;
  color: #FFFFFF !important;
  font-family: "Avenir Next LT Pro", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  text-decoration: none !important;
  margin-top: 32px;
  border: 2px solid #8DBF3E !important;
  box-sizing: border-box;
  box-shadow: none;
  transition:
          transform 0.3s ease,
          background-color 0.3s ease,
          border-color 0.3s ease,
          box-shadow 0.3s ease;
}

/* Texto interno siempre blanco */
.blog-home-btn-all,
.blog-home-btn-all span,
.blog-home-btn-all strong,
.blog-home-btn-all b {
  color: #FFFFFF !important;
}

/* Iconos del botón */
.blog-home-btn-all img,
.blog-home-btn-all svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Flecha blanca si es SVG */
.blog-home-btn-all svg,
.blog-home-btn-all svg path {
  stroke: #FFFFFF !important;
  fill: none !important;
}

/* Flecha blanca si es IMG */
.blog-home-btn-all img {
  filter: brightness(0) invert(1) !important;
}

/* Hover correcto: celeste + texto blanco */
.blog-home-btn-all:hover,
.blog-home-btn-all:focus,
.blog-home-btn-all:active {
  transform: scale(1.03);
  background: #459CD6 !important;
  color: #FFFFFF !important;
  border-color: #459CD6 !important;
  text-decoration: none !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .10) !important;
}

.blog-home-btn-all:hover,
.blog-home-btn-all:hover span,
.blog-home-btn-all:hover strong,
.blog-home-btn-all:hover b,
.blog-home-btn-all:focus,
.blog-home-btn-all:focus span,
.blog-home-btn-all:focus strong,
.blog-home-btn-all:focus b,
.blog-home-btn-all:active,
.blog-home-btn-all:active span,
.blog-home-btn-all:active strong,
.blog-home-btn-all:active b {
  color: #FFFFFF !important;
}

.blog-home-btn-all:hover svg,
.blog-home-btn-all:hover svg path,
.blog-home-btn-all:focus svg,
.blog-home-btn-all:focus svg path,
.blog-home-btn-all:active svg,
.blog-home-btn-all:active svg path {
  stroke: #FFFFFF !important;
  fill: none !important;
}

.blog-home-btn-all:hover img,
.blog-home-btn-all:focus img,
.blog-home-btn-all:active img {
  filter: brightness(0) invert(1) !important;
}

/* ========================================== */
/* RESPONSIVE                                 */
/* ========================================== */

@media (max-width: 1024px) {
  #blog-home {
    width: 100%;
    background: var(--ICO-Blanco, #FFF);
    padding: 32px 0;
  }

  .blog-home-wrapper {
    padding: 0 24px;
  }

  .blog-home-slider-btn,
  #blog-home-prev,
  #blog-home-next {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .blog-home-title {
    font-size: 32px;
  }

  .blog-home-subtitle {
    margin-bottom: 32px;
  }

  .blog-card {
    width: min(100%, 363px);
    gap: 16px;
    padding: 12px;
  }

  .blog-card-img {
    width: 124px;
    height: 100%;
    min-height: 130px;
  }

  .blog-card-tag {
    font-size: 12px;
    padding: 4px 6px;
    margin-bottom: 12px;
  }

  .blog-card-title {
    font-size: 14px;
    margin-bottom: 12px;
    -webkit-line-clamp: 4;
  }

  .blog-home-btn-all {
    width: 100%;
    padding: 16px 20px;
  }
}
/* Ajuste WordPress: cuando la imagen del blog tiene enlace, mantener tamaño exacto de maqueta */
#blog-home .blog-card-image-link,
#blog-home .blog-card-image-link:visited {
  display: block !important;
  flex: 0 0 124px !important;
  width: 124px !important;
  height: 175px !important;
  min-width: 124px !important;
  max-width: 124px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  text-decoration: none !important;
  color: inherit !important;
}

#blog-home .blog-card-image-link .blog-card-img {
  display: block !important;
  width: 124px !important;
  height: 175px !important;
  min-width: 124px !important;
  max-width: 124px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
}

#blog-home .blog-card-link,
#blog-home .blog-card-link:visited {
  color: var(--ICO-Celeste, #459CD6) !important;
  text-decoration: none !important;
}

#blog-home .blog-card-link:hover,
#blog-home .blog-card-link:focus {
  color: var(--ICO-Azul, #0B4460) !important;
  text-decoration: none !important;
}

#blog-home .blog-home-btn-all,
#blog-home .blog-home-btn-all:visited {
  color: var(--ICO-Blanco, #FFF) !important;
  text-decoration: none !important;
}

/* ==========================================================
   Fix definitivo B2C: evita el recorte de la última tarjeta.
   El carrusel es propio (no usa una librería externa). El track
   conserva un pequeño espacio real al final y el JS desplaza los
   grupos unos píxeles adicionales desde el segundo slide.
   ========================================================== */
#blog-home .blog-home-viewport {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#blog-home .blog-home-track {
  padding: 0 4px 0 0 !important;
  box-sizing: content-box !important;
}

#blog-home .blog-card {
  position: relative;
  border: 0 !important;
  box-shadow: inset 0 0 0 1px #d8dde1 !important;
  overflow: hidden;
}

#blog-home .blog-card:hover,
#blog-home .blog-card:focus-within {
  border: 0 !important;
  box-shadow: inset 0 0 0 1px #0B4460 !important;
}
