/* SB Tech Associates — mobile compatibility */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Touch targets */
.nav-menu-btn,
.filter-pill,
.mobile-menu-close,
.mobile-menu-nav a,
.mobile-menu-cta,
.mobile-menu-phone,
.bci-gate__btn {
    min-height: 44px;
    min-width: 44px;
}

.nav-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 110;
    color: #024f7c;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-shrink: 0;
}

/* Mobile menu overlay */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex !important;
    pointer-events: none;
}

.mobile-menu.hidden {
    display: none !important;
}

.mobile-menu:not(.hidden) {
    pointer-events: auto;
}

.mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 13, 24, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-menu.is-open .mobile-menu-backdrop {
    opacity: 1;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(100%, 20rem);
    height: 100%;
    max-height: 100dvh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: calc(5rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.12);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: calc(1rem + env(safe-area-inset-top, 0px));
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    color: #024f7c;
    border-radius: 9999px;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-nav a {
    display: flex;
    align-items: center;
    padding: 0.85rem 0;
    font-size: 1.05rem;
    font-weight: 500;
    color: #024f7c;
    border-bottom: 1px solid rgba(2, 79, 124, 0.08);
    text-decoration: none;
}

.mobile-menu-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    padding: 0.9rem 1.25rem;
    border-radius: 1rem;
    background: #024f7c;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
}

.mobile-menu-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(2, 79, 124, 0.15);
    color: #024f7c !important;
    font-weight: 600;
    text-decoration: none;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* iOS form zoom fix */
@media (max-width: 767px) {
    .form-field input,
    .form-field select,
    .form-field textarea,
    .sidebar-newsletter-input,
    .footer-newsletter-input {
        font-size: 16px !important;
    }
}

/* Homepage hero — full-bleed background photo behind text (index.html) */
@media (max-width: 1023px) {
    .hero-clean {
        padding-bottom: 0;
    }

    .section-inner {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .section-space {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* Insights filter chips — horizontal scroll on small screens (pillar row only) */
@media (max-width: 639px) {
    .insights-filter-pills.insights-filter-row {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.35rem;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        scrollbar-width: none;
    }

    .insights-filter-pills.insights-filter-row::-webkit-scrollbar {
        display: none;
    }

    .insights-filter-pills .filter-pill {
        flex-shrink: 0;
        white-space: nowrap;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .insights-filter-menu-panel {
        min-width: 14rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Sidebar: no sticky on mobile */
@media (max-width: 1023px) {
    .insights-sidebar-sticky {
        position: static !important;
        top: auto !important;
    }
}

/* Article tables scroll */
.article-prose .table-wrap,
.article-prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-prose table {
    min-width: 32rem;
}

/* Footer legal links on dark background */
.site-footer .footer-legal-link,
.site-footer a.footer-legal-link {
    color: rgba(148, 163, 184, 0.95) !important;
}

.site-footer .footer-legal-link:hover {
    color: #fff !important;
}

/* Contact mobile bar */
@media (max-width: 767px) {
    .contact-mobile-bar a {
        min-height: 48px;
        font-size: 0.75rem;
    }
}

/* BCI gate safe areas */
.bci-gate-open {
    height: 100dvh;
}

.bci-gate__footer {
    padding-bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px));
}

/* About page */
@media (max-width: 479px) {
    .about-hero-title {
        max-width: none;
    }

    .practice-strip {
        grid-template-columns: 1fr !important;
    }

    .achieve-grid {
        grid-template-columns: 1fr !important;
    }

    .offices-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Expertise panels */
@media (max-width: 639px) {
    .area-panel-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .area-panel-cta a {
        width: 100%;
        justify-content: center;
        text-align: center;
        min-height: 44px;
    }

    .expertise-section,
    .why-choose,
    .expertise-hero {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

/* Legal pages — add hamburger alongside back link */
.legal-nav .nav-menu-btn {
    margin-left: auto;
}