/* ============================================
   INVOICEPRO BLOG - COMPREHENSIVE CSS
   Professional, SEO-Optimized, Feature-Rich
   ============================================ */

:root {
    --primary: #4F46E5;
    --secondary: #10B981;
    --text-color: #1F2937;
    --text-muted: #6B7280;
    --card-bg: #FFFFFF;
    --border-color: #E5E7EB;
    --bg-light: #F9FAFB;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-muted: #9CA3AF;
    --card-bg: #1F2937;
    --border-color: #374151;
    --bg-light: #111827;
}

/* Force text to always be visible */
body .blog-post-content,
body .blog-post-content p,
body .blog-post-content li,
body .blog-post-content h2,
body .blog-post-content h3,
body .blog-post-content h4,
body .blog-post-content strong {
    color: var(--text-color) !important;
}

body .blog-post-title,
body .blog-post-excerpt {
    color: var(--text-color) !important;
}

/* ============================================
   BLOG POST CONTAINER & LAYOUT
   ============================================ */

.blog-post-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: var(--card-bg);
}

.blog-post-header {
    margin-bottom: 3rem;
    text-align: center;
}

.blog-post-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-post-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

.blog-post-meta-item i {
    color: var(--primary);
}

.blog-post-excerpt {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.8;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    font-weight: 300;
}

/* ============================================
   FEATURED IMAGE
   ============================================ */

.blog-post-featured-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */

.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 1000;
    transition: width 0.2s ease;
}

/* ============================================
   BLOG POST CONTENT
   ============================================ */

.blog-post-content {
    font-size: 1.125rem;
    line-height: 1.9;
    color: var(--text-color);
    margin-bottom: 3rem;
}

.blog-post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.blog-post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.blog-post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.blog-post-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.blog-post-content strong {
    font-weight: 600;
    color: var(--text-color);
}

.blog-post-content em {
    font-style: italic;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.blog-post-content ul li::marker {
    color: var(--primary);
}

.blog-post-content ol li::marker {
    color: var(--primary);
    font-weight: 600;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    background: var(--bg-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-muted);
}

.blog-post-content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-post-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary);
}

