/**
 * ASE runtime footer for theme-owned branded category and single-post views.
 *
 * The footer is emitted from wp_footer(), after normal theme content wrappers
 * have closed. Theme footer containers are neutralized rather than hidden as
 * ancestors, so the ASE footer remains visible even in a theme that calls
 * wp_footer() from inside its footer element.
 */
body.ase-managed-runtime-footer :where(
    .site-footer,
    #colophon,
    footer.wp-block-template-part,
    .wp-site-blocks > footer:not(.ase-runtime-footer)
) {
    display: block !important;
    clear: both !important;
    grid-column: 1 / -1 !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.ase-managed-runtime-footer :where(
    .site-footer,
    #colophon,
    footer.wp-block-template-part,
    .wp-site-blocks > footer:not(.ase-runtime-footer)
)::before,
body.ase-managed-runtime-footer :where(
    .site-footer,
    #colophon,
    footer.wp-block-template-part,
    .wp-site-blocks > footer:not(.ase-runtime-footer)
)::after {
    content: none !important;
    display: none !important;
}

/*
 * Hide the theme's visible footer contents without hiding the footer element
 * itself. If a theme invokes wp_footer() from inside that element, the ASE
 * footer remains a visible direct child.
 */
body.ase-managed-runtime-footer :where(
    .site-footer,
    #colophon,
    footer.wp-block-template-part,
    .wp-site-blocks > footer:not(.ase-runtime-footer)
) > :not(.ase-runtime-footer),
body.ase-managed-runtime-footer :where(
    .site-info,
    .footer-widgets,
    .site-footer-wrap,
    .ast-footer-overlay,
    .site-primary-footer-wrap,
    .site-above-footer-wrap,
    .site-below-footer-wrap
) {
    display: none !important;
}

body.ase-managed-runtime-footer .ase-runtime-footer {
    position: relative;
    z-index: 2;
    display: block !important;
    clear: both !important;
    float: none !important;
    flex: 0 0 100% !important;
    grid-column: 1 / -1 !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--ase-runtime-footer-text, #fff);
    background: var(--ase-runtime-footer-surface, #17242e);
    border: 0;
    box-shadow: none;
    font-family: var(--ase-runtime-footer-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

body.ase-managed-runtime-footer .ase-runtime-footer,
body.ase-managed-runtime-footer .ase-runtime-footer *,
body.ase-managed-runtime-footer .ase-runtime-footer *::before,
body.ase-managed-runtime-footer .ase-runtime-footer *::after {
    box-sizing: border-box;
}

body.ase-managed-runtime-footer .ase-runtime-footer__inner {
    width: min(100% - 2rem, 1240px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem 2.5rem;
    padding-block: clamp(2.25rem, 4vw, 3.5rem);
}

body.ase-managed-runtime-footer .ase-runtime-footer__brand {
    min-width: 0;
}

body.ase-managed-runtime-footer .ase-runtime-footer__title {
    margin: 0;
    color: inherit;
    font-family: var(--ase-runtime-footer-font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

body.ase-managed-runtime-footer .ase-runtime-footer__copyright {
    margin: 0.55rem 0 0;
    color: inherit;
    opacity: 0.82;
    font-size: 0.95rem;
    line-height: 1.6;
}

body.ase-managed-runtime-footer .ase-runtime-footer__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.8rem;
    margin: 0;
    color: inherit;
    font-size: 0.95rem;
}

body.ase-managed-runtime-footer .ase-runtime-footer__links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

body.ase-managed-runtime-footer .ase-runtime-footer__links a:hover,
body.ase-managed-runtime-footer .ase-runtime-footer__links a:focus-visible {
    color: inherit;
    text-decoration-thickness: 2px;
}

body.ase-managed-runtime-footer .ase-runtime-footer :where(a):focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 760px) {
    body.ase-managed-runtime-footer .ase-runtime-footer__inner {
        grid-template-columns: minmax(0, 1fr);
        align-items: flex-start;
    }

    body.ase-managed-runtime-footer .ase-runtime-footer__links {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ase-managed-runtime-footer .ase-runtime-footer *,
    body.ase-managed-runtime-footer .ase-runtime-footer *::before,
    body.ase-managed-runtime-footer .ase-runtime-footer *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
