/*----------------------------------------*/
/*  FOOTER                                 */
/*  Figma: F4P Frame 592 (520-71059)       */
/*----------------------------------------*/

footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    background-color: var(--rd-dark);
    font-family: var(--rd-ff);
    color: var(--rd-txt-on-dark);
}

/* Two dark photos under a 20px backdrop blur, pinned to the bottom.
   The blur is baked into the JPG (14KB), so no filter runs on scroll. */
.footer__main {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    padding: 60px var(--rd-gutter);
    background: var(--rd-dark) url("../../img/redesign/footer-bg-f4p.jpg") no-repeat center bottom / cover;
}

.footer__main > * {
    position: relative;
    z-index: 1;
}


/*--------------------*/
/* - BRAND COLUMN     */
/*--------------------*/
.footer__brand {
    display: flex;
    flex-direction: column;
    gap: 60px;
    flex: 0 0 293px;
    max-width: 293px;
}

.footer__brand-top {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.footer__logo {
    display: block;
    line-height: 0;
}

.footer__logo img {
    display: block;
    width: 248px;
    max-width: 100%;
    height: auto;
}

.footer__intro {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 16px;
    font-weight: 400;
}

.footer__intro p {
    line-height: 1.4;
    color: var(--rd-txt-muted);
}

.footer__intro-link {
    font-weight: 400;
    line-height: normal;
    color: var(--rd-white);
    text-decoration: underline;
    transition: color var(--rd-transition);
}

.footer__social-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer__social-title {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--rd-txt-muted);
}

.footer__social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer__social a {
    display: block;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    line-height: 0;
    transition: opacity var(--rd-transition);
}

.footer__social img {
    display: block;
    width: 100%;
    height: 100%;
}

.footer__address {
    max-width: 222px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    color: rgba(255, 255, 255, .85);
    text-transform: uppercase;
}


/*--------------------*/
/* - LINK COLUMNS     */
/*--------------------*/
/* Five equal columns; the groups inside them are packed in PHP
   so every column is filled and the whole row spans the design width. */
.footer__nav {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 1461px;
}

.footer__col {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1 1 0;
    min-width: 0;
}

.footer__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer__title {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--rd-white);
    text-align: left;
    cursor: default;
}

.footer__title-icon {
    display: none;
}

.footer__link {
    display: block;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--rd-txt-muted);
    text-transform: capitalize;
    transition: color var(--rd-transition);
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer__link.active {
    color: var(--rd-accent);
}

@media (min-width: 1200px) {
    .footer__link:hover,
    .footer__intro-link:hover {
        color: var(--rd-accent);
    }

    .footer__social a:hover {
        opacity: .75;
    }
}


/*--------------------*/
/* - BACK TO TOP      */
/*--------------------*/
/* Floats over the page and appears on scroll — global.js toggles `.active`
   on `.back-to-top`. */
.footer__top-btn {
    position: fixed;
    z-index: 100;
    right: var(--rd-gutter);
    bottom: var(--rd-gutter);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    background-color: var(--rd-white);
    border-radius: var(--rd-radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--rd-transition), transform var(--rd-transition),
                visibility var(--rd-transition), background-color var(--rd-transition);
}

.footer__top-btn.active {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.footer__top-btn img {
    display: block;
    width: 20px;
    height: 20px;
    /* the exported glyph points right */
    transform: rotate(-90deg);
}

@media (min-width: 1200px) {
    .footer__top-btn:hover {
        background-color: var(--rd-accent);
    }
}


/*--------------------*/
/* - BOTTOM BAR       */
/*--------------------*/
.footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 32px;
    padding: 8px var(--rd-gutter);
    background-color: var(--rd-dark);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--rd-txt-muted);
}

.footer__legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 24px;
}

.footer__legal a {
    color: inherit;
    transition: color var(--rd-transition);
}

.footer__by {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: inherit;
    text-decoration: none;
    transition: color var(--rd-transition), opacity var(--rd-transition);
}

.footer__by img {
    display: block;
    width: 37px;
    height: 19px;
    object-fit: contain;
}

@media (min-width: 1200px) {
    .footer__legal a:hover,
    .footer__by:hover {
        color: var(--rd-white);
    }
}


/*--------------------*/
/* - TABLET (<1200px) */
/* Groups collapse into an accordion, as in the mobile design */
/*--------------------*/
@media (max-width: 1199px) {
    .footer__main {
        flex-direction: column;
        gap: 40px;
        padding: 40px var(--rd-gutter);
    }

    .footer__brand {
        flex: 0 0 auto;
        max-width: none;
        gap: 30px;
    }

    .footer__nav {
        flex-direction: column;
        gap: 0;
        max-width: none;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, .15);
    }

    .footer__col {
        gap: 0;
        flex: 0 0 auto;
        width: 100%;
    }

    .footer__group {
        gap: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .15);
    }

    .footer__title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin: 0;
        padding: 18px 0;
        cursor: pointer;
    }

    .footer__title-icon {
        display: block;
        flex-shrink: 0;
        width: 10px;
        height: 10px;
        margin-right: 4px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-3px) rotate(45deg);
        transition: transform var(--rd-transition);
    }

    .footer__title[aria-expanded="true"] .footer__title-icon {
        transform: translateY(1px) rotate(-135deg);
    }

    .footer__links {
        display: none;
        padding-bottom: 18px;
    }

    .footer__title[aria-expanded="true"] + .footer__links {
        display: flex;
        gap: 12px;
    }

}


/*--------------------*/
/* - PHONE (<768px)   */
/*--------------------*/
@media (max-width: 767px) {
    .footer__logo img {
        width: 170px;
    }

    .footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px var(--rd-gutter);
    }
}
