/* 
 ---------------------------------
 |   LAST UPDATED: 2026-04-13    |
 ---------------------------------
 */

/* VIEWPORT HEADNOTE: Standard boundaries 1024, 768–1023, ≤767. */

/* OWNER: footnote indicators, popup, container, backrefs — all viewports.
   Loaded by post.hbs after post.css. Selectors scoped to .post-content
   so they apply only on post pages with footnotes. */

/* ========================================================================
   VIEWPORT-AGNOSTIC (base styles)
   ======================================================================== */

/* Placeholder until Ghost footnote HTML is moved in by footnotes.hbs */
.post-footnotes:empty {
    display: none;
}

.post-content .footnote-indicator:hover,
.post-content a.footnote-indicator:hover {
    text-decoration: underline !important;
    text-decoration-thickness: 3px !important;
    text-decoration-color: #DECE7D !important;
}

/* Footnote popup (rendered by footnotes.hbs JS) */
.footnote-popup {
    position: fixed;
    z-index: 10000;
    background-color: var(--background-color);
    border: 2px solid var(--port);
    padding: calc(1vw * var(--scale)) calc(1.5vw * var(--scale));
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: var(--font3);
    font-size: 13px;
    line-height: 1.4;
    color: var(--revolver);
    display: none;
    pointer-events: auto;
}

.footnote-popup.visible {
    display: block !important;
}

.footnote-popup p {
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--font3) !important;
    font-size: 14px !important;
    color: var(--revolver) !important;
    line-height: 1.4 !important;
}

.footnote-popup em {
    font-family: var(--font3) !important;
    font-style: italic !important;
}

.footnotes-list,
.footnote-item {
    line-height: 125%;
}

/* Container: section.footnotes (Ghost native) or .footnotes-container (fallback) */
.post-content section.footnotes,
.post-content .footnotes-container {
    display: block;
    width: 100%;
    margin-top: calc(2vw * var(--scale));
    font-family: var(--font3);
    font-size: 13px;
    color: var(--revolver);
    line-height: 1.4;
}

