/* ==========================================================
   MSJ Mortgage | Footer
   All styles are scoped to .msj-footer.
   ========================================================== */

/* 1. Footer base and background */
.msj-footer {
    --footer-accent: #e54b50;

    box-sizing: border-box;
    /* Soft tonal depth, without a visible pattern or colored glow. */
    background: #202123;
    background: linear-gradient(
        180deg,
        #2a2b2d 0%,
        #232426 42%,
        #1c1d1f 100%
    );
    color: #e4e4e6;
    font: 400 15px/1.65 Lato, "Segoe UI", Arial, sans-serif;
    padding: 0;
    margin: 0;
    border-top: 3px solid #b81920;
    overflow-wrap: anywhere;
}

.msj-footer *,
.msj-footer *::before,
.msj-footer *::after {
    box-sizing: border-box;
}

/* 2. Main layout */
.msj-footer .msj-footer-inner {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 52px clamp(24px, 3vw, 48px) 22px;
}

.msj-footer .msj-footer-main {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(0, 1fr)
        minmax(0, 1.1fr)
        minmax(246px, 0.85fr);
    gap: clamp(24px, 3vw, 56px);
    align-items: start;
    padding-bottom: 42px;
}

.msj-footer .msj-footer-main > * {
    min-width: 0;
}

/* 3. Typography and navigation links */
.msj-footer h2 {
    font: 700 17px/1.4 Lato, "Segoe UI", Arial, sans-serif;
    letter-spacing: normal;
    margin: 0 0 20px;
    color: #fff;
    max-width: none;
}

.msj-footer h2::after {
    content: "";
    display: block;
    width: 25px;
    height: 2px;
    background: var(--footer-accent);
    margin-top: 10px;
}

.msj-footer p,
.msj-footer address {
    color: #c5c5c9;
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    font-style: normal;
    max-width: none;
}

.msj-footer a {
    color: #d3d3d7;
    text-decoration: none;
    transition: color 0.15s ease;
}

.msj-footer a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.msj-footer a:focus-visible {
    outline: 2px solid #f08488;
    outline-offset: 4px;
}

.msj-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.msj-footer li {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 14px;
}

/* 4. Company logo and contact information */
.msj-footer .msj-footer-logo {
    display: block;
    width: min(210px, 100%);
    margin: 0 0 24px;
}

.msj-footer .msj-footer-logo img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    aspect-ratio: 3 / 1;
}

.msj-footer .msj-footer-phone {
    display: inline-block;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0;
    margin-bottom: 9px;
    line-height: 1.25;
}

.msj-footer .msj-footer-hours {
    margin-top: 10px;
}

.msj-footer .msj-footer-branch {
    display: inline-block;
    margin-top: 14px;
    font-size: 14px;
    color: #fff;
    font-weight: 700;
}

.msj-footer .msj-footer-branch span,
.msj-footer .msj-footer-equal a span {
    color: var(--footer-accent);
}

/* 5. Awards and recognition */
 .msj-footer .msj-footer-awards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 80px));
    justify-content: start;
    gap: 5px;
    width: min(270px, 100%);
    background: #292a2d;
    border: 1px solid #38393c;
    padding: 9px;
    border-radius: 4px;
}
.msj-footer .msj-award-badge {
    display: grid;
    place-items: center;
    position: relative;
    min-width: 0;
    aspect-ratio: 1;
    border-radius: 3px;
}
.msj-footer .msj-award-badge img { width: 100%; height: 100%; display: block; object-fit: contain; }
.msj-footer .msj-award-badge:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.msj-footer .msj-award-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 5px);
    left: 0;
    z-index: 3;
    width: max-content;
    max-width: 160px;
    padding: 6px 9px;
    background: #fff;
    color: #202123;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 2px 8px #0003;
    white-space: normal;
    pointer-events: none;
}
.msj-footer .msj-award-badge:nth-child(3n) .msj-award-tooltip { left: auto; right: 0; }
.msj-footer .msj-award-badge:hover .msj-award-tooltip,
.msj-footer .msj-award-badge:focus .msj-award-tooltip { display: block; }

.msj-footer .msj-footer-all-awards {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}
.msj-footer .msj-footer-all-awards span { color: var(--footer-accent); }
.msj-footer .msj-footer-all-awards:hover { text-decoration: underline; }

/* 6. Social media */
.msj-footer h2.msj-footer-follow {
    margin: 24px 0 12px;
    font-size: 15px;
}

