/**
 * Article Reading Experience Enhancements
 * Additional styles for better mobile reading
 * Version: 1.0.0
 */

/* ============================================
   MOBILE-FIRST TYPOGRAPHY ENHANCEMENTS
   ============================================ */

/* Better font rendering on mobile */
.article-body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* First paragraph - Drop cap effect */
.article-body > p:first-of-type::first-letter {
    font-size: 3.5em;
    font-weight: 700;
    line-height: 0.9;
    float: left;
    margin: 0.1em 0.1em 0 0;
    color: #ff5a00;
    font-family: 'Montserrat', sans-serif;
}

@media (max-width: 767.98px) {
    .article-body > p:first-of-type::first-letter {
        font-size: 2.8em;
    }
}

/* Better link styling */
.article-body a {
    color: #ff5a00;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 90, 0, 0.3);
    transition: all 0.3s ease;
    padding-bottom: 2px;
}

.article-body a:hover {
    color: #e55000;
    border-bottom-color: #e55000;
    background: rgba(255, 90, 0, 0.05);
}

/* ============================================
   ENHANCED CONTENT ELEMENTS
   ============================================ */

/* Code blocks */
.article-body code {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
    border: 1px solid #e0e0e0;
}

.article-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.article-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
}

/* Mobile code blocks */
@media (max-width: 767.98px) {
    .article-body pre {
        margin: 2rem -16px;
        border-radius: 0;
        padding: 15px;
        font-size: 13px;
    }
}

/* Horizontal rule */
.article-body hr {
    border: none;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff5a00, transparent);
    margin: 3rem 0;
}

/* Strong and emphasis */
.article-body strong,
.article-body b {
    font-weight: 700;
    color: #002147;
}

.article-body em,
.article-body i {
    font-style: italic;
    color: #555;
}

/* ============================================
   CALLOUT BOXES
   ============================================ */

/* Info box */
.article-body .info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 5px solid #2196f3;
    padding: 20px 25px;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.article-body .info-box::before {
    content: 'ℹ️ ';
    font-size: 1.2em;
    margin-right: 8px;
}

/* Warning box */
.article-body .warning-box {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left: 5px solid #ffc107;
    padding: 20px 25px;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.article-body .warning-box::before {
    content: '⚠️ ';
    font-size: 1.2em;
    margin-right: 8px;
}

/* Success box */
.article-body .success-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 5px solid #28a745;
    padding: 20px 25px;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.article-body .success-box::before {
    content: '✅ ';
    font-size: 1.2em;
    margin-right: 8px;
}

/* Mobile callout boxes */
@media (max-width: 767.98px) {
    .article-body .info-box,
    .article-body .warning-box,
    .article-body .success-box {
        margin: 2rem -16px;
        border-radius: 0;
        padding: 15px 20px;
    }
}

/* ============================================
   ENHANCED LISTS
   ============================================ */

/* Checklist style */
.article-body ul.checklist {
    list-style: none;
    padding-left: 0;
}

.article-body ul.checklist li {
    padding-left: 35px;
    position: relative;
}

.article-body ul.checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: 700;
    font-size: 1.3em;
}

/* Numbered list with circles */
.article-body ol.circle-numbers {
    list-style: none;
    counter-reset: circle-counter;
    padding-left: 0;
}

.article-body ol.circle-numbers li {
    counter-increment: circle-counter;
    padding-left: 50px;
    position: relative;
    margin-bottom: 1.5rem;
}

.article-body ol.circle-numbers li::before {
    content: counter(circle-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #ff5a00, #ff8833);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

/* ============================================
   READING ENHANCEMENTS
   ============================================ */

/* Highlight text */
.article-body mark,
.article-body .highlight {
    background: linear-gradient(180deg, transparent 50%, #fff59d 50%);
    padding: 2px 4px;
    color: inherit;
}

/* Keyboard shortcuts */
.article-body kbd {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

/* Abbreviations */
.article-body abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
    border-bottom: 1px dotted #999;
}

/* ============================================
   MOBILE READING OPTIMIZATIONS
   ============================================ */

@media (max-width: 767.98px) {
    /* Better tap targets */
    .article-body a {
        padding: 4px 2px;
        margin: 0 -2px;
    }
    
    /* Prevent text overflow */
    .article-body {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Better table of contents */
    .article-body .toc {
        background: #fafbfc;
        padding: 20px;
        margin: 2rem -16px;
        border-radius: 0;
    }
    
    /* Mobile-friendly footnotes */
    .article-body .footnote {
        font-size: 14px;
        color: #666;
        border-top: 1px solid #e0e0e0;
        padding-top: 15px;
        margin-top: 2rem;
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .article-body {
        color: #e0e0e0;
    }
    
    .article-body h2,
    .article-body h3,
    .article-body h4 {
        color: #ffffff;
    }
    
    .article-body a {
        color: #ff8833;
        border-bottom-color: rgba(255, 136, 51, 0.3);
    }
    
    .article-body code {
        background: #2d2d2d;
        color: #ff8833;
        border-color: #444;
    }
    
    .article-body blockquote {
        background: #2d2d2d;
        color: #e0e0e0;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .article-body {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
    }
    
    .article-body a {
        color: #000;
        text-decoration: underline;
    }
    
    .article-body a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    .article-body img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    .article-body h2,
    .article-body h3,
    .article-body h4 {
        page-break-after: avoid;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus indicators */
.article-body a:focus,
.article-body button:focus {
    outline: 3px solid #ff5a00;
    outline-offset: 2px;
}

/* Skip links */
.article-body .skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ff5a00;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.article-body .skip-link:focus {
    top: 0;
}

/* Screen reader only */
.article-body .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU acceleration for smooth scrolling */
.article-body {
    will-change: scroll-position;
    transform: translateZ(0);
}

/* Optimize animations */
.article-body * {
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .article-body * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
