#site-header {
    z-index: 999;
}

#site-header .logo {
    margin-top: -4px;
}
#site-header .logo svg {
    width: auto;
    height: 93px;
}
#site-header .logo svg path {
    transition: all 0.2s ease;
}
#site-header .logo svg:hover path:not(.invert-toggle) {
    fill: transparent;
    stroke-width: 2px;
    stroke: var(--wp--preset--color--off-black);
}
@media screen and (max-width: 1079px) {
    #site-header .logo {
        margin-top: -2px;
    }
    #site-header .logo svg {
        width: auto;
        height: 49px;
    }
}
@media screen and (max-width: 599px) {
    #site-header .logo {
        margin-top: -3.5px;
    }
    #site-header .logo svg {
        width: 35vw;
        height: auto;
    }
}

#site-header svg#square-filled,
#site-header svg#gear-filled,
#site-header svg#steps-filled {
    width: 85px;
    min-width: 85px;
    height: 85px;
    min-height: 85px;
}
#site-header svg#flag-filled {
    width: 113px;
    min-width: 113px;
    height: 85px;
    min-height: 85px;
}
@media screen and (max-width: 1199px) {
    #site-header svg#square-filled,
    #site-header svg#gear-filled,
    #site-header svg#steps-filled {
        width: 45px;
        min-width: 45px;
        height: 45px;
        min-height: 45px;
    }
    #site-header svg#flag-filled {
        width: 60px;
        min-width: 60px;
        height: 45px;
        min-height: 45px;
    }
}
@media screen and (max-width: 1079px) {
    #site-header svg#flag-filled {
        width: 60px;
        min-width: 60px;
        height: 45px;
        min-height: 45px;
    }
}
@media screen and (max-width: 599px) {
    #site-header svg#square-filled,
    #site-header svg#gear-filled,
    #site-header svg#steps-filled {
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }
    #site-header svg#flag-filled {
        width: 45px;
        min-width: 45px;
        height: 30px;
        min-height: 30px;
    }
}

#member-toggle {
    height: 85px;
}
@media screen and (max-width: 1079px) {
    #member-toggle {
        height: 45px;
    }
}
@media screen and (max-width: 599px) {
    #member-toggle {
        height: 30px;
    }
    #member-toggle a,
    #member-toggle p {
        font-size: 10px !important;
        line-height: 0.8 !important;
        padding: 2px !important;
    }
}
#member-toggle p,
#member-toggle span {
    transition: all 0.2s ease;
}

/* If on the back-end (as indicated by the 'inverted-default' class, show the toggle as pushed 'down' */
body.inverted-default #member-toggle p,
body.inverted-default #member-toggle a {
    margin-top: auto;
}

/* Header 'Member Modal' interaction */
#site-header.modal-active #member-modal {
    order: 1;
    pointer-events: none;
}
#site-header.modal-active #member-modal a {
    pointer-events: all !important;
}
#dividing-line {
    height: 350px;
    min-width: 1px;
    transform: rotate(15deg);
}
@media screen and (max-width: 959px) {
    #site-header.modal-active #member-modal #log-in {
        margin-bottom: -120px;
    }
    #site-header.modal-active #member-modal #sign-up {
        margin-top: -120px;
    }
    #dividing-line {
        transform: rotate(75deg) !important;
    }
}

/* Single post secondary headers */
header#above-fold,
header#above-fold .post-inset-front,
header#above-fold .post-inset-front *,
header#above-fold .post-inset-back,
header#above-fold .post-inset-back *,
header#above-fold .post-background {
    aspect-ratio: 1 !important;
    object-fit: cover;
    object-position: center;
}
@media screen and (min-width: 960px) {
    header#above-fold,
    header#above-fold .post-inset-front,
    header#above-fold .post-inset-front *,
    header#above-fold .post-inset-back,
    header#above-fold .post-inset-back *,
    header#above-fold .post-background {
        aspect-ratio: 16/9 !important;
    }
}

