/*
 * Additional Article Content Enhancements
 * Version: 2.0 - Optimized for Readability & SEO
 */

/* Reading time display */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f4f8;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #555;
    font-weight: 500;
    border: 1px solid #d8e2eb;
}

.reading-time svg {
    flex-shrink: 0;
}

/* Inline code styling */
.single .entry-content p code,
.single .entry-content li code {
    background: #f0f4f8;
    color: #2c3e50;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid #d8e2eb;
    font-weight: 500;
    white-space: nowrap;
    font-family: 'Courier New', Courier, monospace;
}

/* Info boxes and alerts */
.single .entry-content .note,
.single .entry-content .alert,
.single .entry-content .info-box {
    padding: 16px 20px;
    margin: 0.8em 0;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f6f8fa;
    font-size: 1.05rem;
    line-height: 1.7;
}

.single .entry-content .note {
    border-left-color: #0066cc;
    background: #e6f2ff;
    color: #004080;
}

.single .entry-content .alert {
    border-left-color: #dc3545;
    background: #ffe6e6;
    color: #8b0000;
}

.single .entry-content .info-box {
    border-left-color: #28a745;
    background: #e6f9e6;
    color: #155724;
}

/* Section anchors */
.single .entry-content h2[id],
.single .entry-content h3[id],
.single .entry-content h4[id] {
    position: relative;
    scroll-margin-top: 100px;
}

/* Ordered lists with custom counters */
.single .entry-content ol {
    counter-reset: custom-counter;
    list-style: decimal;
}

.single .entry-content ol > li {
    counter-increment: custom-counter;
}

/* Highlighted text */
.single .entry-content .highlight,
.single .entry-content mark {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    color: #856404;
    font-weight: 500;
}

/* Citations */
.single .entry-content cite {
    display: block;
    margin-top: 10px;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

.single .entry-content cite::before {
    content: '— ';
}

/* Definition lists */
.single .entry-content dl {
    margin: 0.8em 0;
    padding: 16px;
    background: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
}

.single .entry-content dt {
    font-weight: 600;
    color: #0a0a0a;
    margin-bottom: 8px;
    font-size: 1em;
}

.single .entry-content dd {
    margin-left: 0;
    margin-bottom: 12px;
    color: #333;
    line-height: 1.7;
}

/* Footnotes */
.single .entry-content .footnote,
.single .entry-content sup {
    font-size: 0.75em;
    vertical-align: super;
    color: #0066cc;
    font-weight: 600;
}

.single .entry-content .footnote a,
.single .entry-content sup a {
    text-decoration: none;
    padding: 1px 4px;
    background: #f6f8fa;
    border-radius: 2px;
}

/* Responsive video wrapper */
.single .entry-content .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 0.8em 0;
    border-radius: 6px;
}

.single .entry-content .video-wrapper iframe,
.single .entry-content .video-wrapper object,
.single .entry-content .video-wrapper embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Image comparison grid */
.single .entry-content .image-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 0.8em 0;
}

.single .entry-content .image-comparison img {
    margin: 0;
    width: 100%;
}

/* Callouts */
.single .entry-content .callout {
    background: #f6f8fa;
    border-left: 3px solid #0a0a0a;
    padding: 16px;
    margin: 0.8em 0;
    border-radius: 6px;
}

.single .entry-content .callout p {
    margin-bottom: 0.5em;
}

.single .entry-content .callout p:last-child {
    margin-bottom: 0;
}

/* Stats/Numbers boxes */
.single .entry-content .stat-box {
    display: inline-block;
    background: #f6f8fa;
    color: #0a0a0a;
    padding: 20px 30px;
    border-radius: 6px;
    text-align: center;
    margin: 1em 10px;
    border: 1px solid #e1e4e8;
}

.single .entry-content .stat-number {
    font-size: 2.5em;
    font-weight: 700;
    display: block;
    line-height: 1;
    margin-bottom: 8px;
    color: #0066cc;
}

.single .entry-content .stat-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Download buttons */
.single .entry-content .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2da44e;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
    margin: 1em 0;
}

.single .entry-content .download-btn::before {
    content: '⬇';
    font-size: 1.1em;
}

.single .entry-content .download-btn:hover {
    background: #2c974b;
}

/* Simple dividers */
.single .entry-content .divider {
    height: 1px;
    background: #e1e4e8;
    margin: 2.5em 0;
    border: none;
}

/* Print styles */
@media print {
    .single .entry-content .note,
    .single .entry-content .alert,
    .single .entry-content .info-box,
    .single .entry-content .callout {
        background: white !important;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .single .entry-content .download-btn,
    .single .entry-content .wp-block-button__link {
        background: #333 !important;
        color: white !important;
    }
}

/* Mobile optimizations */
@media (max-width: 820px) {
    .single .entry-content .stat-box {
        display: block;
        margin: 1em 0;
    }
    
    .single .entry-content .image-comparison {
        grid-template-columns: 1fr;
    }
    
    .reading-time {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .single .entry-content .note,
    .single .entry-content .alert,
    .single .entry-content .info-box,
    .single .entry-content .callout {
        padding: 16px 18px;
        font-size: 1rem;
    }
    
    .single .entry-content pre {
        font-size: 0.85rem;
        padding: 1.2em;
    }
    
    .copy-code-btn {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }
    
    .scroll-to-top-btn {
        width: 40px !important;
        height: 40px !important;
        bottom: 20px !important;
        right: 20px !important;
        font-size: 18px !important;
    }
}

@media (max-width: 480px) {
    .single .entry-content .download-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 20px;
    }
    
    .single .entry-content .stat-number {
        font-size: 2em;
    }
    
    .reading-time {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
}
