/* Keep the native end list visible, including after Littlefoot enhancement. */
.wp-block-post-content > ol.wp-block-footnotes {
    border-block-start: 1px solid var(--overthink-border);
    padding-block-start: 1.5rem;
    margin-block-start: 3rem;
    text-align: start;
    overflow-wrap: anywhere;
}
.wp-block-post-content > .overthink-footnotes-list {
    border-block-start: 1px solid var(--overthink-border);
    padding-block-start: 1rem;
    margin-block-start: 2.5rem;
}
.overthink-footnotes-list > summary {
    cursor: pointer;
    color: var(--overthink-muted);
    font: inherit;
    font-weight: 500;
    padding-block: .5rem;
}
.overthink-footnotes-list > summary:focus-visible {
    outline: 2px solid var(--overthink-accent);
    outline-offset: 3px;
}
.overthink-footnotes-list > ol.wp-block-footnotes {
    text-align: start;
    overflow-wrap: anywhere;
    padding-inline-start: 1.7em;
    margin-block: 1rem 0;
}
html[lang^="fa"] ol.wp-block-footnotes { list-style-type: persian; }
@media screen {
    ol.wp-block-footnotes.littlefoot--print { display: block; }
    ol.wp-block-footnotes > li.littlefoot--print { display: list-item; }
}
.wp-block-post-content .littlefoot {
    direction: ltr;
    display: inline;
    --button-background-color: transparent;
    --button-active-background-color: transparent;
    --button-text-color: color-mix(in srgb, var(--overthink-accent) 35%, var(--overthink-text));
    --button-active-text-color: var(--overthink-accent);
    --button-height: 1rem;
    --button-margin: 0;
    --button-padding: 0 .15em;
    --button-font-size: .75em;
    --popover-background-color: var(--overthink-surface-raised);
    --popover-text-color: var(--overthink-text);
    --popover-border: 1px solid var(--overthink-border);
    --popover-font-family: inherit;
    --popover-font-size: 1rem;
    --popover-line-height: 1.8;
    --popover-max-height: min(18rem, 55vh);
    --popover-width: min(22rem, calc(100vw - 24px));
    --popover-z-index: 30;
    --popover-transition: none;
    --popover-horizontal-padding: 1rem;
    --popover-vertical-padding: .8rem;
}
.wp-block-post-content .littlefoot__button {
    font: inherit;
    position: relative;
    font-size: .72em;
    font-weight: 400;
    line-height: 1;
    vertical-align: super;
    height: auto;
    min-width: 1em;
    border-radius: .1em;
    text-decoration: none;
    box-shadow: none;
}
.wp-block-post-content .littlefoot__button:focus:not(:focus-visible) { outline: none; }
.wp-block-post-content .littlefoot__button::after {
    content: "";
    position: absolute;
    width: max(100%, 28px);
    height: 28px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.littlefoot__button:focus-visible, .overthink-footnote-close:focus-visible,
.littlefoot__content a:focus-visible {
    outline: 2px solid var(--overthink-accent);
    outline-offset: 3px;
}
.wp-block-post-content .littlefoot__popover {
    text-align: start;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    white-space: normal;
}
.wp-block-post-content .littlefoot__content { font-family: "Vazirmatn", Tahoma, sans-serif; overflow-wrap: anywhere; }
.wp-block-post-content .littlefoot__wrapper { background: var(--popover-background-color); }
.littlefoot__content p { margin: 0 0 .65em; }
.littlefoot__content p:last-child { margin-block-end: 0; }
.littlefoot__content a { color: var(--overthink-accent); }
.overthink-footnote-close {
    position: absolute;
    inset-block-start: .15rem;
    inset-inline-end: .15rem;
    z-index: 2;
    border: 0;
    color: var(--overthink-muted);
    background: transparent;
    cursor: pointer;
    padding: .3rem .6rem;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
}
.wp-block-post-content .littlefoot__content { padding-inline-end: 2.4rem; }
/* Deliberately retain anchored bubbles on mobile, not upstream's bottom sheet. */
@media (max-width: 767px) {
    .wp-block-post-content .littlefoot__popover {
        position: absolute;
        top: 0 !important;
        margin: calc(var(--popover-tooltip-size) + var(--button-height)) 0;
        border: var(--popover-border);
        border-radius: var(--popover-border-radius);
        max-width: calc(100vw - 24px) !important;
        width: var(--popover-width);
        transform: var(--popover-transform);
    }
    .wp-block-post-content .littlefoot__popover.is-above { top: auto !important; bottom: 0 !important; }
    .wp-block-post-content .littlefoot__popover.is-active { transform: var(--popover-active-transform); }
    .wp-block-post-content .littlefoot__wrapper { border-radius: var(--popover-border-radius); }
    .wp-block-post-content .littlefoot__tooltip { display: block; }
}
@media print {
    .littlefoot, .overthink-footnote-close { display: none !important; }
    ol.wp-block-footnotes { max-height: none; overflow: visible; }
    .overthink-footnotes-list > summary { color: inherit; }
}
