/* =========================================================================
   responsive.css — breakpoints for tablet/mobile
   ========================================================================= */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 232px;
    }

    .main-content {
        padding: var(--space-6);
    }

    .grid--2 {
        grid-template-columns: 1fr;
    }
}

/* Mobile — collapse sidebar into a drawer */
@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .site-footer__top {
        /* Brand column moves to its own full-width row (see grid-column
           below) so the link groups get the full row to themselves —
           auto-fit adapts to however many groups actually exist instead
           of a fixed count that would wrap awkwardly if an admin adds
           or removes a footer_link_groups row later. */
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        text-align: left;
    }

    .site-footer__brand-col {
        grid-column: 1 / -1;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform var(--duration-base) var(--ease-standard);
        box-shadow: var(--shadow-elevated);
        /* Solid background + blur — the base .sidebar rule's near-transparent
           background is fine on desktop (sits beside equally-dark content),
           but as a fixed overlay on mobile it let page content show through. */
        background: var(--bg-elevated);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .topbar__menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        padding: 0 var(--space-4);
    }

    .main-content {
        padding: var(--space-4);
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .btn {
        align-self: flex-start;
    }

    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }

    .card {
        padding: var(--space-5);
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-4);
    }

    .site-footer__top {
        /* Smaller minimum than the 860px tier above so 3 short columns
           (e.g. Product/Company/Support) still fit side by side on a
           narrow phone screen instead of collapsing to a single column —
           brand column still spans the full row via the rule above. */
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }

    .btn {
        padding: 12px 16px;
    }

    .toast-stack {
        left: var(--space-4);
        right: var(--space-4);
        max-width: none;
    }

    /* Public marketing nav (index.php, pricing.php, contact.php, etc.) —
       the brand mark and button group each get their own full-width row
       instead of squeezing into one line, which previously overflowed
       and clipped items like "Contact" off-screen. */
    .public-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .public-nav > div:last-child {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Global safety net: nothing on the page should ever be able to force
   horizontal scroll/zoom-out on mobile, regardless of what causes it —
   this was the actual root cause of the public pages appearing
   "zoomed out" (an overflowing element was widening the whole page). */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Touch devices never get pointer-tilt (handled in tilt.js too, this is belt-and-suspenders) */
@media (hover: none) {
    .card--interactive:hover {
        transform: none;
    }
}
