/* ========================================
   Rich Text Content Styling
   ======================================== */

/* Base prose styling */
.prose {
    color: #374151;
    line-height: 1.75;
    max-width: 65ch;
}

.prose-sm {
    font-size: 0.875rem;
    line-height: 1.7142857;
}

.prose-lg {
    font-size: 1.125rem;
    line-height: 1.7777778;
}

.max-w-none {
    max-width: none;
}

/* Headings */
.prose h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #111827;
    margin-top: 0;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.prose h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4b5563;
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
}

.prose h5 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #6b7280;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.prose h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Paragraphs */
.prose p {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: inherit;
    line-height: 1.75;
}

/* Lists */
.prose ul,
.prose ol {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.625rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 0.375rem;
}

.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.prose ul ul {
    list-style-type: circle;
}

.prose ul ul ul {
    list-style-type: square;
}

/* List items with proper text */
.prose li p {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Links */
.prose a {
    color: #3b82f6;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.prose a:hover {
    color: #2563eb;
}

/* Strong and Emphasis */
.prose strong {
    font-weight: 700;
    color: #111827;
}

.prose em {
    font-style: italic;
}

/* Blockquotes */
.prose blockquote {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 4px solid #3b82f6;
    font-style: italic;
    color: #4b5563;
    background-color: #f9fafb;
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
}

.prose blockquote p:first-of-type::before,
.prose blockquote p:last-of-type::after {
    content: '';
}

/* Code */
.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    color: #dc2626;
    font-weight: 600;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875em;
    line-height: 1.7142857;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    border-radius: 0;
}

/* Horizontal Rule */
.prose hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-size: 0.875em;
    line-height: 1.7142857;
}

.prose thead {
    border-bottom: 1px solid #d1d5db;
}

.prose thead th {
    background-color: #f3f4f6;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    vertical-align: top;
}

.prose tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.prose tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.prose tbody td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    vertical-align: top;
}

/* Images */
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.prose figure {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.prose figure img {
    margin-top: 0;
    margin-bottom: 0;
}

.prose figcaption {
    text-align: center;
    font-size: 0.875em;
    color: #6b7280;
    margin-top: 0.75rem;
}

/* Video */
.prose video {
    max-width: 100%;
    border-radius: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Spacing overrides */
.prose > *:first-child {
    margin-top: 0 !important;
}

.prose > *:last-child {
    margin-bottom: 0 !important;
}

/* Tailwind-specific utility combinations */
.prose.text-gray-600 {
    color: #4b5563;
}

.prose-headings\:text-gray-900 h1,
.prose-headings\:text-gray-900 h2,
.prose-headings\:text-gray-900 h3,
.prose-headings\:text-gray-900 h4,
.prose-headings\:text-gray-900 h5,
.prose-headings\:text-gray-900 h6 {
    color: #111827;
}

.prose-headings\:font-bold h1,
.prose-headings\:font-bold h2,
.prose-headings\:font-bold h3,
.prose-headings\:font-bold h4,
.prose-headings\:font-bold h5,
.prose-headings\:font-bold h6 {
    font-weight: 700;
}

.prose-a\:text-primary a {
    color: var(--color-primary, #8b5cf6);
}

.prose-a\:no-underline a {
    text-decoration: none;
}

.hover\:prose-a\:underline a:hover {
    text-decoration: underline;
}

.prose-img\:rounded-xl img {
    border-radius: 0.75rem;
}
