/* ═══════════════════════════════════════════════════════════
   Mobile bottom navigation — a fixed bar of icon+label items
   The phone companion to the dark sidebar (nav.css): 4–5 primary
   destinations across the bottom, optionally with a raised center
   action. The look (.tn-bottom-nav) is separate from the fixed
   positioning (.tn-bottom-nav--fixed) so it can also be embedded.
   ═══════════════════════════════════════════════════════════ */

.tn-bottom-nav {
    display: flex;
    align-items: flex-end;
    background: var(--tn-bg-card);
    border-top: 1px solid var(--tn-border);
    box-shadow: var(--tn-shadow-lg);
    padding: 4px 0 8px;
}

/* Pin to the bottom of the viewport (the usual case) */
.tn-bottom-nav--fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--tn-z-fixed-nav);
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

/* Items — equal width, icon over label */
.tn-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--tn-text-secondary);
    font-size: 0.65rem;
    text-decoration: none;
    text-align: center;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--tn-transition);
}

.tn-bottom-nav-item i {
    font-size: 1.2rem;
}

.tn-bottom-nav-item:hover {
    color: var(--tn-text-primary);
}

.tn-bottom-nav-item.is-active {
    color: var(--tn-accent);
}

.tn-bottom-nav-item:focus-visible {
    outline: none;
    color: var(--tn-accent);
}

/* Raised center action (a primary "+" style destination) */
.tn-bottom-nav-item--center i {
    background: var(--tn-accent);
    color: var(--tn-accent-contrast, #fff);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    box-shadow: 0 4px 10px rgba(var(--tn-accent-rgb), 0.35);
}

.tn-bottom-nav-item--center.is-active i {
    background: var(--tn-accent-hover);
}

/* Push page content clear of the fixed bar — same derivation pattern as
   topbar.css's .tn-topbar-offset. Add env(safe-area-inset-bottom) here
   too since the bar's own padding-bottom already includes it (the bar
   grows on a device with a home-indicator inset, so the offset must
   grow with it or the last row still sits under the bar there). */
.tn-bottom-nav-offset {
    padding-bottom: calc(var(--tn-bottomnav-height) + env(safe-area-inset-bottom, 0px));
}

/* Hide above the mobile breakpoint when used as the mobile-only nav */
.tn-bottom-nav--mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .tn-bottom-nav--mobile-only {
        display: flex;
    }
}
