/**
*
* Custom styles added outside of build process
*
* TODO: consolidate .nav-tabs styles once tab styles are finalized
**/

/** 
* ====================================================
* Our History
* ====================================================
**/

.our-history-timeline__container {

    --timeline-border-color: var(--mb-primary);
    --timeline-dot-color: var(--mb-primary);
    --timeline-dash-color: var(--mb-primary);

    border-left: 2px solid var(--timeline-border-color);

    li {
        position: relative;
    }

    /* timeline connector - dot */
    >ul>li:not(:has(ul)) {

        :before {
            content: ' ';
            display: block;
            position: absolute;
            left: -2.45rem;
            top: 0.30rem;
            bottom: 0;
            width: 1rem;
            height: 1rem;
            background: var(--timeline-dot-color);
            border-radius: 50%;
        }
    }

    /* timeline connector - dash */
    >ul>li>ul {
        :before {
            content: '';
            display: block;
            position: absolute;
            left: -3.8rem;
            top: 0.75rem;
            width: 2.5rem;
            height: 2px;
            background-image: repeating-linear-gradient(to right,
                    var(--timeline-dash-color) 0,
                    var(--timeline-dash-color) 5px,
                    transparent 5px,
                    transparent 8px);
        }
    }
}


/** 
* ====================================================
* Housing Report
* ====================================================
**/

.market-report-card {
    aspect-ratio: 1 / 1;
    border: 1px solid black;
    max-width: 280px;

    img {
        max-height: 120px;
    }
}

/** 
* ====================================================
* Office Page
* ====================================================
**/

