/* Mobile navigation — shared by the homepage and every page-nav page.
 *
 * The desktop link rows disappear below Tailwind's `md` breakpoint (768px), so
 * below that width this toggle and panel are the only route to Features,
 * Calculator, Guides, Pricing and Support. Plain CSS: the site ships no build
 * step for stylesheets.
 */

/* Anchors the absolutely positioned panel on the homepage; the page-nav header
   is sticky and is already a containing block. */
.site-nav {
    position: relative;
}

.mobile-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid rgba(0, 104, 92, 0.22);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.75);
    color: #00685c;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.mobile-nav-toggle:hover {
    background: #ffffff;
    border-color: rgba(0, 104, 92, 0.45);
}

.mobile-nav-toggle:focus-visible {
    outline: 2px solid #00685c;
    outline-offset: 2px;
}

.mobile-nav-toggle svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-toggle .mobile-nav-icon-menu,
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon-close {
    display: block;
}

.mobile-nav-toggle .mobile-nav-icon-close,
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon-menu {
    display: none;
}

/* Absolute, so opening the panel cannot change the header's measured height —
   the homepage feeds header.offsetHeight into --site-header-h. */
.mobile-nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    max-height: calc(100vh - 100% - var(--grok-banner-h, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(188, 201, 197, 0.6);
    border-bottom: 1px solid rgba(188, 201, 197, 0.6);
    background: #fcf9f5;
    box-shadow: 0 24px 40px rgba(27, 28, 28, 0.12);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.mobile-nav-link,
.mobile-nav-cta {
    display: flex;
    align-items: center;
    min-height: 48px;
    font-family: inherit;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.mobile-nav-link {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(188, 201, 197, 0.35);
    font-size: 1rem;
    font-weight: 600;
    color: #4a6360;
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
    color: #00685c;
    background: rgba(111, 216, 199, 0.12);
}

.mobile-nav-link:focus-visible,
.mobile-nav-cta:focus-visible {
    outline: 2px solid #00685c;
    outline-offset: -2px;
}

.mobile-nav-cta {
    justify-content: center;
    margin: 1rem 1.5rem 1.25rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    background: #00685c;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #ffffff;
}

.mobile-nav-cta:hover {
    background: #008375;
}

.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(27, 28, 28, 0.35);
}

/* `has-mobile-nav` is set by mobile-nav.js. Everything below is gated on it so
   a page that never runs the script keeps the links it already had. */
@media (max-width: 767.98px) {
    .has-mobile-nav .mobile-nav-toggle {
        display: inline-flex;
    }

    .has-mobile-nav .mobile-nav-panel:not([hidden]),
    .has-mobile-nav .mobile-nav-backdrop:not([hidden]) {
        display: block;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    /* page-nav pages: the desktop link row is replaced by the panel, so the
       header stays a single row instead of stacking (site-pages.css). */
    .has-mobile-nav .page-nav-inner {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .has-mobile-nav .page-links {
        display: none;
    }
}

@media (max-width: 400px) {
    .mobile-nav-actions .site-nav-cta {
        padding-right: 0.7rem;
        padding-left: 0.7rem;
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-nav-toggle {
        transition: none;
    }
}
