/*
 * Mobile / tablet responsive fixes for the service landing pages:
 *   buildium, healthcare, cpa-accounting-firms, services-bookkeeping (offshore), cleanup-and-historic,
 *   hoa, propertyware, small-and-medium-business.
 *
 * Additive overrides only — nothing in the original stylesheets is changed. Linked last in common/header.blade.php
 * (after all other page CSS), so it wins the cascade on equal specificity.
 */

/* ---------- Global mobile polish ---------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

a,
button,
label,
summary,
[role="button"] {
    /* removes the 300 ms tap delay / double-tap zoom on iOS and Android */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

img,
video,
iframe {
    max-width: 100%;
}

/* ---------- Header nav, tablet landscape / small laptops (992–1439) ----------
 * The menu wrapped onto 2 lines at 1200–1439 (109px header on 1280/1366 screens and iPad Pro landscape),
 * and at 992–1199 it wrapped only in the fallback font, so the whole page jumped when Raleway loaded (CLS).
 * Keep it on one line with slightly tighter spacing — verified to fit in both fonts. */
@media (min-width: 992px) and (max-width: 1439px) {
    .vh-header .vh-nav {
        flex-wrap: nowrap;
    }

    .vh-header .vh-nav > li > a {
        white-space: nowrap;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .vh-header .vh-nav > li > a {
        letter-spacing: 0;
        padding: 6px 5px !important;
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .vh-header .vh-nav > li > a {
        font-size: 12px;
        letter-spacing: 0.01em;
        padding: 8px 8px;
    }
}

/* ---------- Cleanup "process" cards: the row-end arrow (::after, 350px box) ran 90–140px past the screen
 * at 1200–1440, giving the whole page a sideways scroll. Clip only horizontal overflow of that section. */
.process-worknear.clean-historic-bk {
    overflow-x: hidden;
    overflow-x: clip;
}

/* ---------- Tablet (768–1199): certification badges row no longer spills off both edges ---------- */
/* style.css (loaded after media.css) resets the gap to 100px, so 5 × 132px badges overflow a 970px container */
@media (min-width: 768px) and (max-width: 1199px) {
    .certificationlist ul {
        gap: 40px;
        flex-wrap: wrap;
    }
}

/* ---------- Tablet portrait: fixed-width container inside a padded wrapper overflowed by 22px ---------- */
@media (max-width: 991px) {
    .section_first > .container {
        max-width: 100%;
    }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {

    /* CPA: .row's -15px gutters inside a padding-less .container-fluid made the page scroll sideways */
    .payroll_processing_services .container-fluid.section_first > .row,
    .payroll_processing_services .container-fluid.section_first .container-fluid > .row {
        margin-left: 0;
        margin-right: 0;
    }

    /* CPA "Success Story" card: long pill button was cut off by the card's overflow:hidden */
    .new-cta .cta-box {
        padding: 24px 18px !important;
    }

    .new-cta .cta-box .btn,
    .new-cta .cta-box .btn-lg {
        white-space: normal;
        max-width: 100%;
        line-height: 1.35;
        padding: 12px 20px;
        font-size: 16px;
    }

    .new-cta .cta-box h2 {
        font-size: 24px;
        line-height: 1.3;
    }

    /* CPA cost-comparison table: 40px cell padding forced a sideways scroll at 345px */
    .cpa-bookkeeping .cpa_firms_sction > table.table > thead > tr > th,
    .cpa-bookkeeping .cpa_firms_sction > table.table > tbody > tr > th,
    .cpa-bookkeeping .cpa_firms_sction > table.table > tbody > tr > td {
        padding: 10px 8px;
        font-size: 13px;
        line-height: 1.4;
    }

    .cpa_firms_sction > table.table {
        -webkit-overflow-scrolling: touch;
    }

    /* Justified text leaves wide gaps ("rivers") in narrow columns */
    .sec_align_jus,
    .data_scurity_content p,
    .sec_non_services_content ul li,
    .sec_non_services_content li.why_choose_title {
        text-align: left !important;
        word-spacing: normal;
        -webkit-hyphens: auto;
        hyphens: auto;
    }

    /* Healthcare: section h2s had no size class and fell back to Bootstrap's 30px (5–7 lines on a phone) */
    .healthcare-bg ~ section h2,
    .healthcare-bg ~ div h2 {
        font-size: 22px;
        line-height: 1.3;
    }

    /* same headings that also carry the .fs-30 utility (font-size:30px !important) */
    .healthcare-bg ~ section h2.fs-30,
    .healthcare-bg ~ div h2.fs-30 {
        font-size: 22px !important;
    }

    /* Cleanup FAQ heading (same 30px fallback) */
    .cleanup_faq > .container > h2.center_heading {
        font-size: 22px;
        line-height: 1.3;
    }

    /* Offshore page "In-House Bookkeeping" heading */
    .sec_array_challenge h3.sec-three-head.fs-28 {
        font-size: 22px !important;
        line-height: 1.35;
    }

    /* Propertyware trust strip: the intro line was dark-on-navy (near invisible) */
    .trust-banner-badge .trust-banner > p {
        color: #fff;
        font-size: 16px;
        line-height: 1.45;
    }

    /* Readable minimum text sizes (was 10–11px) */
    .hoa-feature-content .hoa-feature-text {
        font-size: 13px;
        line-height: 1.5;
    }

    .ps-badge {
        font-size: 12px;
    }

    .security-table td,
    .security-table .security-cell > span {
        font-size: 13px;
        line-height: 1.45;
    }

    /* Cookie banner buttons were 10px text */
    #sec_cookie .common_cookie,
    #sec_cookie .customize_cookie {
        font-size: 13px;
        min-height: 40px;
    }

    /* Tap targets ≥ 24px (WCAG 2.2 / Lighthouse) for small inline links */
    .ft-company-links a,
    .ft-legal a,
    .ft-contact-value,
    .vh-contact .vh-email,
    .review-card .read-more,
    .faqspan a {
        display: inline-block;
        min-height: 24px;
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .panel-title > a.accordion-toggle {
        display: block;
        min-height: 24px;
        padding-top: 2px;
        padding-bottom: 2px;
    }

    /* Testimonial carousel arrows: bigger touch area */
    .review-carousel .owl-nav button,
    .review-carousel .owl-nav > div {
        min-width: 36px;
        min-height: 36px;
    }
}

/* ---------- Buildium comparison tables: keep a normal table on phones, scrolled sideways ----------
 * buildium-accounting.css turns .security-table into stacked cards below 768px; this restores the
 * table layout from custom.css (fixed 760px / 700px table inside a horizontally scrolling wrapper). */
@media (max-width: 767px) {
    .buildium-page div.security-table-wrap {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }

    .buildium-page .security-table-wrap .security-table {
        display: table;
        width: 760px;
        min-width: 760px;
        table-layout: fixed;
    }

    .buildium-page .security-table-wrap .security-table thead {
        display: table-header-group;
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .buildium-page .security-table-wrap .security-table tbody {
        display: table-row-group;
        width: auto;
    }

    .buildium-page .security-table-wrap .security-table thead tr {
        display: table-row;
        width: auto;
        min-width: 0;
    }

    .buildium-page .security-table-wrap .security-table tbody tr {
        display: table-row;
        width: auto;
        margin: 0;
        border: 0;
        border-bottom: 1px solid #e7e7e7;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }

    .buildium-page .security-table-wrap .security-table tbody tr:nth-child(even) {
        margin: 0;
        border: 0;
        border-bottom: 1px solid #e7e7e7;
        border-radius: 0;
        background: #fafafa;
    }

    .buildium-page .security-table-wrap .security-table tbody tr:last-child {
        border-bottom: 0;
    }

    .buildium-page .security-table-wrap .security-table th,
    .buildium-page .security-table-wrap .security-table td {
        display: table-cell;
        width: auto;
        min-width: 0;
    }

    .buildium-page .security-table-wrap .security-table td {
        border: 0;
        padding: 14px 16px;
    }

    .buildium-page .security-table-wrap .security-table td:first-child {
        background: transparent;
        color: #323232;
        font-weight: 600;
    }

    /* column labels are in the header again */
    .buildium-page .security-table-wrap .security-table td[data-label]::before {
        content: none;
        display: none;
    }
}

@media (max-width: 480px) {
    .buildium-page .security-table-wrap .security-table {
        width: 700px;
        min-width: 700px;
    }
}

/* ---------- Small phones (iPhone SE / 320–400px) ---------- */
@media (max-width: 400px) {

    /* Propertyware trust links (nowrap + 18px) ran 20px past the screen at 320px */
    .trust-banner-list li {
        white-space: normal;
        margin-left: 8px;
        margin-right: 8px;
    }

    .trust-banner-list .trust-link {
        font-size: 16px;
    }
}