.post-content section.footnotes .footnotes-list,
.post-content .footnotes-container .footnotes-list {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.post-content section.footnotes .footnote-item,
.post-content section.footnotes .footnote,
.post-content .footnotes-container .footnote-item,
.post-content .footnotes-container .footnote {
    font-family: var(--font3);
    font-size: 13px;
    color: var(--revolver);
    position: static;
    width: auto;
    top: auto;
    left: auto;
    margin: 0 0 1.5em;
}

.post-content section.footnotes .footnote-item.indent,
.post-content section.footnotes .footnote.indent,
.post-content .footnotes-container .footnote-item.indent,
.post-content .footnotes-container .footnote.indent {
    margin-left: 0.5em;
}

.post-content section.footnotes .footnote-number,
.post-content .footnotes-container .footnote-number {
    display: inline !important;
    font-weight: 600;
    margin-right: 0.35em;
    color: var(--revolver);
    text-decoration: none;
    white-space: nowrap;
}

.post-content section.footnotes .footnote-item > p:first-of-type,
.post-content .footnotes-container .footnote-item > p:first-of-type {
    display: inline;
}

.post-content section.footnotes .footnote-number:hover,
.post-content .footnotes-container .footnote-number:hover {
    text-decoration: underline;
}

.post-content section.footnotes .footnote-backref,
.post-content .footnotes-container .footnote-backref,
.post-content .footnote-backref {
    font-family: var(--font3);
    font-weight: 650;
    color: var(--port);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: #DECE7D;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.post-content section.footnotes .footnote-backref:hover,
.post-content .footnotes-container .footnote-backref:hover,
.post-content .footnote-backref:hover {
    text-decoration: underline;
    text-decoration-thickness: 4px;
    text-decoration-color: #DECE7D;
}

.post-content section.footnotes .footnote-item ul,
.post-content section.footnotes .footnote-item ol,
.post-content .footnotes-container .footnote-item ul,
.post-content .footnotes-container .footnote-item ol {
    font-size: 13px !important;
}

.post-content section.footnotes .footnote-item em,
.post-content section.footnotes .footnote em,
.post-content section.footnotes em,
.post-content .footnotes-container .footnote-item em,
.post-content .footnotes-container .footnote em,
.post-content .footnotes-container em {
    font-family: var(--font3) !important;
    font-style: italic !important;
}

.post-content section.footnotes .footnote-item p,
.post-content section.footnotes .footnote p,
.post-content .footnotes-container .footnote-item p,
.post-content .footnotes-container .footnote p {
    font-family: var(--font3) !important;
    font-size: 13px !important;
    color: var(--revolver) !important;
    line-height: 125% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.post-content section.footnotes .footnote-item ul,
.post-content section.footnotes .footnote-item ol,
.post-content section.footnotes .footnote-item ul li,
.post-content section.footnotes .footnote-item ol li,
.post-content .footnotes-container .footnote-item ul,
.post-content .footnotes-container .footnote-item ol,
.post-content .footnotes-container .footnote-item ul li,
.post-content .footnotes-container .footnote-item ol li {
    list-style-position: outside;
    margin-left: 0.5em;
    margin-top: 0.35em;
    margin-bottom: 0;
    padding-left: 1.25em !important;
    font-family: var(--font3) !important;
    font-size: inherit;
    line-height: 125%;
    color: var(--revolver);
}

.post-content section.footnotes .footnote-item ul > li::marker,
.post-content section.footnotes .footnote-item ul ul > li::marker,
.post-content section.footnotes .footnote-item ul ul ul > li::marker,
.post-content .footnotes-container .footnote-item ul > li::marker,
.post-content .footnotes-container .footnote-item ul ul > li::marker,
.post-content .footnotes-container .footnote-item ul ul ul > li::marker {
    content: '\2022\00a0' !important;
    font-family: var(--font3) !important;
    font-weight: 400 !important;
    font-size: inherit !important;
}

.post-content section.footnotes .footnote-item ol > li::marker,
.post-content .footnotes-container .footnote-item ol > li::marker {
    font-family: var(--font3) !important;
    font-weight: 600 !important;
    font-size: inherit !important;
    font-variant-numeric: lining-nums;
}

/* Lists inside footnote copy (e.g. under <p>): one marker per li, prose ETB rules do not apply */
.post-content section.footnotes .footnote-item li ul > li::marker,
.post-content .footnotes-container .footnote-item li ul > li::marker {
    content: '\2022\00a0' !important;
    font-family: var(--font3) !important;
    font-weight: 400 !important;
    font-size: inherit !important;
}

.post-content section.footnotes .footnote-item li ol > li::marker,
.post-content .footnotes-container .footnote-item li ol > li::marker {
    font-family: var(--font3) !important;
    font-weight: 600 !important;
    font-size: inherit !important;
    font-variant-numeric: lining-nums;
}

li.footnote-item blockquote {
    margin-top: calc(1vw * var(--scale));
    margin-left: calc(2.2vw * var(--scale));
    padding-left: calc(1vw * var(--scale));
    font-size: 0.9em;
    border-left: 2px solid var(--swiss-coffee);
    font-family: var(--font3);
}


/* ========================================================================
   1. DESKTOP (1024px+)
   ======================================================================== */
@media (min-width: 1024px) {
    .post-content .footnote-indicator,
    .post-content a.footnote-indicator,
    .post-content sup.footnote-ref a {
        font-family: 'CommitMono', 'Fira Code', monospace !important;
        font-size: 14px !important;
        font-weight: 625 !important;
        color: var(--port) !important;
        letter-spacing: -0.8px !important;
        font-kerning: normal;
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-decoration-color: #DECE7D;
        vertical-align: super !important;
        line-height: 0 !important;
        display: inline !important;
        margin: 0 .25rem 0 0 !important;
        padding: 0 0 0 0.5px !important;
    }

    .post-content .footnote-indicator:hover,
    .post-content a.footnote-indicator:hover,
    .post-content sup.footnote-ref a:hover {
        text-decoration: underline !important;
        text-decoration-thickness: 2px !important;
        text-decoration-color: #DECE7D !important;
    }
}


/* ========================================================================
   2. TABLET + MOBILE (≤1023px)
   ======================================================================== */
@media (max-width: 1023px) {
    .post-content .footnotes-container,
    .post-content section.footnotes {
        width: 100%;
    }

    .post-content section.footnotes,
    .post-content .footnotes-container {
        position: static;
        width: 100%;
        z-index: auto;
        font-family: var(--font3);
        font-size: 14px;
        color: var(--revolver);
        line-height: 1.4;
    }

    .post-content section.footnotes .footnotes-list,
    .post-content .footnotes-container .footnotes-list {
        padding-left: 0;
        list-style: none;
    }

    .post-content section.footnotes .footnote-item,
    .post-content section.footnotes .footnote,
    .post-content .footnotes-container .footnote-item,
    .post-content .footnotes-container .footnote {
        margin-bottom: 2.5em;
        font-family: var(--font3);
        font-size: 12px;
        color: var(--revolver);
    }

    .post-content section.footnotes .footnote-item em,
    .post-content section.footnotes .footnote em,
    .post-content section.footnotes em,
    .post-content .footnotes-container .footnote-item em,
    .post-content .footnotes-container .footnote em,
    .post-content .footnotes-container em {
        font-family: var(--font3) !important;
        font-style: italic !important;
    }

    .post-content section.footnotes .footnote-item p,
    .post-content section.footnotes .footnote p,
    .post-content .footnotes-container .footnote-item p,
    .post-content .footnotes-container .footnote p {
        font-family: var(--font3) !important;
        font-size: 12px !important;
        color: var(--revolver) !important;
        line-height: 125% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .post-content section.footnotes .footnote-item.indent,
    .post-content section.footnotes .footnote.indent,
    .post-content .footnotes-container .footnote-item.indent,
    .post-content .footnotes-container .footnote.indent {
        margin-left: 0.5em;
    }

    .post-content section.footnotes .footnote-number,
    .post-content .footnotes-container .footnote-number {
        display: inline !important;
        font-weight: 600;
        margin-right: 0.35em;
        color: var(--revolver);
        text-decoration: none;
        white-space: nowrap;
    }

    .post-content section.footnotes .footnote-item > p:first-of-type,
    .post-content .footnotes-container .footnote-item > p:first-of-type {
        display: inline;
    }

    .post-content section.footnotes .footnote-number:hover,
    .post-content .footnotes-container .footnote-number:hover {
        text-decoration: underline;
    }

    .post-content .footnote-backref:hover {
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-decoration-color: #DECE7D;
    }

    .post-content .footnote-indicator,
    .post-content a.footnote-indicator,
    .post-content sup.footnote-ref a {
        font-family: 'CommitMono', 'Fira Code', monospace !important;
        font-size: 11px !important;
        font-weight: 625 !important;
        color: var(--port) !important;
        letter-spacing: -0.32px !important;
        font-kerning: normal;
        text-decoration: underline !important;
        text-decoration-thickness: 2px !important;
        text-decoration-color: #DECE7D !important;
        vertical-align: super !important;
        line-height: 0 !important;
        display: inline !important;
        margin: 0 0.12rem 0 0 !important;
        padding: 0 !important;
    }

    .post-content .footnote-indicator:hover,
    .post-content a.footnote-indicator:hover,
    .post-content sup.footnote-ref a:hover {
        text-decoration: underline !important;
        text-decoration-thickness: 3px !important;
        text-decoration-color: #DECE7D !important;
    }
}
