/* Blog Home Section Styles */
#blog-home-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 100px;
    padding-bottom: 50px;
}

#blog-home-header h3 {
    font-size: 26px;
    line-height: 1.35;
    font-weight: 600;
    max-width: 750px;
    margin-bottom: 30px;
}

#blog-home-header p {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 400;
    max-width: 885px;
    margin-top: 0;
}

#blog-home {
    padding-bottom: 80px;
}

#blog-home .blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 30px;
    margin-bottom: 50px;
}

/* Nueva estructura de tarjeta con imagen de fondo */
#blog-home .blog-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#blog-home .blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

#blog-home .blog-card-link {
    display: block;
    text-decoration: none;
    color: #fff;
    height: 100%;
    position: relative;
}

/* Overlay base - siempre visible con gradiente */



/* --- Overlay --- */
#blog-home .blog-card-overlay {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 25px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.1) 85%,
    transparent 100%
  );
  z-index: 1;
  overflow: hidden;
}

/* --- Capa oscura que aparece al hover (detrás del texto) --- */
#blog-home .blog-card-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0; /* detrás del texto */
  pointer-events: none;
}

#blog-home .blog-card:hover .blog-card-overlay::after {
  opacity: 1;
}

/* --- Contenido del overlay --- */
#blog-home .blog-card-content {
  position: relative;
  z-index: 2; /* encima del ::after */
  transform: translateY(0);
  transition: transform 0.5s ease;
}

#blog-home .blog-card:hover .blog-card-content {
  transform: translateY(-30px);
}

/* --- Contenido hover (texto oculto) --- */
#blog-home .blog-card-hover-content {
  position: relative;
  z-index: 2; /* también encima del ::after */
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

/* --- Animación suave de entrada --- */
#blog-home .blog-card:hover .blog-card-hover-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Aparición escalonada interna */
#blog-home .blog-card-hover-content p,
#blog-home .blog-card-hover-content .blog-card-button {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#blog-home .blog-card:hover .blog-card-hover-content p {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
}

#blog-home .blog-card:hover .blog-card-hover-content .blog-card-button {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}


/* Contenido siempre visible: título y tags */
#blog-home .blog-card-content {
    z-index: 2;
    transition: transform 0.3s ease;
}

#blog-home .blog-card-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 0;
}

/* Tags de la tarjeta */
#blog-home .blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

#blog-home .blog-card-tag {
    display: inline-block;
    font-size: 12px;
    color: #fff;
    background-color: rgba(50, 95, 124, 0.9);
    padding: 5px 12px;
    border-radius: 20px;
    text-shadow: none;
    transition: background-color 0.3s ease;
}

#blog-home .blog-card:hover .blog-card-tag {
    background-color: rgba(50, 95, 124, 1);
}

/* Contenido que aparece al hover */
#blog-home .blog-card-hover-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-fast, 0.3s) ease, transform var(--transition-fast, 0.3s) ease, max-height var(--transition-fast, 0.3s) ease;
    max-height: 0;
    overflow: hidden;
}

#blog-home .blog-card:hover .blog-card-hover-content {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
    margin-top: 15px;
}

.blog-card-hover-content .link-sideline-right::after {
    background: #fff !important;
}


#blog-home .blog-card-excerpt {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #fff;
    margin-top: 0;
}

/* Botón "ver más" heredando estilo link-sideline-right */
#blog-home .blog-card-button.link-sideline-right {
    display: inline-block;
    color: #fff;
    font-weight: 500;
}


#blog-home .blog-footer {
    text-align: center;
    margin-top: 30px;
}

/* Responsive styles */
@media (max-width: 992px) {
    #blog-home .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #blog-home .blog-grid {
        grid-template-columns: 1fr;
    }
    
    #blog-home-header h3 {
        font-size: 22px;
    }
    
    #blog-home-header p {
        font-size: 16px;
    }
    
    #blog-home .blog-card {
        height: 350px;
    }
}
