/**
 * Professional Blog Styles
 * Enhanced styling for blog posts, archive pages, and single post pages
 */

/* Blog Layout Base */
.blog-main,
.single-post-main {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.95) 0%, 
        rgba(10, 10, 15, 0.95) 50%, 
        rgba(0, 0, 0, 0.95) 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.blog-main::before,
.single-post-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.blog-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Blog Header */
.blog-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
}

.blog-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.blog-description {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.blog-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.blog-stat {
    text-align: center;
}

.blog-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.blog-stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Blog Search and Filters */
.blog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    gap: 1rem;
}

.blog-search {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
    min-width: 250px;
}

.blog-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.blog-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.blog-search-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.blog-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.blog-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.blog-filter-btn {
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.blog-filter-btn:hover,
.blog-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

/* Enhanced Blog Post Card */
.blog-post-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    position: relative;
}

.blog-post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.blog-post-card:hover::before {
    transform: scaleX(1);
}

.blog-post-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.blog-post-featured {
    position: relative;
    overflow: hidden;
    height: 250px;
    border-radius: 16px 16px 0 0;
}

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

.blog-post-card:hover .blog-post-featured img {
    transform: scale(1.1);
}

.blog-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.blog-post-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(102, 126, 234, 0.9);
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    z-index: 3;
}

.blog-post-meta-overlay {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 3;
}

.blog-post-card:hover .blog-post-meta-overlay {
    opacity: 1;
    transform: translateY(0);
}

.blog-post-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Blog Post Content */
.blog-post-content {
    padding: 2rem;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.blog-post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-post-meta-item svg {
    opacity: 0.7;
}

.blog-post-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-post-title a:hover {
    color: #667eea;
}

.blog-post-excerpt {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.blog-post-tag {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-post-tag:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    transform: translateY(-2px);
}

.blog-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-post-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.blog-post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-post-author-name {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.9rem;
}

.blog-post-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.blog-post-read-more:hover {
    color: #ffffff;
    transform: translateX(5px);
}

/* Single Post Styles */
.single-post-header {
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
    padding: 3rem 2rem;
}

.single-post-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    text-decoration: none;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.single-post-title {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.single-post-excerpt {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.single-post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.single-post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.single-post-featured {
    max-width: 900px;
    margin: 0 auto 3rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.single-post-featured img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.single-post-content {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
}

.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4,
.single-post-content h5,
.single-post-content h6 {
    color: #ffffff;
    font-weight: 700;
    line-height: 1.3;
    margin: 2rem 0 1rem;
}

.single-post-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    padding-bottom: 0.5rem;
}

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

.single-post-content p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.single-post-content a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.single-post-content a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.single-post-content blockquote {
    border-left: 4px solid #667eea;
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
}

.single-post-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: rgba(102, 126, 234, 0.3);
    position: absolute;
    top: -10px;
    left: 1rem;
    font-family: Georgia, serif;
}

.single-post-content ul,
.single-post-content ol {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.single-post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.single-post-content code {
    background: rgba(0, 0, 0, 0.3);
    color: #fbbf24;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.single-post-content pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.single-post-content pre code {
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Blog Pagination */
.blog-pagination {
    text-align: center;
    margin: 3rem 0;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.25rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    min-width: 50px;
    justify-content: center;
}

.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.blog-pagination .prev,
.blog-pagination .next {
    font-size: 0.9rem;
    padding: 1rem 1.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .blog-title {
        font-size: 2.5rem;
    }
    
    .blog-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .blog-search {
        max-width: none;
        margin-bottom: 1rem;
    }
    
    .blog-filters {
        justify-content: center;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-post-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .single-post-title {
        font-size: 2.5rem;
    }
    
    .single-post-content {
        padding: 2rem 1.5rem;
    }
    
    .blog-header {
        padding: 2rem 1.5rem;
    }
    
    .blog-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .blog-title {
        font-size: 2rem;
    }
    
    .single-post-title {
        font-size: 2rem;
    }
    
    .blog-post-content {
        padding: 1.5rem;
    }
    
    .single-post-content {
        padding: 1.5rem 1rem;
    }
    
    .blog-post-featured {
        height: 200px;
    }
    
    .single-post-featured img {
        height: 300px;
    }
    
    .blog-pagination .page-numbers {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        margin: 0 0.1rem;
    }
}

/* Loading and Animation States */
.blog-post-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.blog-post-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .blog-post-card {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    .blog-filter-btn {
        background: #000000;
        border: 2px solid #ffffff;
        color: #ffffff;
    }
    
    .blog-filter-btn.active {
        background: #ffffff;
        color: #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .blog-post-card,
    .blog-filter-btn,
    .blog-post-read-more {
        transition: none;
        animation: none;
    }
    
    .blog-post-card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .blog-controls,
    .blog-pagination {
        display: none;
    }
    
    .blog-post-card {
        break-inside: avoid;
        margin-bottom: 2rem;
        background: #ffffff;
        color: #000000;
        border: 1px solid #000000;
    }
    
    .single-post-content {
        background: #ffffff;
        color: #000000;
    }
}