
/* Obsidian default light theme refinements */

/* Reading width */
.wrapper-main #main.container {
    max-width: 900px;
}

/* Headings */
.post h1,
.post h2,
.post h3,
.post h4,
.post h5,
.post h6 {
    font-weight: 700;
    text-align: left !important;
}

/* Remove heading decorations */
.post h2::before,
.post h2::after,
.post h3::before,
.post h3::after {
    content: none !important;
    display: none !important;
}

/* Mathematical formulas */
.post .entry mjx-container[display="true"],
.post .entry .MathJax_Display {
    margin: 1.5em 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Obsidian-style tables */
.post .entry table {
    border-collapse: collapse;
    background: #ffffff;
}

.post .entry th,
.post .entry td {
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    background: #ffffff;
}

.post .entry tr:nth-child(even),
.post .entry tr:nth-child(odd) {
    background: #ffffff;
}

.post .entry th {
    font-weight: 700;
}

/* Paragraph spacing */
.post .entry p {
    margin-bottom: 1em;
    line-height: 1.6;
}

/* Images */
.post .entry img {
    max-width: 100%;
    height: auto;
}


/* Compact technical article layout */

/* 1. Body text */
.post .entry {
    font-size: 15px;
    line-height: 1.6;
}

.post .entry p,
.post .entry li {
    font-size: inherit;
    line-height: 1.6;
}

/* Headings */
.post .entry h1 {
    font-size: 25px;
}

.post .entry h2 {
    font-size: 22px;
}

.post .entry h3 {
    font-size: 18px;
}

.post .entry h4 {
    font-size: 16px;
}

/* 2. Mathematical formulas */
.post .entry mjx-container {
    font-size: 92% !important;
}

.post .entry mjx-container[display="true"] {
    max-width: 100%;
    margin: 1em 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
}

/* 3. Tables fit article width */
.post .entry table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 12px;
    margin: 1em 0;
}

.post .entry th,
.post .entry td {
    padding: 5px 7px !important;
    font-size: inherit;
    line-height: 1.4;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: top;
}

.post .entry td code,
.post .entry th code {
    font-size: 0.95em;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

/* 4. Images fit article and viewport */
.post .entry img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 70vh !important;
    object-fit: contain;
    margin: 1em auto;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .post .entry {
        font-size: 14px;
    }

    .post .entry h2 {
        font-size: 20px;
    }

    .post .entry h3 {
        font-size: 17px;
    }

    .post .entry table {
        font-size: 11px;
    }

    .post .entry img {
        max-height: 65vh !important;
    }
}


/* GitHub Light syntax highlighting */

/* Code blocks and font sizes */
.post .entry pre,
.post .entry pre code,
.post .entry .highlight,
.post .entry .highlight pre,
.post .entry .highlight code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 1em !important;
    line-height: 1.5;
    color: #24292f;
    background-color: #f6f8fa !important;
}

.post .entry .highlight,
.post .entry pre {
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 12px 16px;
    overflow-x: auto;
}

/* Prevent duplicated padding in Rouge code blocks */
.post .entry .highlight pre {
    padding: 0;
    border: none;
    margin: 0;
}

/* Inline code */
.post .entry :not(pre) > code {
    font-size: 1em !important;
    color: #24292f !important;
    background-color: #eff1f3 !important;
    padding: 0.15em 0.3em;
    border-radius: 4px;
}

/* Rouge syntax tokens - GitHub Light palette */

/* Default text and punctuation */
.post .entry .highlight .n,
.post .entry .highlight .p,
.post .entry .highlight .o,
.post .entry .highlight .w {
    color: #24292f;
}

/* Keywords: if, for, return, const */
.post .entry .highlight .k,
.post .entry .highlight .kc,
.post .entry .highlight .kd,
.post .entry .highlight .kn,
.post .entry .highlight .kp,
.post .entry .highlight .kr,
.post .entry .highlight .ow {
    color: #cf222e;
}

/* Types and classes */
.post .entry .highlight .kt,
.post .entry .highlight .nc,
.post .entry .highlight .nn {
    color: #953800;
}

/* Functions */
.post .entry .highlight .nf,
.post .entry .highlight .fm {
    color: #8250df;
}

/* Strings */
.post .entry .highlight .s,
.post .entry .highlight .s1,
.post .entry .highlight .s2,
.post .entry .highlight .sb,
.post .entry .highlight .sc,
.post .entry .highlight .sd,
.post .entry .highlight .si,
.post .entry .highlight .sr,
.post .entry .highlight .ss {
    color: #0a3069;
}

/* Numbers and constants */
.post .entry .highlight .m,
.post .entry .highlight .mi,
.post .entry .highlight .mf,
.post .entry .highlight .mh,
.post .entry .highlight .mo,
.post .entry .highlight .il,
.post .entry .highlight .no {
    color: #0550ae;
}

