body {
    font-family: "Charter", "Bitstream Charter", "Sitka Text", Cambria, serif;
    line-height: 1.7;
    color: #2c3e50;
}

h1, h2, h3, h4 {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    font-weight: 500; 
    color: #1a252f;
    margin-top: 2em;
    margin-bottom: 0.8em;
    letter-spacing: 0.01em;  
}

h1 {
    font-size: 2.2em;
    border-bottom: 1.5px solid #1a252f;  
    padding-bottom: 0.3em;
}

h2 {
    font-size: 1.6em;
    margin-top: 1.8em;
    font-weight: 500;
}

h3 {
    font-weight: 500;
}

.katex { 
    font-size: 1.15em;
    font-weight: 400;
    line-height: 1.2;
    font-family: "Latin Modern Math", "STIX Two Math", "KaTeX_Main", serif;
}

.katex .mrel {
    /* Relations like \to, \in */
    margin: 0 0.1em;
}

.katex .mbin {
    /* Binary operators like +, - */
    margin: 0 0.25em;
}

.katex .msup, .katex .msub, .katex .mfrac, .katex .msqrt {
    vertical-align: middle;
}

.katex-display {
    margin: 1.8em 0;
    padding: 0.5em 0;
    line-height: 1.3;
    text-align: center;
}

.callout-note {
    border: 1.5px solid #b0bec5;
    background-color: #f8f9fa;
    padding: 1.2em 1.5em;
    margin: 2em 0;
    border-radius: 0;
    box-shadow: none;
}

.callout-note .callout-header {
    font-family: "Palatino", Georgia, serif;
    font-weight: 400 !important;
    font-size: 1.05em;
    font-style: italic;
}

