/* ==========================================================================
   Layout / alignment fixes (2026-11-16)
   Loaded with a filemtime version from functions.php, because the child
   style.css is enqueued unversioned and cached for a year.
   ========================================================================== */

/* --- Top bar: phone number and Log In button on one centre line ----------
   flexmls puts an inline style="margin-top:15px" on .flexmls_dialog__buttons,
   which pushed the button ~7px below the phone number (desktop and mobile).
   Inline style, so !important is the only way to override it. Keep the bar's
   original 47px height. */
html body .xs-top-nav.wtp-mls-login-wrapper .flexmls_dialog__buttons {
    margin: 0 !important;
}
html body .xs-top-nav.wtp-mls-login-wrapper .sc_content_container {
    min-height: 47px;
    align-items: center;
}
html body .xs-top-nav.wtp-mls-login-wrapper .sc_content_container > .vc_row {
    align-items: center;
}
html body .xs-top-nav.wtp-mls-login-wrapper .wtp_phone_link,
html body .xs-top-nav.wtp-mls-login-wrapper button.portal-button-primary {
    bottom: 0;
}

/* --- Sidebar "Get In Touch": keep the mail icon on the address's line ----
   At phone width the address (+0.5px letter-spacing) was ~4px wider than the
   box, so it wrapped under its icon. */
.sidebarList a[href^="mailto:"] {
    letter-spacing: normal;
    white-space: nowrap;
}
@media (max-width: 374px) {
    .sidebarList a[href^="mailto:"] {
        font-size: 0.9em;
    }
}

@media (max-width: 767px) {

    /* --- Homepage hero: three equal-width buttons, 2 + 1, evenly spaced ---
       The hero has a fixed height, so a single stacked column overflows it;
       keep the original two rows but make the buttons the same width with an
       even gap. */
    html body #wtp_hero .wtp-media-button-wrapper .wtp-media-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        padding-top: 20px;
    }
    html body .wtp-media-button-wrapper .wtp-media-buttons a.wtp_button,
    html body .scheme_default .wtp-media-button-wrapper .wtp-media-buttons a.wtp_button {
        flex: 0 0 min(150px, calc(50% - 6px));
        margin: 0;
        padding-left: 8px;
        padding-right: 8px;
        text-align: center;
        box-sizing: border-box;
    }

    /* Very narrow phones (the theme already shortens the labels to "Contact"
       and "Search" at 320px): all three on one row. */
    @media (max-width: 359px) {
        html body #wtp_hero .wtp-media-button-wrapper .wtp-media-buttons {
            gap: 8px;
            padding-left: 12px;
            padding-right: 12px;
            box-sizing: border-box;
        }
        html body .wtp-media-button-wrapper .wtp-media-buttons a.wtp_button,
        html body .scheme_default .wtp-media-button-wrapper .wtp-media-buttons a.wtp_button {
            flex-basis: calc((100% - 16px) / 3);
            padding-left: 4px;
            padding-right: 4px;
        }
    }

    /* --- Listing page: Virtual Tours full width like Print / Schedule /
       Ask A Question below it ------------------------------------------- */
    .flexmls_connect__listing_details_page .flexmls_connect__right {
        float: none;
        width: 100%;
        text-align: left;
    }
    .flexmls_connect__listing_details_page .flexmls_connect__right button.tour_click {
        display: block;
        width: 100%;
        margin: 0 0 0.8em;
    }
}
