/* ========================================
   Article/CKEditor Content Styling
   Wrap CKEditor output with class="article-content"
   ======================================== */

.article-content {
    font-size: 16px;
    line-height: 1.75;
    color: #374151;
}

/* Headings */
.article-content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.article-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Paragraphs */
.article-content p {
    margin-bottom: 1rem;
}

.article-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.article-content a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

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

/* Bold & Italic */
.article-content strong,
.article-content b {
    font-weight: 600;
    color: #1e293b;
}

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

/* Lists */
.article-content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.article-content ol {
    list-style-type: decimal;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

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

.article-content li::marker {
    color: #6366f1;
}

.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

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

/* Blockquote / Key Takeaways */
.article-content blockquote {
    border-left: 4px solid #6366f1;
    background: #f8fafc;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.article-content blockquote p {
    margin-bottom: 0.5rem;
    color: #475569;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    color: #e11d48;
}

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

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

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
}

.article-content thead {
    background: #f8fafc;
}

.article-content th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.article-content td {
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    vertical-align: top;
}

.article-content tbody tr:nth-child(even) {
    background: #f8fafc;
}

.article-content tbody tr:hover {
    background: #f1f5f9;
}

/* Table wrapper for horizontal scroll */
.article-content .table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.article-content .table-wrapper table {
    margin: 0;
}

/* Figure & Image */
.article-content figure {
    margin: 1.5rem 0;
    text-align: center;
}

.article-content figure img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.article-content figcaption {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: #6b7280;
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    height: auto;
}

/* Key Takeaways Box (custom styling) */
.article-content .key-takeaways {
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.article-content .key-takeaways strong {
    color: #6366f1;
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-content .key-takeaways ul {
    margin: 0;
    padding-left: 1.25rem;
}

.article-content .key-takeaways li {
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

/* Subscript & Superscript */
.article-content sub {
    font-size: 0.75em;
    vertical-align: sub;
}

.article-content sup {
    font-size: 0.75em;
    vertical-align: super;
}

/* Mark/Highlight */
.article-content mark {
    background: #fef08a;
    padding: 0 4px;
    border-radius: 2px;
}

/* Video Embed */
.article-content .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
    border-radius: 10px;
}

.article-content .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
    .article-content {
        font-size: 15px;
        line-height: 1.7;
    }
    
    .article-content h1 {
        font-size: 1.625rem;
    }
    
    .article-content h2 {
        font-size: 1.25rem;
    }
    
    .article-content h3 {
        font-size: 1.125rem;
    }
    
    .article-content table {
        font-size: 0.8125rem;
    }
    
    .article-content th,
    .article-content td {
        padding: 8px 10px;
    }
    
    .article-content blockquote {
        padding: 0.75rem 1rem;
        margin: 1rem 0;
    }
}