/* 
  Unified Document Stylesheet
  Usage: Imported by Viewer, Editor, and PDF Generator
  Target: .document-content (PDF/Viewer), .tiptap-editor-canvas (Editor)
*/

.document-content,
.tiptap-editor-canvas {
    font-family: 'Inter', sans-serif;
    color: #1f2937;
    /* gray-800 */
    line-height: 1.625;
}

.document-content h1,
.tiptap-editor-canvas h1 {
    font-size: 2.25em;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 0.8888889em;
    line-height: 1.1111111;
    color: #111827;
    /* gray-900 */
}

.document-content h2,
.tiptap-editor-canvas h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3333333;
    color: #111827;
    /* gray-900 */
}

.document-content h3,
.tiptap-editor-canvas h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.6;
    color: #111827;
    /* gray-900 */
}

.document-content p,
.tiptap-editor-canvas p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.document-content a,
.tiptap-editor-canvas a {
    color: #c5785c;
    text-decoration: underline;
    font-weight: 500;
}

.document-content ul,
.tiptap-editor-canvas ul {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
    list-style-type: disc;
}

.document-content ol,
.tiptap-editor-canvas ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
    list-style-type: decimal;
}

/* 
    CRITICAL FIX: Nested List Resets 
    Collapses margins when lists are nested to prevent "Gigantic Gaps".
    REMOVED !important to ensure manual editor overrides (inline styles) work correctly.
*/
.document-content li>p,
.tiptap-editor-canvas li>p {
    margin-bottom: 0;
}

.document-content li>ul,
.tiptap-editor-canvas li>ul,
.document-content li>ol,
.tiptap-editor-canvas li>ol {
    margin-top: 0.5em;
    margin-bottom: 0;
}

.document-content li,
.tiptap-editor-canvas li {
    margin-bottom: 0.5em;
}

.document-content blockquote,
.tiptap-editor-canvas blockquote {
    font-weight: 500;
    font-style: italic;
    color: #111827;
    border-left-width: 0.25rem;
    border-left-color: #e5e7eb;
    margin-top: 1.6em;
    margin-bottom: 1.6em;
    padding-left: 1em;
}

.document-content img,
.tiptap-editor-canvas img {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.document-content table,
.tiptap-editor-canvas table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.875em;
    line-height: 1.7142857;
}

.document-content thead,
.tiptap-editor-canvas thead {
    border-bottom-width: 1px;
    border-bottom-color: #d1d5db;
}

.document-content thead th,
.tiptap-editor-canvas thead th {
    color: #111827;
    font-weight: 600;
    vertical-align: bottom;
    padding-right: 0.5714286em;
    padding-bottom: 0.5714286em;
    padding-left: 0.5714286em;
}

.document-content tbody tr,
.tiptap-editor-canvas tbody tr {
    border-bottom-width: 1px;
    border-bottom-color: #e5e7eb;
}

.document-content tbody tr:last-child,
.tiptap-editor-canvas tbody tr:last-child {
    border-bottom-width: 0;
}

.document-content tbody td,
.tiptap-editor-canvas tbody td {
    vertical-align: baseline;
    padding: 0.5714286em;
}

/* Highlight */
.document-content mark,
.tiptap-editor-canvas mark {
    background-color: #fde047;
    /* yellow-300 */
    padding: 0.125em 0;
}