body.menu-modal-active {
    --wp--preset--color--off-black: #E7E2D9 !important;
    --wp--preset--color--off-white: #231F1F !important;
    --wp--preset--color--l-blue: #231F1F !important;
    height: 100dvh;
    overflow: hidden;
    #site-header {
        min-height: 100dvh;
        #header-menu {
            display: flex !important;
            flex-direction: column !important;
            order: 999;
            font-size: 0.875rem !important;
            li a:has(svg) {
                display: none;
            }
        }
        #site-header-inner {
            flex-wrap: wrap;
        }
    }
}

body.member-modal-active {
    height: 100dvh;
    overflow: hidden;
    --wp--preset--color--off-black: #E7E2D9 !important;
    --wp--preset--color--off-white: #231F1F !important;
    --wp--preset--color--l-blue: #231F1F !important;
    #site-header {
        flex-wrap: wrap;
        background-color: var(--wp--preset--color--off-white);
        min-height: 100dvh;
        #member-modal {
            min-height: 100dvh;
            display: flex !important;
            width: 100%;
        }
        #site-header-inner {
            position: relative;
            z-index: 999;
        }
    }
}

main header {
    .sponsor-badge {
        position: absolute;
        width: 75px;
        top: 0;
        right: 0;
        margin-top: var(--two-spacer);
        margin-right: var(--two-spacer);
        z-index: 99999;
        @media screen and (max-width: 979px) {
            top: unset;
            bottom: 0;
            margin-top: unset;
            margin-bottom: var(--one-point-five-spacer);
            margin-right: var(--one-point-five-spacer);
        }
    }
    &.text-only {
        @media screen and (max-width: 979px) {
            .sponsor-badge {
                position: relative;
                margin-top: var(--two-spacer);
                margin-bottom: 0;
            }
        }
    }
}

/* Header icon animations */
#site-header svg#square-filled,
#site-header svg#gear-filled,
#site-header svg#steps-filled,
#site-header svg#flag-filled {
    overflow: visible;
    * {
        transition: all 1s ease;
        overflow: visible;
        fill: transparent;
        stroke: var(--wp--preset--color--off-black);
        stroke-width: 2px;
    }
    &.quick-transition * {
        transition: all 0.2s ease !important;
    }
    &.loaded * {
        fill: var(--wp--preset--color--off-black);
        stroke-width: 0px;
    }
    &:hover * {
        fill: transparent;
        stroke-width: 2px;
    }
}

