.mtd-footer-custom-stack {
    box-sizing: border-box;
    display: block;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

.mtd-footer-custom-block {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
}

.mtd-footer-custom-block + .mtd-footer-custom-block,
.mtd-footer-bottom + .mtd-footer-custom-block {
    margin-top: 0.75rem;
}

.mtd-footer-custom-block + .mtd-footer-bottom {
    margin-top: 0.75rem;
}

.mtd-footer-bottom-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.25rem;
    min-width: 0;
}

.mtd-footer-bottom-copy > .mtd-footer-custom-block {
    width: auto;
    margin-top: 0;
}

.mtd-footer-brand-tagline {
    max-width: 270px;
    margin-top: 18px;
    color: var(--mtd-muted, currentColor);
    font-size: 14px;
    line-height: 1.65;
}

.mtd-footer-custom-block > :first-child {
    margin-top: 0;
}

.mtd-footer-custom-block > :last-child {
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    .mtd-footer-bottom-copy {
        justify-content: center;
    }
}

/* Keep the footer's primary content visually connected, even when a site has
   older Custom CSS rules that targeted the pre-upgrade footer markup. */
@media (min-width: 992px) {
    #site-footer > .container {
        display: block !important;
    }

    #site-footer .mtd-footer-grid {
        display: grid !important;
        grid-template-columns: minmax(190px, 0.78fr) minmax(180px, 0.62fr) minmax(340px, 1.2fr) !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 30px 32px !important;
        border: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
        border-radius: 20px !important;
        background: rgba(255, 255, 255, 0.035) !important;
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.12) !important;
    }

    #site-footer .mtd-footer-brand,
    #site-footer .mtd-footer-menu-grid,
    #site-footer .mtd-footer-cta {
        grid-row: 1 !important;
        min-width: 0 !important;
    }

    #site-footer .mtd-footer-brand {
        grid-column: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 2px clamp(24px, 2.6vw, 42px) 2px 0 !important;
        border-right: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
    }

    #site-footer .mtd-footer-logo {
        display: block !important;
        width: min(100%, 225px) !important;
        max-width: 225px !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    #site-footer .mtd-footer-logo img {
        display: block !important;
        width: 100% !important;
        max-width: 225px !important;
        height: auto !important;
        max-height: 112px !important;
        margin: 0 !important;
        object-fit: contain !important;
        object-position: left top !important;
    }

    #site-footer .mtd-footer-logo .mtd-logo-dark {
        display: none !important;
    }

    html.serepok-dark-mode #site-footer .mtd-footer-logo .mtd-logo-light,
    body.dark-mode #site-footer .mtd-footer-logo .mtd-logo-light {
        display: none !important;
    }

    html.serepok-dark-mode #site-footer .mtd-footer-logo .mtd-logo-dark,
    body.dark-mode #site-footer .mtd-footer-logo .mtd-logo-dark {
        display: block !important;
    }

    #site-footer .mtd-footer-menu-grid {
        grid-column: 2 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        align-content: start !important;
        padding: 0 clamp(24px, 2.6vw, 42px) !important;
        border-right: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
    }

    #site-footer .mtd-footer-cta {
        grid-column: 3 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: minmax(285px, 1fr) auto !important;
        grid-template-rows: auto 1fr !important;
        column-gap: 24px !important;
        row-gap: 8px !important;
        align-content: start !important;
        width: auto !important;
        padding: 0 0 0 clamp(24px, 2.2vw, 38px) !important;
        border: 0 !important;
        text-align: left !important;
    }

    #site-footer .mtd-footer-cta::before {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        margin: 0 0 10px !important;
        font-size: 19px !important;
        line-height: 1.25 !important;
    }

    #site-footer .mtd-footer-widget-html {
        grid-column: 1 !important;
        grid-row: 2 !important;
        font-size: 15px !important;
        line-height: 1.72 !important;
    }

    #site-footer .mtd-footer-cta .btn {
        grid-column: 2 !important;
        grid-row: 2 !important;
        align-self: end !important;
        justify-self: end !important;
        min-width: 185px !important;
        margin: 0 !important;
    }

    #site-footer .mtd-footer-custom-stack > [data-position="before"] {
        margin: 18px 0 0 !important;
        padding: 15px 20px !important;
        border: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        color: var(--mtd-muted, rgba(255, 255, 255, 0.78)) !important;
        text-align: center !important;
        line-height: 1.6 !important;
    }

    #site-footer .mtd-footer-bottom {
        margin-top: 18px !important;
    }
}

@media (max-width: 991.98px) {
    #site-footer > .container {
        display: block !important;
    }

    #site-footer .mtd-footer-grid {
        display: grid !important;
        grid-template-columns: minmax(170px, 0.8fr) minmax(0, 1.2fr) !important;
        gap: 24px 32px !important;
        padding: 26px !important;
        border: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.035) !important;
    }

    #site-footer .mtd-footer-brand {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    #site-footer .mtd-footer-menu-grid {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    #site-footer .mtd-footer-cta {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        column-gap: 24px !important;
        padding: 22px 0 0 !important;
        border-top: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
    }

    #site-footer .mtd-footer-cta::before {
        grid-column: 1 / -1 !important;
    }

    #site-footer .mtd-footer-widget-html {
        grid-column: 1 !important;
    }

    #site-footer .mtd-footer-cta .btn {
        grid-column: 2 !important;
        align-self: end !important;
    }

    #site-footer .mtd-footer-custom-stack > [data-position="before"] {
        margin-top: 16px !important;
        padding: 14px 18px !important;
        border: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        text-align: center !important;
        line-height: 1.55 !important;
    }
}

@media (max-width: 575.98px) {
    #site-footer .mtd-footer-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 22px 20px !important;
    }

    #site-footer .mtd-footer-brand,
    #site-footer .mtd-footer-menu-grid,
    #site-footer .mtd-footer-cta {
        grid-column: 1 !important;
    }

    #site-footer .mtd-footer-brand {
        grid-row: 1 !important;
        justify-items: start !important;
        padding: 0 0 20px !important;
    }

    #site-footer .mtd-footer-menu-grid {
        grid-row: 2 !important;
        padding: 0 !important;
        border-top: 1px solid var(--mtd-soft-line, rgba(255, 255, 255, 0.14)) !important;
    }

    #site-footer .mtd-footer-cta {
        grid-row: 3 !important;
        grid-template-columns: 1fr !important;
        justify-items: start !important;
        text-align: left !important;
    }

    #site-footer .mtd-footer-cta::before,
    #site-footer .mtd-footer-widget-html,
    #site-footer .mtd-footer-cta .btn {
        grid-column: 1 !important;
    }

    #site-footer .mtd-footer-cta .btn {
        justify-self: stretch !important;
        width: 100% !important;
        max-width: 360px !important;
        margin-top: 12px !important;
    }

    #site-footer .mtd-footer-logo,
    #site-footer .mtd-footer-logo img {
        width: min(210px, 68vw) !important;
        max-width: min(210px, 68vw) !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}
