/**
 * Article SEO Enhancement Styles
 * 
 * Comprehensive CSS for world-class article presentation
 * Optimized for engagement, readability, and SEO
 */

/* ============================================
   1. ARTICLE CONTENT WRAPPER
   ============================================ */
.article-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: #2c3e50;
    max-width: 100%;
}

/* Long-body wrapper from ArticleTrait::structureContentForSeo (pairs with .article-content) */
.article-content--structured {
    max-width: 100%;
}

/* SeoBlogExpertService TOC panel — class hook alongside legacy inline styles */
.seo-expert-toc-shell {
    max-width: 100%;
}

/* ============================================
   2. TYPOGRAPHY & READABILITY
   ============================================ */

/* Headings with proper visual hierarchy */
.article-heading,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
    scroll-margin-top: 100px; /* For smooth anchor scrolling */
}

.article-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

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

.article-content h4 {
    font-size: 1.25rem;
}

/* First paragraph emphasis (lead paragraph) */
.article-paragraph.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: #34495e;
    margin-bottom: 1.5rem;
}

/* Standard paragraphs */
.article-paragraph {
    margin-bottom: 1.25rem;
    text-align: left;
    word-spacing: normal;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

/* ============================================
   3. IMAGES - Responsive & Optimized
   ============================================ */
.article-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
    display: block;
}

.article-image:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Image captions */
.article-content figcaption {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* ============================================
   4. LISTS - Enhanced Styling
   ============================================ */
.article-list {
    padding-left: 0;
    margin: 1.5rem 0;
}

.article-list-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
}

.article-list-item::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: bold;
    font-size: 1.2rem;
}

.article-list-ordered {
    counter-reset: article-counter;
    list-style: none;
    padding-left: 0;
}

.article-list-ordered .article-list-item {
    counter-increment: article-counter;
}

.article-list-ordered .article-list-item::before {
    content: counter(article-counter) ".";
    color: #3498db;
    font-weight: bold;
    left: 0;
}

/* ============================================
   5. BLOCKQUOTES - Visual Emphasis
   ============================================ */
.article-quote {
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.6;
    position: relative;
}

.article-quote::before {
    content: """;
    font-size: 4rem;
    color: #3498db;
    position: absolute;
    left: -20px;
    top: -10px;
    opacity: 0.3;
}

/* ============================================
   6. CODE BLOCKS - Developer-Friendly
   ============================================ */
.article-code-block {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    border-left: 4px solid #3498db;
}

.article-code-block code {
    color: #e0e0e0;
}

.article-code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

/* ============================================
   7. TABLES - Mobile Responsive
   ============================================ */
.article-table {
    margin: 1.5rem 0;
}

.article-table th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
    text-align: left;
}

.article-table td {
    vertical-align: middle;
}

/* ============================================
   8. LINKS - Enhanced UX
   ============================================ */
.article-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

/* Internal links - special styling */
.internal-link {
    background-color: #e3f2fd;
    padding: 0 4px;
    border-radius: 3px;
    position: relative;
}

.internal-link::after {
    content: "↗";
    font-size: 0.7em;
    margin-left: 2px;
    opacity: 0.6;
}

.internal-link:hover {
    background-color: #bbdefb;
}

/* External links */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
}

/* ============================================
   9. READING PROGRESS INDICATOR
   ============================================ */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    z-index: 9999;
    transition: width 0.2s ease;
}

/* ============================================
   10. TABLE OF CONTENTS (if implemented)
   ============================================ */
.article-toc {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.article-toc h3 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.article-toc ul {
    list-style: none;
    padding-left: 0;
}

.article-toc li {
    margin-bottom: 0.5rem;
}

.article-toc a {
    color: #34495e;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-toc a:hover {
    color: #3498db;
}

/* ============================================
   11. SOCIAL SHARING ENHANCEMENTS
   ============================================ */
.article-share-sticky {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-share-sticky .social-btn-share {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.article-share-sticky .social-btn-share:hover {
    transform: scale(1.1);
}

/* ============================================
   12. CALL-TO-ACTION SECTIONS
   ============================================ */
.article-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-cta h3 {
    color: white;
    margin-top: 0;
}

.article-cta .btn {
    background-color: white;
    color: #667eea;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.article-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   13. MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
    }
    
    .article-paragraph.lead {
        font-size: 1.1rem;
        line-height: 1.7;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    }

    .article-paragraph,
    .article-body p {
        text-align: left !important;
        word-spacing: normal !important;
        letter-spacing: normal;
        line-height: 1.7;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    }
    
    .article-quote {
        font-size: 1rem;
        padding-left: 2rem;
    }
    
    .article-quote::before {
        font-size: 2.5rem;
        left: -10px;
    }
    
    .article-list-item {
        padding-left: 1.5rem;
    }
}

/* ============================================
   14. ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus states for keyboard navigation */
.article-content a:focus,
.article-content button:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .article-content {
        color: #000;
    }
    
    .article-content a {
        text-decoration: underline;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .article-image:hover,
    .article-content a,
    .social-btn-share,
    .article-cta .btn {
        transition: none;
    }
}

/* ============================================
   15. PRINT STYLES
   ============================================ */
@media print {
    .article-content {
        font-size: 12pt;
        color: #000;
    }
    
    .article-content a {
        color: #000;
        text-decoration: underline;
    }
    
    .article-content a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    .article-image {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    .reading-progress-bar,
    .article-share-sticky,
    .article-cta {
        display: none;
    }
}

/* ============================================
   16. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for transforms */
.article-image,
.social-btn-share,
.article-cta .btn {
    will-change: transform;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* ============================================
   17. ENGAGEMENT METRICS DISPLAY
   ============================================ */
.article-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.article-meta-item i {
    color: #3498db;
}

/* Reading time badge */
.reading-time-badge {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   18. DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .article-content {
        color: #e0e0e0;
        background-color: #1a1a1a;
    }
    
    .article-heading,
    .article-content h2,
    .article-content h3,
    .article-content h4 {
        color: #f0f0f0;
        border-bottom-color: #333;
    }
    
    .article-quote {
        background-color: #2a2a2a;
        border-color: #3498db;
    }
    
    .article-code {
        background-color: #2a2a2a;
        color: #f0f0f0;
    }
    
    .article-content a {
        color: #64b5f6;
    }
    
    .internal-link {
        background-color: #1e3a5f;
    }
    
    .article-toc {
        background-color: #2a2a2a;
    }
}

