/* MSJ Mortgage | Loan programs directory and shared product page styles */

body.msj-products-page {
    --red: #b81920;
    --ink: #202123;
    --muted: #5c5e60;
    --paper: #f4f3f0;
    --line: #dedcd8;
    margin: 0;
    background: #ffffff;
    color: var(--ink);
    font: 400 17px/1.65 Lato, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

.msj-products img {
    max-width: 100%;
}

.msj-products a:focus-visible, .msj-products button:focus-visible {
    outline: 2px solid #d42a32;
    outline-offset: 5px;
}

.msj-products-page .skip {
    position: absolute;
    left: 20px;
    top: -100px;
    z-index: 100;
    background: #fff;
    padding: 12px;
}

.msj-products-page .skip:focus {
    top: 10px;
}

.msj-products-page .msj-header-spacer {
    display: none;
}

.msj-products-page .msj-header:not(.is-docked) {
    position: absolute;
    top: 0;
}

.loan-wrap {
    width: min(1360px, calc(100% - 112px));
    margin-inline: auto;
}

.loan-hero {
    position: relative;
    isolation: isolate;
    min-height: clamp(400px, 53vh, 550px);
    display: grid;
    align-items: center;
    padding: 140px 0 68px;
    background: #303438;
    color: #fff;
}

.loan-hero-photo, .loan-hero::after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.loan-hero-photo {
    object-fit: cover;
    object-position: center 48%;
}

.loan-hero::after {
    content: "";
    background: linear-gradient(90deg, rgba(17,20,23,.85), rgba(17,20,23,.52) 58%, rgba(17,20,23,.22));
}

.loan-eyebrow {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--red);
}

.loan-eyebrow::before {
    content: "";
    width: 25px;
    height: 2px;
    background: currentColor;
}

.loan-hero .loan-eyebrow {
    color: #fff;
}

.loan-hero .loan-eyebrow::before {
    background: #e54b50;
}

.loan-hero h1 {
    font-size: clamp(40px, 4.2vw, 64px);
    line-height: 1.12;
    font-weight: 700;
    margin: 0 0 20px;
}

.loan-hero p:not(.loan-eyebrow) {
    max-width: 610px;
    color: #f0f0f0;
    font-size: clamp(17px, 1.4vw, 20px);
    margin: 0 0 22px;
}

.loan-hero .loan-hero-link {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border-bottom: 1px solid #ffffff80;
    padding-bottom: 5px;
}

.loan-directory {
    padding: clamp(55px, 6vw, 92px) 0;
    scroll-margin-top: 100px;
}

.loan-directory-head {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: end;
    gap: 45px;
    margin-bottom: 35px;
}

.loan-directory h2, .loan-guidance h2 {
    font-size: clamp(29px, 3vw, 42px);
    line-height: 1.2;
    margin: 0;
    font-weight: 700;
}

.loan-directory-head > p {
    margin: 0;
    max-width: 530px;
    color: var(--muted);
}

.loan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 24px;
}

.loan-card {
    display: grid;
    grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
    border: 1px solid var(--line);
    background: #fff;
    min-width: 0;
}

.loan-card-photo {
    display: block;
    position: relative;
    min-height: 290px;
    background: #e5e2de;
    overflow: hidden;
}

.loan-card-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loan-card-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(20px, 2.3vw, 33px);
    min-width: 0;
}

.loan-card h3 {
    margin: 0 0 12px;
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.2;
    font-weight: 700;
}

.loan-card h3 a {
    color: inherit;
    text-decoration: none;
}

.loan-card h3 a:hover {
    color: var(--red);
}

.loan-card p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.loan-examples {
    margin: 0 0 24px;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    width: 100%;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.6;
}

.loan-examples strong {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--muted);
}

.loan-link {
    color: var(--red);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.loan-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.loan-notice {
    margin: 22px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.loan-guidance {
    padding: clamp(45px, 5vw, 76px) 0;
    background: var(--paper);
    border-top: 1px solid #e7e4df;
}

.loan-guidance-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 45px;
    align-items: center;
}

.loan-guidance p:not(.loan-eyebrow) {
    margin: 16px 0 0;
    color: var(--muted);
    max-width: 590px;
}

.loan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.loan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    background: var(--red);
    color: #fff;
    text-decoration: none;
    padding: 14px 22px;
    border: 1px solid var(--red);
    border-radius: 3px;
    font-size: 15px;
    font-weight: 700;
}

.loan-button.secondary {
    background: transparent;
    color: var(--ink);
    border-color: #9a9793;
}

.loan-button:hover {
    background: #951218;
    color: #fff;
    border-color: #951218;
}

@media (max-width: 1100px) {
    .loan-wrap {
        width: calc(100% - 64px);
    }

    .loan-grid {
        gap: 18px;
    }

    .loan-card {
        grid-template-columns: 1fr;
    }

    .loan-card-photo {
        width: 100%;
        min-width: 0;
        min-height: 0;
        aspect-ratio: 2 / 1;
    }

    .loan-card-content {
        min-height: 250px;
    }
}

@media (max-width: 700px) {
    .loan-wrap {
        width: calc(100% - 40px);
    }

    .loan-hero {
        min-height: 410px;
        padding: 120px 0 55px;
    }

    .loan-directory-head, .loan-guidance-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .loan-grid {
        grid-template-columns: 1fr;
    }

    .loan-card-content {
        min-height: 0;
        padding: 23px;
    }

    .loan-actions {
        justify-content: flex-start;
    }

    .loan-card-photo {
        aspect-ratio: 16 / 9;
    }
}


/* Category navigation and program listing */
.loan-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: #eeeeee;
    font-size: 14px;
}

.loan-breadcrumbs a {
    color: #ffffff;
    text-decoration: none;
}

.loan-breadcrumbs a:hover {
    text-decoration: underline;
}

.loan-hero--category {
    min-height: clamp(370px, 46vh, 490px);
}

.loan-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 42px;
}

.loan-category-nav a {
    display: inline-block;
    padding: 12px 0;
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.loan-category-nav a:hover,
.loan-category-nav a[aria-current="page"] {
    color: var(--red);
    border-bottom-color: var(--red);
}

.loan-program-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.loan-program-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: 30px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.loan-program-item h3 {
    margin: 0 0 14px;
    font-size: 24px;
    line-height: 1.25;
}

.loan-program-item h3 a {
    color: var(--ink);
    text-decoration: none;
}

.loan-program-item h3 a:hover {
    color: var(--red);
}

.loan-program-item p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 16px;
}

/* Individual program overview */
.loan-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(30px, 6vw, 90px);
}

.loan-detail-grid p:not(.loan-eyebrow) {
    color: var(--muted);
}

.loan-detail-copy {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.loan-detail-aside {
    padding: 30px;
    background: var(--paper);
    border: 1px solid var(--line);
}

.loan-detail-aside h3 {
    margin: 0 0 14px;
    font-size: 24px;
    line-height: 1.3;
}

.loan-detail-aside .loan-button {
    margin-top: 12px;
}

/* Responsive category and detail pages */
@media (max-width: 1100px) {
    .loan-program-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .loan-program-grid,
    .loan-detail-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .loan-program-item,
    .loan-detail-aside {
        padding: 24px;
    }

    .loan-category-nav {
        gap: 4px 20px;
        margin-bottom: 30px;
    }
}
