/* ═══════════════════════════════════════════════════════════════
   mobileNav.css
   WhatsApp-style mobile navigation for CONTENT PAGES ONLY.
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bottomnav-height: 60px;
    --bottomnav-bg: var(--nav-bg);
    --bottomnav-border: var(--border);
    --bottomnav-inactive: var(--text-muted);
    --bottomnav-active: #75b5fd;
}

/* ── Mobile search row (sits directly under the top bar) ── */
.mobile-search-row {
    display: none;
    position: sticky;
    top: 60px;
    z-index: 99;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
}

/* Pagefind trigger on mobile — full width, pill-shaped */
.mobile-search-row pagefind-modal-trigger {
    width: 100%;
    min-width: 0;
    max-width: none;
    border-radius: 20px;
    padding: 8px 14px;
}

.mobile-search-row pagefind-modal-trigger::before {
    left: 14px;
    width: 18px;
    height: 18px;
}

.mobile-search-row pagefind-modal-trigger::after {
    left: 42px;
    font-size: 0.95rem;
}

/* ── Bottom tab bar ── */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottomnav-height);
    background: var(--bottomnav-bg);
    border-top: 1px solid var(--bottomnav-border);
    z-index: 300;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-inner {
    display: flex;
    height: 100%;
    max-width: 640px;
    margin: 0 auto;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px 4px;
    color: var(--bottomnav-inactive);
    text-decoration: none;
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 500;
    transition: color 0.15s ease;
}
.bottom-nav-item:hover {
    color: var(--text-secondary);
    text-decoration: none;
}
.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 1px;
}
.bottom-nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 18px;
    border-radius: 14px;
    transition: background-color 0.15s ease;
}
.bottom-nav-item .nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bottom-nav-item.active {
    color: var(--bottomnav-active);
}
.bottom-nav-item.active .nav-icon {
    background: rgba(117, 181, 253, 0.18);
    background: color-mix(in srgb, var(--bottomnav-active) 18%, transparent);
}

/* ── Enable the mobile nav only on small screens ── */
@media (max-width: 768px) {
    .mobile-search-row {
        display: block;
    }
    .bottom-nav {
        display: block;
    }
    body.has-bottom-nav {
        padding-bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom, 0));
    }
    body.has-bottom-nav .left-sidebar {
        height: calc(100vh - var(--bottomnav-height) - env(safe-area-inset-bottom, 0));
        padding-bottom: 20px;
    }
}

/* ── Condensed footer on mobile ── */
@media (max-width: 768px) {
    .footer-content .footer-section:not(:last-child) {
        display: none;
    }
    .footer-content {
        display: flex;
        justify-content: center;
        text-align: center;
    }
    .footer-content .footer-section:last-child {
        max-width: 280px;
    }
}

/* ── Clearer hamburger icon ── */
.hamburger svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* ── Balance the top bar on small screens ── */
@media (max-width: 768px) {
    .top-nav {
        justify-content: space-between;
    }
    .hamburger {
        order: 3;
    }
}