body {
    counter-reset: sidenote-counter;
}

footer {
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

article {
    padding: 5rem 0rem;
}
section {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
p,
dl,
ol,
ul,
.math-result {
    font-size: 1.15rem;
    line-height: 1.8rem;
}

math {
    font-size: 1.15rem;
}

p {
    margin-top: 1.4rem;
    margin-bottom: 1.4rem;
    padding-right: 0;
    vertical-align: baseline;
}
sup {
    line-height: 0;
}

section > p,
section > footer,
section > table,
section > math,
section > .math-result {
    width: var(--main-content-width);
}

section > dl,
section > ol,
section > ul {
    width: 50%;
    -webkit-padding-start: 5%;
}

header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: var(--main-content-width);
    border-bottom: 2px solid var(--foreground-color);
    padding-bottom: 1rem;
    gap: 1em;
}

header > nav {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 1em;
}

.sidenote {
    float: right;
    clear: right;
    margin-right: -60%;
    width: 50%;
    margin-top: 0.3rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.3;
    vertical-align: baseline;
    position: relative;
}
.sidenote-number {
    counter-increment: sidenote-counter;
}
.sidenote-number:after,
.sidenote:before {
    font-family: et-book-roman-old-style;
    position: relative;
    vertical-align: baseline;
}

.sidenote-number:after {
    content: counter(sidenote-counter);
    font-size: 0.7rem;
    top: -0.5rem;
    left: 0.1rem;
}

.sidenote:before {
    content: counter(sidenote-counter) " ";
    font-size: 0.7rem;
    top: -0.5rem;
}
input.margin-toggle {
    display: none;
}

label.sidenote-number {
    display: inline-block;
    max-height: 2rem; /* should be less than or equal to paragraph line-height */
}

label.margin-toggle:not(.sidenote-number) {
    display: none;
}
div.email > span:nth-child(2) {
    display: none;
}
.math-result {
    box-sizing: border-box;
    border: 2px solid var(--foreground-color);
    padding-inline: 16px;
    padding-block: 8px;
    margin-bottom: 1rem;
}
.math-result p:first-child {
  margin-top: 0;
}
.math-result p:last-child {
  margin-bottom: 0;
}

@media(max-width: 48rem) {
    header {
        width: 100%;
    }
    hr,
    section > p,
    section > footer,
    section > table,
    section > math,
    section > .math-result {
        width: 100%;
    }

    section > dl,
    section > ol,
    section > ul {
        width: 90%;
    }
    label.margin-toggle:not(.sidenote-number) {
        display: inline;
    }

    .sidenote {
        display: none;
    }

    .margin-toggle:checked + .sidenote {
        display: block;
        float: left;
        left: 1rem;
        clear: both;
        width: 95%;
        margin: 1rem 2.5%;
        vertical-align: baseline;
        position: relative;
    }

    label {
        cursor: pointer;
    }
}

