/* =========================================
   BLOG - ENTRE LIBROS Y CAFÉ (FUSIONADO)
   ========================================= */

/* =========================================
   1. HERO DEL BOLETÍN - IMAGEN DE FONDO CON DIFUMINADO
   ========================================= */
.newsletter-hero {
    position: relative;
    width: 100%;
    min-height: 700px;
    overflow: hidden;
    margin-top: 40px; /* Compensa el header fijo */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Overlay oscuro para mejorar legibilidad general */
.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

/* Difuminado en la parte inferior */
.hero-fade-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(245, 241, 234, 0.3) 30%,
        rgba(245, 241, 234, 0.7) 60%,
        var(--color-crema) 100%
    );
    z-index: 2;
}

/* Contenido sobre la imagen */
.hero-content-overlay {
    position: absolute;
    top: 0;
    left: 15%;
    z-index: 3;
    max-width: 600px;
    width: 70%;
    padding: 140px 40px 60px;
    text-align: center;
}

.newsletter-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-md);
}

.title-script {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(3.5rem, 7vw, 6rem);
    color: var(--color-crema);
    font-weight: 700;
    line-height: 1;
    text-shadow: 3px 3px 12px rgba(0,0,0,0.8), 0 0 30px rgba(0,0,0,0.4);
    margin-bottom: 0.5rem;
}

.title-main {
    font-family: var(--fuente-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: var(--color-dorado);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 3px 3px 12px rgba(0,0,0,0.8), 0 0 30px rgba(0,0,0,0.4);
}

.newsletter-subtitle {
    font-size: 1.15rem;
    color: var(--color-crema);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9);
    max-width: 550px;
    font-weight: 400;
}

.newsletter-author {
    font-family: 'Dancing Script', cursive;
    font-size: 1.6rem;
    color: var(--color-dorado);
    font-style: italic;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9);
    margin-top: var(--space-sm);
}

/* =========================================
   2. SECCIÓN DE BIENVENIDA A LOS BLOGS
   ========================================= */
.blog-welcome {
    background-color: var(--color-crema);
    padding: var(--space-xl) 0;
    position: relative;
    z-index: 4;
    text-align: center;
}

.welcome-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.welcome-icon {
    width: 70px;
    height: 70px;
    background-color: var(--color-crema-oscuro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-dorado);
    font-size: 1.8rem;
    margin: 0 auto var(--space-md);
}

.welcome-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--color-dorado);
    margin-bottom: var(--space-md);
}

.welcome-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-negro-suave);
    margin-bottom: var(--space-sm);
}

/* =========================================
   3. TÍTULOS DE SECCIÓN
   ========================================= */
.section-title {
    font-family: var(--fuente-serif);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--color-negro);
    text-align: center;
    margin-bottom: var(--space-xl);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--color-dorado);
    margin: var(--space-sm) auto 0;
}

/* =========================================
   4. ARTÍCULOS DESTACADOS (DINÁMICO)
   ========================================= */
.blog-featured {
    background-color: var(--color-crema);
    padding: 0 0 var(--space-xl) 0;
}

.featured-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.featured-post-card {
    background-color: var(--color-blanco);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.featured-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.featured-post-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.featured-post-content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.featured-post-categoria {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-dorado);
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.featured-post-title {
    font-family: var(--fuente-serif);
    font-size: 1.4rem;
    color: var(--color-negro);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.featured-post-extracto {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-negro-suave);
    margin-bottom: var(--space-md);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-post-meta {
    font-size: 0.85rem;
    color: var(--color-gris);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-crema-oscuro);
}

/* =========================================
   5. TODOS LOS ARTÍCULOS (DINÁMICO)
   ========================================= */
.blog-posts {
    background-color: var(--color-crema);
    padding: 0 0 var(--space-xl) 0;
}

.all-posts {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.post-card {
    background-color: var(--color-blanco);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: 350px 1fr;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.post-card-image {
    width: 100%;
    height: 100%;
    min-height: 250px;
    object-fit: cover;
}

.post-card-content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-card-categoria {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-dorado);
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.post-card-title {
    font-family: var(--fuente-serif);
    font-size: 1.6rem;
    color: var(--color-negro);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.post-card-extracto {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-negro-suave);
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-size: 0.85rem;
    color: var(--color-gris);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   6. CTA FINAL ESTILO BOLETÍN
   ========================================= */
.newsletter-cta-final {
    background: linear-gradient(135deg, #2c2420 0%, #1a1512 100%);
    padding: var(--space-xl) 0;
    text-align: center;
}

.cta-final-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.cta-final-content i {
    font-size: 2.5rem;
    color: var(--color-dorado);
    margin-bottom: var(--space-md);
}

.cta-final-content h3 {
    font-family: var(--fuente-serif);
    font-size: 1.8rem;
    color: var(--color-crema);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.cta-final-content p {
    font-size: 1.1rem;
    color: var(--color-crema);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

/* =========================================
   7. FOOTER DEL BOLETÍN
   ========================================= */
.newsletter-footer {
    background-color: var(--color-negro);
    padding: var(--space-xl) 0;
    text-align: center;
}

.newsletter-footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-logo-text {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: var(--color-dorado);
    display: block;
    margin-bottom: var(--space-md);
}

.footer-message {
    font-size: 1.1rem;
    color: var(--color-crema);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.footer-message em {
    font-style: italic;
    color: var(--color-dorado);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.footer-social .social-link {
    width: 40px;
    height: 40px;
    background-color: rgba(245, 241, 234, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.footer-social .social-link:hover {
    background-color: var(--color-dorado);
    transform: translateY(-3px);
}

.footer-social .social-link i {
    color: var(--color-crema);
    font-size: 1.1rem;
    transition: color var(--transition-fast);
}

.footer-social .social-link:hover i {
    color: var(--color-negro);
}

/* =========================================
   8. MEDIA QUERIES - RESPONSIVE
   ========================================= */
@media (min-width: 768px) {
    .post-card {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 767px) {
    .newsletter-hero {
        min-height: 550px;
        margin-top: 70px;
    }

    .hero-content-overlay {
        position: absolute;
        top: 0;
        left: 5%;
        width: 90%;
        padding: 110px 20px 40px;
        text-align: center;
    }

    .newsletter-title {
        align-items: center;
    }

    .title-script {
        font-size: 3rem;
    }

    .title-main {
        font-size: 2rem;
    }

    .newsletter-subtitle {
        font-size: 1rem;
    }

    .newsletter-author {
        font-size: 1.3rem;
    }

    .welcome-title {
        font-size: 2.5rem;
    }

    .post-card {
        grid-template-columns: 1fr;
    }

    .post-card-image {
        height: 220px;
        min-height: auto;
    }
    
    .post-card-content {
        padding: var(--space-md);
    }
    
    .post-card-title {
        font-size: 1.3rem;
    }
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--color-gris);
    font-size: 1.1rem;
    font-style: italic;
}