/* Comments */
.post .entry .highlight .c,
.post .entry .highlight .c1,
.post .entry .highlight .cm,
.post .entry .highlight .cs {
    color: #6e7781;
    font-style: normal;
}

/* Preprocessor directives */
.post .entry .highlight .cp {
    color: #116329;
}

/* Variables and attributes */
.post .entry .highlight .nv,
.post .entry .highlight .na,
.post .entry .highlight .nb,
.post .entry .highlight .bp {
    color: #0550ae;
}

/* Other names */
.post .entry .highlight .nx,
.post .entry .highlight .py,
.post .entry .highlight .nt {
    color: #24292f;
}



/* BEGIN article code typography fixes */

/* Inline code: Obsidian light style */
.post .entry :not(pre) > code {
    color: #24292f !important;
    background: #f6f6f6 !important;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.95em !important;
    font-weight: 400 !important;
    padding: 0.12em 0.3em;
    border: none !important;
    border-radius: 4px;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Code blocks: same font size as article body */
.post .entry pre,
.post .entry pre code,
.post .entry .highlight,
.post .entry .highlight pre,
.post .entry .highlight code,
.post .entry .highlighter-rouge,
.post .entry .highlighter-rouge pre,
.post .entry .highlighter-rouge code {
    font-size: 15px !important;
    line-height: 1.6 !important;
}

/* Rouge syntax tokens inherit the code-block size */
.post .entry .highlight span {
    font-size: inherit !important;
}

/* Keep GitHub Light colors */
.post .entry pre,
.post .entry .highlight,
.post .entry .highlight pre,
.post .entry .highlight code {
    color: #24292f;
    background-color: #f6f8fa !important;
}

/* Allow paragraphs to wrap */
.post .entry p,
.post .entry li {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* END article code typography fixes */

/* Final code block typography */
.post .entry pre,
.post .entry pre code,
.post .entry .highlight,
.post .entry .highlight pre,
.post .entry .highlight code,
.post .entry .highlighter-rouge,
.post .entry .highlighter-rouge pre,
.post .entry .highlighter-rouge code {
    font-size: 13px !important;
    line-height: 1.5 !important;
}

/* Ensure Rouge syntax tokens use the same size */
.post .entry .highlight span,
.post .entry .highlight code span {
    font-size: 13px !important;
}


/* Compact research notes homepage */

.article-index {
    list-style: none !important;
    margin: 20px 0 !important;
    padding: 0 !important;
}

.article-index-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: center;
    column-gap: 24px;
    margin: 0 !important;
    padding: 14px 0 !important;
    border-bottom: 1px solid #eeeeee;
    list-style: none !important;
}

.article-index-date {
    color: #8b929b;
    font-size: 13px !important;
    font-weight: 400;
    white-space: nowrap;
}

.article-index-title {
    display: block;
    min-width: 0;
    color: #24292f !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-index-title:hover {
    color: #705dc7 !important;
    text-decoration: underline !important;
}

@media (max-width: 640px) {
    .article-index-row {
        grid-template-columns: 90px minmax(0, 1fr);
        column-gap: 12px;
    }

    .article-index-date {
        font-size: 12px !important;
    }

    .article-index-title {
        font-size: 14px !important;
    }
}



/* BEGIN compact site header */

.wrapper-masthead {
    margin-bottom: 20px;
}

.wrapper-masthead .container {
    max-width: 900px;
    box-sizing: border-box;
    padding: 0 18px;
}

.wrapper-masthead .masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.wrapper-masthead .site-info {
    float: none;
    min-width: 0;
}

.wrapper-masthead .site-name {
    margin: 0;
    font-size: 18px !important;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: left;
}

.wrapper-masthead .site-name a {
    color: #24292f;
    text-decoration: none;
}

.wrapper-masthead .site-description {
    margin: 3px 0 0;
    font-size: 12px !important;
    font-weight: 400;
    line-height: 1.5;
    color: #8b929b;
    letter-spacing: 0;
}

.wrapper-masthead nav {
    float: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    font-size: 13px !important;
}

.wrapper-masthead nav a {
    margin: 0 0 0 20px;
    font-size: 13px !important;
    font-weight: 500;
    letter-spacing: 0;
    color: #57606a;
    text-decoration: none;
}

.wrapper-masthead nav a:hover {
    color: #24292f;
}

@media (max-width: 640px) {
    .wrapper-masthead .masthead {
        gap: 12px;
        padding: 12px 0;
    }

    .wrapper-masthead .site-name {
        font-size: 16px !important;
    }

    .wrapper-masthead .site-description {
        font-size: 11px !important;
    }

    .wrapper-masthead nav a {
        font-size: 12px !important;
        margin-left: 8px;
    }
}

/* END compact site header */

/* Italic site title */
.wrapper-masthead .site-name {
    font-style: italic !important;
}
