/*
 * Rich Text Content — View-mode styles for HTML produced by the Tiptap editor.
 * Mirrors the editor content styles so rendered output looks identical.
 *
 * Usage: <div class="rich-text-content">@Html.Raw(html)</div>
 */

/* ============================================
   Typography
   ============================================ */

.rich-text-content p {
    margin: 0 0 0.75rem 0;
}

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

.rich-text-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
}

.rich-text-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    line-height: 1.25;
}

.rich-text-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

/* ============================================
   Lists
   ============================================ */

.rich-text-content ul,
.rich-text-content ol {
    margin: 0 0 0.75rem 0;
    padding-left: 1.5rem;
}

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

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

.rich-text-content li {
    margin-bottom: 0.25rem;
}

/* ============================================
   Block Elements
   ============================================ */

.rich-text-content blockquote {
    border-left: 3px solid #086664;
    padding-left: 1rem;
    margin: 0 0 0.75rem 0;
    color: #4b5563;
    font-style: italic;
}

.rich-text-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1rem 0;
}

/* ============================================
   Inline Elements
   ============================================ */

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

.rich-text-content mark {
    border-radius: 0.125rem;
    padding: 0.125rem 0;
}

.rich-text-content a {
    color: #086664;
    text-decoration: underline;
    cursor: pointer;
}

.rich-text-content a:hover {
    color: #05413F;
}

/* ============================================
   Images
   ============================================ */

.rich-text-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 0.5rem 0;
}

/* ============================================
   Tables
   ============================================ */

.rich-text-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.75rem 0;
    overflow: hidden;
}

.rich-text-content table td,
.rich-text-content table th {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}

.rich-text-content table th {
    background-color: #f9fafb;
    font-weight: 600;
    text-align: left;
}

/* ============================================
   Code
   ============================================ */

.rich-text-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, monospace;
    font-size: 0.875em;
}

.rich-text-content pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0 0.75rem 0;
    overflow-x: auto;
}

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

/* ============================================
   Text Alignment
   ============================================ */

.rich-text-content [style*="text-align: left"] {
    text-align: left;
}

.rich-text-content [style*="text-align: center"] {
    text-align: center;
}

.rich-text-content [style*="text-align: right"] {
    text-align: right;
}

.rich-text-content [style*="text-align: justify"] {
    text-align: justify;
}

/* ============================================
   Dark Mode
   ============================================ */

.dark .rich-text-content {
    color: #f3f4f6;
}

.dark .rich-text-content blockquote {
    color: #9ca3af;
}

.dark .rich-text-content a {
    color: #5eead4;
}

.dark .rich-text-content a:hover {
    color: #2dd4bf;
}

.dark .rich-text-content code {
    background-color: #374151;
}

.dark .rich-text-content hr {
    border-color: #4b5563;
}

.dark .rich-text-content table td,
.dark .rich-text-content table th {
    border-color: #4b5563;
}

.dark .rich-text-content table th {
    background-color: #374151;
}
