/* Blog Post Specific Styles */

/* Post Header */
.post-header {
    padding: 150px 0 50px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
    overflow: hidden;
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23333" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.1;
}

.post-breadcrumb {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

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

.post-breadcrumb a:hover {
    color: #764ba2;
}

.breadcrumb-separator {
    color: #aaa;
    margin: 0 0.5rem;
}

.post-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #aaa;
    font-size: 0.9rem;
}

.post-meta i {
    color: #667eea;
}

.post-title {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

.post-excerpt {
    font-size: 1.2rem;
    color: #ccc;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 800px;
    position: relative;
    z-index: 2;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.author-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #667eea;
}

.author-info h4 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.author-info p {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Content Layout */
.post-content {
    padding: 50px 0;
    background: #111;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Table of Contents */
.table-of-contents {
    position: sticky;
    top: 100px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
}

.table-of-contents h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: block;
    padding: 0.3rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
}

.table-of-contents a:hover,
.table-of-contents a.active {
    color: #667eea;
    border-left-color: #667eea;
    padding-left: 1rem;
}

/* Main Content */
.post-main {
    max-width: none;
}

.featured-image {
    margin-bottom: 3rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.featured-image figcaption {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

/* Typography */
.post-main h2 {
    color: #fff;
    font-size: 2rem;
    margin: 3rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
    position: relative;
}

.post-main h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #764ba2;
}

.post-main h3 {
    color: #fff;
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
}

.post-main h4 {
    color: #ccc;
    font-size: 1.2rem;
    margin: 1.5rem 0 0.5rem 0;
}

.post-main h5 {
    color: #ccc;
    font-size: 1rem;
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.post-main p {
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.post-main ul,
.post-main ol {
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-main li {
    margin-bottom: 0.5rem;
}

.post-main strong {
    color: #fff;
    font-weight: 600;
}

/* Code Blocks */
.post-main pre {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.post-main pre code {
    color: #e6e6e6;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-main code:not(pre code) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

/* Callouts */
.callout {
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.callout i {
    font-size: 1.2rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.callout p {
    margin: 0;
}

.callout-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    color: #93c5fd;
}

.callout-info i {
    color: #3b82f6;
}

.callout-tip {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
    color: #6ee7b7;
}

.callout-tip i {
    color: #10b981;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
    color: #fbbf24;
}

.callout-warning i {
    color: #f59e0b;
}

/* Component Types Grid */
.component-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.component-type {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.component-type h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.component-type p {
    margin: 0;
    font-size: 0.9rem;
}

/* State Management Comparison */
.state-management-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.state-option {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.state-option h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.state-option > p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: #aaa;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pros,
.cons {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
}

.pros h5 {
    color: #10b981;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cons h5 {
    color: #ef4444;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.pros ul,
.cons ul {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.85rem;
}

.pros li,
.cons li {
    margin-bottom: 0.3rem;
}

/* Testing Pyramid */
.testing-pyramid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.test-level {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.test-level h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.test-level > p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #aaa;
}

.test-level pre {
    margin: 1rem 0 0 0;
}

/* Share Section */
.post-share {
    margin: 4rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.post-share h3 {
    color: #fff;
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.linkedin {
    background: #0077b5;
    color: white;
}

.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn.copy {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Related Posts */
.related-posts {
    padding: 100px 0;
    background: #0a0a0a;
}

.related-posts h2 {
    color: #fff;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.2);
}

.related-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.related-content {
    padding: 1.5rem;
}

.related-category {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.related-content h3 {
    color: #fff;
    font-size: 1.2rem;
    margin: 1rem 0;
    line-height: 1.4;
}

.related-content p {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.related-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.related-link:hover {
    color: #764ba2;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 200px 1fr;
        gap: 2rem;
    }
    
    .table-of-contents {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 2rem;
    }
    
    .post-excerpt {
        font-size: 1.1rem;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .table-of-contents {
        position: static;
        order: -1;
    }
    
    .post-meta {
        gap: 1rem;
    }
    
    .post-author {
        flex-direction: column;
        text-align: center;
    }
    
    .state-management-comparison {
        grid-template-columns: 1fr;
    }
    
    .pros-cons {
        grid-template-columns: 1fr;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-excerpt {
        font-size: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .component-types {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .table-of-contents,
    .post-share,
    .related-posts,
    .footer {
        display: none;
    }
    
    .post-header {
        background: none;
        color: black;
    }
    
    .post-title,
    .post-main h2,
    .post-main h3,
    .post-main h4 {
        color: black;
    }
    
    .post-main p,
    .post-main li {
        color: black;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .post-main h2,
    .post-main h3,
    .post-main h4 {
        color: #ffffff;
    }
    
    .post-main p,
    .post-main li {
        color: #e0e0e0;
    }
    
    .callout {
        border-width: 2px;
    }
}

/* Focus styles for accessibility */
.table-of-contents a:focus,
.share-btn:focus,
.related-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