#sponsor-bug {
    margin-left: calc(-1 * var(--one-spacer));
    width: 110px;
    height: 85px;
    clip-path: polygon( 19.483% 1.292%,19.483% 1.292%,19.588% 1.063%,19.71% 0.853%,19.848% 0.663%,20% 0.495%,20.165% 0.349%,20.342% 0.226%,20.528% 0.129%,20.723% 0.058%,20.924% 0.015%,21.13% 0%,98.148% 0%,98.148% 0%,98.449% 0.031%,98.734% 0.121%,98.999% 0.266%,99.242% 0.459%,99.458% 0.697%,99.643% 0.975%,99.793% 1.287%,99.906% 1.628%,99.976% 1.995%,100% 2.381%,100% 97.619%,100% 97.619%,99.976% 98.005%,99.906% 98.372%,99.793% 98.713%,99.643% 99.025%,99.458% 99.303%,99.242% 99.541%,98.999% 99.734%,98.734% 99.879%,98.449% 99.969%,98.148% 100%,1.852% 100%,1.852% 100%,1.551% 99.969%,1.267% 99.879%,1.001% 99.734%,0.758% 99.541%,0.542% 99.303%,0.357% 99.025%,0.207% 98.713%,0.094% 98.372%,0.024% 98.005%,0% 97.619%,0% 50.576%,0% 50.576%,0.002% 50.463%,0.008% 50.35%,0.019% 50.238%,0.033% 50.126%,0.052% 50.016%,0.075% 49.907%,0.101% 49.8%,0.132% 49.694%,0.167% 49.59%,0.205% 49.488%,19.483% 1.292% );
    .inner {
        margin-top: 1px;
        margin-left: 1px;
        width: 108px;
        height: 83px;
        clip-path: polygon( 19.478% 1.305%,19.478% 1.305%,19.583% 1.074%,19.707% 0.862%,19.846% 0.67%,20% 0.5%,20.166% 0.352%,20.345% 0.229%,20.532% 0.13%,20.729% 0.059%,20.931% 0.015%,21.139% 0%,98.131% 0%,98.131% 0%,98.434% 0.032%,98.722% 0.123%,98.99% 0.269%,99.235% 0.465%,99.453% 0.706%,99.639% 0.987%,99.791% 1.302%,99.905% 1.648%,99.976% 2.019%,100% 2.41%,100% 97.59%,100% 97.59%,99.976% 97.981%,99.905% 98.352%,99.791% 98.698%,99.639% 99.013%,99.453% 99.294%,99.235% 99.535%,98.99% 99.731%,98.722% 99.877%,98.434% 99.968%,98.131% 100%,1.869% 100%,1.869% 100%,1.566% 99.968%,1.278% 99.877%,1.01% 99.731%,0.765% 99.535%,0.547% 99.294%,0.361% 99.013%,0.209% 98.698%,0.095% 98.352%,0.024% 97.981%,0% 97.59%,0% 50.585%,0% 50.585%,0.002% 50.47%,0.009% 50.355%,0.019% 50.241%,0.034% 50.128%,0.053% 50.016%,0.076% 49.906%,0.103% 49.797%,0.134% 49.689%,0.169% 49.584%,0.208% 49.48%,19.478% 1.305% );
    }
}

:root {
    .sponsor-light {
        display: flex;
    }
    .sponsor-dark { 
        display: none;
    }
    &.invert {
        .sponsor-dark {
            display: flex;
        }
        .sponsor-light {
            display: none;
        }
    }
}
/* Showing specific sponsor image when member modal is open */
body.member-modal-active,
body.inverted-default {
    .sponsor-dark {
        display: flex;
    }
    .sponsor-light {
        display: none;
    }
}

