/* For smaller, one-off styling needs that don't fit elsewhere */

.overflow-hidden {
    overflow: hidden;
}

.aspect-ratio-2-1p25 {
    aspect-ratio: 2/1.25;
    object-fit: cover;
}

.aspect-ratio-3-4 {
    aspect-ratio: 3/4;
    object-fit: cover;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4/3;
    object-fit: cover;
}

.aspect-ratio-5-3 {
    aspect-ratio: 5/3;
    object-fit: cover;
}

hr {
    border: none;
}

/* Styling page number display for pagination */
.pagination {
    font-family: 'Founders Grotesk', sans-serif;
    font-size: 1.875rem;
}
.pagination .page-numbers:not(.current) {
    opacity: 0.5;
}

/* Above-fold for single posts */
.single header #author {
    font-family: 'Founders Grotesk', sans-serif;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
    font-size: 2.5rem;
}

/* Mailchimp Styling */
/* --> Specific styling for 'Subscribe' button in footer */
footer {
    #mc_embed_signup_scroll {
        #mc-embedded-subscribe {
            font-size: inherit;
            text-underline-offset: 3px;
            /* Show underline; gets cut off w/o padding */
            padding-bottom: 1px;
        }
    }
}
#mc_embed_signup_scroll {
    display: flex;
    flex-direction: column;
    gap: var(--two-spacer);
    position: relative;
    #mc-embedded-subscribe {
        color: var(--wp--preset--color--red);
        text-decoration: underline;
        text-decoration-thickness: 0.5px;
        text-underline-offset: 5px;
        text-decoration-color: var(--wp--preset--color--red);
        line-height: 1;
        border: none;
        border-radius: 0;
        background: none;
        padding: 0;
        appearance: none;
        -webkit-appearance: none;
        font-size: 1.5rem;
        height: 100%;
    }
    .clear:has(#mc-embedded-subscribe) {
        text-align: right;
    }
    .indicates-required {
        border: 0;
        clip-path: inset(50%);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
        word-wrap: normal !important;
    }
    input[type="text"],
    input[type="email"] {
        width: 100%;
        border-width: 0 0 0.5px 0;
        border-color: var(--wp--preset--color--blue);
        border-radius: none;
        background: none;
        padding: 0;
        appearance: none;
        -webkit-appearance: none;
        font-family: 'Heldane Text', serif;
        font-size: 0.875rem;
        color: var(--wp--preset--color--blue);
        &&::placeholder {
            color: var(--wp--preset--color--blue);
        }
    }
    #mce-responses:has(#mce-error-response:empty):has(#mce-success-response:empty) {
        display: none;
    }
}

/* Horizontal scroll for 'All Articles' and 'Author' archive indexical view */
@media screen and (max-width: 1079px) {
    .horizontal-scroll-wrapper {
        overflow-x: scroll;
        overflow-y: hidden;
        padding-bottom: var(--one-spacer);
        /* Necessary to have scrollbar appear at *top* of div */
        transform: rotate(180deg) scaleX(-1);
    }
    .horizontal-scroll-wrapper::-webkit-scrollbar {
        height: 1px;
    }
    .horizontal-scroll-wrapper::-webkit-scrollbar-thumb {
        background-color: var(--wp--preset--color--blue);
    }
    .horizontal-scroll-wrapper::-webkit-scrollbar-track {
        background-color: var(--wp--preset--color--light-blue);
        opacity: 0.5;
    }
    .horizontal-scroll {
        /* Min-width matches -md- breakpoint (1080px) while accounting for 20px margin on L/R side */
        min-width: 1040px;
        /* Necessary to have scrollbar appear at *top* of div */
        transform: rotate(180deg) scaleX(-1);
    }
}

/* Sticky positioning for 'Further Reading' div */
#further-reading {
    position: sticky;
    top: var(--three-spacer);
    height: fit-content;
}

/* Footnote styling */
a.footnote {
    font-family: 'Founders Grotesk', sans-serif;
    position: relative;
    display: inline;
    padding-right: 5px;
    font-size: 0.75rem;
    top: -6px;
    scroll-margin-top: 6rem;
    border-bottom: none !important;
    color: var(--jfi-red) !important;
    margin-bottom: 0 !important;
    text-decoration: none;
}
a.footnote::before {
    content: '';
    position: absolute;
    top: 6px;
    left: -3px;
    right: 1px;
    bottom: 7px;
    border-radius: 4px;
    background-color: var(--light-red) !important;
}
div#footnotes-wrapper div, div#footnotes-wrapper div a, div#footnotes-wrapper div em {
    font-size: 0.875rem !important;
    line-height: 1.4rem;
}
[id^='footnote-list-'] {
    scroll-margin-top: 5rem;
}
#footnote-popup {
    position: relative;
    opacity: 0;
    pointer-events: none;
    position: sticky;
    padding-top: 0.5rem;
}
#footnote-popup a {
    word-break: break-all;
}
div#footnotes-wrapper div {
    margin-bottom: var(--two-spacer);
}

.object-fit-cover {
    object-fit: cover;
}

.sort-arrow svg {
    padding: 3px;
    border: 1px solid var(--wp--preset--color--blue);
}

/* Prevent all SVGs from shrinking */
svg {
    flex-shrink: 0;
}

/* Make all 'Further Reading' etc. text black for posts that are in a series */
main.in-series {
    .further-reading-col,
    #further-reading-bottom {
        .has-red-color,
        .has-blue-color {
            color: var(--wp--preset--color--black) !important;
        }
        svg {
            path {
                fill: var(--wp--preset--color--black) !important;
            }
        }
    }
    #filed-under {
        color: var(--wp--preset--color--black) !important;
        * {
            color: var(--wp--preset--color--black) !important;
        }
    }
}

/* Issue card hover styles */
.issue-card-minimal {
    &&:hover {
        color: var(--wp--preset--color--white) !important;
        background-color: var(--wp--preset--color--black) !important;
        border-color: var(--wp--preset--color--black) !important;
    }
}

/* All SVGs in 'has-black-color' match text */
.has-black-color {
    svg {
        path {
            fill: var(--wp--preset--color--black);
        }
    }
}