/* CKEditor 5 Content Dark Mode Styling for Rasam Energy */
.ck-content {
    color: #cbd5e1 !important; /* slate-300 */
    font-family: 'Vazirmatn', sans-serif !important;
    line-height: 1.9 !important;
    font-size: 0.95rem !important;
}

.ck-content h1, .ck-content h2, .ck-content h3, .ck-content h4 {
    color: #ffffff !important;
    font-weight: 800 !important;
    margin-top: 1.8rem !important;
    margin-bottom: 0.8rem !important;
    scroll-margin-top: 100px; /* برای اسکرول دقیق TOC */
}

.ck-content h2 {
    font-size: 1.35rem !important;
    border-right: 4px solid #00D2FF !important;
    padding-right: 0.75rem !important;
}

.ck-content h3 {
    font-size: 1.15rem !important;
    border-right: 3px solid #FFB800 !important;
    padding-right: 0.5rem !important;
}

.ck-content p {
    margin-bottom: 1.2rem !important;
}

.ck-content a {
    color: #00D2FF !important;
    text-decoration: underline !important;
}

.ck-content blockquote {
    background: rgba(15, 23, 42, 0.7) !important;
    border-right: 4px solid #00D2FF !important;
    padding: 1rem 1.25rem !important;
    border-radius: 0.75rem !important;
    margin: 1.5rem 0 !important;
    color: #f8fafc !important;
}

.ck-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.5rem 0 !important;
    background-color: #0f172a !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
}

.ck-content table th, .ck-content table td {
    border: 1px solid #334155 !important;
    padding: 0.75rem 1rem !important;
    text-align: right !important;
}

.ck-content table th {
    background-color: #1e293b !important;
    color: #00D2FF !important;
}

.ck-content img {
    border-radius: 1rem !important;
    margin: 1.5rem auto !important;
    max-width: 100% !important;
    height: auto !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

/* =========================================================
   CKEditor 5 Content Fixes (Overriding Tailwind Preflight)
   ========================================================= */

/* 1. Headings (تیترها) */
.ck-content h2 {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin-top: 2.25rem !important;
    margin-bottom: 1.25rem !important;
    border-right: 4px solid #00D2FF !important; /* خط رنگی عمودی سمت راست */
    padding-right: 0.75rem !important;
    line-height: 1.5 !important;
    scroll-margin-top: 100px;
}

.ck-content h3 {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #f1f5f9 !important;
    margin-top: 1.75rem !important;
    margin-bottom: 1rem !important;
    border-right: 3px solid #FFB800 !important;
    padding-right: 0.5rem !important;
    line-height: 1.5 !important;
}

/* 2. Paragraphs & Text (متن‌ها و فاصله‌ها) */
.ck-content p {
    color: #cbd5e1 !important; /* slate-300 */
    line-height: 2.1 !important; /* فاصله اسطرها برای خوانایی فارسی */
    margin-bottom: 1.25rem !important;
    font-size: 0.95rem !important;
}

.ck-content strong,
.ck-content b {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* 3. Lists (لیست‌های نقطه‌ای و شماره‌دار) */
.ck-content ul {
    list-style-type: disc !important;
    padding-right: 1.75rem !important;
    margin-top: 0.75rem !important;
    margin-bottom: 1.5rem !important;
    color: #cbd5e1 !important;
}

.ck-content ol {
    list-style-type: decimal !important;
    padding-right: 1.75rem !important;
    margin-top: 0.75rem !important;
    margin-bottom: 1.5rem !important;
    color: #cbd5e1 !important;
}

.ck-content li {
    margin-bottom: 0.6rem !important;
    line-height: 1.9 !important;
}

/* 4. Blockquotes (باکس نقل‌قول) */
.ck-content blockquote {
    background-color: rgba(30, 41, 59, 0.7) !important; /* bg-rasam-slate/70 */
    border-right: 4px solid #00D2FF !important;
    padding: 1.25rem 1.5rem !important;
    margin: 2rem 0 !important;
    border-radius: 0.75rem !important;
    color: #f8fafc !important;
    font-style: normal !important;
    line-height: 2 !important;
}

.ck-content blockquote p {
    margin-bottom: 0 !important;
    color: #f8fafc !important;
    font-weight: 500 !important;
}

/* 5. Tables (استایل جدول‌ها) */
.ck-content figure.table {
    margin: 2rem 0 !important;
    overflow-x: auto !important;
    border-radius: 0.75rem !important;
    border: 1px solid #334155 !important;
}

.ck-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    background-color: #0f172a !important; /* slate-900 */
    color: #cbd5e1 !important;
    text-align: right !important;
    font-size: 0.875rem !important;
}

.ck-content table th {
    background-color: #1e293b !important; /* slate-800 */
    color: #00D2FF !important;
    font-weight: 700 !important;
    padding: 0.875rem 1rem !important;
    border-bottom: 2px solid #334155 !important;
    border-left: 1px solid #334155 !important;
}

.ck-content table th:last-child {
    border-left: none !important;
}

.ck-content table td {
    padding: 0.875rem 1rem !important;
    border-bottom: 1px solid #1e293b !important;
    border-left: 1px solid #334155 !important;
}

.ck-content table td:last-child {
    border-left: none !important;
}

.ck-content table tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.3) !important;
}

.ck-content table tr:hover {
    background-color: rgba(0, 210, 255, 0.05) !important;
}
