/* Blog Page Specific Styles */

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin-top: 90px;
    background: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="%23cbd5e1" fill-opacity="0.2"><circle cx="20" cy="20" r="1"/></g></svg>') repeat;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.blog-hero-description {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Search and Filter Section */
.blog-search {
    padding: 3rem 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.search-controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.search-bar {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#blog-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

#blog-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
}

.search-help {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.filter-section,
.sort-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.category-select,
.sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 0.875rem;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-select:focus,
.sort-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Search Results Info */
.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    color: #6b7280;
    font-size: 0.875rem;
}

.clear-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* Blog Posts Grid */
.blog-posts {
    padding: 3rem 0 4rem;
    background: #f9fafb;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
    text-decoration: none;
    color: inherit;
}

.blog-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.blog-card-image i {
    font-size: 3rem;
    color: #9ca3af;
}

.blog-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-card-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.blog-tag {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-tag:hover {
    background: #3b82f6;
    color: white;
    text-decoration: none;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #3b82f6;
    font-weight: 500;
    font-size: 0.875rem;
}

.blog-card-footer i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-footer i {
    transform: translateX(2px);
}

/* Loading and No Results States */
.loading-state,
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.loading-spinner {
    font-size: 2rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.no-results-icon {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.no-results p {
    margin-bottom: 1.5rem;
}

/* Load More Section */
.load-more-section {
    text-align: center;
}

/* Featured Categories */
.featured-categories {
    padding: 4rem 0;
    background: white;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border: 2px solid #f3f4f6;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.6s ease;
}

.category-card:hover::before {
    left: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: #3b82f6;
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.1);
    text-decoration: none;
    color: inherit;
}

.category-icon {
    width: 60px;
    height: 60px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: #3b82f6;
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    background: #3b82f6;
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.category-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.category-count {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.category-arrow {
    color: #3b82f6;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.category-card:hover .category-arrow {
    transform: translateX(5px);
}

/* Newsletter Section */
.newsletter-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
}

.newsletter-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.newsletter-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    align-items: start;
}

.newsletter-form .form-group {
    position: relative;
}

#newsletter-email {
    padding: 0.875rem 1rem;
    border: 2px solid #374151;
    border-radius: 8px;
    background: #374151;
    color: white;
    font-size: 1rem;
    min-width: 300px;
    transition: all 0.3s ease;
}

#newsletter-email:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: #4b5563;
}

#newsletter-email::placeholder {
    color: #9ca3af;
}

.newsletter-form .btn {
    white-space: nowrap;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .newsletter-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 0 2rem;
    }
    
    .blog-hero-title {
        font-size: 2.25rem;
    }
    
    .blog-search {
        padding: 2rem 0;
    }
    
    .search-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-section,
    .sort-section {
        flex-direction: row;
        align-items: center;
    }
    
    .category-select,
    .sort-select {
        min-width: 120px;
    }
    
    .search-results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-card-content {
        padding: 1.25rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem 1rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }
    
    #newsletter-email {
        min-width: auto;
        width: 100%;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .blog-hero-title {
        font-size: 1.875rem;
    }
    
    .blog-hero-description {
        font-size: 1rem;
    }
    
    #blog-search-input {
        padding: 0.75rem 0.875rem 0.75rem 2.5rem;
        font-size: 0.875rem;
    }
    
    .search-icon {
        left: 0.875rem;
        font-size: 0.875rem;
    }
    
    .blog-card-image {
        height: 160px;
    }
    
    .blog-card-title {
        font-size: 1.125rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-title {
        font-size: 1.5rem;
    }
    
    .newsletter-description {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .blog-hero,
    .blog-search,
    .newsletter-section {
        background: white !important;
        color: black !important;
    }
    
    .blog-card {
        break-inside: avoid;
        border: 1px solid #000;
    }
    
    .newsletter-section {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .blog-card,
    .category-card {
        border: 2px solid #000;
    }
    
    #blog-search-input,
    .category-select,
    .sort-select {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .category-card,
    .category-icon,
    .category-arrow,
    .blog-card-footer i,
    #blog-search-input,
    .category-select,
    .sort-select,
    #newsletter-email {
        transition: none;
    }
    
    .blog-card:hover,
    .category-card:hover {
        transform: none;
    }
    
    .category-card:hover .category-icon {
        transform: none;
    }
    
    .category-card:hover .category-arrow,
    .blog-card:hover .blog-card-footer i {
        transform: none;
    }
    
    .loading-spinner i {
        animation: none;
    }
    
    .category-card::before {
        display: none;
    }
}