/* =========================================
   BLOG - HOJA DE ESTILOS
   ========================================= */

/* --- HERO SLIDER --- */
/* --- HERO SLIDER (Ajustado al 80% y más bajo) --- */
.blog-hero-slider {
    position: relative;
    width: 90%;            /* Cambio 1: Ancho al 80% */
    max-width: 1400px;     /* Opcional: Tope máximo para pantallas gigantes */
    margin: 2rem auto;     /* Cambio 2: Centrado (auto) y un poco de margen arriba/abajo */
    height: 50vh;          /* Cambio 3: Altura reducida (antes era 70vh) */
    min-height: 400px;     /* Altura mínima para que no se aplaste */
    background-color: #15233A;
    overflow: hidden;
    border-radius: 20px;   /* Cambio 4: Bordes redondeados (se ve mejor si no es full-width) */
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); /* Sombra para resaltar */
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Estilos de cada Slide */
.blog-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* Efecto de transición suave (Fade) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    z-index: 1;
}

.blog-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Capa oscura sobre la imagen para que el texto se lea bien */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    display: flex;
    align-items: center; /* Centrar verticalmente el contenido */
}

/* Contenido del Slide (Texto) */
.slide-content {
    max-width: 600px; /* Ancho máximo del texto */
    color: #ffffff;
    padding: 2rem 0;
}

.blog-category {
    display: inline-block;
    background-color: #187495; /* Azul Cian */
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slide-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.slide-content p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    color: #e2e8f0;
}

/* Botón del Slide */
.btn-blog-slide {
    display: inline-block;
    background-color: #ffffff;
    color: #15233A;
    padding: 1rem 2.5rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-blog-slide:hover {
    background-color: #187495;
    color: #ffffff;
    transform: translateY(-3px);
}

/* --- CONTROLES DEL SLIDER --- */
.slider-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Flechas */
.prev-slide, .next-slide {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    line-height: 1;
}

.prev-slide:hover, .next-slide:hover {
    color: #ffffff;
}

/* Puntos (Dots) */
.slider-dots {
    display: flex;
    gap: 0.8rem;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: #187495; /* Punto activo azul */
    transform: scale(1.2);
}

/* =========================================
   RESPONSIVE (AJUSTE DE TEXTOS Y TAMAÑOS)
   ========================================= */

/* 1. TABLETA Y MÓVIL (Menos de 900px) */
@media (max-width: 900px) {
    .blog-hero-slider {
        width: 95%; /* Aprovechamos más espacio lateral */
        height: 50vh;
        min-height: 400px;
    }

    /* Fondo oscuro sólido para mejorar lectura */
    .slide-overlay {
        background: rgba(0,0,0,0.7); 
    }

    .slide-content {
        text-align: center;
        margin: 0 auto;
        padding: 0 1.5rem; /* Margen de seguridad lateral */
    }

    /* Títulos más controlados */
    .slide-content h2 {
        font-size: 1.8rem; /* Reducido de 2.2rem */
        margin-bottom: 1rem;
    }

    .slide-content p {
        font-size: 1rem; /* Reducido de 1.1rem */
        line-height: 1.5;
        margin-bottom: 2rem;
    }
}

/* =========================================
   RESPONSIVE (TEXTOS Y CONTROLES)
   ========================================= */

/* 1. TABLETA Y MÓVIL (Menos de 900px) */
@media (max-width: 900px) {
    .blog-hero-slider {
        width: 95%;
        height: 50vh;
        min-height: 400px;
    }

    .slide-overlay {
        background: rgba(0,0,0,0.7); 
    }

    .slide-content {
        text-align: center;
        margin: 0 auto;
        padding: 0 1.5rem; 
    }

    .slide-content h2 {
        font-size: 1.8rem; 
        margin-bottom: 1rem;
    }

    .slide-content p {
        font-size: 1rem; 
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    /* --- AJUSTE DE CONTROLES (Tableta) --- */
    .slider-controls {
        bottom: 20px; /* Más abajo para dar espacio al texto */
        gap: 1.5rem;  /* Juntamos flechas y puntos */
    }

    .prev-slide, .next-slide {
        font-size: 1.5rem !important; /* Reducimos flechas */
    }

    .dot {
        width: 10px !important;  /* Reducimos puntos */
        height: 10px !important;
    }
}

/* 2. CELULARES (< 480px) */
@media (max-width: 480px) {
    .blog-hero-slider {
        min-height: 380px; 
        border-radius: 15px;
    }

    .blog-category {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
        margin-bottom: 1rem;
    }

    .slide-content h2 {
        font-size: 1.5rem; 
    }

    .slide-content p {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 3; 
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .btn-blog-slide {
        padding: 0.8rem 2rem; 
        font-size: 0.9rem;
    }
    
    /* --- AJUSTE DE CONTROLES (Móvil) --- */
    .slider-controls {
        bottom: 15px;
        gap: 1rem; /* Muy juntitos */
    }

    .prev-slide, .next-slide {
        font-size: 1.2rem !important; /* Flechas muy discretas */
    }
    
    .dot {
        width: 8px !important; /* Puntos pequeños */
        height: 8px !important;
    }
}

/* --- SECCIÓN RECENT POSTS --- */
.blog-recent-posts {
    padding: 4rem 0 6rem 0;
    background-color: #ffffff; /* Fondo blanco limpio */
}

/* Alineación al 80% (Igual que el Hero) */
.blog-recent-posts .contenedor {
    width: 80%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Encabezado (Título izq - Botón der) */
.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.posts-header h3 {
    font-size: 1.8rem;
    color: #15233A;
    font-weight: 700;
}

.btn-all-posts {
    padding: 0.6rem 1.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px; /* Botón ligeramente redondeado */
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-all-posts:hover {
    border-color: #15233A;
    color: #15233A;
    background-color: #f8fafc;
}

/* GRID LAYOUT (3 Columnas) */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 2.5rem; /* Espacio generoso entre tarjetas */
}

/* Tarjeta Individual */
.post-card {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px); /* Pequeño salto al pasar el mouse */
}

/* Imagen con Bordes Redondeados */
.post-img-wrapper {
    width: 100%;
    height: 220px;
    border-radius: 16px; /* Bordes muy redondeados (como la referencia) */
    overflow: hidden;
    margin-bottom: 1.2rem;
    background-color: #e2e8f0; /* Fondo gris si no carga imagen */
}

.img-placeholder {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

/* Efecto Zoom en Imagen */
.post-card:hover .img-placeholder {
    transform: scale(1.05);
}

/* Contenido de Texto */
.post-content h4 {
    font-size: 1.25rem;
    color: #15233A;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.post-content p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Cortar texto a 3 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Metadatos (Autor y Tiempo) */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.author-avatar {
    width: 28px;
    height: 28px;
    background-color: #187495; /* Círculo azul para foto */
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.author-info span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.read-time {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en Tablet */
    }
}

@media (max-width: 700px) {
    .posts-grid {
        grid-template-columns: 1fr; /* 1 columna en Móvil */
    }
    .posts-header {
        flex-direction: row; /* Mantener botón al lado */
        gap: 1rem;
    }
    .posts-header h3 {
        font-size: 1.5rem;
    }
}