/* Article Content Styles - Enhanced formatting support */

.article-content {
    line-height: 1.8;
    color: #1a1a1a;
}

/* IMPORTANT: Force remove inline styles - use !important to override */
.article-content p {
    margin-bottom: 1.25rem !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    text-align: justify !important;
}

/* Remove any lingering style attributes */
.article-content p[style] {
    color: #374151 !important;
    line-height: 1.8 !important;
    margin-bottom: 1.25rem !important;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: #1f2937;
}

.article-content h1 { font-size: 2.25rem; }
.article-content h2 { font-size: 1.875rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.25rem; }
.article-content h5 { font-size: 1.125rem; }
.article-content h6 { font-size: 1rem; }

.article-content strong,
.article-content b {
    font-weight: 700;
    color: #111827;
}

.article-content em,
.article-content i {
    font-style: italic;
}

.article-content u {
    text-decoration: underline;
}

.article-content s,
.article-content strike {
    text-decoration: line-through;
}

.article-content ul,
.article-content ol {
    margin: 1.25rem 0;
    padding-left: 2rem;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

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

.article-content ul ul,
.article-content ol ul {
    list-style-type: circle;
}

.article-content ol ol,
.article-content ul ol {
    list-style-type: lower-alpha;
}

.article-content a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s;
}

.article-content a:hover {
    color: #1d4ed8;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
    border-radius: 8px;
    display: block;
}

.article-content table,
.article-content .editor-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;
    background: white;
}

.article-content table thead,
.article-content .editor-table thead {
    background: #f3f4f6;
}

.article-content table th,
.article-content .editor-table th {
    padding: 12px;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    text-align: left;
    color: #1f2937;
}

.article-content table td,
.article-content .editor-table td {
    padding: 12px;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.article-content table tr:nth-child(even),
.article-content .editor-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.article-content table tr:hover,
.article-content .editor-table tbody tr:hover {
    background: #f3f4f6;
}

.article-content blockquote {
    border-left: 4px solid #2563eb;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
    background: #f9fafb;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

.article-content code {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #dc2626;
}

.article-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

.article-content .table-of-contents {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.article-content .table-of-contents h3 {
    margin: 0 0 15px 0;
    font-size: 1.125rem;
    color: #1f2937;
}

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

.article-content .table-of-contents li {
    margin: 8px 0;
}

.article-content .table-of-contents a {
    color: #2563eb;
    text-decoration: none;
}

.article-content .table-of-contents a:hover {
    text-decoration: underline;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    /* Reduce font sizes on mobile */
    .article-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .article-content h1 { font-size: 1.75rem; }
    .article-content h2 { font-size: 1.5rem; }
    .article-content h3 { font-size: 1.25rem; }
    .article-content h4 { font-size: 1.125rem; }
    .article-content h5 { font-size: 1rem; }
    .article-content h6 { font-size: 0.95rem; }
    
    /* Responsive tables */
    .article-content table,
    .article-content .editor-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.875rem;
    }
    
    /* Reduce padding on mobile */
    .article-content blockquote {
        padding-left: 1rem;
        padding-right: 1rem;
        margin: 1rem 0;
    }
    
    .article-content pre {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .article-content ul,
    .article-content ol {
        padding-left: 1.5rem;
    }
    
    /* Images */
    .article-content img {
        margin: 1rem auto;
        border-radius: 6px;
    }
    
    /* Table of contents */
    .article-content .table-of-contents {
        padding: 15px;
        margin: 15px 0;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .article-content h1 { font-size: 1.5rem; }
    .article-content h2 { font-size: 1.35rem; }
    .article-content h3 { font-size: 1.15rem; }
    
    .article-content table th,
    .article-content .editor-table th,
    .article-content table td,
    .article-content .editor-table td {
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* Figure and caption support */
.article-content figure {
    margin: 1.5rem 0;
}

.article-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-style: italic;
}