/* Shared mobile-first improvements for the public website. */
html {
    overflow-x: hidden;
}

body {
    min-width: 320px;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

/* Keep the floating navigation inside the viewport on narrow phones. */
#navbar {
    left: max(0.5rem, env(safe-area-inset-left));
    right: max(0.5rem, env(safe-area-inset-right));
}

#navbar > div {
    min-width: 0;
}

#navbar img {
    max-width: min(180px, 48vw);
}

/* Long article tables remain readable without forcing the page wider. */
.prose {
    min-width: 0;
    overflow-wrap: anywhere;
}

.prose img {
    height: auto;
}

.prose table {
    min-width: 520px;
}

@media (max-width: 767px) {
    #navbar {
        top: max(0.5rem, env(safe-area-inset-top));
    }

    #navbar > div {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    #mobile-menu {
        max-height: calc(100dvh - 5rem);
        overflow-y: auto;
    }

    /* Prevent the hero from creating a 650px+ blank area on smartphones. */
    .hero-grid {
        min-height: auto !important;
    }

    .hero-copy {
        width: 100%;
        max-width: none;
    }

    .hero-heading {
        font-size: clamp(2rem, 10vw, 3.25rem) !important;
        line-height: 1.08 !important;
    }

    .hero-heading > .whitespace-nowrap {
        white-space: normal !important;
    }

    .hero-badge-container {
        height: clamp(3.25rem, 16vw, 5.25rem) !important;
        max-width: 100% !important;
    }

    .hero-badge-item {
        max-width: 100%;
        white-space: normal !important;
        font-size: clamp(1.8rem, 9vw, 3.25rem) !important;
        line-height: 1 !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .hero-subtitle {
        font-size: clamp(1.1rem, 5vw, 1.625rem) !important;
    }

    .hero-image {
        width: min(88vw, 420px) !important;
        height: min(88vw, 420px) !important;
    }

    .hero-review-card {
        right: 0.25rem !important;
        width: min(16rem, calc(100vw - 2rem)) !important;
    }

    /* Stack search controls so inputs and buttons remain comfortably tappable. */
    form.mobile-stack {
        flex-direction: column;
    }

    form.mobile-stack > * {
        width: 100%;
    }

    .mobile-page-main {
        padding-top: 7rem !important;
    }

    .article-card {
        padding: 1.25rem !important;
        border-radius: 1.25rem !important;
    }

    .article-card h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
        overflow-wrap: anywhere;
    }

    .prose p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }

    .prose h2 {
        font-size: 1.45rem !important;
    }

    .prose h3 {
        font-size: 1.25rem !important;
    }

    .prose table {
        font-size: 0.875rem !important;
    }

    .floating-whatsapp {
        right: max(1rem, env(safe-area-inset-right));
        bottom: max(1rem, env(safe-area-inset-bottom));
        width: 3rem !important;
        height: 3rem !important;
        font-size: 1.5rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}