.blog-post-content pre {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-post-content pre code {
    background: none;
    padding: 0;
    color: var(--text-color);
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.blog-post-content a {
    color: var(--primary);
    text-decoration: underline;
    transition: var(--transition);
}

.blog-post-content a:hover {
    color: var(--secondary);
}

/* ============================================
   HIGHLIGHT BOX / CALLOUT
   ============================================ */

.highlight-box {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(16, 185, 129, 0.1));
    border-left: 4px solid var(--primary);
    padding: 2rem;
    margin: 2.5rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.highlight-box h3 {
    margin-top: 0 !important;
    color: var(--primary);
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

/* ============================================
   SOCIAL SHARE BUTTONS
   ============================================ */

.social-share-section {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    text-align: center;
}

.social-share-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

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

.social-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    color: white;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-share-btn.twitter {
    background: #1DA1F2;
}

.social-share-btn.facebook {
    background: #1877F2;
}

.social-share-btn.linkedin {
    background: #0A66C2;
}

.social-share-btn.email {
    background: #6B7280;
}

.social-share-btn i {
    font-size: 1rem;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */

.table-of-contents {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0 3rem;
}

.table-of-contents h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-of-contents h3 i {
    color: var(--primary);
}

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

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

.table-of-contents a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.table-of-contents a:hover {
    background: var(--card-bg);
    color: var(--primary);
    padding-left: 1.25rem;
}

/* ============================================
   RELATED POSTS
   ============================================ */

.related-posts-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.related-posts-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
}

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

.related-post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

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

.related-post-content {
    padding: 1.5rem;
}

.related-post-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.related-post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.related-post-excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   AUTHOR BIO
   ============================================ */

.author-bio-section {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-bio-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.author-bio-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ============================================
   NEWSLETTER CTA
   ============================================ */

.newsletter-cta-section {
    margin: 4rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    text-align: center;
    color: white;
}

.newsletter-cta-section h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.newsletter-cta-section p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.newsletter-cta-section .btn {
    background: white;
    color: var(--primary);
    padding: 1rem 2.5rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.newsletter-cta-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   BACK TO BLOG LINK
   ============================================ */

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.back-to-blog:hover {
    gap: 0.75rem;
}

.back-to-blog i {
    font-size: 1.25rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .blog-post-container {
        padding: 1rem;
    }

    .blog-post-title {
        font-size: 2rem;
    }

    .blog-post-excerpt {
        font-size: 1.125rem;
    }

    .blog-post-meta {
        gap: 1rem;
        font-size: 0.875rem;
    }

    .blog-post-featured-image {
        height: 250px;
    }

    .blog-post-content {
        font-size: 1rem;
    }

    .blog-post-content h2 {
        font-size: 1.5rem;
    }

    .blog-post-content h3 {
        font-size: 1.25rem;
    }

    .social-share-buttons {
        flex-direction: column;
    }

    .social-share-btn {
        width: 100%;
        justify-content: center;
    }

    .author-bio-section {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-cta-section {
        padding: 2rem 1.5rem;
    }

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

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .table-of-contents {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .blog-post-title {
        font-size: 1.75rem;
    }

    .blog-post-content h2 {
        font-size: 1.25rem;
    }

    .highlight-box,
    .social-share-section {
        padding: 1.5rem;
    }
}

/* ============================================
   ENHANCED MOBILE OPTIMIZATION
   ============================================ */

/* Modern Large Phones (414px-430px) */
@media (max-width: 430px) {
    .blog-post-container {
        padding: 0.875rem;
    }
    
    .blog-post-title {
        font-size: 1.65rem;
        line-height: 1.3;
    }
    
    .blog-post-meta {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .blog-post-content {
        font-size: 0.9375rem;
        line-height: 1.6;
    }
    
    .table-of-contents {
        padding: 1.25rem;
        font-size: 0.875rem;
    }
    
    .social-share-btn {
        padding: 0.65rem 1rem;
        font-size: 0.875rem;
    }
}

/* Standard Modern Phones (375px-414px) */
@media (max-width: 414px) {
    .blog-post-container {
        padding: 0.75rem;
    }
    
    .blog-post-title {
        font-size: 1.5rem;
    }
    
    .blog-post-excerpt {
        font-size: 1rem;
    }
    
    .blog-post-featured-image {
        height: 200px;
    }
    
    .blog-post-content h2 {
        font-size: 1.35rem;
        margin-top: 1.5rem;
    }
    
    .blog-post-content h3 {
        font-size: 1.15rem;
        margin-top: 1.25rem;
    }
    
    .blog-post-content p {
        margin-bottom: 1rem;
    }
    
    .highlight-box {
        padding: 1.25rem;
        font-size: 0.9rem;
    }
    
    .newsletter-cta-section {
        padding: 1.75rem 1.25rem;
    }
    
    .newsletter-cta-section input,
    .newsletter-cta-section button {
        font-size: 16px !important;
        padding: 0.75rem;
    }
}

/* Compact Phones (360px-375px) */
@media (max-width: 375px) {
    .blog-post-container {
        padding: 0.65rem;
    }
    
    .blog-post-title {
        font-size: 1.4rem;
    }
    
    .blog-post-content {
        font-size: 0.9rem;
    }
    
    .blog-post-content h2 {
        font-size: 1.25rem;
    }
    
    .blog-post-content h3 {
        font-size: 1.1rem;
    }
    
    .blog-post-featured-image {
        height: 180px;
    }
    
    .author-bio-section {
        padding: 1.25rem;
    }
    
    .related-posts-grid {
        gap: 1rem;
    }
    
    .table-of-contents {
        padding: 1rem;
    }
}

/* Small Compact Phones (360px and below) */
@media (max-width: 360px) {
    .blog-post-container {
        padding: 0.5rem;
    }
    
    .blog-post-title {
        font-size: 1.3rem;
        line-height: 1.25;
    }
    
    .blog-post-content {
        font-size: 0.875rem;
    }
    
    .blog-post-content h2 {
        font-size: 1.2rem;
    }
    
    .highlight-box {
        padding: 1rem;
    }
    
    .newsletter-cta-section {
        padding: 1.5rem 1rem;
    }
    
    .newsletter-cta-section h3 {
        font-size: 1.25rem;
    }
}

/* Touch Optimizations for Blog */
@media (hover: none) and (pointer: coarse) {
    .social-share-btn,
    .back-to-blog,
    .newsletter-cta-section button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .social-share-btn:active,
    .back-to-blog:active {
        transform: scale(0.98);
        transition: transform 100ms ease;
    }
    
    .blog-post-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .table-of-contents a {
        padding: 0.5rem 0;
        display: block;
    }
}

/* Landscape Mode for Blog */
@media (max-height: 500px) and (orientation: landscape) {
    .blog-post-featured-image {
        height: 150px;
    }
    
    .blog-post-container {
        padding: 0.75rem;
    }
    
    .newsletter-cta-section {
        padding: 1.5rem 1rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .reading-progress-bar,
    .social-share-section,
    .newsletter-cta-section,
    .related-posts-section,
    .back-to-blog {
        display: none;
    }

    .blog-post-content {
        font-size: 12pt;
        line-height: 1.6;
    }

    .blog-post-title {
        font-size: 24pt;
    }
}