.msj-footer h2.msj-footer-follow::after {
    display: none;
}

.msj-footer .msj-footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.msj-footer .msj-footer-social {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #77787b;
    border-radius: 50%;
    color: #fff;
    flex: none;
}

.msj-footer .msj-footer-social svg {
    width: 19px;
    height: 19px;
    display: block;
}

.msj-footer a.msj-footer-social:hover {
    background: #b81920;
    border-color: #b81920;
    text-decoration: none;
}

.msj-footer .msj-footer-social--pending {
    color: #c5c5c9;
}

/* 7. Equal Housing and regulatory disclosures */
.msj-footer .msj-footer-compliance {
    border-top: 1px solid #4b4c50;
    border-bottom: 1px solid #4b4c50;
    padding: 20px 0;
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.msj-footer .msj-footer-equal {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.msj-footer .msj-footer-equal img {
    width: 62px;
    height: auto;
    flex: none;
    object-fit: contain;
}

.msj-footer .msj-footer-equal strong,
.msj-footer .msj-footer-equal span,
.msj-footer .msj-footer-equal a {
    display: block;
    font-size: 13px;
    line-height: 1.5;
}

.msj-footer .msj-footer-equal strong {
    color: white;
    font-size: 14px;
    margin-bottom: 3px;
}

.msj-footer .msj-footer-equal a {
    margin-top: 5px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.msj-footer .msj-footer-equal a span {
    display: inline;
}

.msj-footer .msj-footer-disclosures p {
    font-size: 11px;
    line-height: 1.55;
    color: #bfc0c3;
    white-space: pre-line;
}

.msj-footer .msj-footer-disclosures p + p {
    margin-top: 5px;
}

.msj-footer .msj-footer-disclosures strong {
    color: #e2e2e4;
}

/* 8. Copyright, legal links and developer credit */
.msj-footer .msj-footer-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px 32px;
    padding-top: 18px;
}

.msj-footer .msj-footer-bottom p,
.msj-footer .msj-footer-bottom li {
    font-size: 13px;
}

.msj-footer .msj-footer-bottom ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.msj-footer .msj-footer-credit {
    white-space: nowrap;
    color: #d8d8da;
    font-size: 13px;
    text-align: right;
}

.msj-footer .msj-footer-credit a {
    font-weight: 700;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.msj-footer .msj-footer-credit a span {
    color: var(--footer-accent);
}

/* 9. Tablet layout */
@media (max-width: 1000px) {
    .msj-footer .msj-footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 36px 48px;
    }

    .msj-footer .msj-footer-compliance {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .msj-footer .msj-footer-bottom {
        grid-template-columns: 1fr auto;
    }

    .msj-footer .msj-footer-credit {
        grid-column: 1 / -1;
    }
}

/* 10. Mobile layout */
@media (max-width: 560px) {
    .msj-footer .msj-footer-inner {
        width: 100%;
        padding: 36px 20px 22px;
    }

    .msj-footer .msj-footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 32px 16px;
        padding-bottom: 30px;
    }

    .msj-footer .msj-footer-contact,
    .msj-footer .msj-footer-recognition {
        grid-column: 1 / -1;
    }

    .msj-footer h2 {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .msj-footer li {
        font-size: 13px;
    }

    .msj-footer .msj-footer-logo {
        width: 190px;
        margin-bottom: 18px;
    }

    .msj-footer .msj-footer-bottom {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 12px;
    }

    .msj-footer .msj-footer-bottom ul {
        gap: 8px 16px;
    }

    .msj-footer .msj-footer-credit {
        text-align: left;
    }
}

/* 11. Extra-small screens */
@media (max-width: 340px) {
    .msj-footer .msj-footer-main {
        grid-template-columns: 1fr;
    }

    .msj-footer .msj-footer-inner {
        width: 100%;
        padding-inline: 16px;
    }
}

/* 12. Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
    .msj-footer a {
        transition: none;
    }
}

/* Remove underlines from regulatory and developer links */
.msj-footer .msj-footer-equal a,
.msj-footer .msj-footer-credit a {
    text-decoration: none;
    font-weight: 700;
}

/* Keep links clean on hover */
.msj-footer .msj-footer-equal a:hover,
.msj-footer .msj-footer-credit a:hover {
    text-decoration: none;
    color: var(--footer-accent);
}

/* The floating controls move above the legal row; no extra footer whitespace. */
.msj-footer .msj-footer-credit a,
.msj-footer .msj-footer-credit a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}
