/* ===== BLOG LIST PAGE ===== */
.blog-list-page {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.blog-list-page .navbar + * {
    margin-top: 0 !important;
}

/* ===== POSTS GRID/CAROUSEL (Desktop: Grid, Mobile: Carousel) ===== */
.posts-grid-carousel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 0 15px;
}

.post-item {
    width: 100%;
}

/* Mobile: Scroll horizontal nativo */
@media (max-width: 768px) {
    .posts-grid-carousel {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding: 20px;
        margin: 0 -20px;
    }
    
    .posts-grid-carousel::-webkit-scrollbar {
        height: 8px;
    }
    
    .posts-grid-carousel::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .posts-grid-carousel::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .post-item {
        flex: 0 0 280px;
        min-width: 280px;
        scroll-snap-align: start;
    }
}

/* ===== BANNER DE NOTICIAS ===== */
.blog-banner {
    position: relative;
    width: 100%;
    height: 768px;
    background: url('../img/equipo.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0 !important;
}

.blog-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 0;
}

.blog-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(20, 32, 41, 0.3) 0%, rgba(20, 32, 41, 0.1) 100%);
}

.blog-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.blog-banner-title {
    font-size: 3.5rem;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: -1px;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out;
}

.blog-banner-title strong {
    font-weight: 700;
}

.blog-banner-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-animate {
    opacity: 0;
    animation: heroReveal 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SECCIÓN DE PESTAÑAS ===== */
.blog-tabs-card {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    background: linear-gradient(135deg, #b8a5d6 0%, #c4b3e3 100%);
    position: relative;
    overflow: hidden;
    padding: 60px 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.blog-tabs-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.blog-tabs-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.card-inner {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
}

.blog-tabs-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: 1.5px;
    margin-bottom: 40px;
    text-transform: uppercase;
}

.blog-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 20px;
}

.blog-tab {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    padding: 12px 32px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.blog-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.blog-tab.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #142029 !important;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.4);
}

.blog-tabs-content {
    color: #ffffff !important;
    line-height: 1.8;
    font-size: 1rem;
    min-height: 80px;
}

.blog-pane {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: none;
}

.blog-pane.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.tab-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.95) !important;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    font-size: 1rem;
}

/* ===== CAROUSEL INFINITO DE PUBLICACIONES ===== */
.posts-carousel-section {
    width: 100%;
    padding: 80px 0;
    background: #f8f9fa;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.posts-carousel-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.posts-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.posts-carousel-container:active {
    cursor: grabbing;
}

.posts-carousel-slider {
    display: flex;
    gap: 30px;
    animation: slidePostsCarousel 40s linear infinite;
    transition: transform 0.3s ease-out;
}

.posts-carousel-slider.dragging {
    animation: none;
    transition: none;
}

@keyframes slidePostsCarousel {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.posts-carousel-slider:hover {
    animation-play-state: paused;
}

/* ===== POST CARD ===== */
.post-slide {
    flex: 0 0 400px;
    width: 400px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
}

.post-slide:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.post-image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-slide:hover .post-image {
    transform: scale(1.1);
}

.post-image-placeholder {
    font-size: 4rem;
    color: rgba(20, 32, 41, 0.2);
}

.post-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.post-date,
.post-reading-time {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-date i,
.post-reading-time i {
    font-size: 0.9rem;
}

.post-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-reporte {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-blog {
    background: #fff3e0;
    color: #f57c00;
}

.post-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #142029;
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.post-tag {
    padding: 4px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    font-size: 0.75rem;
    color: #495057;
    font-weight: 500;
}

.post-btn {
    display: inline-block;
    padding: 12px 28px;
    background: transparent;
    border: 2px solid #142029;
    color: #142029;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.post-btn:hover {
    background: #142029;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 32, 41, 0.2);
}

/* Variantes de post cards */
.post-slide-reporte {
    border-top: 4px solid #1976d2;
}

.post-slide-blog {
    border-top: 4px solid #f57c00;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .blog-banner {
        height: 520px;
    }
    
    .blog-banner-title {
        font-size: 2.75rem;
    }
    
    .blog-banner-subtitle {
        font-size: 1.1rem;
    }
    
    .card-inner {
        padding: 0 40px;
    }
    
    .blog-tabs-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .blog-tabs {
        gap: 10px;
    }
    
    .blog-tab {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
    
    .post-slide {
        flex: 0 0 350px;
        width: 350px;
    }
    
    .post-image-wrapper {
        height: 220px;
    }
    
    .post-content {
        padding: 25px;
    }
}

@media (max-width: 575.98px) {
    .blog-banner {
        height: 340px;
    }
    
    .blog-banner-title {
        font-size: 2rem;
    }
    
    .blog-banner-subtitle {
        font-size: 0.95rem;
    }
    
    .blog-tabs-card {
        padding: 50px 0;
    }
    
    .card-inner {
        padding: 0 25px;
    }
    
    .blog-tabs-title {
        font-size: 1.3rem;
        margin-bottom: 25px;
    }
    
    .blog-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .blog-tab {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 0.85rem;
    }
    
    .blog-tabs-content {
        font-size: 0.9rem;
        min-height: 60px;
    }
    
    .tab-description {
        font-size: 0.9rem;
    }
    
    .posts-carousel-section {
        padding: 60px 0;
    }
    
    .posts-carousel-container {
        touch-action: pan-y pinch-zoom;
        -webkit-overflow-scrolling: touch;
    }
    
    .posts-carousel-slider {
        animation: slidePostsCarousel 60s linear infinite;
    }
    
    .post-slide {
        flex: 0 0 280px;
        width: 280px;
    }
    
    .post-image-wrapper {
        height: 180px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-title {
        font-size: 1.2rem;
    }
    
    .post-excerpt {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .post-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
        width: 100%;
    }
}

/* Accesibilidad: reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .posts-carousel-slider {
        animation: none !important;
    }
    
    .blog-banner-title,
    .blog-banner-subtitle {
        animation: none !important;
    }
    
    .post-slide:hover {
        transform: none !important;
    }
    
    .post-image {
        transition: none !important;
    }
}
