/* Footnote Links Styling */

.note {
    font-family: var(--font-sans);
    font-style: italic;
    font-size: var(--step--1);

    @media (width >= 1400px) {
        float: right;
        clear: right;
        /* margin-right: -24.5rem; */
        margin-right: calc(var(--measure) - 100cqi - var(--space-l));
        width: 300px;

        line-height: 150%;
        vertical-align: baseline;
        margin-bottom: 3rem;

        a {
            text-decoration-thickness: 1px;
            text-underline-offset: 1.5px;

            &:hover {
                color: #96000c;
                text-decoration-color: currentcolor;
                text-decoration-thickness: 1px;
            }
        }
    }

    .mantra {
        text-transform: uppercase;
        font-size: inherit;
        font-weight: 600;
    }
}

.context .note {
    @media (width >= 1400px) {
        float: right;
        clear: right;
        margin-right: -593px;
        margin-right: calc(
            (var(--measure) - (var(--space-l) * 5)) * -1
        );
        width: 300px;

        line-height: 150%;
        vertical-align: baseline;
        margin-bottom: 3rem;

        a {
            text-decoration-thickness: 1px;
            text-underline-offset: 1.5px;

            &:hover {
                color: #96000c;
                text-decoration-color: currentcolor;
                text-decoration-thickness: 1px;
            }
        }
    }
}

blockquote .note {
    font-weight: 400;
}

h2 .note,
h3 .note,
h4 .note {
    margin-right: calc(var(--measure) - 100cqi - var(--space-l));
    /* font-size: var(--step--1); */
    font-family: var(--font-sans);
    font-variant: normal;
    font-weight: 300;
    line-height: 150%;
    vertical-align: baseline;
    margin-bottom: 3rem;
}

/* Footnote reference links in text */
sup a[href^='#note'] {
    text-decoration: none;
    color: inherit;
    border-bottom: 1px dotted currentColor;
    transition: border-color 0.2s;
}

sup a[href^='#note']:hover {
    border-bottom-color: #c65d3b;
}

/* Return links in footnotes */

.note {
    sup {
        font-size: var(--step--2);
    }
    sup a[href^='#ref'] {
        text-decoration: none;
        color: inherit;
        font-weight: 600;
    }
    sup a[href^='#ref']:hover {
        color: #c65d3b;
    }
}

.footnote-return {
    text-decoration: none;
    margin-left: 0.25em;
    font-size: 0.9em;
    color: rgba(0, 0, 0, 0.5);
    transition: color 0.2s;
    @media (width >= 1225px) {
        visibility: hidden;
    }
}

.footnote-return:hover {
    color: #c65d3b;
}

/* Mobile Footnotes Section */
@media (width < 1400px) {
    .footnotes-section {
        margin-top: 3rem;
        padding-top: 2rem;
        scroll-margin-top: 2rem;
    }

    .footnotes-section h3 {
        font-family: var(--font-sans);
        font-size: 1.5em;
        margin-bottom: 1.5rem;
    }

    .footnotes-section .note {
        display: block !important;
        margin: 1rem 0;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        float: none !important;
        width: 100% !important;
        margin-right: 0 !important;
    }

    .footnotes-section .note sup a[href^='#ref'] {
        cursor: pointer;
    }
}