.office-page {

    /* Page specific utility variables and utility classes */
    --off-white: #f1f1f1;

    .sub-heading-48 {
        /* @include font-size(48px); */
        font-size: 48px;
    }

    .sub-heading-27 {
        /* @include font-size(27px); */
        font-size: 27px;
    }

    .sub-small-15 {
        /* @include font-size(15px); */
        font-size: 15px;
    }

    .row-gap-sm-40 { 
      @media (min-width: 576px) { 
        row-gap: 60px; 
      } 
    }

    .full-width-bg-gray {
        position: relative;

        &::after {
            content: " ";
            background-color: var(--off-white);
            position: absolute;
            width: 100vw;
            top: 0px;
            height: 100%;
            left: calc(-50vw + 48.53%);
            z-index: -1;
        }
    }

    /* Tab Navigation Styles */
    .office-page-tabs {

        --mb-nav-link-padding-x: 0.75rem;
        overflow-x: scroll;
        margin-bottom: 30px;
        scrollbar-width: none;
        border-bottom: none;
        flex-wrap: nowrap;

        .nav-item {
            text-align: center;
            white-space: nowrap;
        }

        .nav-link {
            background: none;
            border: none;
            border-radius: 0;
            font-family: var(--mb-font-sans-serif);
            color: var(--mb-body-color);
            text-decoration: none;

            h4 {
                display: inline-block;
                margin: 0;
                padding-bottom: 10px;
                border-bottom: 2px solid transparent;
            }

            &.active h4 {
                background: none;
                border: none;
                border-bottom: 2px solid var(--mb-body-color);
                color: var(--mb-primary);
            }

            &:hover h4 {
                color: var(--mb-primary);
                background: none;
            }
        }

        /* @include media-breakpoint-up(md) */
        @media (min-width: 768px) {
            gap: 10px;
        }
    }

    .office-card-container {
        img {
            max-width: 340px;
            aspect-ratio: 4 / 3;
        }
    }


    .agent-card-row:not(:last-child) {
        margin-bottom: 30px;
    }

    .agent-card-container {

        display: flex;
        flex-direction: column;

        /* Bootstrap 5 sm breakpoint */
        @media (max-width: 575px) {
            max-width: 320px;
        } 
        

        .agent-image {
            aspect-ratio: 3 / 4;
            overflow: hidden;
        }
        
        .agent-name {
            min-height: 50px;
            white-space: nowrap;
            flex-grow: 1;
        }

        .agent-location {
            min-height: 45px;
        }

        a {
            text-decoration: none;
            border-color: var(--mb-dark-gray) !important;

            &:hover {
                text-decoration: underline;
                color: var(--mb-primary);
            }
        }

        .agent-location-container {
            p {
                line-height: 1.3;
            }
        }
    }

    /* Email Us tab */
    .email-us-staff-card-container {
        img {
            max-width: 160px;
        }
    }

    .email-us-form-container {

        textarea {
            height: 200px;
            width: 100%;
            resize: none;
            overflow-y: auto;
            border-top-width: 1px !important;
        }

        input {
            border-color: var(--mb-dark-gray) !important;
        }

        ::placeholder {
            color: var(--mb-dark-gray-2);
        }
    }

    /* Our Agents Tab */
    .agent-search-form-container {

        input {
            border-color: var(--mb-dark-gray) !important;
        }

        .agent-search-text {
            grid-template-columns: auto fit-content(40%);

            @media (max-width: 575px) {
                grid-template-columns: initial;
                grid-template-rows: 1fr 1fr;
            }
        }

    }


    /* Our Team Tab */

    .staff-members-container {

        /* md and above */
        @media (min-width: 576px) {
            border-top: none;
            /* Present borders differently depending on number of columns staff member columns */
    
            /* If there are 4 columns show left border on all but first and last */
            &:has(.staff-column:last-child:nth-child(4)) {
                .staff-column:not(:last-child):not(:first-child) {
                    border-left: 1px solid var(--mb-light-gray-1);
                }
            }

            /* If there are 3 columns show left border on all but first */
            &:has(.staff-column:last-child:nth-child(3)) {
                .staff-column:not(:first-child) {
                    border-left: 1px solid var(--mb-light-gray-1);
                }
            }

            /* If there are 2 columns show left border on all but first */
            &:has(.staff-column:last-child:nth-child(2)) {
                .staff-column:not(:first-child) {
                    border-left: 1px solid var(--mb-light-gray-1);
                }
            }

        }
        

    }
    .staff-column {

        /* sm and below */
        @media (max-width: 575px) {
            &:not(:first-child) h3 {
                border-top: 1px solid var(--mb-light-gray-1);
                padding-top: 15px;
            }
        }

        /* lg and above */
        @media (min-width: 992px) {
            &:not(:first-child) {
                border-left: 1px solid var(--mb-light-gray-1);
            }
        }

        .agent-card-row {
            display: flex;
            justify-content: center;
        }

        .staff-heading-row h3 {
            @media (max-width: 575px) {
                text-align: center;
            }

        }
        
    }

    .find-agent-cta {
        small {
            display: block;
            line-height: 1.6;
            max-width: 840px;
        }

    }

}

/**
* ====================================================
* Pre-Approval Process Page
* ====================================================
**/

.pre-approval-process-page {

    @media (min-width: 576px) {
        .border-sm-top {
            border-top: 1px solid var(--mb-dark-gray) !important;
        }
    }

    .pre-approval-form {
        input {
            border-color: var(--mb-dark-gray) !important;
            line-height: 1;
        }

        textarea {
            margin-top: 15px;
            height: 8.7rem;
            width: 100%;
            resize: none;
            overflow-y: auto;
            border-color: var(--mb-dark-gray) !important;

            @media screen and (min-width: 992px) {
                height: 8.85rem;

            }

            @media screen and (min-width: 768px) {
                margin-top: 2.15rem;
            }

        }

        ::placeholder {
            color: var(--mb-light-gray-1);
        }

    }

    .logo-button-container {
        --img-width: 720px;

        max-width: var(--img-width);
        margin: 0 auto;

        a {
            width: fit-content;
            position: relative;
            right: 76px;

            /* center button on small screens */
            @media screen and (max-width: 768px) {
                right: 18px;

            }
        }

        img {
            max-width: var(--img-width);
            height: auto;

            @media screen and (max-width: 768px) {
                position: relative;
                right: 20px;
            }
        }
    }
}


/**
* ====================================================
* Explore Our Communities Pages
* ====================================================
**/

