/**
 * ITCMS Prose/Article Content Styles
 * 
 * Enhanced typography for blog posts, articles, and rich content.
 * This is a fallback/supplement for Tailwind Typography plugin.
 * Include this in themes that need consistent prose styling.
 * 
 * Usage: <div class="prose prose-lg">...</div>
 */

/* ============================================
   BASE PROSE STYLES
   ============================================ */
.prose {
    color: #334155;
    line-height: 1.8;
    font-size: 1.0625rem;
}

.prose > * + * {
    margin-top: 1.25em;
}

/* ============================================
   PARAGRAPHS
   ============================================ */
.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    text-align: justify;
}

.prose > p:first-child {
    margin-top: 0;
}

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

/* ============================================
   HEADINGS
   ============================================ */
.prose h1 {
    font-size: 2.25em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.75em;
    line-height: 1.2;
    color: #0f172a;
}

.prose h2 {
    font-size: 1.75em;
    font-weight: 600;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    color: #0f172a;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #e2e8f0;
}

.prose h3 {
    font-size: 1.375em;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.4;
    color: #1e293b;
}

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

.prose h5 {
    font-size: 1em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #1e293b;
}

.prose h6 {
    font-size: 0.875em;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* First heading in content - no top margin */
.prose > h1:first-child,
.prose > h2:first-child,
.prose > h3:first-child,
.prose > h4:first-child {
    margin-top: 0;
}

/* ============================================
   TEXT FORMATTING
   ============================================ */
.prose strong,
.prose b {
    font-weight: 600;
    color: #1e293b;
}

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

.prose small {
    font-size: 0.875em;
}

/* ============================================
   LINKS
   ============================================ */
.prose a {
    color: #0ea5e9;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.prose a:hover {
    color: #0284c7;
}

/* ============================================
   LISTS
   ============================================ */
.prose ul,
.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.5em;
}

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

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

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose li::marker {
    color: #0ea5e9;
}

.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */
.prose blockquote {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    padding: 1em 1.25em;
    border-left: 4px solid #0ea5e9;
    font-style: italic;
    color: #475569;
    background-color: #f8fafc;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose blockquote p {
    margin: 0;
}

.prose blockquote cite {
    display: block;
    margin-top: 0.75em;
    font-size: 0.875em;
    font-style: normal;
    color: #64748b;
}

/* ============================================
   IMAGES
   ============================================ */
.prose img {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.prose figure {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

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

/* ============================================
   CODE
   ============================================ */
.prose pre {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    padding: 1em;
    background-color: #1e293b;
    border-radius: 0.5rem;
    overflow-x: auto;
    color: #e2e8f0;
}

.prose code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875em;
}

.prose :not(pre) > code {
    background-color: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    color: #e11d48;
}

/* ============================================
   TABLES
   ============================================ */
.prose table {
    width: 100%;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-collapse: collapse;
    font-size: 0.9375em;
}

.prose thead {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.prose th {
    padding: 0.75em 1em;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
}

.prose td {
    padding: 0.75em 1em;
    border-bottom: 1px solid #e2e8f0;
}

.prose tbody tr:hover {
    background-color: #f8fafc;
}

/* ============================================
   HORIZONTAL RULES
   ============================================ */
.prose hr {
    margin-top: 2em;
    margin-bottom: 2em;
    border: none;
    border-top: 1px solid #e2e8f0;
}

/* ============================================
   SIZE VARIANTS
   ============================================ */

/* Prose LG - Larger text for feature articles */
.prose-lg {
    font-size: 1.125rem;
}

.prose-lg p {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

.prose-lg h1 {
    font-size: 2.5em;
}

.prose-lg h2 {
    font-size: 1.875em;
}

.prose-lg h3 {
    font-size: 1.5em;
}

/* Prose SM - Compact text for sidebars, cards */
.prose-sm {
    font-size: 0.9375rem;
}

.prose-sm p {
    margin-top: 1em;
    margin-bottom: 1em;
}

.prose-sm h2 {
    font-size: 1.5em;
}

.prose-sm h3 {
    font-size: 1.25em;
}

/* ============================================
   COLOR VARIANTS
   ============================================ */

/* Slate (default) */
.prose-slate {
    color: #334155;
}

.prose-slate h1,
.prose-slate h2,
.prose-slate h3,
.prose-slate h4,
.prose-slate strong {
    color: #0f172a;
}

/* Gray */
.prose-gray {
    color: #4b5563;
}

.prose-gray h1,
.prose-gray h2,
.prose-gray h3,
.prose-gray h4,
.prose-gray strong {
    color: #111827;
}

/* Invert (for dark backgrounds) */
.prose-invert {
    color: #cbd5e1;
}

.prose-invert h1,
.prose-invert h2,
.prose-invert h3,
.prose-invert h4,
.prose-invert strong {
    color: #f1f5f9;
}

.prose-invert a {
    color: #38bdf8;
}

.prose-invert a:hover {
    color: #7dd3fc;
}

.prose-invert blockquote {
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: #38bdf8;
}

.prose-invert :not(pre) > code {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fda4af;
}