.callout-note .callout-title {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-note .callout-title-container {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-note.callout-style-default > .callout-header {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-note .callout-body {
    margin-top: 0.8em;
}

.callout-important {
    border: 1.5px solid #90b4d2 !important;
    border-left: 4px solid #5a8bb8;
    background-color: #f8fafb;
    padding: 1.2em 1.5em;
    margin: 2em 0;
    border-radius: 0;
}

.callout-important .callout-header {
    font-family: "Palatino", Georgia, serif;
    font-weight: 400 !important;
    font-style: italic;
    color: #4a5568;
}

.callout-important .callout-title {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-important .callout-title-container {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-important.callout-style-default > .callout-header {
    font-weight: 400 !important;
    font-style: italic;
}


.callout-tip {
    border: 1px solid #d0d4d9;
    background-color: #f9fafb;
    padding: 1em 1.3em;
    margin: 1.5em 0;
    border-radius: 0;
}

.callout-tip .callout-header {
    font-family: "Palatino", Georgia, serif;
    font-style: italic;
    color: #4a5568;
    font-weight: 400 !important;
}

.callout-tip .callout-title {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-tip .callout-title-container {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-tip.callout-style-default > .callout-header {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-tip .callout-body {
    margin-top: 0.8em;
}

.callout-warning {
    border: 1px solid #e2b778;
    border-left: 3px solid #d69e2e;
    background-color: #fffdf8;
    padding: 1.2em 1.5em;
    margin: 2em 0;
    border-radius: 0;
}

.callout-warning .callout-header {
    font-family: "Palatino", Georgia, serif;
    font-weight: 400 !important;
    font-style: italic;
    color: #4a5568;
}

.callout-warning .callout-title {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-warning .callout-title-container {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-warning.callout-style-default > .callout-header {
    font-weight: 400 !important;
    font-style: italic;
}

.callout-icon {
    display: none;
}

.callout-body {
    transition: none !important;
}







/* Definition blocks - regular text, blue accent */
div[id^="def-"] {
    border: 1px solid #d0d9e5;
    border-left: 5px solid #3f77e7;
    background-color: transparent;
    padding: 1.2em 1.5em;
    margin: 2em 0;
    border-radius: 0;
    box-shadow: none;
}

div[id^="def-"] > h3, div[id^="def-"] > h2 {
    font-family: "Palatino", Georgia, serif !important;
    font-weight: 400 !important;
    font-size: 1.05em !important;
    font-style: italic !important;
    margin-top: 0 !important;
    margin-bottom: 0.8em !important;
    color: #2c3e50 !important;
}

/* Theorem blocks - italic text, different accent */
div[id^="thm-"], div[id^="cor-"], div[id^="lem-"], div[id^="prop-"] {
    border: 1px solid #d0d9e5;
    border-left: 5px solid #f7d14b;
    background-color: transparent;
    padding: 1.2em 1.5em;
    margin: 2em 0;
    border-radius: 0;
    box-shadow: none;
    font-style: italic;
}

div[id^="thm-"] > h3, div[id^="thm-"] > h2,
div[id^="cor-"] > h3, div[id^="cor-"] > h2,
div[id^="lem-"] > h3, div[id^="lem-"] > h2,
div[id^="prop-"] > h3, div[id^="prop-"] > h2 {
    font-family: "Palatino", Georgia, serif !important;
    font-weight: 400 !important;
    font-size: 1.05em !important;
    font-style: italic !important;
    margin-top: 0 !important;
    margin-bottom: 0.8em !important;
    color: #2c3e50 !important;
}


figure {
    margin: 2.5em auto;
    text-align: center;
    max-width: 90%;
}

figure img {
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 100%;
}

figcaption {
    margin-top: 1em;
    font-style: italic;
    color: #5a6570;
    font-size: 0.95em;
    font-family: "Palatino", Georgia, serif;
}

.sourceCode {
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-left: 3px solid #6c757d;
    border-radius: 0;
    padding: 1em;
    font-family: "Fira Code", "Consolas", "Monaco", monospace;
    font-size: 0.9em;
}

pre {
    margin: 1.5em 0;
}

code {
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 0.92em;
    background-color: #f1f3f5;
    padding: 0.15em 0.4em;
    border-radius: 2px;
}

.math.display {
    overflow-x: auto;
    overflow-y: hidden;
}

em {
    font-style: italic;
    font-weight: 400;
}

strong {
    font-weight: 500; 
    color: #1a252f;
}

blockquote {
    border-left: 3px solid #cbd5e0;
    padding-left: 1.5em;
    margin: 1.5em 0;
    color: #4a5568;
    font-style: italic;
    background-color: #f7fafc;
    padding: 1em 1.5em;
}

ul, ol {
    padding-left: 2em;
    margin: 1em 0;
}

li {
    margin: 0.5em 0;
}

table {
    border-collapse: collapse;
    margin: 2em auto;
    border-top: 2px solid #1a252f;
    border-bottom: 2px solid #1a252f;
}

thead {
    border-bottom: 1px solid #1a252f;
}

th {
    padding: 0.8em 1.2em;
    text-align: left;
    font-weight: 500;  
    font-family: "Palatino", Georgia, serif;
}

td {
    padding: 0.6em 1.2em;
    border-bottom: 1px solid #e2e8f0;
}

tbody tr:last-child td {
    border-bottom: none;
}

hr {
    border: none;
    border-top: 1px solid #cbd5e0;
    margin: 3em 0;
}

a {
    color: #2c5282;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s;
}

a:hover {
    border-bottom: 1px solid #2c5282;
}

.quarto-title {
    margin-bottom: 2em;
}

.quarto-title-block {
    border-bottom: 1.5px solid #1a252f;  
    padding-bottom: 1em;
    margin-bottom: 2em;
}

#TOC {
    font-family: "Palatino", Georgia, serif;
    font-size: 0.95em;
}

#TOC .active {
    font-weight: 500;  
    color: #1a252f;
}

.boxed {
    border: 1.5px solid #1a252f;  
    padding: 1em;
    margin: 1.5em 0;
    text-align: center;
}

@media print {
    body {
        font-size: 11pt;
    }
    
    .callout-note,
    .callout-important,
    .callout-tip,
    .callout-warning {
        page-break-inside: avoid;
    }
}