/*
* Blog Articles Shared Styles
* AppWT LLC - Professional Blog Styling
* Ensures WCAG AAA contrast compliance and perfect readability
*/

/* Code blocks - Dark theme for visibility - HIGH PRIORITY */
.code-block,
div[style*="font-family: monospace"],
div[style*="background: #f8f9fa"][style*="font-family: monospace"],
div[style*="padding: 1rem"][style*="font-family: monospace"] {
    background: #212529 !important;
    color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    font-family: 'Courier New', Monaco, monospace !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    overflow-x: auto !important;
}

/* Specific override for problematic light code blocks */
div[style*="background: #f8f9fa; padding: 1rem; border-radius: 8px; margin: 1rem 0; font-family: monospace"] {
    background: #212529 !important;
    color: #f8f9fa !important;
}

div[style*="background: #f8f9fa; padding: 1.5rem; border-radius: 8px"][style*="font-family: monospace"] {
    background: #212529 !important;
    color: #f8f9fa !important;
}

/* White background containers for perfect readability - ONLY for individual blog articles, NOT blog index */
body:not([data-page="blog"]) .content-section {
    background: white !important;
    padding: 2rem !important;
    margin: 2rem 0 !important;
    border-radius: 8px !important;
    border: 1px solid #e9ecef !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* Author attribution styling - ONLY for individual blog articles, NOT blog index */
body:not([data-page="blog"]) .author-attribution {
    background: white !important;
    text-align: center !important;
    margin-bottom: 2rem !important;
    padding: 2rem !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

body:not([data-page="blog"]) .author-attribution h1 {
    color: #721c24 !important;
    margin-bottom: 0.5rem !important;
    font-size: 2.2rem !important;
    background: white !important;
    padding: 0.5rem !important;
}

body:not([data-page="blog"]) .author-attribution p {
    color: #212529 !important;
    background: white !important;
    padding: 0.5rem !important;
}

.author-attribution strong {
    color: #0056b3 !important;
}

/* Ensure all text has proper contrast */
.blog-content {
    color: #212529 !important;
    line-height: 1.8 !important;
}

.blog-content h2,
.blog-content h3,
.blog-content h4 {
    color: #0056b3 !important;
    margin: 2rem 0 1rem !important;
}

.blog-content p {
    color: #212529 !important;
    line-height: 1.8 !important;
    margin-bottom: 1.5rem !important;
}

/* Alert and warning boxes - ONLY for individual blog articles */
body:not([data-page="blog"]) .alert-box {
    background: white !important;
    border: 2px solid #ffc107 !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    margin: 2rem 0 !important;
}

.alert-box h3 {
    color: #856404 !important;
    margin-bottom: 1rem !important;
}

.alert-box p {
    color: #212529 !important;
    margin: 0 !important;
}

/* Danger/error boxes */
.danger-box {
    background: #dc3545 !important;
    color: white !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    margin: 2rem 0 !important;
    text-align: center !important;
}

.danger-box h2,
.danger-box h3 {
    color: white !important;
    margin-bottom: 1rem !important;
}

.danger-box p {
    color: white !important;
    margin: 0 !important;
}

/* Info boxes */
.info-box {
    background: #f8f9fa !important;
    border: 2px solid #6c757d !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    margin: 2rem 0 !important;
}

.info-box h3,
.info-box h4 {
    color: #212529 !important;
    margin-bottom: 1rem !important;
}

.info-box p {
    color: #212529 !important;
    line-height: 1.6 !important;
}

/* Lists in content boxes */
.info-box ul,
.info-box ol {
    color: #212529 !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

.info-box li {
    color: #212529 !important;
    margin-bottom: 0.5rem !important;
}

/* Success/solution boxes */
.success-box {
    background: #d1ecf1 !important;
    border-left: 4px solid #155724 !important;
    padding: 1.5rem !important;
    border-radius: 8px !important;
    margin: 2rem 0 !important;
}

.success-box h4 {
    color: #155724 !important;
    margin-bottom: 1rem !important;
}

.success-box p,
.success-box ul,
.success-box li {
    color: #212529 !important;
    line-height: 1.6 !important;
}

/* Grid layouts */
.grid-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 1rem !important;
}

body:not([data-page="blog"]) .grid-item {
    text-align: center !important;
    padding: 1rem !important;
    background: white !important;
    border-radius: 8px !important;
    border: 1px solid #e9ecef !important;
}

.grid-item h4 {
    color: #721c24 !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    margin-bottom: 0.5rem !important;
}

.grid-item p {
    color: #212529 !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
}

/* CTA sections - ONLY for individual blog articles */
body:not([data-page="blog"]) .cta-section {
    background: #f8f9fa !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    margin: 2rem 0 !important;
    text-align: center !important;
}

.cta-section h4 {
    color: #0056b3 !important;
    margin-bottom: 1rem !important;
}

.cta-section p {
    color: #212529 !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
}

.cta-section a {
    background: #0056b3 !important;
    color: white !important;
    padding: 1rem 2rem !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

.cta-section a:hover {
    background: #004494 !important;
}

/* Quote sections - ONLY for individual blog articles */
body:not([data-page="blog"]) .quote-section {
    background: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    margin: 2rem 0 !important;
}

.quote-section h3 {
    color: #856404 !important;
    margin-bottom: 1rem !important;
}

.quote-section blockquote {
    color: #856404 !important;
    font-style: italic !important;
    margin: 0 !important;
}

.quote-section p {
    color: #856404 !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
}

/* Reality check / warning sections */
.reality-check {
    background: #dc3545 !important;
    color: white !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    margin: 2rem 0 !important;
}

.reality-check h4 {
    color: white !important;
    margin-bottom: 1rem !important;
}

.reality-check p {
    color: white !important;
    margin: 0 !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .content-section {
        padding: 1rem !important;
    }

    .author-attribution {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .author-attribution h1 {
        font-size: 1.8rem !important;
    }

    .code-block,
    div[style*="font-family: monospace"] {
        font-size: 0.8rem !important;
        padding: 0.8rem !important;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: 0.5rem !important;
    }
}

/* Print styles for accessibility */
@media print {
    .content-section,
    .author-attribution {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .code-block,
    div[style*="font-family: monospace"] {
        background: #f8f9fa !important;
        color: #212529 !important;
        border: 1px solid #000 !important;
    }
}

/* JavaScript backup solution loaded at end of CSS */
/* This CSS will be enhanced by JavaScript to catch any remaining issues */