.explore-our-communities-home {

    /* Tab Navigation Styles */
    .nav-tabs {

        .nav-item {

            @media screen and (max-width: 576px) {
                width: 100% !important;
            }

        }
    }

    .community-card {

        .community-card-image {
            &::after {
                content: "";
                display: block;
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                height: 70%;
                background: linear-gradient(to top, #000000 7%, transparent 100%);
                border-radius: 4px;
                opacity: 0.7;
            }
        }
    }
}

/**
* ====================================================
* Explore Our Communities Pages
* ====================================================
**/

.explore-our-communities-home {

    /* Tab Navigation Styles */
    .nav-tabs {
        border-bottom: none;

        .nav-item {

            @media screen and (max-width: 576px) {
                /* width: 100% !important; */
            }            

            .nav-link {
                border: none;
                background: none;
                color: #000;
                text-decoration: none;
                border-radius: 0;
                font-family: "mencken-std", Times, "Times New Roman", Georgia, serif;
            
                p {
                    border-bottom: 2px solid transparent;
                }

                &:hover p {
                    color: var(--mb-primary);
                    border-bottom: 2px solid transparent;
                    background: none;
                }

                &.active p {
                    color: var(--mb-primary);
                    background: none;
                    border: none;
                    border-bottom: 2px solid var(--mb-body-color);
                }
            }
        }
    }

    .community-card {

        position: relative;
        transition: transform 0.3s ease;
        overflow: hidden !important;

        .community-card-text {

            background: linear-gradient( to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 63%, rgba(0, 0, 0, 0) 100%);

            .community-card-text-subheading {
                font-size: 0.75em;
            }

            h5 {
                font-family: var(--mb-font-sans-serif);
            }
        }
     
        &:hover {
            cursor: pointer;
            img {
                transition: transform 0.3s ease;
                cursor: pointer;
                transform: scale(1.05);
            }
        }
    }
}

.explore-our-communities-detail-page {

    --light-gray-4: #9D9A98;

    .property-search-form {

        select, input {
            border-color: var(--mb-dark-gray) !important;
        }

        select {
            color: var(--mb-dark-gray-2);
        }

        /* Change text color when option is selected */
        select:has(option:not(:first-child):checked) {
            color: var(--mb-body-color);
        }


        ::placeholder {
            color: var(--mb-dark-gray-2);
        }
       
    }

    /* Tab Navigation Styles */
    .nav-tabs {
        border-bottom: none;

        .nav-item {

            @media screen and (max-width: 576px) {
                /* width: 100% !important; */
            }            

            .nav-link {
                border: none;
                background: none;
                color: #000;
                text-decoration: none;
                border-radius: 0;
                font-family: "mencken-std", Times, "Times New Roman", Georgia, serif;
            
                p {
                    border-bottom: 2px solid transparent;
                }

                &:hover p {
                    color: var(--mb-primary);
                    border-bottom: 2px solid transparent;
                    background: none;
                }

                &.active p {
                    color: var(--mb-primary);
                    background: none;
                    border: none;
                    border-bottom: 2px solid var(--mb-body-color);
                }
            }
        }
    }

    .school-info-table {
        th, td, tbody > tr {
            border-collapse: collapse;
            border: none;
            white-space: nowrap;
            /* font-family: "mencken-std", Times, "Times New Roman", Georgia, serif; */
        }

        thead tr:last-child, tfoot tr:last-child {
            border-color: var(--light-gray-4) !important;
        }
    }

    .school-info-disclaimer {
        max-width: 960px;

        .smaller {
            font-size: 0.75rem;
        }
    }

}

/** 
* ====================================================
* Find Your Local Office Page
* ====================================================
**/

.find-your-local-office {

    /* possibly add utiltity class for responsive font sizes */
    .sub-heading-27 {
        /* @include font-size(27px); */
        font-size: 27px;
    }

    .office-search-form {
        select {
            border-color: var(--mb-dark-gray) !important; 
        }
    }

    a.office-card-container:hover {
        cursor: pointer;
    }

    .office-card-container {
        gap: 30px;

        p,h3 {
            font-family: var(--mb-font-sans-serif) !important;
            line-height: 1.3;
        }

        .office-card-image-container {
            img {
                max-width: 270px;
                width: 100%;
                height: 100%;
                aspect-ratio: 15/11;
            }
        }
    }
}

/** 
* ====================================================
* First to know landing page
* ====================================================
**/

.first-to-know-landing {

    .sub-small-12 {
        /* @include font-size(12px); */
        font-size: 12px !important;
    }

    .sub-heading-24 {
        /* @include font-size(24px); */
        font-size: 24px !important;
    }

    .first-to-know-header {
        line-height: 1.1;
    }


    .first-to-know-signup-form {
        bottom: 0;
        margin: 0; 
        input {
            border-color: var(--mb-dark-gray) !important;
        }

        input[type="checkbox"] + label {
            line-height: 1.2;
        }

        ::placeholder {
            color: var(--mb-gray);
        }

        /* @include media-breakpoint-up(sm) { ... } */
        @media (min-width: 576px) { 
            position: absolute
         }
    }

    /* Accordion menu styles */
    .accordion {
        border-top: 1px solid var(--mb-dark-gray);
        border-bottom: 1px solid var(--mb-dark-gray);

        .accordion-item {
            border-color: var(--mb-dark-gray) !important;
        }

        .accordion-button {
            gap: 10px;
            &::after {
                display: none;
            }
            &:not(.collapsed) {
                color: var(--mb-primary);
                background-color: transparent;
                box-shadow: none;
            }
            .bi-chevron-up {
                color: var(--mb-black);
                opacity: 0.5;
                transition: transform 0.2s ease-in-out;
                transform: rotate(180deg);
            }

            &:not(.collapsed) .bi-chevron-up {
                transform: rotate(0deg);
            }
        }
    }    
}

/** 
* ====================================================
* Your Homesuite
* ====================================================
**/

/* todo: change main class name? */
.your-homesuite {

    /* Page specific utility classes */
    .sub-heading-27 {
        /* @include font-size(27px); */
        font-size: 27px;
    }

    .sub-heading-17 {
        /* @include font-size(17px); */
        font-size: 17px;
    }
    
    .sub-small-11 {
        /* @include font-size(11px); */
        font-size: 11px;
    }

    .sub-small-12 {
        /* @include font-size(12px); */
        font-size: 12px;
    }

    .card-box-shadow-2 {
        box-shadow: 0px 4px 6px 3px rgba(0, 0, 0, 0.13);
    }

    .page-intro-text {
        p {
            max-width: 910px;
            margin: auto;
        }
    }

    /* Swiper container */
    .swiper-wrapper {
        align-items: end;
        justify-content: center;
        gap: 50px;
    }
    
    /* Center logos within slides */
    .homesuite-logo-card {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;

        a {
            width: 100%;
            height: 100%;
        }
    }

    .homesuite-logo-card img:not(.mich-title-img) {
        max-height: 70px;
        width: auto;
        object-fit: cover;
    }

    .mich-title-img  {
        position: relative;
        max-height: 120px;
        top: 0px;
        left: -32px;
    }

    /* Homesuite Signup Form */
    .homesuite-signup-form {

        input, textarea {
            &::placeholder {
                color: var(--mb-light-gray-1);
            }
            border-color: var(--mb-dark-gray);
        }
        .terms-disclaimer {
            line-height: 1.1;
        }
    }

    .homesuite-form-copy {
        max-width: 500px;

        @media screen and (max-width: 576px) {
            text-align: center;
            margin-bottom: 0px auto 40px auto;
        }
    }
}

/** 
* ====================================================
* Past Housing Reports
* ====================================================
**/

.past-housing-reports {

    /* Page specific utility classes */

    
    /* Tab Navigation Styles */
    .nav-tabs {
        border-bottom: none;

        .nav-row {
            /* --mb-nav-link-padding-x: 0.75rem; */
            /* margin-bottom: 30px; */
            overflow-x: scroll;
            scrollbar-width: none;
            border-bottom: none;
            flex-wrap: nowrap;
        }
        

        .nav-item {

            @media screen and (max-width: 576px) {
                /* width: 100% !important; */
            }            

            .nav-link {
                border: none;
                background: none;
                color: #000;
                text-decoration: none;
                border-radius: 0;
                font-family: "mencken-std", Times, "Times New Roman", Georgia, serif;
            
                p {
                    white-space: nowrap;
                    border-bottom: 2px solid transparent;
                }

                &:hover p {
                    color: var(--mb-primary);
                    border-bottom: 2px solid transparent;
                    background: none;
                }

                &.active p {
                    color: var(--mb-primary);
                    background: none;
                    border: none;
                    border-bottom: 2px solid var(--mb-body-color);
                }
            }
        }
    }

    .housing-report-card {

        position: relative;
        transition: transform 0.3s ease;
        overflow: hidden !important;

        a {
            cursor: pointer;
            text-decoration: none;
            border-color: var(--mb-dark-gray) !important;

            &:hover {
                text-decoration: underline;
                color: var(--mb-primary);
            }
        }

        .housing-report-card-text {
            h5 {
                font-family: var(--mb-font-sans-serif);
            }
        }
    }

}

/** 
* ====================================================
* Prepare to shop for a home
* ====================================================
**/

.shop-for-home-buy-sell {

    .home-buy-sell-accordion ul {
        list-style: none;
        padding-left: 0;

        li {
            position: relative;
            padding-left: 25px;

            &::before {
                content: "";
                display: block;
                position: absolute;
                left: 0;
                top: 8px;
                width: 12px;
                height: 12px;
                border: 1px solid var(--mb-dark-gray-2);
                border-radius: 2px;
                background-color: transparent;
            }
        }
    }

    #movingOutOfAreaFormModal {
        --mb-border-color: var(--mb-dark-gray-2);

        a:not(:hover) {
            color: var(--mb-dark-gray-2);
        }

        .modal-body {
            padding: 60px 30px;
            border-radius: var(--mb-modal-border-radius);
        }

        .modal-text {
            font-size: 15px;
            font-weight: 500;
        }

        .modal-form-header {
            margin-bottom: 25px;
        }

        .modal-form-row {
            margin-bottom: 25px;
        }

        .agent-find-languages {
            row-gap: 0.5rem;
            margin-bottom: 15px;
        }

        .agent-find-languages .modal-text {
            margin-bottom: 5px;
        }

        .agent-find-submit {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
        }

        .agent-find-submit .modal-text {
            margin-bottom: 0;
            font-style: italic;
        }

        .form-control,
        .form-select {
            font-size: 15px;
        }

        .form-check {
            font-size: 15px;
        }

        .moving-services-intro {
            margin-bottom: 20px;
        }

        .moving-services {
            margin-bottom: 30px;
        }

        

        .form-check label {
            margin-left: 5px;
        }

        textarea.form-control {
            overflow-y: auto;
            overflow-x: hidden;
            height: 200px;
            padding: 10px;
            color: var(--mb-dark-gray);
            line-height: 1.6;
            border: 1px solid var(--mb-border-color);
        }

        .terms-disclaimer {
            color: var(--mb-black);
        }
    }


    /* Accordion menu styles */
    .accordion {
        border-top: 1px solid var(--mb-dark-gray);
        border-bottom: 1px solid var(--mb-dark-gray);

        .accordion-item {
            border-color: var(--mb-dark-gray) !important;
        }

        .accordion-button {
            gap: 10px;

            &::after {
                display: none;
            }

            &:not(.collapsed) {
                color: var(--mb-primary);
                background-color: transparent;
                box-shadow: none;
            }

            .bi-chevron-up {
                color: var(--mb-black);
                opacity: 0.5;
                transition: transform 0.2s ease-in-out;
                transform: rotate(180deg);
            }

            &:not(.collapsed) .bi-chevron-up {
                transform: rotate(0deg);
            }
        }
    }

    .cta-section {

        h5 {
            font-family: "mencken-std", Times, "Times New Roman", Georgia, serif;
        }
        
        .cta-content {
            max-width: 1024px;
            margin: auto;
            box-shadow: 0px 4px 6px 3px rgba(0, 0, 0, 0.13);

            border-radius: 10px;
        }
    }
}