/* Endnote toggle and endnote list */

/* Toggle button in article header */
.endnote-toggle {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    color: var(--color-text-light);
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    padding: 0.2em 0.6em;
    cursor: pointer;
    margin-left: 1em;
    vertical-align: middle;
    transition: border-color 0.15s;
}

.endnote-toggle:hover {
    border-color: var(--color-text-muted);
}

.endnote-toggle__active {
    font-weight: 700;
    color: var(--color-text);
}

/* Endnote list — hidden by default, shown in endnotes-mode */
.endnote-list {
    display: none;
    grid-column: 1 / -1;
    max-width: var(--content-max);
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.endnote-list__heading {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light);
    margin: 0 0 1em;
}

.endnote-list__ol {
    padding-left: 1.5em;
    margin: 0;
}

.endnote-list__item {
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--color-text-muted);
    margin-bottom: 0.5em;
}

/* Endnotes mode — hide margin sidenotes, show endnote list */
body.endnotes-mode .sidenote {
    display: none !important;
}

body.endnotes-mode .endnote-list {
    display: block;
}

/* On mobile, endnotes mode is the natural fallback anyway */
@media (max-width: 768px) {
    .endnote-toggle {
        display: none;
    }
}
