/* ===== Prose Typography (replaces @tailwindcss/typography) ===== */

.prose-sg {
    color: #374151;
    line-height: 1.75;
    font-size: 1rem;
}

.prose-sg h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.2;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.prose-sg h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.prose-sg h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.prose-sg h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose-sg p {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.prose-sg a {
    color: #16a34a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose-sg a:hover {
    color: #15803d;
}

.prose-sg strong {
    font-weight: 600;
    color: #111827;
}

.prose-sg em {
    font-style: italic;
}

/* Lists */
.prose-sg ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.prose-sg ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.prose-sg li {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.prose-sg li > ul,
.prose-sg li > ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Blockquotes */
.prose-sg blockquote {
    border-left: 4px solid #16a34a;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #f0fdf4;
    color: #166534;
    border-radius: 0 0.375rem 0.375rem 0;
}

.prose-sg blockquote p {
    margin: 0;
}

/* Inline code */
.prose-sg code {
    background: #f3f4f6;
    color: #dc2626;
    font-size: 0.875em;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* Fenced code blocks */
.prose-sg pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

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

/* Tables */
.prose-sg table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.prose-sg thead th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-align: left;
    padding: 0.625rem 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.prose-sg tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.prose-sg tbody tr:hover {
    background: #f9fafb;
}

/* Horizontal rules */
.prose-sg hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* Images */
.prose-sg img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* ===== Sidebar ===== */

[x-cloak] {
    display: none !important;
}

/* Scrollbar styling for sidebar */
aside::-webkit-scrollbar {
    width: 4px;
}

aside::-webkit-scrollbar-track {
    background: transparent;
}

aside::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

aside::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Scroll margin for anchored headings (clears sticky navbar) */
.prose-sg h2[id] {
    scroll-margin-top: 5rem;
}

/* TOC sidebar scrollbar */
.toc-sidebar::-webkit-scrollbar {
    width: 4px;
}

.toc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* ===== highlight.js overrides for dark code blocks ===== */

.prose-sg pre .hljs {
    background: transparent;
    color: #e5e7eb;
}