/* Media queries for sponsor bug */
@media screen and (min-width: 1200px) and (max-width: 1299px) {
    #site-header:has(#sponsor-bug) {
        .logo {
            margin-top: -3.5px;
            svg {
                height: calc(0.8 * 93px);
            }
        }
        #sponsor-bug {
            /* width: calc(0.8 * 110px); */
            width: 88px;
            /* height: calc(0.8 * 85px); */
            height: 68px;
            .inner {
                width: 86px;
                height: 66px;
            }
        }
        svg#square-filled,
        svg#gear-filled,
        svg#steps-filled {
            width: calc(0.8 * 85px) !important;
            min-width: calc(0.8 * 85px) !important;
            height: calc(0.8 * 85px) !important;
            min-height: calc(0.8 * 85px) !important;
        }
        svg#flag-filled {
            width: calc(0.8 * 113px) !important;
            min-width: calc(0.8 * 113px) !important;
            height: calc(0.8 * 85px) !important;
            min-height: calc(0.8 * 85px) !important;
        }
    }
}
@media screen and (min-width: 1000px) and (max-width: 1199px) {
    #site-header:has(#sponsor-bug) {
        .logo {
            margin-top: -3.5px;
            svg {
                height: calc(0.7 * 93px);
            }
        }
        #sponsor-bug {
            /* width: calc(0.7 * 110px); */
            width: 77px;
            /* height: calc(0.7 * 85px); */
            height: 60px;
            * {
                font-size: 10px !important;
            }
            .inner {
                width: 75px;
                height: 58px;
            }
        }
        svg#square-filled,
        svg#gear-filled,
        svg#steps-filled {
            width: calc(0.7 * 85px) !important;
            min-width: calc(0.7 * 85px) !important;
            height: calc(0.7 * 85px) !important;
            min-height: calc(0.7 * 85px) !important;
        }
        svg#flag-filled {
            width: calc(0.7 * 113px) !important;
            min-width: calc(0.7 * 113px) !important;
            height: calc(0.7 * 85px) !important;
            min-height: calc(0.7 * 85px) !important;
        }
    }
}
@media screen and (min-width: 960px) and (max-width: 999px) {
    #site-header:has(#sponsor-bug) {
        .logo {
            svg {
                height: calc(0.6 * 93px);
            }
        }
        #sponsor-bug {
            /* width: calc(0.6 * 110px); */
            width: 66px;
            /* height: calc(0.6 * 85px); */
            height: 51px;
            * {
                font-size: 10px !important;
            }
            .inner {
                width: 64px;
                height: 49px;
                div {
                    padding: 2px !important;
                }
            }
        }
        svg#square-filled,
        svg#gear-filled,
        svg#steps-filled {
            width: calc(0.6 * 85px) !important;
            min-width: calc(0.6 * 85px) !important;
            height: calc(0.6 * 85px) !important;
            min-height: calc(0.6 * 85px) !important;
        }
        svg#flag-filled {
            width: calc(0.6 * 113px) !important;
            min-width: calc(0.6 * 113px) !important;
            height: calc(0.6 * 85px) !important;
            min-height: calc(0.6 * 85px) !important;
        }
    }
}
@media screen and (min-width: 600px) and (max-width: 959px) {
    #site-header:has(#sponsor-bug) {
        .logo {
            svg {
                height: calc(0.5 * 93px);
            }
        }
        #sponsor-bug {
            margin-left: 0;
            /* width: calc(0.5 * 110px); */
            width: 55px;
            /* height: calc(0.5 * 85px); */
            height: 43px;
            * {
                font-size: 8px !important;
            }
            .inner {
                width: 53px;
                height: 41px;
                div {
                    padding: 2px !important;
                }
            }
        }
        svg#square-filled,
        svg#gear-filled,
        svg#steps-filled {
            width: calc(0.5 * 85px) !important;
            min-width: calc(0.5 * 85px) !important;
            height: calc(0.5 * 85px) !important;
            min-height: calc(0.5 * 85px) !important;
        }
        svg#flag-filled {
            width: calc(0.5 * 113px) !important;
            min-width: calc(0.5 * 113px) !important;
            height: calc(0.5 * 85px) !important;
            min-height: calc(0.5 * 85px) !important;
        }
    }
}
@media screen and (max-width: 600px) {
    #site-header:has(#sponsor-bug) {
        .logo {
            margin-top: -2px;
            svg {
                height: calc(0.4 * 93px);
                width: fit-content;
            }
        }
        #member-toggle {
            height: 26px;
        }
        #sponsor-bug {
            margin-left: calc(-1 * var(--zero-point-five-spacer));
            /* width: calc(0.4 * 110px); */
            width: 44px;
            /* height: calc(0.4 * 85px); */
            height: 34px;
            * {
                font-size: 6px !important;
            }
            .inner {
                width: 42px;
                height: 32px;
                div {
                    padding: 2px !important;
                }
            }
        }
        svg#square-filled,
        svg#gear-filled,
        svg#steps-filled {
            width: calc(0.3 * 85px) !important;
            min-width: calc(0.3 * 85px) !important;
            height: calc(0.3 * 85px) !important;
            min-height: calc(0.3 * 85px) !important;
        }
        svg#flag-filled {
            width: calc(0.3 * 113px) !important;
            min-width: calc(0.3 * 113px) !important;
            height: calc(0.3 * 85px) !important;
            min-height: calc(0.3 * 85px) !important;
        }
    }
}