/*******************************************************************************
CUSTOM STYLES

Add your custom CSS styles here to override or extend the default styles.
*******************************************************************************/

@font-face {
	font-family: "Latin Modern Math";
	src: url("/assets/fonts/latinmodern-math.otf") format("opentype");
	font-display: swap;
}

.math-inline math,
.math-block math,
.math-inline math *,
.math-block math * {
	font-family: "Latin Modern Math", serif;
}

p:has(> .sidenote-caption) {
	display: none !important;
}

.page-title {
	text-align: center;
}

li:has(> ul, > ol) > p:has(+ ul, + ol) {
	margin-bottom: 0;
}

li:has(> ul, > ol) > p + ul,
li:has(> ul, > ol) > p + ol,
li:has(> ul, > ol) > ul + p,
li:has(> ul, > ol) > ol + p {
	margin-top: 0;
}

li:has(> ul, > ol) > ul,
li:has(> ul, > ol) > ol {
	margin-bottom: 0;
}

li:has(> ul, > ol) > p:last-child {
	margin-bottom: 0;
}

li:has(+ li > ul, + li > ol) > p:last-child {
	margin-bottom: 0;
}

li:has(+ li > ul, + li > ol) + li > p:first-child {
	margin-top: 0;
}

@media (min-width: 761px) {

    /* Widen the main column while keeping the notes in a narrower side column. */
    article>section {
        --sidenote-content-width: 0.65;
        --sidenote-column-start: 0.705;
        --sidenote-column-width: 0.175;
    }

    article>section>p,
    article>section>ul,
    article>section>ol,
    article>section>dl,
    article>section>h1,
    article>section>h2,
    article>section>h3,
    article>section>h4,
    article>section>h5 {
        width: 65%;
    }

    article>section .marginnote {
        inline-size: calc(100cqi * var(--sidenote-column-width));
    }

    section>img,
    section>svg,
    .math-block,
    .article-byline,
    pre,
    .blog-entry {
        width: 65%;
    }

    section>img,
    section>svg {
        max-width: 65%;
        left: 32.5%;
    }

    div[style*="border-inline-start"] {
        width: 65% !important;
    }

    article>section figure:has(.sidenote-caption) {
        display: block !important;
        float: none !important;
        width: 65cqi !important;
        inline-size: 65cqi !important;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    article>section>figure:not(.math-block):has(> div) {
        display: block !important;
        float: none !important;
        width: 65cqi !important;
        inline-size: 65cqi !important;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    article>section figure:has(.sidenote-caption)>div {
        display: block !important;
        width: 100% !important;
        max-width: none;
    }

    article>section>figure:not(.math-block):has(> div)>div {
        display: block !important;
        width: 100% !important;
        max-width: none;
    }

    article>section figure:has(.sidenote-caption) .math-block,
    article>section>figure:not(.math-block):has(> div) .math-block {
        width: 100%;
        max-width: 100%;
    }

    article>section figure:has(.sidenote-caption) p,
    article>section figure:has(.sidenote-caption) ul,
    article>section figure:has(.sidenote-caption) ol,
    article>section figure:has(.sidenote-caption) dl,
    article>section>figure:not(.math-block):has(> div) p,
    article>section>figure:not(.math-block):has(> div) ul,
    article>section>figure:not(.math-block):has(> div) ol,
    article>section>figure:not(.math-block):has(> div) dl {
        width: 100%;
    }

    section>table {
        left: 32.5%;
    }
}