/* Markdown Content Styling */

.markdown-content {
    line-height: 1.8;
    color: #44403c; /* stone-700 */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.markdown-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1c1917;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1c1917;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e7e5e4;
    line-height: 1.3;
}

.markdown-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1c1917;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-weight: 600;
    color: #292524;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.markdown-content p {
    margin-bottom: 1.25rem;
}

.markdown-content a {
    color: #b45309;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.markdown-content a:hover {
    color: #92400e;
}

.markdown-content strong {
    font-weight: 600;
    color: #1c1917;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

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

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

.markdown-content li {
    margin-bottom: 0.375rem;
}

.markdown-content li > ul,
.markdown-content li > ol {
    margin-top: 0.375rem;
    margin-bottom: 0;
}

.markdown-content blockquote {
    border-left: 3px solid #d97706;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: #fdf8f0;
    border-radius: 0 0.75rem 0.75rem 0;
    color: #57534e;
}

.markdown-content blockquote p:last-child {
    margin-bottom: 0;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid #e7e5e4;
    margin: 2rem 0;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.markdown-content thead th {
    background: #faf8f5;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #1c1917;
    border-bottom: 2px solid #e7e5e4;
}

.markdown-content tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f5f5f4;
}

.markdown-content tbody tr:hover {
    background: #faf8f5;
}

/* Inline Code */
.markdown-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: #faf8f5;
    color: #b45309;
    padding: 0.15rem 0.4rem;
    border-radius: 0.375rem;
    border: 1px solid #e7e5e4;
}

/* Code Blocks */
.markdown-content pre {
    margin: 1.5rem 0;
    border-radius: 1rem;
    overflow-x: auto;
    border: 1px solid #e7e5e4;
}

.markdown-content pre code {
    display: block;
    padding: 1.25rem;
    background: #1c1917;
    color: #e7e5e4;
    font-size: 0.875rem;
    line-height: 1.7;
    border: none;
    border-radius: 1rem;
}

/* Pygments / codehilite Syntax Highlighting */
.codehilite {
    margin: 1.5rem 0;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #e7e5e4;
}

.codehilite pre {
    margin: 0;
    padding: 1.25rem;
    background: #1c1917;
    overflow-x: auto;
    border: none;
    border-radius: 0;
}

.codehilite code {
    background: transparent;
    color: #e7e5e4;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Pygments token colors (warm-toned) */
.codehilite .hll { background-color: #49483e }
.codehilite .c { color: #78716c; font-style: italic } /* Comment */
.codehilite .k { color: #f59e0b } /* Keyword */
.codehilite .o { color: #a8a29e } /* Operator */
.codehilite .p { color: #d6d3d1 } /* Punctuation */
.codehilite .cm { color: #78716c; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #f59e0b } /* Comment.Preproc */
.codehilite .c1 { color: #78716c; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #78716c; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #ef4444 } /* Generic.Deleted */
.codehilite .gi { color: #22c55e } /* Generic.Inserted */
.codehilite .ge { font-style: italic } /* Generic.Emph */
.codehilite .gs { font-weight: bold } /* Generic.Strong */
.codehilite .kc { color: #f59e0b } /* Keyword.Constant */
.codehilite .kd { color: #f59e0b } /* Keyword.Declaration */
.codehilite .kn { color: #fb923c } /* Keyword.Namespace */
.codehilite .kp { color: #f59e0b } /* Keyword.Pseudo */
.codehilite .kr { color: #f59e0b } /* Keyword.Reserved */
.codehilite .kt { color: #fbbf24 } /* Keyword.Type */
.codehilite .m { color: #a78bfa } /* Literal.Number */
.codehilite .s { color: #86efac } /* Literal.String */
.codehilite .na { color: #67e8f9 } /* Name.Attribute */
.codehilite .nb { color: #fde68a } /* Name.Builtin */
.codehilite .nc { color: #67e8f9; font-weight: bold } /* Name.Class */
.codehilite .no { color: #f59e0b } /* Name.Constant */
.codehilite .nd { color: #67e8f9 } /* Name.Decorator */
.codehilite .ni { color: #d6d3d1 } /* Name.Entity */
.codehilite .ne { color: #f59e0b } /* Name.Exception */
.codehilite .nf { color: #67e8f9 } /* Name.Function */
.codehilite .nl { color: #d6d3d1 } /* Name.Label */
.codehilite .nn { color: #d6d3d1 } /* Name.Namespace */
.codehilite .nt { color: #fb923c } /* Name.Tag */
.codehilite .nv { color: #d6d3d1 } /* Name.Variable */
.codehilite .ow { color: #f59e0b } /* Operator.Word */
.codehilite .w { color: #d6d3d1 } /* Text.Whitespace */
.codehilite .mf { color: #a78bfa } /* Literal.Number.Float */
.codehilite .mh { color: #a78bfa } /* Literal.Number.Hex */
.codehilite .mi { color: #a78bfa } /* Literal.Number.Integer */
.codehilite .mo { color: #a78bfa } /* Literal.Number.Oct */
.codehilite .sb { color: #86efac } /* Literal.String.Backtick */
.codehilite .sc { color: #86efac } /* Literal.String.Char */
.codehilite .sd { color: #86efac } /* Literal.String.Doc */
.codehilite .s2 { color: #86efac } /* Literal.String.Double */
.codehilite .se { color: #fbbf24 } /* Literal.String.Escape */
.codehilite .sh { color: #86efac } /* Literal.String.Heredoc */
.codehilite .si { color: #86efac } /* Literal.String.Interpol */
.codehilite .sx { color: #86efac } /* Literal.String.Other */
.codehilite .sr { color: #86efac } /* Literal.String.Regex */
.codehilite .s1 { color: #86efac } /* Literal.String.Single */
.codehilite .ss { color: #86efac } /* Literal.String.Symbol */
.codehilite .bp { color: #d6d3d1 } /* Name.Builtin.Pseudo */
.codehilite .vc { color: #d6d3d1 } /* Name.Variable.Class */
.codehilite .vg { color: #d6d3d1 } /* Name.Variable.Global */
.codehilite .vi { color: #d6d3d1 } /* Name.Variable.Instance */
.codehilite .il { color: #a78bfa } /* Literal.Number.Integer.Long */

/* TOC anchor links */
.toc-anchor {
    color: #d6d3d1;
    text-decoration: none;
    margin-left: 0.5rem;
    font-size: 0.875em;
    opacity: 0;
    transition: opacity 0.2s;
}

.markdown-content h1:hover .toc-anchor,
.markdown-content h2:hover .toc-anchor,
.markdown-content h3:hover .toc-anchor,
.markdown-content h4:hover .toc-anchor {
    opacity: 1;
    color: #d97706;
}

/* Admonitions */
.admonition {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    border-left: 3px solid #d97706;
    background: #fdf8f0;
}

.admonition-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #92400e;
}

/* Footnotes */
.footnote {
    font-size: 0.875rem;
    color: #78716c;
    border-top: 1px solid #e7e5e4;
    margin-top: 2rem;
    padding-top: 1rem;
}

.footnote ol {
    padding-left: 1.5rem;
}

.footnote-ref {
    color: #d97706;
    text-decoration: none;
    font-weight: 600;
}
