/* ==========================================
   Blog Page Styles - Francis Mendoza Chavez
   ========================================== */

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, #007bff 0%, #1f2bc5 100%);
    padding: 80px 20px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="%23ffffff" fill-opacity="0.05"/></svg>');
    background-size: 50px 50px;
    opacity: 0.3;
}

.blog-hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.blog-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.blog-hero h1 i {
    font-size: 3.2rem;
}

.blog-hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Categories Section */
.categories-section {
    background: #fff;
    padding: 40px 0;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.categories-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.category-chip {
    background: #f5f5f5;
    border: 2px solid transparent;
    color: #555;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
}

.category-chip:hover {
    background: #e8f2ff;
    color: #007bff;
    border-color: #007bff;
    transform: translateY(-2px);
}

.category-chip.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.category-chip i {
    font-size: 1.1rem;
}

/* Blog Posts Section */
.blog-posts-section {
    background: #f5f5f5;
    padding: 60px 0;
    min-height: 60vh;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,123,255,.15);
}

.post-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

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

.post-card:hover .post-image img {
    transform: scale(1.08);
}

.post-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #007bff 0%, #1f2bc5 100%);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,123,255,.3);
}

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

.post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #888;
    font-size: 0.9rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta i {
    font-size: 1rem;
}

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

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

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
}

.post-author i {
    font-size: 1.5rem;
    color: #007bff;
}

.read-more {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #007bff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 10px;
    color: #0056b3;
}

.read-more i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(4px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-number {
    background: #fff;
    border: 2px solid #e5e5e5;
    color: #555;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled),
.pagination-number:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-number.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 25px;
    }
    
    .container {
        padding: 0 30px;
    }
}

@media screen and (max-width: 768px) {
    .blog-hero {
        padding: 60px 20px;
    }
    
    .blog-hero h1 {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .blog-hero h1 i {
        font-size: 2.8rem;
    }
    
    .blog-hero p {
        font-size: 1.1rem;
    }
    
    .categories-section {
        position: relative;
        top: 0;
    }
    
    .categories-title {
        font-size: 1.25rem;
    }
    
    .categories-filter {
        gap: 10px;
    }
    
    .category-chip {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 0 20px;
    }
    
    .blog-posts-section {
        padding: 40px 0;
    }
    
    .post-image {
        height: 200px;
    }
    
    .post-title {
        font-size: 1.2rem;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 20px;
    }
    
    .pagination-numbers {
        order: -1;
    }
}

@media screen and (max-width: 480px) {
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-hero h1 i {
        font-size: 2.2rem;
    }
    
    .blog-hero p {
        font-size: 1rem;
    }
    
    .category-chip {
        padding: 7px 14px;
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .pagination-btn,
    .pagination-number {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Animation for filtering */
.post-card.hidden {
    display: none;
}

.post-card.visible {
    animation: fadeInUp 0.5s ease forwards;
}

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

/* Loading, Error, and Empty States */
.loading-message,
.error-message,
.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
    color: #666;
}

.loading-message {
    color: #007bff;
    font-weight: 500;
}

.loading-message::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error-message {
    color: #dc3545;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 40px;
}

.no-posts {
    color: #999;
    font-style: italic;
}

.posts-grid.loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}
