/* Blog-specific styles */

/* Blog Header */
.blog-header {
    background: var(--gradient);
    color: white;
    padding: 8rem 0 4rem;
    margin-top: 80px;
    text-align: center;
}

.blog-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.blog-description {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Blog Filters */
.blog-filters {
    background: var(--light-color);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.filters-wrapper {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-box {
    flex: 1;
    max-width: 400px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.filter-dropdowns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-results-info {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* Featured Posts */
.featured-posts {
    padding: 4rem 0;
    background: white;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.featured-post {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
}

.featured-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--secondary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

/* All Posts */
.all-posts {
    padding: 4rem 0;
    background: var(--light-color);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.blog-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 64, 175, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.read-more-btn {
    background: white;
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: var(--light-color);
    transform: scale(1.05);
}

.blog-content {
    padding: 1.5rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-category {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
}

.blog-date,
.blog-read-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-date::before {
    content: "📅";
    font-size: 0.8rem;
}

.blog-read-time::before {
    content: "🕐";
    font-size: 0.8rem;
}

.blog-title {
    margin-bottom: 1rem;
}

.blog-title a {
    color: var(--dark-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.blog-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.blog-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tag {
    background: var(--light-color);
    color: var(--text-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

.load-more-container {
    text-align: center;
    margin-top: 3rem;
}

.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.blog-error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.blog-error i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Newsletter Section */
.newsletter-section {
    background: var(--dark-color);
    color: white;
    padding: 4rem 0;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-content p {
    opacity: 0.9;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.newsletter-form {
    margin-top: 2rem;
}

.newsletter-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.newsletter-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-input-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.15);
}

.newsletter-consent {
    font-size: 0.9rem;
    opacity: 0.8;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    margin: 0;
}

.checkbox-label a {
    color: var(--secondary-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-title {
        font-size: 2.2rem;
    }

    .blog-description {
        font-size: 1.1rem;
    }

    .filters-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-box {
        max-width: none;
    }

    .filter-dropdowns {
        justify-content: stretch;
    }

    .filter-select {
        flex: 1;
        min-width: auto;
    }

    .featured-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-input-group {
        flex-direction: column;
    }

    .checkbox-label {
        text-align: left;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .blog-header {
        padding: 6rem 0 3rem;
    }

    .blog-title {
        font-size: 1.8rem;
    }

    .blog-filters {
        padding: 1.5rem 0;
    }

    .featured-posts,
    .all-posts {
        padding: 3rem 0;
    }

    .blog-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .blog-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .newsletter-section {
        padding: 3rem 0;
    }

    .newsletter-content h3 {
        font-size: 1.5rem;
    }
}

/* Loading States */
.blog-grid.loading .blog-card {
    opacity: 0.5;
    pointer-events: none;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

/* Animation Enhancements */
.blog-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* Custom scrollbar for filter dropdowns */
.filter-select {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--light-color);
}

.filter-select::-webkit-scrollbar {
    width: 6px;
}

.filter-select::-webkit-scrollbar-track {
    background: var(--light-color);
}

.filter-select::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Focus styles for accessibility */
.blog-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.read-more-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Search Results Info Styles */
.search-results {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.results-count {
    font-weight: 600;
    color: var(--primary-color);
}

.results-filters {
    color: var(--text-light);
    font-size: 0.9rem;
}

.clear-filters-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-filters-btn:hover {
    background: #dc3545;
    transform: translateY(-1px);
}

.clear-filters-btn i {
    font-size: 0.7rem;
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-style: italic;
    grid-column: 1 / -1;
}

/* Load More Container Improvements */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

#load-more-posts {
    position: relative;
    overflow: hidden;
}

#load-more-posts:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive improvements for search results */
@media (max-width: 768px) {
    .search-results {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .filters-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-dropdowns {
        justify-content: center;
        width: 100%;
    }
    
    .filter-select {
        flex: 1;
        min-width: auto;
    }
}

/* Animations for incremental loading */
.blog-card {
    transition: all 0.5s ease;
}

.blog-card.loading {
    opacity: 0;
    transform: translateY(20px);
}

.blog-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Loading button animation */
#load-more-posts {
    transition: all 0.3s ease;
}

#load-more-posts:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

#load-more-posts:active {
    transform: translateY(0);
}