/* Footnote reference link (inline in text) */
.footnote-ref {
    text-decoration: none;
    margin-left: 0.125em;
    margin-right: 0.125em;
}

/* Circular badge for the footnote number */
.footnote-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25em;
    height: 1.25em;
    padding: 0 0.25em;
    background-color: #444;
    color: white;
    border-radius: 50%;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    vertical-align: baseline;
    transition: background-color 0.2s ease;
}

.footnote-ref:hover .footnote-marker {
    background-color: #357abd;
}

.footnote-ref:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
    border-radius: 0.25em;
}

/* Footnote section at bottom of document */
.footnotes-sep {
    margin-top: 3em;
    margin-bottom: 1em;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.footnotes {
    font-size: 0.875em;
    color: #666;
}

.footnotes-list {
    padding-left: 1.5em;

    li {
        line-height: 1.1em;
    }
}

.footnote-item {
    margin-bottom: 0.5em;
}

.footnote-backref {
    text-decoration: none;
    margin-left: 0.25em;
    padding: 0.125em 0.25em;
    border-radius: 0.25em;
    transition: background-color 0.2s ease;
}

.footnote-backref:hover {
    background-color: #f0f0f0;
}

.footnote-backref:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .footnote-marker {
        background-color: #eee;
        color: #333;
    }

    .footnote-ref:hover .footnote-marker {
        background-color: #6ba8f5;
    }

    .footnotes-sep {
        border-top-color: #444;
    }

    .footnotes {
        color: #aaa;
    }

    .footnote-backref:hover {
        background-color: #333;
    }
}

/* Alternative: Square/rounded rectangle badges */
.footnote-marker.square {
    border-radius: 0.25em;
    min-width: 1.5em;
    padding: 0.125em 0.375em;
}

/* Alternative: Superscript-style (traditional look with custom colors) */
.footnote-ref.superscript {
    vertical-align: super;
    font-size: 0.75em;
}

.footnote-ref.superscript .footnote-marker {
    background: transparent;
    color: #4a90e2;
    font-weight: 700;
}

.footnote-ref.superscript:hover .footnote-marker {
    color: #357abd;
    text-decoration: underline;
}
