/*
 * Rivera — Footer
 *
 * One block, .footer, with two rows: contacts opposite the phone and the
 * messengers, then the map beside a photo of the office.
 *
 * Sizes come off the design, normalised to this project's 1380px container:
 * the reference is 1804px wide with a 1710px content column, so every measured
 * value below is multiplied by 1340/1710 ≈ 0.78.
 */

.footer {
    /* The design opens the footer with a maroon rule — the same colour as the
     * menu bar, which is what ties the two ends of the page together. */
    border-top:       4px solid var(--color-maroon);
    padding:          46px 0 72px;
    background-color: var(--footer-bg);
    color:            var(--color-secondary);
}

/* ── Contacts opposite the phone ────────────────────────────────────────── */
.footer__top {
    display:         flex;
    align-items:     flex-start;
    justify-content: space-between;
    gap:             40px;
}

.footer__contacts {
    flex:      0 1 auto;
    min-width: 0;
}

.footer__company {
    margin:         0;
    font-size:      20px;
    line-height:    1.3;
    letter-spacing: 0.5px;
    text-transform: var(--tt-heading);
}

/* <address> is the right tag for a business's own contact details, and the
 * browser sets it in italic — which is a rendering default, not a meaning. */
.footer__address {
    display:        flex;
    flex-direction: column;
    gap:            4px;
    margin:         46px 0 0;
    font-size:      var(--fs-body);
    font-style:     normal;
    line-height:    1.5;
}

.footer__address-line {
    display: block;
}

/* align-self keeps the underline and the click area to the address itself,
 * not the whole column. */
.footer__email {
    align-self:      flex-start;
    color:           inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition:      color var(--transition);
}

.footer__email:hover,
.footer__email:focus-visible {
    color: var(--color-orange);
}

/* ── Phone and messengers ───────────────────────────────────────────────── */
.footer__reach {
    display:        flex;
    flex-direction: column;
    /* The phone is the wider of the two, so this lines the last messenger up
     * with the last digit — both ending on the container's right edge. */
    align-items:    flex-end;
    flex:           0 0 auto;
}

/* The one thing this footer exists for, so it gets the only accent colour on
 * the page's bottom half. */
.footer__phone {
    color:           var(--color-orange);
    font-size:       30px;
    line-height:     1.1;
    white-space:     nowrap;
    text-decoration: none;
    transition:      color var(--transition);
}

.footer__phone:hover,
.footer__phone:focus-visible {
    color: var(--color-secondary);
}

/* The hover states below are colour and movement only, which a keyboard user
 * cannot rely on — so the focus ring is drawn explicitly. */
.footer__phone:focus-visible,
.footer__channel-link:focus-visible {
    outline:        2px solid var(--color-orange);
    outline-offset: 4px;
}

.footer__channels {
    display:     flex;
    align-items: center;
    gap:         20px;
    margin:      24px 0 0;
    padding:     0;
    list-style:  none;
}

.footer__channel {
    display: flex;
}

.footer__channel-link {
    display:    block;
    transition: transform var(--transition), opacity var(--transition);
}

.footer__channel-link:hover,
.footer__channel-link:focus-visible {
    transform: translateY(-2px);
    opacity:   0.85;
}

.footer__channel-icon {
    display: block;
    width:   36px;
    height:  36px;
}

/* ── Map and photo ──────────────────────────────────────────────────────── */
/* The design does not run these to the edges of the content column — they sit
 * as a centred pair, which keeps the map from turning into a wall on a wide
 * screen. Their widths are the design's own ratio, 704:553. */
.footer__media {
    display:   flex;
    gap:       100px;
    max-width: 1105px;
    margin:    96px auto 0;
}

.footer__map {
    flex:   704 1 0;
    height: 320px;
}

.footer__map-frame {
    display: block;
    width:   100%;
    height:  100%;
    border:  0;
}

.footer__photo {
    flex:   553 1 0;
    height: 320px;
}

.footer__photo-img {
    display:    block;
    width:      100%;
    height:     100%;
    object-fit: cover;
}

/* ── Tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .footer {
        padding: 32px 0 48px;
    }

    .footer__company {
        font-size: 18px;
    }

    .footer__address {
        margin-top: 24px;
        font-size:  16px;
    }

    .footer__phone {
        font-size: 26px;
    }

    .footer__channels {
        gap:        18px;
        margin-top: 18px;
    }

    .footer__channel-icon {
        width:  34px;
        height: 34px;
    }

    .footer__media {
        gap:        40px;
        max-width:  none;
        margin-top: 48px;
    }

    .footer__map,
    .footer__photo {
        height: 260px;
    }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
/* Four 32px icons and three 12px gaps come to 164px, so the row still holds on
 * a 320px screen with room to spare. */
@media (max-width: 767px) {
    .footer {
        padding: 24px 0 32px;
    }

    .footer__top {
        flex-direction: column;
        gap:            28px;
    }

    /* Stacked under the address, the column reads from the left like the rest
     * of the text — a right-aligned icon row would float away from it. */
    .footer__reach {
        align-items: flex-start;
    }

    .footer__company {
        font-size: 17px;
    }

    .footer__address {
        margin-top: 16px;
        font-size:  15px;
    }

    .footer__phone {
        font-size: 24px;
    }

    .footer__channels {
        gap:        12px;
        margin-top: 16px;
    }

    .footer__channel-icon {
        width:  32px;
        height: 32px;
    }

    /* A wrapping row rather than a column. The client's photo is only 350px
     * wide, so a full-width column on a 600–767px screen stretched it to twice
     * its size and cropped the building down to the sign. Letting the pair
     * wrap keeps them side by side while two 220px cards still fit — down to
     * roughly a 500px screen — and stacks them only below that, where a
     * full-width card is about as wide as the photo itself.
     *
     * The flex value also replaces the desktop 704:553 basis of 0, which in a
     * narrow row shrank the map to the iframe's default 150px. */
    .footer__media {
        flex-wrap:  wrap;
        gap:        16px;
        margin-top: 32px;
    }

    .footer__map,
    .footer__photo {
        flex:   1 1 220px;
        height: 200px;
    }
}
